commit 0ffd4689a8073c18730ea5d8bdf957b06ca973e0
parent 46f0b4c84c949672c1d6022de6ab71149aa653df
Author: oscarbenedito <oscar@oscarbenedito.com>
Date: Sat, 28 Mar 2020 01:09:27 +0100
Web feed from RSS to Atom
Diffstat:
5 files changed, 58 insertions(+), 52 deletions(-)
diff --git a/config.toml b/config.toml
@@ -7,6 +7,7 @@ disableKinds = "taxonomyTerm"
[Author]
name = "Oscar Benedito"
+ email = "oscar@oscarbenedito.com"
[params]
blog_title = "Personal blog"
diff --git a/content/blog/2020-01-12-securing-communications.md b/content/blog/2020-01-12-securing-communications.md
@@ -19,7 +19,7 @@ Craig's attack is known as a man-in-the-middle attack, happening when the attack
Alice knows about the flaws of the mail system, so she decides to encrypt her message. She could use the Caesar cipher. If Bob knows how much Alice "shifted" the alphabet, he will be able to read her message, while Craig won't. Or will he? Couldn't Craig just try all the numbers from 1 to 25 and just see which one gives a message that makes sense? And how did Alice tell Bob how much she "shifted" the alphabet without Craig reading it?
-Those are good points. We currently use better encryption methods than the Caesar cipher that tackle these issues. The first concern is talking about a brute-force attack (when the attacker tries many keys in order to—eventually—find the correct one). We can protect our messages against brute-force attacks by using an encryption method that admits a huge number of different possible keys. How big? If you create a key with GPG, the minimum key size is 1024 bits (which gives us 2<sup>1024</sup> different possible keys). How hard would it be to crack it? [This video](https://www.invidio.us/watch?v=S9JGmA5_unY)[^invidious] explains it pretty well for a key that is 256 bits long (2<sup>256</sup> possible keys). First problem solved! Bob isn't deciphering our letter anytime soon!
+Those are good points. We currently use better encryption methods than the Caesar cipher that tackle these issues. The first concern is talking about a brute-force attack (when the attacker tries many keys in order to—eventually—find the correct one). We can protect our messages against brute-force attacks by using an encryption method that admits a huge number of different possible keys. How big? If you create a key with GPG, the minimum key size is 1024 bits (which gives us 2{{< raw-html >}}<sup>1024</sup>{{< /raw-html >}} different possible keys). How hard would it be to crack it? [This video](https://www.invidio.us/watch?v=S9JGmA5_unY)[^invidious] explains it pretty well for a key that is 256 bits long (2{{< raw-html >}}<sup>256</sup>{{< /raw-html >}} possible keys). First problem solved! Bob isn't deciphering our letter anytime soon!
[^invidious]: The video was originally posted on YouTube, I linked to Invidious, a platform that minimizes Google's tracking while watching YouTube. The original video link is <https://www.youtube.com/watch?v=S9JGmA5_unY>.
diff --git a/content/resources.md b/content/resources.md
@@ -17,26 +17,26 @@ I have also found [AlternativeTo](https://alternativeto.net/) to be really usefu
Blogs I have found interesting, alphabetically sorted.
- - [blacklight447](https://write.privacytools.io/my-thoughts-on-security/) — [RSS feed](https://write.privacytools.io/my-thoughts-on-security/feed/)
- - [Brendan Abolivier](https://brendan.abolivier.bzh/) — [RSS feed](https://brendan.abolivier.bzh/index.xml)
- - [Codesections](https://www.codesections.com/blog/) — [RSS feed](https://www.codesections.com/rss.xml)
- - [Ctrl blog](https://www.ctrl.blog/) — [RSS feed](https://feed.ctrl.blog/latest.atom)
- - [davd.io](https://www.davd.io/) — [RSS feed](https://www.davd.io/index.xml)
- - [Dave Lane](https://davelane.nz/blog) — [RSS feed](https://davelane.nz/rss.xml)
- - [Emanuel Pina](https://emanuelpina.pt/) — [RSS feed](https://emanuelpina.pt/index.xml)
- - [Henrique Dias](https://hacdias.com/blog/) — [RSS feed](https://hacdias.com/blog/feed.xml)
- - [InfoSec Handbook](https://infosec-handbook.eu/blog/) — [RSS feed](https://infosec-handbook.eu/blog/index.xml)
- - [Jan-Lukas Else](https://jlelse.blog/) — [RSS feed](https://jlelse.blog/index.xml)
- - [Justin Vollmer](https://www.justinvollmer.com/) — [RSS feed](https://www.justinvollmer.com/feed/)
- - [Kev Quirk](https://kevq.uk/) — [RSS feed](https://kevq.uk/feed)
- - [Marko Saric](https://markosaric.com/blog/) — [RSS feed](https://markosaric.com/blog/feed/)
- - [Matthias Ott](https://matthiasott.com/) — [RSS feed](https://matthiasott.com/rss)
- - [mcol](https://mcol.xyz/) — [RSS feed](https://mcol.xyz/rss.xml)
- - [Mike Babb](https://mikebabb.com/blog/) — [RSS feed](https://mikebabb.com/feed.xml)
- - NCSC Guidance Feed — [RSS feed](https://www.ncsc.gov.uk/feeds/guidance.xml)
- - [PapaTutuWawa](https://blog.polynom.me/) — [RSS feed](https://blog.polynom.me/atom.xml)
- - [PINE64](https://www.pine64.org/blog/) — [RSS feed](https://www.pine64.org/feed/)
- - [privacytools.io](https://blog.privacytools.io/) — [RSS feed](https://blog.privacytools.io/rss/)
- - [Sheogorath](https://shivering-isles.com/#blog) — [RSS feed](https://shivering-isles.com/feed.xml)
- - [The New Oil](https://write.as/thenewoil/) — [RSS feed](https://write.as/thenewoil/feed/)
- - [Tutanota](https://tutanota.com/blog/) — [RSS feed](https://tutanota.com/blog/feed.xml)
+ - [blacklight447](https://write.privacytools.io/my-thoughts-on-security/) — [Feed](https://write.privacytools.io/my-thoughts-on-security/feed/)
+ - [Brendan Abolivier](https://brendan.abolivier.bzh/) — [Feed](https://brendan.abolivier.bzh/index.xml)
+ - [Codesections](https://www.codesections.com/blog/) — [Feed](https://www.codesections.com/rss.xml)
+ - [Ctrl blog](https://www.ctrl.blog/) — [Feed](https://feed.ctrl.blog/latest.atom)
+ - [davd.io](https://www.davd.io/) — [Feed](https://www.davd.io/index.xml)
+ - [Dave Lane](https://davelane.nz/blog) — [Feed](https://davelane.nz/rss.xml)
+ - [Emanuel Pina](https://emanuelpina.pt/) — [Feed](https://emanuelpina.pt/index.xml)
+ - [Henrique Dias](https://hacdias.com/blog/) — [Feed](https://hacdias.com/blog/feed.xml)
+ - [InfoSec Handbook](https://infosec-handbook.eu/blog/) — [Feed](https://infosec-handbook.eu/blog/index.xml)
+ - [Jan-Lukas Else](https://jlelse.blog/) — [Feed](https://jlelse.blog/index.xml)
+ - [Justin Vollmer](https://www.justinvollmer.com/) — [Feed](https://www.justinvollmer.com/feed/)
+ - [Kev Quirk](https://kevq.uk/) — [Feed](https://kevq.uk/feed)
+ - [Marko Saric](https://markosaric.com/blog/) — [Feed](https://markosaric.com/blog/feed/)
+ - [Matthias Ott](https://matthiasott.com/) — [Feed](https://matthiasott.com/rss)
+ - [mcol](https://mcol.xyz/) — [Feed](https://mcol.xyz/rss.xml)
+ - [Mike Babb](https://mikebabb.com/blog/) — [Feed](https://mikebabb.com/feed.xml)
+ - NCSC Guidance Feed — [Feed](https://www.ncsc.gov.uk/feeds/guidance.xml)
+ - [PapaTutuWawa](https://blog.polynom.me/) — [Feed](https://blog.polynom.me/atom.xml)
+ - [PINE64](https://www.pine64.org/blog/) — [Feed](https://www.pine64.org/feed/)
+ - [privacytools.io](https://blog.privacytools.io/) — [Feed](https://blog.privacytools.io/rss/)
+ - [Sheogorath](https://shivering-isles.com/#blog) — [Feed](https://shivering-isles.com/feed.xml)
+ - [The New Oil](https://write.as/thenewoil/) — [Feed](https://write.as/thenewoil/feed/)
+ - [Tutanota](https://tutanota.com/blog/) — [Feed](https://tutanota.com/blog/feed.xml)
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
@@ -1,33 +1,38 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
-{{- $pages := $pctx.RegularPages -}}
+{{- $pages := slice -}}
+{{- if or $.IsHome $.IsSection -}}
+{{- $pages = $pctx.RegularPages -}}
+{{- else -}}
+{{- $pages = $pctx.Pages -}}
+{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
-{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
- <channel>
- <title>{{ if .Title }}{{ if eq .Kind "taxonomy" }}{{ .Title | title }} on {{ .Site.Params.blog_title }}{{ else }}{{ .Title }}{{ end }}{{ else }}{{ .Site.Title }}{{ end }}</title>
- <link>{{ .Permalink }}</link>
- <description>Recent content in {{ if .Title }}{{ if eq .Kind "taxonomy" }}{{ .Title }} on {{ .Site.Params.blog_title }}{{ else }}{{ .Title }}{{ end }}{{ else }}{{ .Site.Title }}{{ end }}</description>
- {{ with .Site.LanguageCode }}<language>{{.}}</language>{{end}}
- {{ with .Site.Author.email }}<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}
- {{ with .Site.Author.email }}<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}
- {{ with .Site.Copyright }}<copyright>{{.}}</copyright>{{end}}
- {{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
- {{ with .OutputFormats.Get "RSS" }}
- {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
- {{ end }}
- {{ range $pages }}
- <item>
- <title>{{ .Title }}</title>
- <link>{{ .Permalink }}</link>
- <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
- {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
- <guid>{{ .Permalink }}</guid>
- <description>{{ .Content | html }}</description>
- </item>
- {{ end }}
- </channel>
-</rss>
+{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }}
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
+ <link href="{{ .Permalink }}index.xml" rel="self"/>
+ <link href="{{ $.Site.BaseURL }}"/>{{ if not .Date.IsZero }}
+ <updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
+ <id>{{ $.Site.BaseURL }}</id>{{ with $.Site.Author.name }}
+ <author>
+ <name>{{ . }}</name>{{ with $.Site.Author.email }}
+ <email>{{ . }}</email>{{ end }}
+ </author>{{ end }}
+ <generator>Hugo -- gohugo.io</generator>{{ range $pages }}
+ <entry>
+ <title>{{ .Title }}</title>
+ <link href="{{ .Permalink }}"/>
+ <id>tag:oscarbenedito.com,{{ .Date.Format "2006-01-02" | safeHTML }}:{{ .RelPermalink }}</id>{{ with $.Site.Author.name }}
+ <author>
+ <name>{{ . }}</name>{{ with $.Site.Author.email }}
+ <email>{{ . }}</email>{{ end }}
+ </author>{{ end }}
+ <published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
+ {{ if eq (.Lastmod.Format "2006-01-02") "0001-01-01" }}<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
+ {{- else }}<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
+ <content type="html">{{ .Content | html }}</content>
+ </entry>{{ end }}
+</feed>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
@@ -3,7 +3,7 @@
<div class="column left">
<h3>Links</h3>
<p><a href="/">Home</a></p>
- <p><a href="/blog/">Blog</a> (<a href="/blog/index.xml">RSS feed</a>, <a href="/blog/archive/">archive</a>)</p>
+ <p><a href="/blog/">Blog</a> (<a href="/blog/index.xml">feed</a>, <a href="/blog/archive/">archive</a>)</p>
<p><a href="/resources/">Other resources</a></p>
<p><a href="/about/">About</a></p>
<p><a href="/jsweblabels/" rel="jslicense">JavaScript Web Labels</a></p>