commit ff78efe39f4b4bf3da7bbb6051fcf415ccd73ba6
parent 8dd94378d23d346c4d18f960cdd28508d36e7ff4
Author: oscarbenedito <oscar@obenedito.org>
Date: Fri, 18 Oct 2019 20:04:50 +0200
Added IndieWeb integration
Diffstat:
5 files changed, 51 insertions(+), 52 deletions(-)
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -1,7 +1,50 @@
{{ define "main" }}
-{{ partial "header.html" . }}
+<header class="page-header">
+ {{ if eq .Kind "taxonomy" }}
+ <h1>{{ .Title | title }}</h1>
+ {{ else }}
+ <h1>{{ .Title }}</h1>
+ {{ end }}
+ {{ if eq .Kind "taxonomy" }}
+ <h2>{{ .Data.Singular | title }}</h2>
+ {{ else }}
+ {{ with .Params.subtitle }}
+ <h2>{{ . }}</h2>
+ {{ end }}
+ {{ end }}
+</header>
+
<main class="list">
- {{ partial "list.html" . }}
- {{ partial "pagination.html" . }}
+ {{ $paginator := .Paginator }}
+ {{ range $paginator.Pages }}
+ <div class="card h-entry">
+ <header>
+ <h2 class="p-name">{{ .Title }}</h2>
+ </header>
+ <section class="content">
+ {{ if .Params.subtitle }}
+ <p class="p-summary">{{ .Params.subtitle }}</p>
+ {{ else }}
+ <p class="p-summary">{{ .Content | truncate 200 }}</p>
+ {{ end }}
+ </section>
+ <footer>
+ {{ with .Params.categories }}<a class="p-category" style="color: var(--secondary-text-color)" href="{{ "blog/categories/" | relURL }}{{ . | urlize }}">{{ . | title }}</a> · {{ end }}<data class="dt-published">{{ .Date.Format "January 2, 2006" }}</data> · {{ partial "read-time.html" . }}
+ </footer>
+ <a class="card-link u-url" href="{{ .RelPermalink }}"></a>
+ </div>
+ {{ end }}
+
+ {{ $paginator := .Paginator }}
+ {{ if or $paginator.HasPrev $paginator.HasNext }}
+ <div class="pagination">
+ {{ if $paginator.HasPrev }}
+ <a class="button" href="{{ $paginator.Prev.URL }}">← Newer Posts</a>
+ {{ end }}
+ {{ if $paginator.HasNext }}
+ <a class="button right" href="{{ $paginator.Next.URL }}">Older Posts →</a>
+ {{ end }}
+ </div>
+ {{ end }}
</main>
{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -4,17 +4,17 @@
<h2>{{ .Params.categories | title }} entry</h2>
</header>
<main>
- <article>
+ <article class="h-entry">
<header>
- <h1 class="post-title">{{ .Title }}</h1>
- <div class="post-meta">{{ with .Params.categories }}<a style="color: var(--secondary-text-color)" href="{{ "blog/categories/" | relURL }}{{ . | urlize }}">{{ . | title }}</a> · {{ end }}{{ .Date.Format "January 2, 2006" }}{{ if .Lastmod }} (last modified on {{ .Lastmod.Format "January 2, 2006" }}){{ end }}
+ <h1 class="post-title p-name">{{ .Title }}</h1>
+ <div class="post-meta">{{ with .Params.categories }}<a class="p-category" style="color: var(--secondary-text-color)" href="{{ "blog/categories/" | relURL }}{{ . | urlize }}">{{ . | title }}</a> · {{ end }}<data class="dt-published">{{ .Date.Format "January 2, 2006" }}</data>{{ if .Lastmod }} (last modified on <data class="dt-updated">{{ .Lastmod.Format "January 2, 2006" }}</data>){{ end }}
</div>
</header>
- <div class="post-content">{{ .Content }}</div>
+ <div class="post-content e-content">{{ .Content }}</div>
{{ if .Params.tags }}
<footer>
<ul class="post-tags">
- {{ range .Params.tags | sort }}<li><a href="{{ "blog/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a></li>{{ end }}
+ {{ range .Params.tags | sort }}<li><a class="p-category" href="{{ "blog/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a></li>{{ end }}
</ul>
</footer>
{{ end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
@@ -1,14 +0,0 @@
-<header class="page-header">
- {{ if eq .Kind "taxonomy" }}
- <h1>{{ .Title | title }}</h1>
- {{ else }}
- <h1>{{ .Title }}</h1>
- {{ end }}
- {{ if eq .Kind "taxonomy" }}
- <h2>{{ .Data.Singular | title }}</h2>
- {{ else }}
- {{ with .Params.subtitle }}
- <h2>{{ . }}</h2>
- {{ end }}
- {{ end }}
-</header>
diff --git a/layouts/partials/list.html b/layouts/partials/list.html
@@ -1,19 +0,0 @@
-{{ $paginator := .Paginator }}
-{{ range $paginator.Pages }}
-<div class="card">
- <header>
- <h2>{{ .Title }}</h2>
- </header>
- <section class="content">
- {{ if .Params.subtitle }}
- <p>{{ .Params.subtitle }}</p>
- {{ else }}
- <p>{{ .Content | truncate 200 }}</p>
- {{ end }}
- </section>
- <footer>
- <time>{{ with .Params.categories }}<a style="color: var(--secondary-text-color)" href="{{ "blog/categories/" | relURL }}{{ . | urlize }}">{{ . | title }}</a> · {{ end }}{{ .Date.Format "January 2, 2006" }} · {{ partial "read-time.html" . }}</time>
- </footer>
- <a class="card-link" href="{{ .RelPermalink }}"></a>
-</div>
-{{ end }}
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
@@ -1,11 +0,0 @@
-{{ $paginator := .Paginator }}
-{{ if or $paginator.HasPrev $paginator.HasNext }}
-<div class="pagination">
- {{ if $paginator.HasPrev }}
- <a class="button" href="{{ $paginator.Prev.URL }}">← Newer Posts</a>
- {{ end }}
- {{ if $paginator.HasNext }}
- <a class="button right" href="{{ $paginator.Next.URL }}">Older Posts →</a>
- {{ end }}
-</div>
-{{ end }}