mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-09 01:35:56 +01:00
Simplify RSS layout
This commit is contained in:
parent
4168e59ab3
commit
1cc2a659c2
3 changed files with 35 additions and 36 deletions
|
@ -33,42 +33,8 @@
|
||||||
{{ if .Page.Params.Audio }}<enclosure url="{{ .Permalink | absURL }}{{ .Page.Params.Audio }}" length="{{ (os.Stat (path.Join .File.Dir .Page.Params.Audio)).Size }}" type="audio/mpeg" />{{end}}
|
{{ if .Page.Params.Audio }}<enclosure url="{{ .Permalink | absURL }}{{ .Page.Params.Audio }}" length="{{ (os.Stat (path.Join .File.Dir .Page.Params.Audio)).Size }}" type="audio/mpeg" />{{end}}
|
||||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
<guid>{{ .Permalink | absURL }}</guid>
|
<guid>{{ .Permalink | absURL }}</guid>
|
||||||
<description>
|
<description>{{- partial "description.txt" . -}}</description>
|
||||||
{{- if .Params.bookmarkOf -}}
|
<content:encoded>{{- partial "feedpost.html" . | html -}}</content:encoded>
|
||||||
{{- $reference := partial "reference.obj" (dict "url" .Params.bookmarkOf "page" .) -}}
|
|
||||||
Thoughts on a bookmarked article{{ with $reference.name }}: {{.}}{{ end }}.
|
|
||||||
{{- else -}}
|
|
||||||
{{- if eq .Section "calendar" -}}(An event I may be going to.) {{ end -}}
|
|
||||||
{{- $desc := (index (split .Summary "\n") 0) | plainify | safeHTML -}}
|
|
||||||
{{- $desc -}}
|
|
||||||
{{- range .Params.tags }} #{{.}}{{ end -}}
|
|
||||||
{{- end -}}
|
|
||||||
</description>
|
|
||||||
<content:encoded>
|
|
||||||
{{- range $i, $src := .Params.Media }}
|
|
||||||
<img src="{{ path.Join $page.RelPermalink $src.url | absURL }}" {{ with $src.alt }}alt="{{ . }}" {{ end }}/><br/>
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq .Section "calendar" -}}
|
|
||||||
{{ $timing := dict -}}
|
|
||||||
{{ range .Params.timings -}}
|
|
||||||
{{ if (time.AsTime .starts).After time.Now -}}
|
|
||||||
{{ $timing = . -}}
|
|
||||||
{{ break -}}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
||||||
{{ if $timing }}
|
|
||||||
<p><i><small>I'm planning on going to this event on
|
|
||||||
{{ partial "year-relative-date.txt" (time.AsTime $timing.starts) }}.
|
|
||||||
See the bottom of <a href="{{ .Permalink | absURL }}#post-info">the post</a> for more information, and get in touch if you'd like to go together!</small></i></p>
|
|
||||||
{{ end }}
|
|
||||||
{{- end -}}
|
|
||||||
{{ if .Params.bookmarkOf }}
|
|
||||||
<p><i><small>{{ partial "bookmark-of.html" . | html }}</small></i></p>
|
|
||||||
{{ else if .Params.inReplyTo }}
|
|
||||||
<p><i><small>{{ partial "in-reply-to.html" . | html }}</small></i></p>
|
|
||||||
{{ end }}
|
|
||||||
{{ .Content | html }}
|
|
||||||
</content:encoded>
|
|
||||||
{{- range .Params.syndications}}
|
{{- range .Params.syndications}}
|
||||||
<dc:relation>{{ . }}</dc:relation>
|
<dc:relation>{{ . }}</dc:relation>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
9
layouts/partials/description.txt
Normal file
9
layouts/partials/description.txt
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{{- if .Params.bookmarkOf -}}
|
||||||
|
{{- $reference := partial "reference.obj" (dict "url" .Params.bookmarkOf "page" .) -}}
|
||||||
|
Thoughts on a bookmarked article{{ with $reference.name }}: {{.}}{{ end }}.
|
||||||
|
{{- else -}}
|
||||||
|
{{- if eq .Section "calendar" -}}(An event I may be going to.) {{ end -}}
|
||||||
|
{{- $desc := (index (split .Summary "\n") 0) | plainify | safeHTML -}}
|
||||||
|
{{- $desc -}}
|
||||||
|
{{- range .Params.tags }} #{{.}}{{ end -}}
|
||||||
|
{{- end -}}
|
24
layouts/partials/feedpost.html
Normal file
24
layouts/partials/feedpost.html
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{{- $page := . -}}
|
||||||
|
{{- range $i, $src := .Params.Media -}}
|
||||||
|
<img src="{{ path.Join $page.RelPermalink $src.url | absURL }}" {{ with $src.alt }}alt="{{ . }}" {{ end }}/><br/>
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq .Section "calendar" -}}
|
||||||
|
{{ $timing := dict -}}
|
||||||
|
{{ range .Params.timings -}}
|
||||||
|
{{ if (time.AsTime .starts).After time.Now -}}
|
||||||
|
{{ $timing = . -}}
|
||||||
|
{{ break -}}
|
||||||
|
{{ end -}}
|
||||||
|
{{ end -}}
|
||||||
|
{{ if $timing }}
|
||||||
|
<p><i><small>I'm planning on going to this event on
|
||||||
|
{{ partial "year-relative-date.txt" (time.AsTime $timing.starts) }}.
|
||||||
|
See the bottom of <a href="{{ .Permalink | absURL }}#post-info">the post</a> for more information, and get in touch if you'd like to go together!</small></i></p>
|
||||||
|
{{ end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{ if .Params.bookmarkOf }}
|
||||||
|
<p><i><small>{{ partial "bookmark-of.html" . | html }}</small></i></p>
|
||||||
|
{{- else if .Params.inReplyTo -}}
|
||||||
|
<p><i><small>{{ partial "in-reply-to.html" . | html }}</small></i></p>
|
||||||
|
{{ end }}
|
||||||
|
{{ .Content }}
|
Loading…
Reference in a new issue