From 61e8c9f2c0a88338bb79d88653a2b0dd43004380 Mon Sep 17 00:00:00 2001 From: jk Date: Fri, 12 Mar 2021 12:28:52 +0000 Subject: [PATCH] fixing atom --- .gitmodules | 7 +------ layouts/feeds/single.html | 20 +++++++++---------- .../layouts/_default/list.atom.xml | 16 ++++++++++++--- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3fad27fc..8b137891 100644 --- a/.gitmodules +++ b/.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 + diff --git a/layouts/feeds/single.html b/layouts/feeds/single.html index d7fe23a6..541a7ef7 100644 --- a/layouts/feeds/single.html +++ b/layouts/feeds/single.html @@ -2,15 +2,15 @@

All feeds

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.

-

All feeds - everything!RSS | MF2

-

All articles - long form blog postsRSS | MF2

-

Brewshido articlesRSS | MF2

-

Bushido Dreams articlesRSS | MF2

-

Whitabootery articlesRSS | MF2

-

Kilted Scot articles (currently dormant)RSS | MF2

-

Sovereign Scot articles (currently dormant)RSS | MF2

-

Notes - short form notesRSS | MF2

-

PhotosRSS | MF2

-

Responses - likes, replies, shares, mentions.RSS | MF2

+

All feeds - everything!ATOM | RSS | MF2

+

All articles - long form blog postsATOM | RSS | MF2

+

Brewshido articlesATOM | RSS | MF2

+

Bushido Dreams articlesATOM | RSS | MF2

+

Whitabootery articlesATOM | RSS | MF2

+

Kilted Scot articles (currently dormant)ATOM | RSS | MF2

+

Sovereign Scot articles (currently dormant)ATOM | RSS | MF2

+

Notes - short form notesATOM | RSS | MF2

+

PhotosATOM | RSS | MF2

+

Responses - likes, replies, shares, mentions.ATOM | RSS | MF2

{{ end }} diff --git a/themes/hugo-atom-feed/layouts/_default/list.atom.xml b/themes/hugo-atom-feed/layouts/_default/list.atom.xml index abc1c861..1bd3691b 100644 --- a/themes/hugo-atom-feed/layouts/_default/list.atom.xml +++ b/themes/hugo-atom-feed/layouts/_default/list.atom.xml @@ -1,5 +1,5 @@ {{ printf `` | safeHTML }} {{/* ref: https://validator.w3.org/feed/docs/atom.html */}} - + Hugo {{- $title := site.Title -}} @@ -85,8 +85,18 @@ {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ $description1 := .Description | default "" }} {{ $description := (cond (eq "" $description1) "" (printf "
%s
" ($description1 | markdownify))) }} - {{ printf `` $description .Content | safeHTML }} - + {{ $media := newScratch }} + {{ $media.Set "media" ""}} + {{ range .Params.Photo }} + {{ if not ( in . "http" ) }} + {{ $this := . }} + {{ $media.Add "media" (printf "" (echoParam $this "value") ) }} + {{ else }} + {{ $this := . }} + {{ $media.Add "media" (printf "" (echoParam $this "value") ) }} + {{ end }} + {{ end }} + {{ printf `` $description .Content ($media.Get "media")| safeHTML }} {{ end }}