1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-27 14:12:09 +00:00

Fix data feeds

This commit is contained in:
Rohan Kumar 2022-05-20 18:35:04 -07:00
parent 2204ae8861
commit db2410ed32
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 10 additions and 9 deletions

View file

@ -1,5 +1,5 @@
{{ define "main" }}
<main class="h-feed hfeed" itemscope itemtype="https://schema.org/DataFeed">
<main itemprop="mainEntity" class="h-feed hfeed" itemscope itemtype="https://schema.org/DataFeed">
<h1 id="bookmarks" class="p-name" itemprop="name headline">My book&shy;marks</h1>
{{ .Content }}
<p role="doc-tip">
@ -9,17 +9,18 @@
{{ $bookmarks := getJSON "https://seirdy.one/data/bookmarks.json" -}}
{{ range sort $bookmarks "tags" "desc" -}}
{{ $bookmark := . -}}
<li>
<article class="h-entry hentry" itemprop="dataFeedElement" itemscope itemtype="https://schema.org/SocialMediaPosting https://schema.org/DataFeedItem">
{{- $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&shy;alisation` | safeHTML }}</span>
</a>
</h2>
{{- $tags := split $bookmark.tags "," -}}
{{- $firstTag := index $tags 0 }}
{{- $timestamp := dateFormat "2006-01-02 15:04:05-0700" $firstTag }}
<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">

View file

@ -22,8 +22,8 @@
{{- end -}}
{{- range $posts -}}
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
<li itemprop="dataFeedElement" itemscope itemtype="https://schema.org/DataFeedItem https://schema.org/BlogPosting" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
<article class="h-entry hentry">
<li itemprop="dataFeedElement" itemscope itemtype="https://schema.org/DataFeedItem">
<article class="h-entry hentry" itemprop="item" itemscope itemtype="https://schema.org/BlogPosting" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
{{ if $isStandalone -}}
<h2
{{- else -}}