1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-15 01:42:10 +00:00
seirdy.one/layouts/_default/bookmarks.html
Rohan Kumar 297ad1e5cb
Add skip-link
This one is simpler than the last attempt, since it doesn't overlap with
any content except the navbar links' empty padding.
2022-07-07 08:52:55 -07:00

49 lines
2.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{ define "main" -}}
<main id="main" tabindex="-1"
itemprop="mainEntity" class="h-feed hfeed" itemscope="" itemtype="https://schema.org/DataFeed">
<h1 id="bookmarks" class="p-name" itemprop="name headline">My book&#173;marks</h1>
{{ partial "processed-content.html" . }}
<p role="doc-tip">
Timestamp format: <code>YYYY-MM-DD HH:MM</code>, as per <cite><a href="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</a></cite>
</p>
<ol>
{{ $bookmarks := getJSON "https://seirdy.one/data/bookmarks.json" -}}
{{ range sort $bookmarks "tags" "desc" -}}
{{ $bookmark := . -}}
{{- $tags := split $bookmark.tags "," -}}
{{- $firstTag := index $tags 0 }}
{{- $timestamp := dateFormat "2006-01-02 15:04:05-0700" $firstTag }}
<li itemprop="dataFeedElement" itemscope="" itemtype="https://schema.org/DataFeedItem">
<meta itemprop="dateCreated" content="{{ $timestamp }}" /><!--Just because we can't have one timestap refer to two items-->
<article class="h-entry hentry" itemprop="item" itemscope="" itemtype="https://schema.org/SocialMediaPosting">
<meta itemprop="headline" content="{{ $bookmark.title }}" /><!--Just because we can't have one headline refer to two items-->
<h2 itemprop="sharedContent" itemscope="" itemtype="https://schema.org/WebPage" class="p-name">
<a itemprop="url" href="{{ $bookmark.uri }}" class="u-bookmark-of h-cite">
<span itemprop="headline">{{ $bookmark.title | replaceRE `Defunctionalisation` `Defunction&#173;alisation` | safeHTML }}</span>
</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>
</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>
</article>
</li>
{{- end }}
</ol>
</main>
{{ end }}