1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02: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" }} {{ 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> <h1 id="bookmarks" class="p-name" itemprop="name headline">My book&shy;marks</h1>
{{ .Content }} {{ .Content }}
<p role="doc-tip"> <p role="doc-tip">
@ -9,17 +9,18 @@
{{ $bookmarks := getJSON "https://seirdy.one/data/bookmarks.json" -}} {{ $bookmarks := getJSON "https://seirdy.one/data/bookmarks.json" -}}
{{ range sort $bookmarks "tags" "desc" -}} {{ range sort $bookmarks "tags" "desc" -}}
{{ $bookmark := . -}} {{ $bookmark := . -}}
<li> {{- $tags := split $bookmark.tags "," -}}
<article class="h-entry hentry" itemprop="dataFeedElement" itemscope itemtype="https://schema.org/SocialMediaPosting https://schema.org/DataFeedItem"> {{- $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--> <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"> <h2 itemprop="sharedContent" itemscope itemtype="https://schema.org/WebPage" class="p-name">
<a itemprop="url" href="{{ $bookmark.uri }}" class="u-bookmark-of h-cite"> <a itemprop="url" href="{{ $bookmark.uri }}" class="u-bookmark-of h-cite">
<span itemprop="headline">{{ $bookmark.title | replaceRE `Defunctionalisation` `Defunction&shy;alisation` | safeHTML }}</span> <span itemprop="headline">{{ $bookmark.title | replaceRE `Defunctionalisation` `Defunction&shy;alisation` | safeHTML }}</span>
</a> </a>
</h2> </h2>
{{- $tags := split $bookmark.tags "," -}}
{{- $firstTag := index $tags 0 }}
{{- $timestamp := dateFormat "2006-01-02 15:04:05-0700" $firstTag }}
<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 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"> <br>Tags: <span itemprop="keywords">

View file

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