Compare commits

...

8 Commits

Author SHA1 Message Date
ktyl 394489f4b1 chore(gemini): update gemini capsule
continuous-integration/drone/push Build is failing Details
2023-11-15 01:20:16 +00:00
ktyl 3bf1ca0c76 feat: add gemini capsule as submodule 2023-11-15 01:20:15 +00:00
ktyl a76793e961 ci(garden): add rule file requirements
continuous-integration/drone/push Build is passing Details
2023-11-15 01:18:08 +00:00
ktyl 5b938fe2fa ci(garden): build garden site files 2023-11-15 01:17:12 +00:00
ktyl 7f4cc152ca feat: add navigation 2023-11-12 02:30:03 +00:00
ktyl 9849fff782 build: add make targets 2023-11-12 02:30:03 +00:00
ktyl 6ed995de6c feat(garden): generate rss 2023-11-12 02:29:55 +00:00
ktyl cb39047ee9 feat(garden): rss youtube subscriptions
Describe how to get RSS feeds for YouTube channels
2023-10-04 00:54:39 +01:00
9 changed files with 146 additions and 2 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "blog"] [submodule "blog"]
path = blog path = blog
url = https://sauce.pizzawednes.day/ktyl/blog.git url = https://sauce.pizzawednes.day/ktyl/blog.git
[submodule "src/garden/period3.xyz"]
path = src/garden/period3.xyz
url = git@sauce.pizzawedney.day:ktyl/period3.xyz

View File

