Compare commits

..

6 Commits

Author SHA1 Message Date
ktyl 499b9a3e74 chore(garden): generate rss
continuous-integration/drone/push Build is passing Details
2023-10-04 00:54:59 +01:00
ktyl 82cfd03e9f docs(garden): update RSS 2023-10-04 00:54:39 +01:00
ktyl 23134ef83c build: add make targets 2023-10-04 00:54:39 +01:00
ktyl 0cacdd0b10 wip: generate garden rss 2023-10-04 00:54:39 +01: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
ktyl f86bbad8bb chore: remove redundant fsText class
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2023-10-01 22:23:24 +01:00
12 changed files with 114 additions and 27 deletions

6
src/garden/Makefile Normal file
View File

@ -0,0 +1,6 @@
feed:
python feed.py `pwd`
rss: feed
.PHONY: feed

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

View File

@ -1,16 +1,22 @@
# RSS # 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 ### Stubs:
* feed generation
## 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.
## Managing YouTube Subscriptions
There are many reasons to avoid the YouTube homepage, such as recommended videos or the accursed Shorts. 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: Get a channel's ID:
1. Go to the channel's page 1. Go to the channel's page

View File

@ -4,14 +4,14 @@
text-align: center; text-align: center;
} }
.landing .fsText a { .landing a {
color: var(--foreground-inactive); color: var(--foreground-inactive);
font-size: 2em; font-size: 2em;
transform: translate(0,50%); transform: translate(0,50%);
transition: all 0.3s; transition: all 0.3s;
} }
.landing .fsText a:hover { .landing a:hover {
color: var(--accent); color: var(--accent);
} }
@ -45,7 +45,6 @@
.landing .socials i { .landing .socials i {
color: var(--foreground-inactive); color: var(--foreground-inactive);
font-size: 3.5em;
padding: 0 .07em; padding: 0 .07em;
} }

View File

@ -30,6 +30,12 @@ ul.nav-links {
margin-bottom: 0.8em; margin-bottom: 0.8em;
} }
.nav .nav-links li a {
color: var(--foreground-inactive);
font-size: 1.4em;
display: block;
}
.nav li a::before { .nav li a::before {
content: "/"; content: "/";
} }

View File

@ -3,6 +3,7 @@
} }
.title h1 { .title h1 {
font-size: 1.4em;
padding-bottom: 0; padding-bottom: 0;
margin-bottom:0; margin-bottom:0;
margin-top:0; margin-top:0;

View File

@ -1,5 +1,5 @@
<ul class="nav-links"> <ul class="nav-links">
<li><a href="/about.html" class="fsText">about</a></li> <li><a href="/about.html">about</a></li>
<li><a href="/blog.html" class="fsText">blog</a></li> <li><a href="/blog.html">blog</a></li>
<li><a href="/gallery.html" class="fsText">gallery</a></li> <li><a href="/gallery.html">gallery</a></li>
</ul> </ul>

View File

@ -1,2 +1,2 @@
<div class="title"> <div class="title">
<h1 class="fsText"><a href="https://ktyl.dev/">ktyl.dev</a><span class="pageTitle"> <h1><a href="https://ktyl.dev/">ktyl.dev</a><span class="pageTitle">

View File

@ -14,4 +14,8 @@
--color3: #ff00ff; --color3: #ff00ff;
--color4: #ffff00; --color4: #ffff00;
--color5: #00ffff; --color5: #00ffff;
/* TODO: extract general varibles file ? */
/* Text */
--font-size: 1.4em;
} }

View File

@ -21,21 +21,8 @@ li {
display:inline; display:inline;
} }
a.fsText { a {
text-decoration: none; text-decoration: none;
color: var(--foreground-inactive);
transform: scale(1);
transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.fsText a {
text-decoration: none;
color: var(--foreground);
}
.fsText {
--font-size: 1.4em;
font-size: var(--font-size);
color: var(--foreground); color: var(--foreground);
} }