diff options
author | Marcin Mierzejewski <marcin@mierzejewski.net> | 2020-04-30 23:02:40 +0300 |
---|---|---|
committer | Marcin Mierzejewski <marcin@mierzejewski.net> | 2020-04-30 23:02:40 +0300 |
commit | 9943fc2d5557429370854c53356729c110a45938 (patch) | |
tree | 64c5de8fd1576113d67482a077c072078d6f95fc /layouts |
big bang
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 4 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 56 | ||||
-rw-r--r-- | layouts/_default/list.html | 14 | ||||
-rw-r--r-- | layouts/_default/single.html | 4 | ||||
-rw-r--r-- | layouts/gallery/list.html | 17 | ||||
-rw-r--r-- | layouts/gallery/single.html | 15 | ||||
-rw-r--r-- | layouts/index.html | 7 | ||||
-rw-r--r-- | layouts/opengraph.html | 49 | ||||
-rw-r--r-- | layouts/posts/single.html | 14 | ||||
-rw-r--r-- | layouts/sitemap.xml | 16 |
10 files changed, 196 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..a25bc14 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,4 @@ +{{ define "main" }}
+<h1>Page not found</h1>
+<p><a href="{{ .Site.BaseURL }}">Return to the home page</a>.</p>
+{{ end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..01b3f86 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html lang="{{ .Site.LanguageCode }}"> +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <title>{{ .Site.Title }}{{ $url := urls.Parse .Page.Permalink }}{{ $url.Path }}</title> + {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }} + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name="robots" content="all,follow"> + <meta name="googlebot" content="index,follow,snippet,archive"> + <link rel="stylesheet" href="{{ "hugo-theme-console/css/terminal-0.7.1.min.css" | absURL }}"> + <link rel="stylesheet" href="{{ "hugo-theme-console/css/animate-3.7.2.min.css" | absURL }}"> + <link rel="stylesheet" href="{{ "hugo-theme-console/css/console.css" | absURL }}"> + {{ ` + <!--[if lt IE 9]> + <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> + <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> + <![endif]--> + ` | safeHTML }} + + <link rel="shortcut icon" href="{{ "img/favicon.ico" | absURL }}"> + <link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png"> + <link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png"> + <link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png"> + <link rel="manifest" href="/img/site.webmanifest"> + {{ with .OutputFormats.Get "RSS" }} + {{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }} + {{ end }} + {{ template "opengraph.html" . }} + {{ template "_internal/twitter_cards.html" . }} + {{ template "_internal/google_analytics.html" . }} +</head> +<body class="terminal"> + <div class="container"> + <div class="terminal-nav"> + <header class="terminal-logo"> + <div class="logo terminal-prompt"> + {{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} + {{ $.Scratch.Add "path" .Site.BaseURL }} + <a href="{{ .Site.BaseURL }}" class="no-style site-name">{{ .Site.Title }}</a>:~# {{ range $index, $element := split $url "/" }}{{ $.Scratch.Add "path" $element }}{{ if ne $element "" }}<a href='{{ $.Scratch.Get "path" }}'>{{ . }}</a>/{{ $.Scratch.Add "path" "/" }}{{ end }}{{ end }}</header> + <nav class="terminal-menu"> + <ul vocab="https://schema.org/" typeof="BreadcrumbList"> + {{ range .Site.Params.navlinks }} + <li><a href="{{ absURL .url }}" typeof="ListItem">{{ .name }}</a></li> + {{ end }} + </ul> + </nav> + </div> + </div> + + <div class="container animated zoomIn fast"> + {{ block "main" . }} + {{ end }} + </div> + </body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..f730d59 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,14 @@ +{{ define "main" }} +<h1>{{ .Page.Title }}</h1> +<br/> +{{ .Content }} + +{{ range sort .Data.Pages "Date" "desc" }} + {{ if not .Params.private }} + <div class="post-list-date">{{ .PublishDate.Format "Jan. 2, 2006" }}</div> + <h1><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a></h1> + {{ .Summary }} + {{ end }} +{{ end }} + +{{ end }}
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..ed057a4 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,4 @@ +{{ define "main" }} +<h1>{{ .Title }}</h1> +{{ .Content }} +{{ end }}
\ No newline at end of file diff --git a/layouts/gallery/list.html b/layouts/gallery/list.html new file mode 100644 index 0000000..e1233da --- /dev/null +++ b/layouts/gallery/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} +<h1>{{ .Page.Title }}</h1> +{{ .Content }} +<div class="image-grid"> + {{ range sort .Data.Pages "Date" "desc" }} + {{ if and (isset .Params "image") .Params.image }} + <a href="{{ .Permalink }}" title="{{ .Title }}"> + {{ $image := .Page.Resources.GetMatch .Params.image }} + {{ with $image }} + {{ $thumb := .Resize "400x" }} + <img src="{{ $thumb.RelPermalink }}" alt="{{ .Title }}" class="img-responsive"> + {{end}} + </a> + {{ end }} + {{ end }} +</div> +{{ end }}
\ No newline at end of file diff --git a/layouts/gallery/single.html b/layouts/gallery/single.html new file mode 100644 index 0000000..87a0c77 --- /dev/null +++ b/layouts/gallery/single.html @@ -0,0 +1,15 @@ +{{ define "main" }} +<h1>{{ .Page.Title }}</h1> + +{{ if and (isset .Params "image") .Params.image }} + {{ $image := .Page.Resources.GetMatch .Params.image }} + {{ with $image }} + {{ $thumb := .Resize "1000x" }} + {{ printf `<img src="%s" alt="%s" class="img-responsive gallery-image">` $thumb.RelPermalink .Title | safeHTML }} + {{end}} +{{ end }} + +{{ .Content }} +{{ template "_internal/disqus.html" . }} +</div> +{{ end }}
\ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..7d458f0 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,7 @@ +<head> + {{ range .Site.Params.navlinks }} + {{ if .home }} + <meta http-equiv="refresh" content="0; URL={{ .url | absURL }}" /> + {{ end }} + {{ end }} +</head>
\ No newline at end of file diff --git a/layouts/opengraph.html b/layouts/opengraph.html new file mode 100644 index 0000000..23aa06a --- /dev/null +++ b/layouts/opengraph.html @@ -0,0 +1,49 @@ +<meta property="og:title" content="{{ .Title }}" /> +<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" /> +<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> +<meta property="og:url" content="{{ .Permalink }}" /> + +{{- with .Params.image }} +{{ $image := $.Resources.GetMatch . }} +{{ with $image }} + {{ $thumb := .Resize "400x" }} +<meta property="og:image" content="{{ $thumb.Permalink }}"> +{{ end }} +{{ end }} + +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{- if .IsPage }} +{{- if not .PublishDate.IsZero }}<meta property="article:published_time" {{ .PublishDate.Format $iso8601 | printf "content=%q" | safeHTMLAttr }} /> +{{ else if not .Date.IsZero }}<meta property="article:published_time" {{ .Date.Format $iso8601 | printf "content=%q" | safeHTMLAttr }} /> +{{ end }} +{{- end }}{{/* .IsPage */}} + +{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }} +{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }} +{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }} +{{- with .Params.videos }} +{{- range . }} +<meta property="og:video" content="{{ . | absURL }}" /> +{{ end }}{{ end }} + +{{- /* If it is part of a series, link to related articles */}} +{{- $permalink := .Permalink }} +{{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }} +{{- range $name := . }} + {{- $series := index $siteSeries $name }} + {{- range $page := first 6 $series.Pages }} + {{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }} + {{- end }} +{{ end }}{{ end }} + +{{- if .IsPage }} +{{- range .Site.Authors }}{{ with .Social.facebook }} +<meta property="article:author" content="https://www.facebook.com/{{ . }}" />{{ end }}{{ with .Site.Social.facebook }} +<meta property="article:publisher" content="https://www.facebook.com/{{ . }}" />{{ end }} +<meta property="article:section" content="{{ .Section }}" /> +{{- with .Params.tags }}{{ range first 6 . }} +<meta property="article:tag" content="{{ . }}" />{{ end }}{{ end }} +{{- end }}{{ end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} diff --git a/layouts/posts/single.html b/layouts/posts/single.html new file mode 100644 index 0000000..17a638b --- /dev/null +++ b/layouts/posts/single.html @@ -0,0 +1,14 @@ +{{ define "main" }} +<h1>{{ .Title }}</h1> + +{{ .PublishDate.Format "Jan. 2, 2006" }} +{{ with .Params.linkedin }} + // <a href="{{ . }}">Linkedin</a> +{{ end }} +{{ with .Params.twitter }} + // <a href="{{ . }}">Twitter</a> +{{ end }} +<br/><br/> +{{ .Content }} +{{ template "_internal/disqus.html" . }} +{{ end }}
\ No newline at end of file diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml new file mode 100644 index 0000000..489a75f --- /dev/null +++ b/layouts/sitemap.xml @@ -0,0 +1,16 @@ +{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" + xmlns:xhtml="http://www.w3.org/1999/xhtml"> + {{ range .Data.Pages }} + {{ if not .Params.private }} + <url> + <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }} + <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }} + <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + <xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"/>{{ end }} + <xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"/>{{ end }} + </url> + {{ end }} + {{ end }} +</urlset>
\ No newline at end of file |