layout: add default and partials

* NEW Adds a section template.
* NEW Adds a single page template.
* NEW Fills in the header and footer templates.
* BETTER Improves the global html head template.

Co-Authored-by: Igor Milhit <igor@milhit.ch>
pull/31/head
iGor milhit 2019-07-08 07:05:23 +02:00
parent 9b7e39acd2
commit 498a724195
Signed by: igor
GPG Key ID: 692D97C3D0228A99
5 changed files with 71 additions and 1 deletions

View File

@ -0,0 +1,16 @@
{{ define "main" }}
<main>
{{ .Content }}
<ul class="contents">
{{ range .Paginator.Pages }}
<li><a href="{{ .Permalink }}">{{.Title}} &mdash; {{ .Date.Format "2006-01-02" }}</a>
{{/* <div>
{{ partial "summary.html" . }}
</div> */}}
</li>
{{ end }}
</ul>
{{/* {{ partial "pagination.html" . }} */}}
</main>
{{ end }}

View File

@ -0,0 +1,44 @@
{{ define "main" }}
<section id="main">
<header>
<h1 id="title">{{ .Title }}</h1>
<h4 id="date">{{ .Date.Format "2006-01-02" }}</h4>
</header>
<article id="content">
{{ .Content }}
</article>
</section>
{{/*
<aside id="meta">
<div>
<section>
</section>
{{ with .Params.topics }}
<ul id="topics">
{{ range . }}
<li><a href="{{ "topics" | absURL}}{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
{{ end }}
{{ with .Params.tags }}
<ul id="tags">
{{ range . }}
<li> <a href="{{ "tags" | absURL }}{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
{{ end }}
</div>
<div>
{{ with .PrevInSection }}
<a class="previous" href="{{.Permalink}}"> {{.Title}}</a>
{{ end }}
{{ with .NextInSection }}
<a class="next" href="{{.Permalink}}"> {{.Title}}</a>
{{ end }}
</div>
</aside>
*/}}
{{ end }}

View File

@ -0,0 +1,6 @@
<footer class="main-footer">
<ul>
<li><a href="https://framagit.org/iGormilhit/igor.milhit">Sources</a></li>
<li><a href="http://creativecommons.org/licenses/by/4.0/">CC-BY</a></li>
</ul>
</footer>

View File

@ -2,7 +2,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<base href="{{ .Site.BaseURL }}"> <base href="{{ .Site.BaseURL }}">
<title> {{ .Title }} </title> <title>{{ .Title }} | {{ .Site.Title }}</title>
<link rel="canonical" href="{{ .Permalink }}"> <link rel="canonical" href="{{ .Permalink }}">
<link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}style.css"> <link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}style.css">

View File

@ -0,0 +1,4 @@
<header class="main-header">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
<a href="{{ .Site.BaseURL }}blog">Blog</a>
</header>