layouts: Migrate layout modifications from tlwiki

Previous home:
https://git.thurstylark.com/thurstylark/tlwiki/src/branch/master/layouts
This commit is contained in:
David Thurstenson 2021-10-07 01:10:23 -05:00
parent aed270edf2
commit 9ea510e106
9 changed files with 47 additions and 21 deletions

View File

@ -1,12 +1,4 @@
{{ define "main" }}
<h1 id="{{ .Title | urlize }}">{{ .Title | markdownify }}</h2>
{{ .Content }}
<ul>
{{ range .Pages }}
{{ .Render "li" }}
{{ end }}
</ul>
{{ partial "title_and_desc.html" . }}
{{ partial "postlist.html" . }}
{{ end }}

View File

@ -8,12 +8,3 @@
<footer class="content__footer"></footer>
{{ end }}
{{define "aside" }}
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
{{ if or (.Params.author) (.Params.date) }}
<p>
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }}
{{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }}
</p>
{{ end }}
{{ end }}

View File

@ -1,4 +1,5 @@
{{ define "main" }}
{{ .Content }}
{{ partial "title_and_desc.html" . }}
{{ partial "postlist.html" . }}
{{ end }}

View File

@ -0,0 +1,9 @@
{{define "aside" }}
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
{{ if or (.Params.author) (.Params.date) }}
<p>
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }}
{{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }}
</p>
{{ end }}
{{ end }}

View File

@ -1,2 +1 @@
<p class="copyright">{{ .Site.Copyright }}</p>
<p class="advertisement">Powered by <a href="https://gohugo.io/">hugo</a> and <a href="https://github.com/joeroe/risotto">risotto</a>.</p>

View File

@ -0,0 +1,13 @@
{{ range .Pages }}
{{ if not (isset .Params "hide") }}
<article class="post">
<header class="post__header">
<h2><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
</header>
<section class="post__summary">
{{ .Description }}
</section>
</article>
{{ end }}
{{ end }}

View File

@ -0,0 +1,13 @@
{{ range .Sections }}
{{ if not (isset .Params "hide") }}
<article class="post">
<header class="post__header">
<h2><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
</header>
<section class="post__summary">
{{ .Description }}
</section>
</article>
{{ end }}
{{ end }}

View File

@ -0,0 +1,4 @@
<header class="content__header">
<h1>{{ .Title | markdownify }}</h1>
{{ .Content }}
</header>

View File

@ -0,0 +1,4 @@
<header class="content__header">
<h1>{{ .Title | markdownify }}</h1>
{{ .Description }}
</header>