Verified Commit fd92fb82 authored by Maxim Lebedev's avatar Maxim Lebedev 🔀

💄 Format layouts and configs

parent 9f5b0fd3
Pipeline #134378481 passed with stage
in 30 seconds
......@@ -17,7 +17,7 @@ test:
pages:
stage: deploy
script: hugo -e production
script: hugo -e gitlab
artifacts:
paths:
- public
......
---
baseURL: https://tulpawiki.gitlab.io/
baseURL: https://tulpawiki.org/
canonifyURLs: true
defaultContentLanguage: ru
enableEmoji: true
......
---
defaultMarkdownHandler: goldmark
goldmark:
extensions:
......
---
baseURL: http://localhost:1313/
baseURL: http://127.0.0.1:1313/
disableLiveReload: false
watch: true
---
repository: https://github.com/tulpawiki/tulpawiki.github.io/
---
baseURL: https://tulpawiki.org/
......@@ -14,14 +14,14 @@
</hgroup>
<!-- <div class="frame">
<video autoplay loop muted playsinline>
<source src="{{ "/video/glitch.av1.mp4" | absURL }}" type="video/mp4; codecs=av1.0.05M.08" />
<source src="{{ "/video/glitch.h264.mp4" | absURL }}" type="video/mp4" />
<source src="{{ "/video/glitch.av1.mp4" | relURL }}" type="video/mp4; codecs=av1.0.05M.08" />
<source src="{{ "/video/glitch.h264.mp4" | relURL }}" type="video/mp4" />
</video>
</div> -->
<p>{{ i18n "404__description" }}</p>
<div class="cluster cluster_align_center cluster_justify_space-around">
<div>
<a href="{{ .Site.BaseURL | relURL }}" target="_self">{{ i18n "404__back-link" }}</a>
<a href="{{ "/" | relURL }}" target="_self">{{ i18n "404__back-link" }}</a>
<a href="{{ print .Site.Params.repository "-/new/master/" | relURL }}" target="_blank">{{ i18n "404__create-page" }}</a>
</div>
</div>
......
......@@ -2,7 +2,7 @@
<div class="cover cover_min-height_50vh">
<div class="cover__centered center center_text stack" style="min-width: 50%">
<span class="cover__centered frame frame_ratio_40:13">
{{ $config := imageConfig "static/images/logo.png" }}
{{- $config := imageConfig "static/images/logo.png" -}}
<img src="{{ "images/logo.png" | relURL }}" width="{{ $config.Width }}" height="{{ $config.Height }}" alt="{{ .Site.Title }}" loading="lazy">
</span>
{{- with .Site.Params.description }}<p>{{ . }}</p>{{ end -}}
......
......@@ -9,7 +9,7 @@
{{ range $index, $contact := .Params.contacts }}
<div class="box cluster cluster_justify_space-between cluster_align_center">
<div itemscope itemtype="http://schema.org/Person">
{{ $image := $.Page.Resources.GetMatch (print $contact.image) }}
{{- $image := $.Page.Resources.GetMatch (print $contact.image) -}}
{{- if $image }}
<img alt="{{ $contact.name }}" src="{{ $image.RelPermalink }}" width="64" height="64" loading="lazy" itemprop="image">
{{ end -}}
......
......@@ -17,12 +17,12 @@
</div>
<div class="grid js-grid" style="--minimum: 7.5rem">
{{ range $i, $number := $numbers }}
{{ $pages := slice }}
{{ range $.Pages.ByTitle }}
{{ if hasPrefix .Name $number }}
{{ $pages = $pages | append . }}
{{ end }}
{{ end }}
{{- $pages := slice -}}
{{- range $.Pages.ByTitle -}}
{{- if hasPrefix .Name $number -}}
{{- $pages = $pages | append . -}}
{{- end -}}
{{- end -}}
{{ if gt $pages 0 }}
<div class="stack">
<h2 id="_">0-9</h2>
......@@ -37,12 +37,12 @@
{{ end }}
{{ range $i, $letter := $letters }}
{{ $pages := slice }}
{{ range $.Pages.ByTitle }}
{{ if hasPrefix .Name $letter }}
{{ $pages = $pages | append . }}
{{ end }}
{{ end }}
{{- $pages := slice -}}
{{- range $.Pages.ByTitle -}}
{{- if hasPrefix .Name $letter -}}
{{- $pages = $pages | append . -}}
{{- end -}}
{{- end -}}
{{ if gt $pages 0 }}
<div class="stack">
<h2 id="{{ $letter | lower }}">{{ $letter | upper }}</h2>
......
......@@ -6,10 +6,16 @@
<h3>{{ i18n "menu_contribute" }}</h3>
<nav>
<ul>
<li><a href="{{ print .Site.Params.repository "-/issues/new" | absURL }}" title="{{ i18n "menu_contribute__bug" }}" target="_blank">{{ i18n "menu_contribute__bug" }}</a></li>
<li><a href="{{ print .Site.Params.repository "-/blob/master/content/" .Page.File.Path | absURL }}" title="{{ i18n "menu_contribute__source" }}" target="_blank">{{ i18n "menu_contribute__source" }}</a></li>
<li><a href="{{ print .Site.Params.repository "-/blame/master/content/" .Page.File.Path | absURL }}" title="{{ i18n "menu_contribute__blame" }}" target="_blank">{{ i18n "menu_contribute__blame" }}</a></li>
<li><a href="{{ print .Site.Params.repository "-/edit/master/content/" .Page.File.Path }}" title="{{ i18n "menu_contribute__edit" }}" target="_blank">{{ i18n "menu_contribute__edit" }}</a></li>
<li><a href="{{ print .Site.Params.repository "issues/new" | absURL }}" title="{{ i18n "menu_contribute__bug" }}" target="_blank">{{ i18n "menu_contribute__bug" }}</a></li>
{{- if .Page.File }}
<li><a href="{{ print .Site.Params.repository "blob/master/content/" .Page.File.Path | absURL }}" title="{{ i18n "menu_contribute__source" }}" target="_blank">{{ i18n "menu_contribute__source" }}</a></li>
{{ end -}}
{{- if .Page.File }}
<li><a href="{{ print .Site.Params.repository "blame/master/content/" .Page.File.Path | absURL }}" title="{{ i18n "menu_contribute__blame" }}" target="_blank">{{ i18n "menu_contribute__blame" }}</a></li>
{{ end -}}
{{- if .Page.File }}
<li><a href="{{ print .Site.Params.repository "edit/master/content/" .Page.File.Path }}" title="{{ i18n "menu_contribute__edit" }}" target="_blank">{{ i18n "menu_contribute__edit" }}</a></li>
{{ end -}}
<li>
{{- $helpPage := .Site.GetPage "/help" -}}
<a href="{{- $helpPage.RelPermalink -}}" title="{{- $helpPage.Description -}}">{{- $helpPage.Title -}}</a>
......@@ -62,11 +68,11 @@
</div>
{{ with .Site.Data.patrons }}
<section class="stack">
{{ $imagePath := "static/images/become_a_patron_button.png" }}
{{- $imagePath := "static/images/become_a_patron_button.png" -}}
{{ if (fileExists $imagePath) }}
<a href="//patreon.com/join/toby3d" target="_blank">
{{ $config := imageConfig $imagePath }}
<img class="max-width_fifth" alt="become a patron" src="{{ strings.TrimPrefix "static/" $imagePath | absURL }}" width="{{ $config.Width }}" height="{{ $config.Height }}" loading="lazy">
{{- $config := imageConfig $imagePath -}}
<img class="max-width_fifth" alt="become a patron" src="{{ strings.TrimPrefix "static/" $imagePath | relURL }}" width="{{ $config.Width }}" height="{{ $config.Height }}" loading="lazy">
</a>
{{ else }}
<h3>{{ i18n "menu_patrons" }}</h3>
......@@ -79,7 +85,7 @@
{{- $imagePath := (print "static/images/patrons/" .id ".png") -}}
{{- if (and .id (fileExists $imagePath)) }}
{{- $config := imageConfig $imagePath -}}
<img alt="{{- .name -}}" src="{{- strings.TrimPrefix "static/" $imagePath | absURL -}}" width="{{- $config.Width -}}" height="{{- $config.Height -}}" loading="lazy">
<img alt="{{- .name -}}" src="{{- strings.TrimPrefix "static/" $imagePath | relURL -}}" width="{{- $config.Width -}}" height="{{- $config.Height -}}" loading="lazy">
{{ else }}
<small>{{- delimit (split .name " ") "<br/>" -}}</small>
{{ end -}}
......@@ -96,7 +102,7 @@
<div class="cluster cluster_justify_space-between cluster_align_center">
<small>
<a href="https://creativecommons.org/licenses/by-sa/4.0/" rel="license" target="_blank">
&#127279; {{ now.Format "2006" }} {{ .Site.Title }}
{{ println "&#127279;" (now.Format "2006") .Site.Title | safeHTML }}
</a>
{{ partial "components/theme-switcher" . }}
</small>
......
......@@ -2,10 +2,10 @@
<base href="{{ .Page.Permalink | absURL }}">
<meta http-equiv="content-type" content="text/html">
<meta http-equiv="default-style" content="default">
{{ with .GitInfo }}<meta name="author" content="{{ .AuthorName }}">{{ end }}
{{ with .GitInfo -}}<meta name="author" content="{{ .AuthorName }}">{{- end }}
<meta name="application-name" content="{{ .Site.Title }}">
<meta name="description" content="{{ .Page.Description }}">
{{ with .Page.Params.tags }}<meta name="keywords" content="{{ delimit . "," }}">{{ end }}
{{ with .Page.Params.tags -}}<meta name="keywords" content="{{ delimit . "," }}">{{- end }}
<meta name="referrer" content="origin-when-crossorigin">
<meta name="theme-color" content="#00cfff">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
......
<meta property="og:type" content="article">
<meta property="og:title" content="{{ .Page.Title }}">
<meta property="og:url" content="{{ .Page.Permalink | absLangURL }}">
{{ with .Page.Description }}<meta property="og:description" content="{{ . }}">{{ end }}
<meta property="og:locale" content="{{ .Site.Params.locale }}">
{{ if .Page.IsTranslated }}{{ range .Page.Translations }}
<meta property="og:locale:alternate" content="{{ .Site.Params.locale }}">
{{ end }}{{ end }}
<meta property="og:site_name" content="{{ .Site.Title }}">
{{ with .Page.PublishDate }}<meta property="article:published_date" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }}
{{ with .Page.Lastmod }}<meta property="article:modified_date" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }}
{{ with .Page.ExpiryDate }}<meta property="article:expiration_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }}
{{ with .Page.Section }}<meta property="article:section" content="{{ . }}">{{ end }}
{{ range .Page.Params.tags }}<meta property="article:tag" content="{{ . }}">{{ end }}
{{/*
<meta property="og:audio" content="">
<meta property="og:audio:secure_url" content="">
<meta property="og:audio:type" content="">
<meta property="og:video" content="">
<meta property="og:video:height" content="">
<meta property="og:video:secure_url" content="">
<meta property="og:video:type" content="">
<meta property="og:video:width" content="">
<meta property="og:image" content="">
<meta property="og:image:alt" content="">
<meta property="og:image:height" content="">
<meta property="og:image:secure_url" content="">
<meta property="og:image:type" content="">
<meta property="og:image:width" content="">
*/}}
<meta property="og:locale" content="{{ .Site.Params.locale }}">
{{ if .Page.IsTranslated -}}{{ range .Page.Translations -}}<meta property="og:locale:alternate" content="{{ .Site.Params.locale }}">{{- end }}{{- end }}
{{ with .Page.Description -}}<meta property="og:description" content="{{ . }}">{{- end }}
{{ with .Page.PublishDate -}}<meta property="article:published_date" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{- end }}
{{ with .Page.Lastmod -}}<meta property="article:modified_date" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{- end }}
{{ with .Page.ExpiryDate -}}<meta property="article:expiration_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{- end }}
{{ with .Page.Section -}}<meta property="article:section" content="{{ . }}">{{- end }}
{{ range .Page.Params.tags -}}<meta property="article:tag" content="{{ . }}">{{- end }}
{{- /* <meta property="og:audio" content=""> */ -}}
{{- /* <meta property="og:audio:secure_url" content=""> */ -}}
{{- /* <meta property="og:audio:type" content=""> */ -}}
{{- /* <meta property="og:video" content=""> */ -}}
{{- /* <meta property="og:video:height" content=""> */ -}}
{{- /* <meta property="og:video:secure_url" content=""> */ -}}
{{- /* <meta property="og:video:type" content=""> */ -}}
{{- /* <meta property="og:video:width" content=""> */ -}}
{{- /* <meta property="og:image" content=""> */ -}}
{{- /* <meta property="og:image:alt" content=""> */ -}}
{{- /* <meta property="og:image:height" content=""> */ -}}
{{- /* <meta property="og:image:secure_url" content=""> */ -}}
{{- /* <meta property="og:image:type" content=""> */ -}}
{{- /* <meta property="og:image:width" content=""> */ -}}
<meta name="telegram:title" content="{{ .Page.Title }}">
{{/* <meta name="telegram:subtitle" content=""> */}}
{{ with .Page.Section }}<meta name="telegram:kicker" content="{{ . }}">{{ end }}
{{ with .Page.PublishDate }}<meta name="telegram:published_date" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }}
{{ with .Page.Description }}<meta name="telegram:description" content="{{ . }}">{{ end }}
{{/* <meta name="telegram:image_url" content=""> */}}
{{/* <meta name="telegram:document_url" content=""> */}}
{{ with .Site.Title }}<meta name="telegram:site_name" content="{{ . }}">{{ end }}
{{- /* <meta name="telegram:subtitle" content=""> */ -}}
{{- with .Page.Section }}<meta name="telegram:kicker" content="{{ . }}">{{ end -}}
{{- with .Page.PublishDate }}<meta name="telegram:published_date" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end -}}
{{- with .Page.Description }}<meta name="telegram:description" content="{{ . }}">{{ end -}}
{{- /* <meta name="telegram:image_url" content=""> */ -}}
{{- /* <meta name="telegram:document_url" content=""> */ -}}
{{- with .Site.Title }}<meta name="telegram:site_name" content="{{ . }}">{{ end -}}
<meta property="twitter:card" content="summary_large_image">
{{ with .Page.Description }}<meta property="twitter:description" content="{{ . }}">{{ end }}
{{ with .Page.Description -}}<meta property="twitter:description" content="{{ . }}">{{- end }}
<meta name="twitter:title" content="{{ .Page.Title }}">
{{/* <meta name="twitter:image" content=""> */}}
{{/* <meta name="twitter:image:alt" content=""> */}}
{{/* <meta name="twitter:player" content=""> */}}
{{/* <meta name="twitter:player:width" content=""> */}}
{{/* <meta name="twitter:player:height" content=""> */}}
{{/* <meta name="twitter:player:stream" content=""> */}}
{{/* <meta name="twitter:app:name:iphone" content=""> */}}
{{/* <meta name="twitter:app:id:iphone" content=""> */}}
{{/* <meta name="twitter:app:url:iphone" content=""> */}}
{{/* <meta name="twitter:app:name:ipad" content=""> */}}
{{/* <meta name="twitter:app:id:ipad" content=""> */}}
{{/* <meta name="twitter:app:url:ipad" content=""> */}}
{{/* <meta name="twitter:app:name:googleplay" content=""> */}}
{{/* <meta name="twitter:app:id:googleplay" content=""> */}}
{{/* <meta name="twitter:app:url:googleplay" content=""> */}}
{{- /* <meta name="twitter:image" content=""> */ -}}
{{- /* <meta name="twitter:image:alt" content=""> */ -}}
{{- /* <meta name="twitter:player" content=""> */ -}}
{{- /* <meta name="twitter:player:width" content=""> */ -}}
{{- /* <meta name="twitter:player:height" content=""> */ -}}
{{- /* <meta name="twitter:player:stream" content=""> */ -}}
{{- /* <meta name="twitter:app:name:iphone" content=""> */ -}}
{{- /* <meta name="twitter:app:id:iphone" content=""> */ -}}
{{- /* <meta name="twitter:app:url:iphone" content=""> */ -}}
{{- /* <meta name="twitter:app:name:ipad" content=""> */ -}}
{{- /* <meta name="twitter:app:id:ipad" content=""> */ -}}
{{- /* <meta name="twitter:app:url:ipad" content=""> */ -}}
{{- /* <meta name="twitter:app:name:googleplay" content=""> */ -}}
{{- /* <meta name="twitter:app:id:googleplay" content=""> */ -}}
{{- /* <meta name="twitter:app:url:googleplay" content=""> */ -}}
{{- $themeSwitcher := resources.Get "js/theme-switcher.js" | minify -}}
{{- $grid := resources.Get "js/grid.js" | minify -}}
{{- $reel := resources.Get "js/reel.js" | minify -}}
{{- $liteYouTube := resources.Get "js/lite-yt-embed.js" | minify -}}
{{- $liteVimeo := resources.Get "js/lite-vimeo-embed.js" | minify -}}
{{- $themeSwitcher := resources.Get "js/theme-switcher.js" -}}
{{- $grid := resources.Get "js/grid.js" -}}
{{- $reel := resources.Get "js/reel.js" -}}
{{- $liteYouTube := resources.Get "js/lite-yt-embed.js" -}}
{{- $liteVimeo := resources.Get "js/lite-vimeo-embed.js" -}}
{{- $scripts := slice $themeSwitcher $grid $reel $liteVimeo $liteYouTube | resources.Concat "scripts.js" | resources.ExecuteAsTemplate (print "script." .Lang ".js" ) . | minify | fingerprint -}}
<script src="{{ $scripts.RelPermalink | relURL }}"></script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment