Compare commits
5 Commits
9c030e83e9
...
a76793e961
Author | SHA1 | Date |
---|---|---|
ktyl | a76793e961 | |
ktyl | 5b938fe2fa | |
ktyl | 7f4cc152ca | |
ktyl | 9849fff782 | |
ktyl | 6ed995de6c |
12
makefile
12
makefile
|
@ -15,6 +15,9 @@ BLOG_BUILD_DIR = $(BLOG_BASE_DIR)out/html/
|
|||
BLOG_OUT_DIR = $(OUT_DIR)/blog
|
||||
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")
|
||||
STYLES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.css")
|
||||
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)
|
||||
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)
|
||||
cp $(IMG_DIR)/*.png $(OUT_DIR)/
|
||||
|
@ -62,8 +66,12 @@ blog: $(HTML_INCLUDES) $(CSS_TARGETS)
|
|||
cp $(CSS_TARGETS) `dirname $$page` ; \
|
||||
done
|
||||
|
||||
garden:
|
||||
make --directory $(GARDEN_BASE_DIR) html
|
||||
|
||||
clean:
|
||||
make --directory $(GARDEN_BASE_DIR) clean
|
||||
make --directory $(BLOG_BASE_DIR) clean
|
||||
rm -rf $(OUT_DIR)
|
||||
|
||||
.PHONY: blog
|
||||
.PHONY: blog garden
|
||||
|
|
|
@ -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
|
|
@ -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())
|
|
@ -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>
|
|
@ -0,0 +1,5 @@
|
|||
# Digital Gardens
|
||||
|
||||
* Obsidian
|
||||
* Notion
|
||||
* Git
|
|
@ -1,16 +1,30 @@
|
|||
# RSS
|
||||
|
||||
Really Simple Syndication (RSS) is a an ancient file format for communicating updates over the Web.
|
||||
Really Simple Syndication (RSS) is an ancient file format for communicating updates over the Web, and my personal favourite.
|
||||
|
||||
## Stubs:
|
||||
* [It's Time for an RSS Revival](https://www.wired.com/story/rss-readers-feedly-inoreader-old-reader/)
|
||||
|
||||
* readers
|
||||
* feed generation
|
||||
### Stubs:
|
||||
|
||||
## YouTube Subscriptions
|
||||
* 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.
|
||||
Since RSS feeds are published per-channel, it's 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.
|
||||
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,4 +2,5 @@
|
|||
<li><a href="/about.html">about</a></li>
|
||||
<li><a href="/blog.html">blog</a></li>
|
||||
<li><a href="/gallery.html">gallery</a></li>
|
||||
<li><a href="/garden/index.html">garden</a></li>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue