1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +00:00

Indieweb: more h-entry metadata

Should have all the basic elements of an h-entry now.
This commit is contained in:
Rohan Kumar 2020-12-28 19:23:54 -08:00
parent 39818533a1
commit 5741154155
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 28 additions and 25 deletions

View file

@ -1,4 +1,5 @@
# {{$.Title | safeHTML}} # {{$.Title | safeHTML}}
{{ $lastmod := .Lastmod -}} {{ $lastmod := .Lastmod -}}
{{ if lt .Date $lastmod -}} {{ if lt .Date $lastmod -}}
Originally posted {{ .Date.Format "2006-01-02" }}. Last updated {{ .Lastmod.Format "2006-01-02" }}. Originally posted {{ .Date.Format "2006-01-02" }}. Last updated {{ .Lastmod.Format "2006-01-02" }}.

View file

@ -1,28 +1,30 @@
{{ define "main" }} {{ define "main" }}
<article itemscope itemtype="https://schema.org/Article" class="h-entry"> <div itemscope itemtype="https://schema.org/Article" class="h-entry">
<header id="post-header"> <article itemprop="mainEntityOfPage">
<h1 itemprop="name headline" class="p-hame">{{ .Title }}</h1> <header id="post-header">
{{ $lastmod := .Lastmod -}} <h1 itemprop="name headline" class="p-name">{{ .Title }}</h1>
{{ if lt .Date $lastmod -}} {{ $lastmod := .Lastmod -}}
Originally posted <time class="dt-published" itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time> by <a itemprop="author" class="p-author h-card" href="https://seirdy.one" rel="author">{{ .Site.Author.name }}</a>.<br> {{ if lt .Date $lastmod -}}
Last updated <time itemprop="dateModified" class="dt-updated" datetime="{{ $lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>. <a href="{{ .Site.Params.logUrlPrefix }}content/{{ .File.Path }}">Changelog</a> Originally posted <a class="u-url" href="https://seirdy.one{{ .RelPermalink }}"><time class="dt-published" itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time></a> by <a itemprop="author" class="p-author h-card" href="https://seirdy.one" rel="author">{{ .Site.Author.name }}</a>.<br>
{{ else -}} Last updated <time itemprop="dateModified" class="dt-updated" datetime="{{ $lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>. <a href="{{ .Site.Params.logUrlPrefix }}content/{{ .File.Path }}">Changelog</a>
Posted <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>. {{ else -}}
{{ end }} Posted <a class="u-url" href="https://seirdy.one{{ .RelPermalink }}"><time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time></a>.
</header> {{ end }}
<section itemprop="articlebody"> </header>
{{ .Content -}} <section class="e-content" itemprop="articlebody">
</section> {{ .Content -}}
</article> </section>
<br> </article>
<hr> <br>
<footer class="comment"> <hr>
{{ with .OutputFormats.Get "gemtext" -}} <footer class="comment">
<p> {{ with .OutputFormats.Get "gemtext" -}}
View this article on <a href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">my Gemini capsule</a> <p>
</p> View this article on <a rel="syndication" class="u-syndication" href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">my Gemini capsule</a>
{{ end -}} </p>
<p><a href="mailto:~seirdy/seirdy.one-comments@lists.sr.ht">Send an email</a> to leave a comment in the <a href="https://lists.sr.ht/~seirdy/seirdy.one-comments">mailing list</a> for seirdy.one. You'll have to send in plain text; please <a href="https://useplaintext.email/">learn how.</a>. Alternatively, send your email <a href="mailto:seirdy@seirdy.one">directly to me</a>; it wont show up on the mailing list, but Ill see it.</p> {{ end -}}
</footer> <p><a href="mailto:~seirdy/seirdy.one-comments@lists.sr.ht">Send an email</a> to leave a comment in the <a href="https://lists.sr.ht/~seirdy/seirdy.one-comments">mailing list</a> for seirdy.one. You'll have to send in plain text; please <a href="https://useplaintext.email/">learn how.</a>. Alternatively, send your email <a href="mailto:seirdy@seirdy.one">directly to me</a>; it wont show up on the mailing list, but Ill see it.</p>
</footer>
</div>
<hr> <hr>
{{ end }} {{ end }}