Define Base Template (baseof.html)
This commit is contained in:
parent
39e9d944a6
commit
896326481e
7 changed files with 93 additions and 95 deletions
|
@ -1,9 +1,7 @@
|
||||||
{{ partial "header.html" . }}
|
{{ define "main" }}
|
||||||
<div class="main">
|
<div class="page404 block center">
|
||||||
<div class="page404 block center">
|
<h1 class="page404__title">{{ T "page404_title" }}</h1>
|
||||||
<h1 class="page404__title">{{ T "page404_title" }}</h1>
|
<p class="page404__lead">{{ T "page404_lead" }}</p>
|
||||||
<p class="page404__lead">{{ T "page404_lead" }}</p>
|
<a class="page404__link" href="">{{ T "page404_link" }}</a>
|
||||||
<a class="page404__link" href="">{{ T "page404_link" }}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{ partial "footer.html" . }}
|
{{ end }}
|
39
layouts/_default/baseof.html
Normal file
39
layouts/_default/baseof.html
Normal 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>
|
|
@ -1,18 +1,10 @@
|
||||||
{{ partial "header.html" . }}
|
{{ define "main" }}
|
||||||
<div class="main">
|
<div class="cards">
|
||||||
{{- if or .Title .Content }}
|
{{ range .Paginator.Pages }}
|
||||||
<div class="page block">
|
<div class="card{{ if $.Param "cardsPerRow" }} card--{{ $.Param "cardsPerRow" }}col{{ else }} card--2col{{ end }}">
|
||||||
{{ with .Title }}<h1 class="page__title">{{ . }}</h1>{{ end }}
|
{{ .Render "summary" }}
|
||||||
{{ with .Content }}<div class="page__content{{ if not $.Title }} page__content--notitle{{ end }}">{{ . }}</div>{{ end }}
|
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="cards">
|
|
||||||
{{ range .Paginator.Pages }}
|
|
||||||
<div class="card{{ if $.Param "cardsPerRow" }} card--{{ $.Param "cardsPerRow" }}col{{ else }} card--2col{{ end }}">
|
|
||||||
{{ .Render "summary" }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
{{ partial "pagination.html" . }}
|
|
||||||
</div>
|
</div>
|
||||||
{{ partial "footer.html" . }}
|
{{ partial "pagination.html" . }}
|
||||||
|
{{ end }}
|
|
@ -1,21 +1,19 @@
|
||||||
{{ partial "header.html" . }}
|
{{ define "main" }}
|
||||||
<div class="main">
|
<div class="single block">
|
||||||
<div class="single block">
|
<article class="post">
|
||||||
<article class="post">
|
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
||||||
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
<div class="post__meta meta mb">{{ partial "post_meta.html" . }}</div>
|
||||||
<div class="post__meta meta mb">{{ partial "post_meta.html" . }}</div>
|
<h1 class="post__title">{{ .Title }}</h1>
|
||||||
<h1 class="post__title">{{ .Title }}</h1>
|
{{- partial "post_toc.html" . }}
|
||||||
{{- partial "post_toc.html" . }}
|
<div class="post__content">{{ .Content }}</div>
|
||||||
<div class="post__content">{{ .Content }}</div>
|
{{ if or (.Param "share") (isset $.Params "tags") }}
|
||||||
{{ if or (.Param "share") (isset $.Params "tags") }}
|
<footer class="post__footer">
|
||||||
<footer class="post__footer">
|
{{ partial "post_tags.html" . }}
|
||||||
{{ partial "post_tags.html" . }}
|
{{ partial "post_share.html" . }}
|
||||||
{{ partial "post_share.html" . }}
|
</footer>
|
||||||
</footer>
|
{{ end }}
|
||||||
{{ end }}
|
</article>
|
||||||
</article>
|
|
||||||
</div>
|
|
||||||
{{ partial "related.html" . }}
|
|
||||||
{{ partial "comments.html" . }}
|
|
||||||
</div>
|
</div>
|
||||||
{{ partial "footer.html" . }}
|
{{ partial "related.html" . }}
|
||||||
|
{{ partial "comments.html" . }}
|
||||||
|
{{ end }}
|
|
@ -1,22 +1,20 @@
|
||||||
{{ partial "header.html" . }}
|
{{ define "main" }}
|
||||||
<div class="main">
|
<div class="cards">
|
||||||
<div class="cards">
|
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
|
||||||
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
|
{{ $paginator := .Paginate ( where .Data.Pages "Section" "in" $mainSections ) }}
|
||||||
{{ $paginator := .Paginate ( where .Data.Pages "Section" "in" $mainSections ) }}
|
{{ range $paginator.Pages }}
|
||||||
{{ range $paginator.Pages }}
|
<div class="card{{ if $.Param "cardsPerRow" }} card--{{ $.Param "cardsPerRow" }}col{{ else }} card--2col{{ end }}">
|
||||||
<div class="card{{ if $.Param "cardsPerRow" }} card--{{ $.Param "cardsPerRow" }}col{{ else }} card--2col{{ end }}">
|
{{ .Render "summary" }}
|
||||||
{{ .Render "summary" }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
</div>
|
||||||
{{- if eq $paginator.TotalNumberOfElements 0 }}
|
{{ end }}
|
||||||
<div class="empty block center">
|
|
||||||
<div class="empty__icon">¯\_(ツ)_/¯</div>
|
|
||||||
<h3 class="empty__title">{{ T "empty_title" }}</h3>
|
|
||||||
<p class="empty__text">{{ T "empty_text_start" | safeHTML }} ({{ delimit (apply $mainSections "printf" "<code>content/%s</code>" ".") ", " | safeHTML }}), {{ T "empty_text_end" }}.</p>
|
|
||||||
<p class="empty__tip">{{ T "empty_tip" | safeHTML }}</p>
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
{{ partial "pagination.html" . }}
|
|
||||||
</div>
|
</div>
|
||||||
{{ partial "footer.html" . }}
|
{{- if eq $paginator.TotalNumberOfElements 0 }}
|
||||||
|
<div class="empty block center">
|
||||||
|
<div class="empty__icon">¯\_(ツ)_/¯</div>
|
||||||
|
<h3 class="empty__title">{{ T "empty_title" }}</h3>
|
||||||
|
<p class="empty__text">{{ T "empty_text_start" | safeHTML }} ({{ delimit (apply $mainSections "printf" "<code>content/%s</code>" ".") ", " | safeHTML }}), {{ T "empty_text_end" }}.</p>
|
||||||
|
<p class="empty__tip">{{ T "empty_tip" | safeHTML }}</p>
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
{{ partial "pagination.html" . }}
|
||||||
|
{{ end }}
|
|
@ -1,9 +1,4 @@
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
{{- partial "footer_social.html" . }}
|
{{- partial "footer_social.html" . }}
|
||||||
<div class="footer__copyright">© {{ now.Format "2006" }} {{ .Site.Title }}. <span class="footer__copyright-credits">{{ T "footer_credits" | safeHTML }}</span></div>
|
<div class="footer__copyright">© {{ now.Format "2006" }} {{ .Site.Title }}. <span class="footer__copyright-credits">{{ T "footer_credits" | safeHTML }}</span></div>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="{{ "js/modernizr.js" | relURL }}"></script>
|
|
||||||
<script src="{{ "js/menu.js" | relURL }}"></script>
|
|
||||||
{{- partial "mathjax.html" . -}}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,26 +1,4 @@
|
||||||
<!DOCTYPE html>
|
<header class="header">
|
||||||
<html class="h" lang="{{ .Site.LanguageCode | default "en-us" }}">
|
<a class="logo" href="{{ "" | relURL }}">{{ .Site.Title }}</a>
|
||||||
<head>
|
{{ partial "menu.html" . }}
|
||||||
<meta charset="UTF-8">
|
</header>
|
||||||
<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">
|
|
||||||
<a class="logo" href="{{ "" | relURL }}">{{ .Site.Title }}</a>
|
|
||||||
{{ partial "menu.html" . }}
|
|
||||||
</header>
|
|
Loading…
Reference in a new issue