diff --git a/posts/implementing-rss.md b/posts/implementing-rss.md index 0beef7e..3edf7d8 100644 --- a/posts/implementing-rss.md +++ b/posts/implementing-rss.md @@ -68,3 +68,5 @@ Maybe I should write tests for this. hmm... It finally happened -- I wrote a bunch of "clever" Go code last year to make this blog and now it's hard for me to grok what I've written. It's not _too_ bad though -- I was able to get RSS to work, after all! -- but I think it's a sign that I need to refactor a lot of this code to be simpler. I don't want to abandon the all-text-files-load-from-memory thing _yet,_ we'll see if I can tame the complexity beast enough while still keeping that one thing I think is cool. Gonna `git commit -as && git push` this now, and start refreshing the RSS reader. Fingers crossed! + +**Update (June 28, 2022, 11:58AM):** Following some really helpful suggestions on this [lobste.rs](https://lobste.rs/s/lrnqsv/implementing_rss_for_my_blog_yes_this_one) thread, I made some changes to my feed and blog HTML for better compatibility and discoverability. If you're following this, highly recommend following the suggestions listed there -- like running your feed through the [W3C validator](https://validator.w3.org/feed/) or adding a `` tag corresponding to your RSS feed in the HTML. Thanks to snej and carlmjohnson for the suggestions! Also, the feed works, test passed. :) diff --git a/server.go b/server.go index 2df5270..92ceb4a 100644 --- a/server.go +++ b/server.go @@ -253,7 +253,7 @@ func (s *server) loadStylesheet(res http.ResponseWriter, req *http.Request, file } func rssDatetime(timestamp int64) string { - return time.Unix(timestamp, 0).Format("Mon, 02 Jan 06 15:04:05 MST") + return time.Unix(timestamp, 0).Format("Mon, 02 Jan 2006 15:04:05 MST") } func createImage(title, summary, url string, out io.Writer) error { diff --git a/styles/main.scss b/styles/main.scss index 17b3fc9..75dcf1f 100644 --- a/styles/main.scss +++ b/styles/main.scss @@ -30,6 +30,26 @@ $accentColorDark: #3498db; --accentColor: #{$accentColorLight}; } +@mixin link { + color: var(--strongColor); + text-decoration: none; + background-image: linear-gradient( + transparent 80%, + var(--faintFadeColor) 80%, + var(--faintFadeColor) 87.5%, + transparent 87.5% + ); + + &:hover { + background-image: linear-gradient( + transparent 80%, + var(--faintBodyColor) 80%, + var(--faintBodyColor) 87.5%, + transparent 87.5% + ); + } +} + ::selection { background-color: var(--accentColor); } @@ -259,23 +279,7 @@ article { section.content { a { - color: var(--strongColor); - text-decoration: none; - background-image: linear-gradient( - transparent 80%, - var(--faintFadeColor) 80%, - var(--faintFadeColor) 87.5%, - transparent 87.5% - ); - - &:hover { - background-image: linear-gradient( - transparent 80%, - var(--faintBodyColor) 80%, - var(--faintBodyColor) 87.5%, - transparent 87.5% - ); - } + @include link; } ul, ol { @@ -331,7 +335,14 @@ article { footer { text-align: center; - padding: $ls 0; + padding: 0; + p { + margin: $ls 0; + + a { + @include link; + } + } } @media (prefers-color-scheme: dark) { diff --git a/templates/page.html b/templates/page.html index 7f554e7..383264f 100644 --- a/templates/page.html +++ b/templates/page.html @@ -13,6 +13,7 @@ + @@ -32,7 +33,8 @@ {{{contents}}} diff --git a/templates/rss-channel.xml b/templates/rss-channel.xml index c70fdd6..338f116 100644 --- a/templates/rss-channel.xml +++ b/templates/rss-channel.xml @@ -1,10 +1,11 @@ - + {{title}} {{link}} {{description}} en-US {{pubDate}} + {{{items}}} diff --git a/templates/rss-item.xml b/templates/rss-item.xml index 2cf4242..17ca111 100644 --- a/templates/rss-item.xml +++ b/templates/rss-item.xml @@ -1,7 +1,8 @@ {{metadata.title}} {{getFullUrl slug}} + {{slug}} {{metadata.summary}} - mail@nsood.in + mail@nsood.in (Naman Sood) {{rssDatetime metadata.time}}