initial template
This commit is contained in:
77
layouts/_default/baseof.html
Normal file
77
layouts/_default/baseof.html
Normal file
@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode | default "en" }}">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
{{/* Generate consistent title */}}
|
||||
{{ $title := "" }}
|
||||
{{ if if .IsHome }}
|
||||
{{ $title = .Title }}
|
||||
{{ else }}
|
||||
{{ $title = printf "%s - %s" .Title .Site.Title }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Basic SEO -->
|
||||
<title>{{ $title }}</title>
|
||||
|
||||
{{/* Generate description from summary, description, or default site description */}}
|
||||
{{ $description := "" }}
|
||||
{{ with .Description }}
|
||||
{{ $description = . }}
|
||||
{{ else }}
|
||||
{{ $description = .Site.Params.description }}
|
||||
{{ end }}
|
||||
<meta name="description" content="{{ $description }}" />
|
||||
|
||||
{{/* Generate keywords from topics */}}
|
||||
{{ with .Params.topics }}
|
||||
<meta name="keywords" content="{{ delimit . ", " }}" />
|
||||
{{ end }}
|
||||
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}" />
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:title" content="{{ $title }}" />
|
||||
<meta property="og:description" content="{{ $description }}" />
|
||||
{{ with .Params.ogImage | default .Site.Params.openGraphImage }}
|
||||
<meta property="og:image" content="{{ . | absURL }}" />
|
||||
{{ end }}
|
||||
|
||||
<!-- Twitter -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="{{ $title }}" />
|
||||
<meta name="twitter:description" content="{{ $description }}" />
|
||||
{{ with .Params.ogImage | default .Site.Params.openGraphImage }}
|
||||
<meta name="twitter:image" content="{{ . | absURL }}" />
|
||||
{{ end }}
|
||||
|
||||
<!-- Canonical URL -->
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
|
||||
<!-- CSS Styles -->
|
||||
{{ $style := resources.Get "css/styles.css" }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $style = $style | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
{{ end }}
|
||||
</head>
|
||||
<body class="">
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
{{ block "main" . }}{{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
|
||||
{{ $js := resources.Match "js/*.js" | resources.Concat "js/bundle.js" }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $js = $js | minify | fingerprint }}
|
||||
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{ else }}
|
||||
<script src="{{ $js.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
12
layouts/_default/section.html
Normal file
12
layouts/_default/section.html
Normal file
@ -0,0 +1,12 @@
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
9
layouts/_default/single.html
Normal file
9
layouts/_default/single.html
Normal file
@ -0,0 +1,9 @@
|
||||
{{ define "main" }}
|
||||
<article>
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
</article>
|
||||
{{ end }}
|
26
layouts/_default/taxonomy.html
Normal file
26
layouts/_default/taxonomy.html
Normal file
@ -0,0 +1,26 @@
|
||||
{{ define "main" }}
|
||||
<header class="my-8">
|
||||
<p>{{ .Data.Singular }}</p>
|
||||
<h1>{{ .Title }}</h1>
|
||||
</header>
|
||||
<main>
|
||||
<ul>
|
||||
{{ range .Data.Pages }}
|
||||
<li>
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ if gt (len (index .Site.Taxonomies .Data.Singular)) 1 }}
|
||||
<section>
|
||||
<h2>Other {{ .Data.Plural }}</h2>
|
||||
<div class="tag-cloud">
|
||||
{{ partial "taxonomy-cloud" (dict "taxonomy" .Data.Singular "Site" .Site "page" .Page) }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
</main>
|
||||
{{ end }}
|
Reference in New Issue
Block a user