@ -15,6 +15,9 @@ BLOG_BUILD_DIR = $(BLOG_BASE_DIR)out/html/
BLOG_OUT_DIR = $(OUT_DIR)/blog BLOG_OUT_DIR = $(OUT_DIR)/blog
BLOG_INDEX = $(BLOG_BUILD_DIR)/index.html BLOG_INDEX = $(BLOG_BUILD_DIR)/index.html
GARDEN_BASE_DIR = $(SRC_DIR)/garden/
GARDEN_BUILD_DIR = $(GARDEN_BASE_DIR)html
PAGES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.html") PAGES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.html")
STYLES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.css") STYLES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.css")
IMAGES = $(shell find $(IMG_DIR) -wholename "$(IMG_DIR)/*.png") IMAGES = $(shell find $(IMG_DIR) -wholename "$(IMG_DIR)/*.png")
@ -26,7 +29,8 @@ HTML_TARGETS = $(PAGES:$(ROOT_DIR)/%.html=$(OUT_DIR)/%.html)
CSS_TARGETS = $(STYLES:$(ROOT_DIR)/%.css=$(OUT_DIR)/%.css) CSS_TARGETS = $(STYLES:$(ROOT_DIR)/%.css=$(OUT_DIR)/%.css)
PNG_TARGETS = $(IMG_DIR)/%.png=$(OUT_DIR)/%.png PNG_TARGETS = $(IMG_DIR)/%.png=$(OUT_DIR)/%.png
all: html blog | $(OUT_DIR) all: html blog garden | $(OUT_DIR)
cp -r src/garden/html $(OUT_DIR)/garden
html: $(HTML_TARGETS) $(CSS_TARGETS) | $(OUT_DIR) html: $(HTML_TARGETS) $(CSS_TARGETS) | $(OUT_DIR)
cp $(IMG_DIR)/*.png $(OUT_DIR)/ cp $(IMG_DIR)/*.png $(OUT_DIR)/
@ -62,8 +66,12 @@ blog: $(HTML_INCLUDES) $(CSS_TARGETS)
cp $(CSS_TARGETS) `dirname $$page` ; \ cp $(CSS_TARGETS) `dirname $$page` ; \
done done
garden:
make --directory $(GARDEN_BASE_DIR) html
clean: clean:
make --directory $(GARDEN_BASE_DIR) clean
make --directory $(BLOG_BASE_DIR) clean make --directory $(BLOG_BASE_DIR) clean
rm -rf $(OUT_DIR) rm -rf $(OUT_DIR)
.PHONY: blog .PHONY: blog garden

18
src/garden/Makefile Normal file
View File

@ -0,0 +1,18 @@
html: feed.py Makefile
mkdir html
cp feed.py Makefile html
cp *.md html
clean-html:
[[ -d html ]] && rm -r html
.PHONY: clean-html
feed:
python feed.py `pwd`
rss: feed
clean: clean-html
.PHONY: feed clean

58
src/garden/feed.py Normal file
View File

@ -0,0 +1,58 @@
#!/usr/bin/env python3
import markdown
import pathlib
import sys
import re
import glob
def print_usage():
print("\nusage: python feed.py ROOT\n")
print("\n")
print("\t\ROOT\tbase folder")
def validate():
# check args for at least one file path
if len(sys.argv) < 2:
print_usage()
sys.exit(1)
validate()
base_folder = sys.argv[1]
def get_paths() -> [str]:
return [x for x in glob.glob(f"{base_folder}/*.md")]
def get_text(path):
with open(path) as f:
return f.read()
#def to_html(md : str) -> str:
# return markdown.markdown(md, extensions=["fenced_code"])
def get_entry(path):
return get_title(get_text(path))
def get_title(md):
return re.compile(r"^# (.+)\n").match(md).group(1)
def get_entries() -> [str]:
return "\n\n".join([get_entry(p) for p in get_paths()])
def get_header() -> str:
return """<?xml version="1.0" encoding="utf-8" ?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title></title>
<link>https://ktyl.dev/garden</link>
<description></description>
<atom:link href="https://ktyl.dev/garden/feed.xml" rel="self" type="application/rss+xml"/>
"""
def get_footer() -> str:
return "\n</channel></rss>"
print(get_header())
print(get_entries())
print(get_footer())

15
src/garden/feed.xml Normal file
View File

@ -0,0 +1,15 @@
python feed.py `pwd`
<?xml version="1.0" encoding="utf-8" ?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title></title>
<link>https://ktyl.dev/garden</link>
<description></description>
<atom:link href="https://ktyl.dev/garden/feed.xml" rel="self" type="application/rss+xml"/>
Digital Gardens
RSS
</channel></rss>

5
src/garden/gardens.md Normal file
View File

@ -0,0 +1,5 @@
# Digital Gardens
* Obsidian
* Notion
* Git

@ -0,0 +1 @@
Subproject commit 7801c79eb9a8b7b88445fd3b3d3cde2f71ee47d1

35
src/garden/rss.md Normal file
View File

@ -0,0 +1,35 @@
# RSS
Really Simple Syndication (RSS) is an ancient file format for communicating updates over the Web, and my personal favourite.
* [It's Time for an RSS Revival](https://www.wired.com/story/rss-readers-feedly-inoreader-old-reader/)
### Stubs:
* my curated feeds
* reader applications
## Technical Simplicity
From a technical perspective, like [Gemini](gemini://gemini.circumlunar.space) [\(HTTP\)](https://gemini.circumlunar.space/) it's grokkable with a couple good reads of the specification.
I wrote [a simple generator](https://ktyl.dev/blog/2022/6/3/rss.md)] for my blog posts, and am now working on [a simpler one](./feed.py) for the garden.
To start with, I'd like to generate it as simply as possible, from just a directory structure, but I can already see I'd like to do more with it.
I work predominantly in [Git](https://git-scm.com/) repositories, which, like a directory, or a garden, is tree-based.
My blog's feed has a chronological hierarchy, but at present it's based on manually creating and naming folders.
It's also very much a _published_ format, rather than a living one.
This is silly!
Instead, I'd like to structure my feed around a Git repository, as I think it'd be a much better descriptor of activity.
## Managing YouTube Subscriptions
There are many reasons to avoid the YouTube homepage, such as recommended videos or the accursed Shorts.
YouTube publishes channel-specific RSS feeds, making it totally possible to circumvent its subscription system entirely - including having to make an account - and keep track of channels one enjoys with RSS feeds instead.
Get a channel's ID:
1. Go to the channel's page
2. Go to the About section
3. Share icon under Stats block
4. Copy channel ID
The channel's feed is available at `https://www.youtube.com/feeds/videos.xml?channel_id=CHANNEL_ID_HERE`.

View File

@ -2,4 +2,5 @@
<li><a href="/about.html">about</a></li> <li><a href="/about.html">about</a></li>
<li><a href="/blog.html">blog</a></li> <li><a href="/blog.html">blog</a></li>
<li><a href="/gallery.html">gallery</a></li> <li><a href="/gallery.html">gallery</a></li>
<li><a href="/garden/index.html">garden</a></li>
</ul> </ul>