Define Base Template (baseof.html)

This commit is contained in:
vimux 2018-11-03 10:23:41 -04:00
parent 39e9d944a6
commit 896326481e
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
7 changed files with 93 additions and 95 deletions

View file

@ -1,9 +1,7 @@
{{ partial "header.html" . }}
<div class="main">
<div class="page404 block center">
{{ define "main" }}
<div class="page404 block center">
<h1 class="page404__title">{{ T "page404_title" }}</h1>
<p class="page404__lead">{{ T "page404_lead" }}</p>
<a class="page404__link" href="">{{ T "page404_link" }}</a>
</div>
</div>
{{ partial "footer.html" . }}
{{ end }}

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html class="h" lang="{{ .Site.LanguageCode | default "en-us" }}">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="{{ .Site.Params.Manifest.themeColor | default "#1b1b1b" }}">
<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}">
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }}
{{ if .Site.Params.twitter_cards }}{{ template "_internal/twitter_cards.html" . }}{{ end }}
<link rel="stylesheet" href="{{ "css/main.css" | relURL }}">
<link rel="icon" href="{{ "icons/16.png" | relURL }}" sizes="16x16" type="image/png">
<link rel="icon" href="{{ "icons/32.png" | relURL }}" sizes="32x32" type="image/png">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
{{ end -}}
<link rel="manifest" href="{{ "manifest.json" | relURL }}">
{{ if not .Site.IsServer }}{{ template "_internal/google_analytics_async.html" . }}{{ end }}
</head>
<body>
{{ partial "header" . }}
<div class="main">
{{ block "main" . }}
{{- if or .Title .Content }}
<div class="page block">
{{ with .Title }}<h1 class="page__title">{{ . }}</h1>{{ end }}
{{ with .Content }}<div class="page__content{{ if not $.Title }} page__content--notitle{{ end }}">{{ . }}</div>{{ end }}
</div>
{{ end }}
{{ end }}
</div>
{{ partial "footer" . }}
<script src="{{ "js/modernizr.js" | relURL }}"></script>
<script src="{{ "js/menu.js" | relURL }}"></script>
{{- partial "mathjax.html" . -}}
</body>
</html>

View file

@ -1,11 +1,4 @@
{{ partial "header.html" . }}
<div class="main">
{{- if or .Title .Content }}
<div class="page block">
{{ with .Title }}<h1 class="page__title">{{ . }}</h1>{{ end }}
{{ with .Content }}<div class="page__content{{ if not $.Title }} page__content--notitle{{ end }}">{{ . }}</div>{{ end }}
</div>
{{ end }}
{{ define "main" }}
<div class="cards">
{{ range .Paginator.Pages }}
<div class="card{{ if $.Param "cardsPerRow" }} card--{{ $.Param "cardsPerRow" }}col{{ else }} card--2col{{ end }}">
@ -14,5 +7,4 @@
{{ end }}
</div>
{{ partial "pagination.html" . }}
</div>
{{ partial "footer.html" . }}
{{ end }}

View file

@ -1,5 +1,4 @@
{{ partial "header.html" . }}
<div class="main">
{{ define "main" }}
<div class="single block">
<article class="post">
{{- partial "post_thumbnail.html" (dict "page" . ) }}
@ -17,5 +16,4 @@
</div>
{{ partial "related.html" . }}
{{ partial "comments.html" . }}
</div>
{{ partial "footer.html" . }}
{{ end }}

View file

@ -1,5 +1,4 @@
{{ partial "header.html" . }}
<div class="main">
{{ define "main" }}
<div class="cards">
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{ $paginator := .Paginate ( where .Data.Pages "Section" "in" $mainSections ) }}
@ -18,5 +17,4 @@
</div>
{{- end }}
{{ partial "pagination.html" . }}
</div>
{{ partial "footer.html" . }}
{{ end }}

View file

@ -2,8 +2,3 @@
{{- partial "footer_social.html" . }}
<div class="footer__copyright">© {{ now.Format "2006" }} {{ .Site.Title }}. <span class="footer__copyright-credits">{{ T "footer_credits" | safeHTML }}</span></div>
</footer>
<script src="{{ "js/modernizr.js" | relURL }}"></script>
<script src="{{ "js/menu.js" | relURL }}"></script>
{{- partial "mathjax.html" . -}}
</body>
</html>

View file

@ -1,26 +1,4 @@
<!DOCTYPE html>
<html class="h" lang="{{ .Site.LanguageCode | default "en-us" }}">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="{{ .Site.Params.Manifest.themeColor | default "#1b1b1b" }}">
<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}">
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }}
{{ if .Site.Params.twitter_cards }}{{ template "_internal/twitter_cards.html" . }}{{ end }}
<link rel="stylesheet" href="{{ "css/main.css" | relURL }}">
<link rel="icon" href="{{ "icons/16.png" | relURL }}" sizes="16x16" type="image/png">
<link rel="icon" href="{{ "icons/32.png" | relURL }}" sizes="32x32" type="image/png">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
{{ end -}}
<link rel="manifest" href="{{ "manifest.json" | relURL }}">
{{ if not .Site.IsServer }}{{ template "_internal/google_analytics_async.html" . }}{{ end }}
</head>
<body>
<header class="header">
<header class="header">
<a class="logo" href="{{ "" | relURL }}">{{ .Site.Title }}</a>
{{ partial "menu.html" . }}
</header>
</header>