1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 20:02:10 +00:00

Make list pages structurally consistent

This commit is contained in:
Rohan Kumar 2022-08-01 20:52:35 -07:00
parent 650c1b9646
commit 0fd4ad9f4f
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
6 changed files with 37 additions and 19 deletions

View file

@ -23,24 +23,30 @@
</a>
</h2>
<p>
Bookmarked on: <time class="dt-published published" itemprop="datePublished" datetime="{{ dateFormat "2006-01-02 15:04:05Z07:00" $timestamp }}">{{ dateFormat "2006-01-02 15:04" $timestamp }}</time>
<br />Tags: <span itemprop="keywords">
{{- $start := 2 -}}
{{- $firstTag := (index $tags 1) -}}
{{- if (eq $firstTag "public") -}}
{{- $firstTag = (index $tags 2) -}}
{{- $start = 3 -}}
{{- end -}}
{{- printf "<span class=\"p-category\">%s</span>" $firstTag | safeHTML -}}
{{- range after $start $tags -}}
{{- $tag := . -}}
{{- if (ne $tag "public") -}}
{{- printf ", <span class=\"p-category\">%s</span>" $tag | safeHTML -}}
{{ end -}}
{{- end }}
</span>
Bookmarked <time class="dt-published published" itemprop="datePublished" datetime="{{ dateFormat "2006-01-02 15:04:05Z07:00" $timestamp }}">{{ dateFormat "2006-01-02 15:04" $timestamp }}</time>
</p>
<p class="e-summary entry-summary" itemprop="description">{{ $bookmark.description | markdownify | replaceRE `\&rsquo;` `` | replaceRE `\&nbsp;` `\&#160;` | replaceRE `\&ldquo;` `“` | replaceRE `\&rdquo;` `”` | replaceRE `\&hellip;` `—` | replaceRE `\&mdash;` `—` | replaceRE `\&shy;` `\&#173;` | replaceRE `&lsquo;` `` | safeHTML }}</p>
<div>
<p>
Tags: <span itemprop="keywords">
{{- $start := 2 -}}
{{- $firstTag := (index $tags 1) -}}
{{- if (eq $firstTag "public") -}}
{{- $firstTag = (index $tags 2) -}}
{{- $start = 3 -}}
{{- end -}}
{{- printf "<span class=\"p-category\">%s</span>" $firstTag | safeHTML -}}
{{- range after $start $tags -}}
{{- $tag := . -}}
{{- if (ne $tag "public") -}}
{{- printf ", <span class=\"p-category\">%s</span>" $tag | safeHTML -}}
{{ end -}}
{{- end }}
</span>
</p>
<p class="e-summary entry-summary" itemprop="description">
{{ $bookmark.description | markdownify | replaceRE `\&rsquo;` `` | replaceRE `\&nbsp;` `\&#160;` | replaceRE `\&ldquo;` `“` | replaceRE `\&rdquo;` `”` | replaceRE `\&hellip;` `—` | replaceRE `\&mdash;` `—` | replaceRE `\&shy;` `\&#173;` | replaceRE `&lsquo;` `` | safeHTML }}
</p>
</div>
</article>
</li>
{{- end }}

View file

@ -76,7 +76,11 @@
{{- end -}}
<activity:object-type>http://activitystrea.ms/schema/1.0/{{ $type }}</activity:object-type>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
{{ with .Params.image -}}
{{- $image := resources.Get (printf "/p/%s" . ) | resources.Fingerprint "md5" -}}
<media:thumbnail url="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" />
{{- end }}
</entry>
{{- end }}
{{ end }}
{{- end -}}
{{- end }}
</feed>

View file

@ -37,8 +37,10 @@
{{ partial "processed-content.html" . }}
</div>
{{- else }}
<div><!--Keep this attr-free div to make this part structurally identical.-->
<p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p>
<p>{{- partial "wordcount.html" . -}}</p>
</div>
{{- end }}
</article>
</li>

View file

@ -26,8 +26,10 @@
, updated <time{{ if not (.Params.evergreen) }} itemprop="dateModified" class="dt-updated updated"{{ end }} datetime="{{ .Lastmod.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02 15:04" }}</time>
{{- end }}
</p>
<div>
<p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p>
<p>{{- partial "wordcount.html" . -}}</p>
</div>
</article>
</li>
{{- end }}

View file

@ -26,8 +26,10 @@
, updated <time{{ if not (.Params.evergreen) }} itemprop="dateModified" class="dt-updated updated"{{ end }} datetime="{{ .Lastmod.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02 15:04" }}</time>
{{- end }}
</p>
<div>
<p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p>
<p>{{- partial "wordcount.html" . -}}</p>
</div>
</article>
</li>
{{- end }}

View file

@ -25,8 +25,10 @@
{{- end }}
</p>
<div>
<p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p>
<p>{{- partial "wordcount.html" . -}}</p>
</div>
</article>
</li>
{{- end }}