Browse Source

fixing atom

master
jk 4 years ago
parent
commit
61e8c9f2c0
  1. 7
      .gitmodules
  2. 20
      layouts/feeds/single.html
  3. 16
      themes/hugo-atom-feed/layouts/_default/list.atom.xml

7
.gitmodules

@ -1,6 +1 @@
[submodule "gohugo-theme-ananke"]
path = gohugo-theme-ananke
url = https://github.com/budparr/gohugo-theme-ananke.git
[submodule "themes/atom-template-for-hugo"]
path = themes/atom-template-for-hugo
url = https://gitlab.com/araname/atom-template-for-hugo

20
layouts/feeds/single.html

@ -2,15 +2,15 @@
<article class="feeds"> <article class="feeds">
<header><h3 class="title">All feeds</h3> <header><h3 class="title">All feeds</h3>
<p class="p-summary">This is a list of all of the feeds on this site for both microformats 2 (MF2) and RSS for following using your reader of choice.</p></header> <p class="p-summary">This is a list of all of the feeds on this site for both microformats 2 (MF2) and RSS for following using your reader of choice.</p></header>
<p class="feedrow"><span class="description">All feeds - everything!</span><span class="feedlinks"><a href="/index.xml" class="u-url">RSS</a> | <a href="/all/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">All articles - long form blog posts</span><span class="feedlinks"><a href="/article/index.xml" class="u-url">RSS</a> | <a href="/article/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Brewshido articles</span><span class="feedlinks"><a href="/blog/brewshido/index.xml" class="u-url">RSS</a> | <a href="/blog/brewshido/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Bushido Dreams articles</span><span class="feedlinks"><a href="/blog/bushido-dreams/index.xml" class="u-url">RSS</a> | <a href="/blog/bushido-dreams/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Whitabootery articles</span><span class="feedlinks"><a href="/blog/whitabootery/index.xml" class="u-url">RSS</a> | <a href="/blog/whitabootery/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Kilted Scot articles (currently dormant)</span><span class="feedlinks"><a href="/blog/kilted-scot/index.xml" class="u-url">RSS</a> | <a href="/blog/kilted-scot/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Sovereign Scot articles (currently dormant)</span><span class="feedlinks"><a href="/blog/sovereign-scot/index.xml" class="u-url">RSS</a> | <a href="/blog/sovereign-scot/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Notes - short form notes</span><span class="feedlinks"><a href="/note/index.xml" class="u-url">RSS</a> | <a href="/note/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Photos</span><span class="feedlinks"><a href="/photo/index.xml" class="u-url">RSS</a> | <a href="/photo/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Responses - likes, replies, shares, mentions.</span><span class="feedlinks"><a href="/response/index.xml" class="u-url">RSS</a> | <a href="/response/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">All feeds - everything!</span><span class="feedlinks"><a href="/atom.xml" class="u-url">ATOM</a> | <a href="/index.xml" class="u-url">RSS</a> | <a href="/all/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">All articles - long form blog posts</span><span class="feedlinks"><a href="/article/atom.xml" class="u-url">ATOM</a> | <a href="/article/index.xml" class="u-url">RSS</a> | <a href="/article/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Brewshido articles</span><span class="feedlinks"><a href="/blog/brewshido/atom.xml" class="u-url">ATOM</a> | <a href="/blog/brewshido/index.xml" class="u-url">RSS</a> | <a href="/blog/brewshido/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Bushido Dreams articles</span><span class="feedlinks"><a href="/blog/bushido-dreams/atom.xml" class="u-url">ATOM</a> | <a href="/blog/bushido-dreams/index.xml" class="u-url">RSS</a> | <a href="/blog/bushido-dreams/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Whitabootery articles</span><span class="feedlinks"><a href="/blog/whitabootery/atom.xml" class="u-url">ATOM</a> | <a href="/blog/whitabootery/index.xml" class="u-url">RSS</a> | <a href="/blog/whitabootery/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Kilted Scot articles (currently dormant)</span><span class="feedlinks"><a href="/blog/kilted-scot/atom.xml" class="u-url">ATOM</a> | <a href="/blog/kilted-scot/index.xml" class="u-url">RSS</a> | <a href="/blog/kilted-scot/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Sovereign Scot articles (currently dormant)</span><span class="feedlinks"><a href="/blog/sovereign-scot/atom.xml" class="u-url">ATOM</a> | <a href="/blog/sovereign-scot/index.xml" class="u-url">RSS</a> | <a href="/blog/sovereign-scot/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Notes - short form notes</span><span class="feedlinks"><a href="/note/atom.xml" class="u-url">ATOM</a> | <a href="/note/index.xml" class="u-url">RSS</a> | <a href="/note/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Photos</span><span class="feedlinks"><a href="/photo/atom.xml" class="u-url">ATOM</a> | <a href="/photo/index.xml" class="u-url">RSS</a> | <a href="/photo/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Responses - likes, replies, shares, mentions.</span><span class="feedlinks"><a href="/response/atom.xml" class="u-url">ATOM</a> | <a href="/response/index.xml" class="u-url">RSS</a> | <a href="/response/" class="u-url">MF2</a></span></p>
</article> </article>
{{ end }} {{ end }}

16
themes/hugo-atom-feed/layouts/_default/list.atom.xml

@ -1,5 +1,5 @@
{{ printf `<?xml version="1.0" encoding="utf-8"?>` | safeHTML }} {{/* ref: https://validator.w3.org/feed/docs/atom.html */}} {{ printf `<?xml version="1.0" encoding="utf-8"?>` | safeHTML }} {{/* ref: https://validator.w3.org/feed/docs/atom.html */}}
<feed xmlns="http://www.w3.org/2005/Atom"{{ with site.LanguageCode }} xml:lang="{{ . }}"{{ end }}>
<feed xmlns:media="http://search.yahoo.com/mrss/" xmlns="http://www.w3.org/2005/Atom"{{ with site.LanguageCode }} xml:lang="{{ . }}"{{ end }}>
<generator uri="https://gohugo.io/" version="{{ hugo.Version }}">Hugo</generator> <generator uri="https://gohugo.io/" version="{{ hugo.Version }}">Hugo</generator>
<link href="http://pubsubhubbub.superfeedr.com/" rel="hub"/> <link href="http://pubsubhubbub.superfeedr.com/" rel="hub"/>
{{- $title := site.Title -}} {{- $title := site.Title -}}
@ -85,8 +85,18 @@
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated> <updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ $description1 := .Description | default "" }} {{ $description1 := .Description | default "" }}
{{ $description := (cond (eq "" $description1) "" (printf "<blockquote>%s</blockquote>" ($description1 | markdownify))) }} {{ $description := (cond (eq "" $description1) "" (printf "<blockquote>%s</blockquote>" ($description1 | markdownify))) }}
{{ printf `<content type="html"><![CDATA[%s%s]]></content>` $description .Content | safeHTML }}
{{ $media := newScratch }}
{{ $media.Set "media" ""}}
{{ range .Params.Photo }}
{{ if not ( in . "http" ) }}
{{ $this := . }}
{{ $media.Add "media" (printf "<img src='https://jk.nipponalba.scot%s'/>" (echoParam $this "value") ) }}
{{ else }}
{{ $this := . }}
{{ $media.Add "media" (printf "<img src='%s'/>" (echoParam $this "value") ) }}
{{ end }}
{{ end }}
{{ printf `<content type="html"><![CDATA[%s%s%s]]></content>` $description .Content ($media.Get "media")| safeHTML }}
</entry> </entry>
{{ end }} {{ end }}
</feed> </feed>