1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +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> </a>
</h2> </h2>
<p> <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> 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>
<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>
</p> </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> </article>
</li> </li>
{{- end }} {{- end }}

View file

@ -76,7 +76,11 @@
{{- end -}} {{- end -}}
<activity:object-type>http://activitystrea.ms/schema/1.0/{{ $type }}</activity:object-type> <activity:object-type>http://activitystrea.ms/schema/1.0/{{ $type }}</activity:object-type>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> <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> </entry>
{{- end }} {{- end -}}
{{ end }} {{- end }}
</feed> </feed>

View file

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

View file

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