Adds references to posts

This commit is contained in:
Miguel de la Cruz 2024-01-10 09:51:59 +01:00
parent fb57ca43fc
commit a3de983ff2
5 changed files with 51 additions and 1 deletions

2
data/en/references.yaml Normal file
View file

@ -0,0 +1,2 @@
---
by: by

2
data/es/references.yaml Normal file
View file

@ -0,0 +1,2 @@
---
by: por

View file

@ -179,3 +179,31 @@ figcaption > p {
footer a.footerlink { footer a.footerlink {
text-decoration: none; text-decoration: none;
} }
content .blog-reference {
width: 100% - 20px;
border: 1px solid;
padding: 10px;
margin: 10px;
}
content .blog-reference p {
margin: 0;
}
content .blog-reference p.blog-reference-title {
font-weight: bold;
}
content .blog-reference p.blog-reference-title > a{
text-decoration: none;
}
content .blog-reference p.blog-reference-subtitle {
font-size: 0.8rem;
line-height: 1;
}
content .blog-reference p.blog-reference-description {
margin-top: 10px;
}

View file

@ -65,7 +65,16 @@
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }} {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid> <guid>{{ .Permalink }}</guid>
<description>{{ .Summary | transform.XMLEscape | safeHTML }}</description> <description>{{ .Summary | transform.XMLEscape | safeHTML }}</description>
<content:encoded>{{ `<![CDATA[` | safeHTML }}{{ .Content | safeHTML }}{{ `]]>` | safeHTML }}</content:encoded> <content:encoded>{{ `<![CDATA[` | safeHTML }}
{{ $data := index .Site.Data .Site.Language.Lang }}
{{ range (.Params.references) }}
{{ `<p><a href="` | safeHTML }}{{ .url }}{{ `">` | safeHTML }}{{ .name }}{{ `</a>` | safeHTML }} {{ $data.references.by }} {{ .author }}: {{ .description }}{{ `</p>` | safeHTML }}
{{ end }}
{{ .Content | safeHTML }}
{{ `]]>` | safeHTML }}</content:encoded>
</item> </item>
{{- end }} {{- end }}
</channel> </channel>

View file

@ -9,6 +9,15 @@
</p> </p>
{{ end }} {{ end }}
<content> <content>
{{ $data := index .Site.Data .Site.Language.Lang }}
{{ range (.Params.references) }}
<div class="blog-reference">
<p class="blog-reference-title"><a href="{{ .url }}">{{ .name }}</a></p>
<p class="blog-reference-subtitle">{{ $data.references.by }} {{ .author }}</p>
<p class="blog-reference-description">{{ .description }}</p>
</div>
{{ end }}
{{ .Content }} {{ .Content }}
</content> </content>
<p> <p>