aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html17
-rw-r--r--layouts/_default/home.html29
-rw-r--r--layouts/_default/list.html29
-rw-r--r--layouts/_default/rss.xml47
-rw-r--r--layouts/_default/single.html49
-rw-r--r--layouts/partials/comments.html32
-rw-r--r--layouts/partials/footer.html12
-rw-r--r--layouts/partials/head.html9
-rw-r--r--layouts/partials/head/css.html36
-rw-r--r--layouts/partials/head/js.html12
-rw-r--r--layouts/partials/header.html8
-rw-r--r--layouts/partials/hmenu.html51
-rw-r--r--layouts/partials/icon.html6
-rw-r--r--layouts/partials/list.html26
-rw-r--r--layouts/partials/menu.html53
-rw-r--r--layouts/partials/pagination.html98
-rw-r--r--layouts/partials/terms.html9
-rw-r--r--layouts/pico8/list.html50
-rw-r--r--layouts/pico8/single.html106
-rw-r--r--layouts/shortcodes/figure.html38
-rw-r--r--layouts/shortcodes/gist.html1
-rw-r--r--layouts/shortcodes/quote.html15
22 files changed, 733 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..e2e4362
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="{{ site.Language.LanguageCode }}" dir="{{ or site.Language.LanguageDirection `ltr` }}">
+<head>
+ {{ partial "head.html" . }}
+</head>
+<body>
+ <main class="container">
+ <header>
+ {{ partial "header.html" . }}
+ </header>
+ {{ block "main" . }}{{ end }}
+ <footer>
+ {{ partial "footer.html" . }}
+ </footer>
+ </main>
+</body>
+</html>
diff --git a/layouts/_default/home.html b/layouts/_default/home.html
new file mode 100644
index 0000000..99524d3
--- /dev/null
+++ b/layouts/_default/home.html
@@ -0,0 +1,29 @@
+{{ define "main" }}
+<div class="row">
+ <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last-xs last-sm first-md first-lg sidebar">
+ <article>
+ <header>Навигатор</header>
+ {{ partial "menu.html" (dict "menuID" "sections" "page" .) }}
+ </article>
+ </div>
+ <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8">
+ <article>
+ <header>
+ <div class="row between-xs">
+ <span class="p-name"> {{ .Title }} </span>
+ <a href="/posts/index.xml">{{ partial "icon.html" "rss" }}</a>
+ </div>
+ </header>
+ <div class="e-content">
+ {{ .Content }}
+ </div>
+ </article>
+ {{ $pages := where site.RegularPages "Type" "posts" }}
+ {{ $paginator := .Paginate $pages 7 }}
+ {{ range $paginator.Pages }}
+ {{ partial "list.html" . }}
+ {{ end }}
+ <nav>{{ partial "pagination.html" . }}</nav>
+ </div>
+</div>
+{{ end }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644
index 0000000..860fd5c
--- /dev/null
+++ b/layouts/_default/list.html
@@ -0,0 +1,29 @@
+{{ define "main" }}
+<div class="row">
+ <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last-xs last-sm first-md first-lg sidebar">
+ <article>
+ <header>Навигатор</header>
+ {{ partial "menu.html" (dict "menuID" "sections" "page" .) }}
+ </article>
+ </div>
+ <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8">
+ {{ if .Title }}
+ <article>
+ <header>
+ <div class="row between-xs">
+ <span class="p-name"> {{ .Title }} </span>
+ <a href="index.xml">{{ partial "icon.html" "rss" }}</a>
+ </div>
+ </header>
+ {{ .Content }}
+ </article>
+ {{ end }}
+ {{ $paginator := .Paginate .Pages 7 }}
+ {{ range $paginator.Pages }}
+ {{ partial "list.html" . }}
+ {{ end }}
+ <nav>{{ partial "pagination.html" . }}</nav>
+ </div>
+</div>
+
+{{ end }}
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
new file mode 100644
index 0000000..da8fb0c
--- /dev/null
+++ b/layouts/_default/rss.xml
@@ -0,0 +1,47 @@
+{{- $pctx := . -}}
+{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
+{{- $pages := slice -}}
+{{- if or $.IsHome $.IsSection -}}
+{{- $pages = $pctx.RegularPages -}}
+{{- else -}}
+{{- $pages = $pctx.Pages -}}
+{{- end -}}
+{{- $pages := where $pages "Params.hidden" "!=" true -}}
+{{- $limit := .Site.Config.Services.RSS.Limit -}}
+{{- if ge $limit 1 -}}
+{{- $pages = $pages | first $limit -}}
+{{- end -}}
+{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
+{{- printf "<?xml-stylesheet href=\"/rss.xsl\" type=\"text/xsl\"?>" | safeHTML }}
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
+ <link>{{ .Permalink }}</link>
+ <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
+ <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
+ <language>{{.}}</language>{{end}}{{ with .Site.Params.Author.email }}
+ <managingEditor>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.Author.email }}
+ <webMaster>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
+ <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
+ <lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
+ {{- with .OutputFormats.Get "RSS" -}}
+ {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
+ {{- end -}}
+ {{ range $pages }}
+ {{- $content := safeHTML (.Summary | html) -}}
+ {{- if .Params.Description -}}
+ {{- $content = safeHTML ( .Params.Description | html) -}}
+ {{- end -}}
+ <item>
+ <title>{{ .Title }}</title>
+ <link>{{ .Permalink }}</link>
+ <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
+ {{ with .Site.Params.Author.email }}<author>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</author>{{end}}
+ <guid>{{ .Permalink }}</guid>
+ <description>
+ {{ $content }}
+ </description>
+ </item>
+ {{ end }}
+ </channel>
+</rss>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..2bc6870
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,49 @@
+{{ define "main" }}
+<div class="row">
+ <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last-xs last-sm first-md first-lg sidebar">
+ {{ if .Params.toc }}
+ <article>
+ <header>Содержание</header>
+ <aside>{{ .TableOfContents }}</aside>
+ </article>
+ {{ end }}
+ <article>
+ <header>Навигатор</header>
+ {{ partial "menu.html" (dict "menuID" "sections" "page" .) }}
+ </article>
+ </div>
+ <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8">
+ <article>
+ <header>
+ <div class="row between-xs">
+ <span class="p-name"> {{ .Title }} </span>
+ {{ if .Date }}
+ {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
+ {{ $dateHuman := .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") }}
+ <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
+ {{ end }}
+ </div>
+ </header>
+ {{ if .Params.Image }}
+ <img src="{{.Params.Image}}" />
+ {{ end }}
+ <div class="p-summary">{{ .Summary }}</div>
+ <div class="e-content">{{ .Content }}</div>
+ <footer>
+ <div class="row between-xs">
+ <span>
+ {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
+ </span>
+
+ <a class="u-url" href="{{ .Permalink }}">#</a>
+
+ {{ if .Params.Location }}
+ <span class="p-location">@ {{.Params.Location}}</span>
+ {{ end }}
+ </div>
+ </footer>
+ </article>
+ {{ if .Params.comments }} {{ partial "comments.html" . }} {{ end }}
+ </div>
+</div>
+{{ end }}
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
new file mode 100644
index 0000000..77b4410
--- /dev/null
+++ b/layouts/partials/comments.html
@@ -0,0 +1,32 @@
+{{- with .Site.Params.comments -}}
+<article class="comments">
+ <header>Комментарии</header>
+ <div id="remark42"></div>
+</article>
+<script>
+ var remark_config = {
+ host: '{{ .host }}',
+ site_id: '{{ .site }}',
+ components: ['embed'],
+ url: '{{ $.Permalink }}',
+ max_shown_comments: {{ default 15 .max_shown_comments }},
+ theme: (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light',
+ page_title: '{{ $.Title }}',
+ locale: '{{ default "en" .locale }}',
+ show_email_subscription: {{ default true .show_email_subscription }}
+ };
+
+ !function(e, n) {
+ for (var o = 0; o < e.length; o++) {
+ var r = n.createElement('script'),
+ c = '.js',
+ d = n.head || n.body;
+ 'noModule' in r ? (r.type = 'module', c = '.mjs') : r.async = !0, r.defer = !0, r.src = remark_config.host + '/web/' + e[o] + c, d.appendChild(r)
+ }
+ }(remark_config.components || ['embed'], document);
+
+ window.addEventListener('onColorSchemeChange', (e) => {
+ window.REMARK42.changeTheme(e.detail);
+ })
+</script>
+{{- end -}} \ No newline at end of file
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 0000000..f520850
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -0,0 +1,12 @@
+<nav>
+ <ul>
+ <li>
+ <cite>2007—{{ now.Year }} Александр NeonXP Кирюхин. г.Казань</cite>
+ </li>
+ </ul>
+ <ul>
+ <li><a href="https://git.neonxp.ru/neonxp/blog">Исходный код</a></li>
+ <li><a href="mailto:i@neonxp.ru" rel="me">Электропочта</a></li>
+ <li><a href="https://neonxp.ru/posts/index.xml">РСС</a></li>
+ </ul>
+</nav>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..6731ae0
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,9 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width">
+<link rel="icon" type="image/png" href="/favicon.png">
+<link rel="authorization_endpoint" href="https://indieauth.com/auth">
+<link rel="token_endpoint" href="https://tokens.indieauth.com/token">
+<link rel="micropub" href="https://neonxp.ru/micropub">
+<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
+{{ partialCached "head/css.html" . }}
+{{ partialCached "head/js.html" . }}
diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html
new file mode 100644
index 0000000..c0dc59e
--- /dev/null
+++ b/layouts/partials/head/css.html
@@ -0,0 +1,36 @@
+{{- with resources.Get "css/pico.min.css" }}
+ {{- if eq hugo.Environment "development" }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+ {{- else }}
+ {{- with . | minify | fingerprint }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
+ {{- end }}
+ {{- end }}
+{{- end }}
+{{- with resources.Get "css/flexboxgrid.min.css" }}
+ {{- if eq hugo.Environment "development" }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+ {{- else }}
+ {{- with . | minify | fingerprint }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
+ {{- end }}
+ {{- end }}
+{{- end }}
+{{- with resources.Get "css/syntax.css" }}
+ {{- if eq hugo.Environment "development" }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+ {{- else }}
+ {{- with . | minify | fingerprint }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
+ {{- end }}
+ {{- end }}
+{{- end }}
+{{- with resources.Get "css/main.css" }}
+ {{- if eq hugo.Environment "development" }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+ {{- else }}
+ {{- with . | minify | fingerprint }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
+ {{- end }}
+ {{- end }}
+{{- end }} \ No newline at end of file
diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html
new file mode 100644
index 0000000..18fe842
--- /dev/null
+++ b/layouts/partials/head/js.html
@@ -0,0 +1,12 @@
+{{- with resources.Get "js/main.js" }}
+ {{- if eq hugo.Environment "development" }}
+ {{- with . | js.Build }}
+ <script src="{{ .RelPermalink }}"></script>
+ {{- end }}
+ {{- else }}
+ {{- $opts := dict "minify" true }}
+ {{- with . | js.Build $opts | fingerprint }}
+ <script src="{{ .RelPermalink }}" integrity="{{- .Data.Integrity }}" crossorigin="anonymous"></script>
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
new file mode 100644
index 0000000..c9b4934
--- /dev/null
+++ b/layouts/partials/header.html
@@ -0,0 +1,8 @@
+<nav>
+ <ul>
+ <li>
+ <a href="/"><img class="logo" src="{{ .Site.Params.Logo }}" /><strong>{{ .Site.Title }}</strong></a>
+ </li>
+ </ul>
+ {{ partial "hmenu.html" (dict "menuID" "main" "page" .) }}
+</nav>
diff --git a/layouts/partials/hmenu.html b/layouts/partials/hmenu.html
new file mode 100644
index 0000000..7183180
--- /dev/null
+++ b/layouts/partials/hmenu.html
@@ -0,0 +1,51 @@
+{{- /*
+Renders a menu for the given menu ID.
+
+@context {page} page The current page.
+@context {string} menuID The menu ID.
+
+@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
+*/}}
+
+{{- $page := .page }}
+{{- $menuID := .menuID }}
+
+{{- with index site.Menus $menuID }}
+ <nav>
+ <ul>
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ul>
+ </nav>
+{{- end }}
+
+{{- define "partials/inline/menu/walk.html" }}
+ {{- $page := .page }}
+ {{- range .menuEntries }}
+ {{- $attrs := dict "href" .URL }}
+ {{- if $page.IsMenuCurrent .Menu . }}
+ {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
+ {{- else if $page.HasMenuCurrent .Menu .}}
+ {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
+ {{- end }}
+ {{- $name := .Name }}
+ {{- with .Identifier }}
+ {{- with T . }}
+ {{- $name = . }}
+ {{- end }}
+ {{- end }}
+ <li>
+ <a
+ {{- range $k, $v := $attrs }}
+ {{- with $v }}
+ {{- printf " %s=%q" $k $v | safeHTMLAttr }}
+ {{- end }}
+ {{- end -}}
+ >{{ $name }}</a>
+ {{- with .Children }}
+ <ul>
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ul>
+ {{- end }}
+ </li>
+ {{- end }}
+{{- end }}
diff --git a/layouts/partials/icon.html b/layouts/partials/icon.html
new file mode 100644
index 0000000..72162e8
--- /dev/null
+++ b/layouts/partials/icon.html
@@ -0,0 +1,6 @@
+{{- $iconFile := resources.GetMatch (printf "icons/%s.svg" .) -}}
+{{- if $iconFile -}}
+ {{- $iconFile.Content | safeHTML -}}
+{{- else -}}
+ {{- errorf "Error: icon '%s.svg' is not found under 'assets/icons' folder" . -}}
+{{- end -}} \ No newline at end of file
diff --git a/layouts/partials/list.html b/layouts/partials/list.html
new file mode 100644
index 0000000..329d47b
--- /dev/null
+++ b/layouts/partials/list.html
@@ -0,0 +1,26 @@
+<article>
+ <header>
+ <div class="row between-sm">
+ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
+ {{ if .Date }}
+ <span>
+ {{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}}
+ </span>
+ {{ end }}
+ </div>
+ </header>
+ {{ if .Params.Image }}
+ <img src="{{ .RelPermalink }}{{.Params.Image}}" />
+ {{ end }}
+ {{ if .Description }}
+ {{ .Description }}
+ {{ else }}
+ {{ .Summary }}
+ {{ if .Truncated }}
+ <a href="{{ .RelPermalink }}">Далее...</a>
+ {{ end }}
+ {{ end }}
+ <footer>
+ {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
+ </footer>
+</article> \ No newline at end of file
diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html
new file mode 100644
index 0000000..c860b4c
--- /dev/null
+++ b/layouts/partials/menu.html
@@ -0,0 +1,53 @@
+{{- /*
+Renders a menu for the given menu ID.
+
+@context {page} page The current page.
+@context {string} menuID The menu ID.
+
+@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
+*/}}
+
+{{- $page := .page }}
+{{- $menuID := .menuID }}
+
+{{- with index site.Menus $menuID }}
+ <aside>
+ <nav>
+ <ol>
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ol>
+ </nav>
+ </aside>
+{{- end }}
+
+{{- define "partials/inline/menu/walk.html" }}
+ {{- $page := .page }}
+ {{- range .menuEntries }}
+ {{- $attrs := dict "href" .URL }}
+ {{- if $page.IsMenuCurrent .Menu . }}
+ {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
+ {{- else if $page.HasMenuCurrent .Menu .}}
+ {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
+ {{- end }}
+ {{- $name := .Name }}
+ {{- with .Identifier }}
+ {{- with T . }}
+ {{- $name = . }}
+ {{- end }}
+ {{- end }}
+ <li>
+ <a
+ {{- range $k, $v := $attrs }}
+ {{- with $v }}
+ {{- printf " %s=%q" $k $v | safeHTMLAttr }}
+ {{- end }}
+ {{- end -}}
+ >{{ $name }}</a>
+ {{- with .Children }}
+ <ol>
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ol>
+ {{- end }}
+ </li>
+ {{- end }}
+{{- end }}
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
new file mode 100644
index 0000000..ee7a171
--- /dev/null
+++ b/layouts/partials/pagination.html
@@ -0,0 +1,98 @@
+{{- $validFormats := slice "default" "terse" }}
+
+{{- $msg1 := "When passing a map to the internal pagination template, one of the elements must be named 'page', and it must be set to the context of the current page." }}
+{{- $msg2 := "The 'format' specified in the map passed to the internal pagination template is invalid. Valid choices are: %s." }}
+
+{{- $page := . }}
+{{- $format := "default" }}
+
+{{- if reflect.IsMap . }}
+ {{- with .page }}
+ {{- $page = . }}
+ {{- else }}
+ {{- errorf $msg1 }}
+ {{- end }}
+ {{- with .format }}
+ {{- $format = lower . }}
+ {{- end }}
+{{- end }}
+
+{{- if in $validFormats $format }}
+ {{- if gt $page.Paginator.TotalPages 1 }}
+ <ul class="pagination pagination-{{ $format }}">
+ {{- partial (printf "partials/inline/pagination/%s" $format) $page }}
+ </ul>
+ {{- end }}
+{{- else }}
+ {{- errorf $msg2 (delimit $validFormats ", ") }}
+{{- end -}}
+
+{{/* --------------------------------------------------------------------- */}}
+{{- define "partials/inline/pagination/default" }}
+ {{- with .Paginator }}
+ {{- $currentPageNumber := .PageNumber }}
+
+ {{- with .First }}
+ {{- if ne $currentPageNumber .PageNumber }}
+ <li class="page-item">
+ <a href="{{ .URL }}" aria-label="First" class="page-link"><span aria-hidden="true">&lAarr;</span></a>
+ </li>
+ {{- else }}
+ <li class="page-item disabled">
+ <a aria-disabled="true" aria-label="First" class="page-link" tabindex="-1"><span aria-hidden="true">&lAarr;</span></a>
+ </li>
+ {{- end }}
+ {{- end }}
+
+ {{- with .Prev }}
+ <li class="page-item">
+ <a href="{{ .URL }}" aria-label="Previous" class="page-link"><span aria-hidden="true">&larr;</span></a>
+ </li>
+ {{- else }}
+ <li class="page-item disabled">
+ <a aria-disabled="true" aria-label="Previous" class="page-link" tabindex="-1"><span aria-hidden="true">&larr;</span></a>
+ </li>
+ {{- end }}
+
+ {{- $slots := 5 }}
+ {{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }}
+ {{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }}
+ {{- if lt (add (sub $end $start) 1) $slots }}
+ {{- $start = math.Max 1 (add (sub $end $slots) 1) }}
+ {{- end }}
+
+ {{- range $k := seq $start $end }}
+ {{- if eq $.Paginator.PageNumber $k }}
+ <li class="page-item active">
+ [{{ $k }}]
+ </li>
+ {{- else }}
+ <li class="page-item">
+ <a href="{{ (index $.Paginator.Pagers (sub $k 1)).URL }}" aria-label="Page {{ $k }}" class="page-link">{{ $k }}</a>
+ </li>
+ {{- end }}
+ {{- end }}
+
+ {{- with .Next }}
+ <li class="page-item">
+ <a href="{{ .URL }}" aria-label="Next" class="page-link"><span aria-hidden="true">&rarr;</span></a>
+ </li>
+ {{- else }}
+ <li class="page-item disabled">
+ <a aria-disabled="true" aria-label="Next" class="page-link" tabindex="-1"><span aria-hidden="true">&rarr;</span></a>
+ </li>
+ {{- end }}
+
+ {{- with .Last }}
+ {{- if ne $currentPageNumber .PageNumber }}
+ <li class="page-item">
+ <a href="{{ .URL }}" aria-label="Last" class="page-link"><span aria-hidden="true">&rAarr;</span></a>
+ </li>
+ {{- else }}
+ <li class="page-item disabled">
+ <a aria-disabled="true" aria-label="Last" class="page-link" tabindex="-1"><span aria-hidden="true">&rAarr;</span></a>
+ </li>
+ {{- end }}
+ {{- end }}
+ {{- end }}
+{{- end -}} \ No newline at end of file
diff --git a/layouts/partials/terms.html b/layouts/partials/terms.html
new file mode 100644
index 0000000..9802a11
--- /dev/null
+++ b/layouts/partials/terms.html
@@ -0,0 +1,9 @@
+{{- $page := .page }}
+{{- $taxonomy := .taxonomy }}
+
+{{- with $page.GetTerms $taxonomy }}
+ {{- $label := (index . 0).Parent.LinkTitle }}
+ {{- range . }}
+ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>&nbsp;
+ {{- end }}
+{{- end }}
diff --git a/layouts/pico8/list.html b/layouts/pico8/list.html
new file mode 100644
index 0000000..7158b4a
--- /dev/null
+++ b/layouts/pico8/list.html
@@ -0,0 +1,50 @@
+{{ define "main" }}
+<div class="row">
+ <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last-xs last-sm first-md first-lg sidebar">
+ <article>
+ <header>Навигатор</header>
+ {{ partial "menu.html" (dict "menuID" "sections" "page" .) }}
+ </article>
+ </div>
+ <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8">
+ {{ if .Title }}
+ <article>
+ <header>
+ <div class="row between-xs">
+ <span class="p-name"> {{ .Title }} </span>
+ </div>
+ </header>
+ {{ .Content }}
+ </article>
+ {{ end }}
+ {{ $paginator := .Paginate .Pages 7 }}
+ {{ range $paginator.Pages }}
+ <article>
+ <header>
+ <div class="row between-sm">
+ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
+ {{ if .Date }}
+ <span>
+ {{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}}
+ </span>
+ {{ end }}
+ </div>
+ </header>
+ {{ if .Description }}
+ {{ .Description }}
+ {{ else }}
+ {{ .Summary }}
+ {{ end }}
+ <a href="{{ .RelPermalink }}">
+ <img src="{{ .Params.Game }}" />
+ </a>
+ <footer>
+ <a href="{{ .Params.Game }}">Скачать</a>
+ </footer>
+ </article>
+ {{ end }}
+ <nav>{{ partial "pagination.html" . }}</nav>
+ </div>
+</div>
+
+{{ end }}
diff --git a/layouts/pico8/single.html b/layouts/pico8/single.html
new file mode 100644
index 0000000..8d63215
--- /dev/null
+++ b/layouts/pico8/single.html
@@ -0,0 +1,106 @@
+{{ define "main" }}
+<div class="row">
+ <div
+ class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last-xs last-sm first-md first-lg sidebar"
+ >
+ {{ if .Params.toc }}
+ <article>
+ <header>Содержание</header>
+ <aside>{{ .TableOfContents }}</aside>
+ </article>
+ {{ end }}
+ <article>
+ <header>Навигатор</header>
+ {{ partial "menu.html" (dict "menuID" "sections" "page" .) }}
+ </article>
+ </div>
+ <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8">
+ <article>
+ <header>
+ <div class="row between-xs">
+ <span class="p-name"> {{ .Title }} </span>
+ </div>
+ </header>
+ <div id="pico-container">
+ <!-- <div class="buttons">
+ <button
+ id="pico-up"
+ style="grid-area: up"
+ onclick="PicoPress(3, 0)"
+ >
+ &uArr;
+ </button>
+ <button
+ id="pico-down"
+ style="grid-area: down"
+ onclick="PicoPress(3, 0)"
+ >
+ &dArr;
+ </button>
+ <button
+ id="pico-left"
+ style="grid-area: left"
+ onclick="PicoPress(3, 0)"
+ >
+ &lArr;
+ </button>
+ <button
+ id="pico-right"
+ style="grid-area: right"
+ onclick="PicoPress(3, 0)"
+ >
+ &rArr;
+ </button>
+ <button
+ id="pico-a"
+ style="grid-area: a"
+ onclick="PicoPress(3, 0)"
+ >
+ A
+ </button>
+ <button
+ id="pico-b"
+ style="grid-area: b"
+ onclick="PicoPress(3, 0)"
+ >
+ B
+ </button>
+ <div class="square_hack"></div>
+ </div> -->
+ </div>
+ <h2>Управление</h2>
+ <h3>Игрок 1</h3>
+ <img src="/img/p8_lf.png" />&larr;&nbsp;
+ <img src="/img/p8_rt.png" />&rarr;&nbsp;
+ <img src="/img/p8_up.png" />&uarr;&nbsp;
+ <img src="/img/p8_dw.png" />&darr;&nbsp;
+ <img src="/img/p8_x.png" />Z C&nbsp;
+ <img src="/img/p8_o.png" />X V&nbsp;
+ <h3>Игрок 2</h3>
+ <img src="/img/p8_lf.png" /> S&nbsp;
+ <img src="/img/p8_rt.png" /> F&nbsp;
+ <img src="/img/p8_up.png" /> E&nbsp;
+ <img src="/img/p8_dw.png" /> D&nbsp;
+ <img src="/img/p8_x.png" />Q W&nbsp;
+ <img src="/img/p8_o.png" />TAB&nbsp;
+ <h3>Пауза</h3>
+ P/Enter
+ <footer>
+ <div class="row between-xs">
+ <a href="{{ .Params.Game }}">Скачать</a>
+ </div>
+ </footer>
+ </article>
+ {{ if .Params.comments }} {{ partial "comments.html" . }} {{ end }}
+ </div>
+</div>
+
+<script src="/js/picoplayer.js"></script>
+<script src="/js/pico8.js"></script>
+
+<script>
+ document.addEventListener("DOMContentLoaded", function (event) {
+ PicoPlayer("pico-container", "{{.Params.Game}}");
+ });
+</script>
+{{ end }} \ No newline at end of file
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html
new file mode 100644
index 0000000..a4bae51
--- /dev/null
+++ b/layouts/shortcodes/figure.html
@@ -0,0 +1,38 @@
+<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
+ {{- if .Get "link" -}}
+ <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
+ {{- end -}}
+
+ {{- $u := urls.Parse (.Get "src") -}}
+ {{- $src := $u.String -}}
+ {{- if not $u.IsAbs -}}
+ {{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}}
+ {{- $src = .RelPermalink -}}
+ {{- end -}}
+ {{- end -}}
+
+ <img src="{{ $src }}"
+ {{- if or (.Get "alt") (.Get "caption") }}
+ alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
+ {{- end -}}
+ {{- with .Get "width" }} width="{{ . }}"{{ end -}}
+ {{- with .Get "height" }} height="{{ . }}"{{ end -}}
+ {{- with .Get "loading" }} loading="{{ . }}"{{ end -}}
+ ><!-- Closing img tag -->
+ {{- if .Get "link" }}</a>{{ end -}}
+ {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
+ <figcaption>
+ {{ with (.Get "title") -}}
+ {{ . }}
+ {{- end -}}
+ {{- if or (.Get "caption") (.Get "attr") -}}<p>
+ {{- .Get "caption" | markdownify -}}
+ {{- with .Get "attrlink" }}
+ <a href="{{ . }}">
+ {{- end -}}
+ {{- .Get "attr" | markdownify -}}
+ {{- if .Get "attrlink" }}</a>{{ end }}</p>
+ {{- end }}
+ </figcaption>
+ {{- end }}
+</figure> \ No newline at end of file
diff --git a/layouts/shortcodes/gist.html b/layouts/shortcodes/gist.html
new file mode 100644
index 0000000..783fa1e
--- /dev/null
+++ b/layouts/shortcodes/gist.html
@@ -0,0 +1 @@
+<script src="https://gist.neonxp.ru/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script> \ No newline at end of file
diff --git a/layouts/shortcodes/quote.html b/layouts/shortcodes/quote.html
new file mode 100644
index 0000000..09bb07c
--- /dev/null
+++ b/layouts/shortcodes/quote.html
@@ -0,0 +1,15 @@
+<blockquote>
+ <p>{{ .Inner | markdownify }}</p>
+ {{- if or (.Get "author") (.Get "source") -}}
+ <span class="cite"><span>― </span>
+ {{- if .Get "author" -}}
+ <span>
+ {{- .Get "author" -}}{{- if .Get "source" -}}, {{ end -}}
+ </span>
+ {{- end -}}
+ {{- with .Get "url" -}}<a href="{{ . }}">{{- end -}}
+ <cite>{{ .Get "source" }}</cite>
+ {{- if .Get "url" -}}</a>{{- end -}}
+ </span>
+ {{- end -}}
+</blockquote> \ No newline at end of file