Add: Basic Hugo layouts to enable site rendering
This commit is contained in:
parent
63c1a13ba6
commit
43dff7d415
19
layouts/_default/baseof.html
Normal file
19
layouts/_default/baseof.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ .Title }}</title>
|
||||
<link rel="stylesheet" href="/css/style.css"> {{/* We'll create this later if needed */}}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
|
||||
</header>
|
||||
<main>
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
<footer>
|
||||
<p>© {{ now.Format "2006" }} {{ .Site.Title }}</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
20
layouts/_default/index.html
Normal file
20
layouts/_default/index.html
Normal file
@ -0,0 +1,20 @@
|
||||
{{ define "main" }}
|
||||
<article>
|
||||
<h2>{{ .Title }}</h2>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
|
||||
<h3>Recent Posts</h3>
|
||||
<ul>
|
||||
{{ range first 5 .Site.RegularPages.ByDate.Reverse }}
|
||||
{{/* Only show pages from the 'post' section or other main sections */}}
|
||||
{{ if eq .Section "post" }}
|
||||
<li>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
<p><small>Published: {{ .Date.Format "January 2, 2006" }}</small></p>
|
||||
{{ .Summary }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
13
layouts/_default/list.html
Normal file
13
layouts/_default/list.html
Normal file
@ -0,0 +1,13 @@
|
||||
{{ define "main" }}
|
||||
<h2>{{ .Title }}</h2>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{ range .Pages.ByDate.Reverse }}
|
||||
<li>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
<p><small>Published: {{ .Date.Format "January 2, 2006" }}</small></p>
|
||||
{{ .Summary }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
17
layouts/_default/single.html
Normal file
17
layouts/_default/single.html
Normal file
@ -0,0 +1,17 @@
|
||||
{{ define "main" }}
|
||||
<article>
|
||||
<h2>{{ .Title }}</h2>
|
||||
<p><small>Published: {{ .Date.Format "January 2, 2006" }}</small></p>
|
||||
{{ if .Params.tags }}
|
||||
<p>
|
||||
Tags:
|
||||
{{ range .Params.tags }}
|
||||
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
<div>
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
Loading…
x
Reference in New Issue
Block a user