Refactor code & install prettier-plugin-go-template
This commit is contained in:
parent
785e09c45d
commit
83c6d7a5e6
37 changed files with 504 additions and 173 deletions
|
@ -3,9 +3,9 @@
|
|||
"printWidth": 100,
|
||||
"trailingComma": "all",
|
||||
"overrides": [{
|
||||
"files": ".html",
|
||||
"files": ["*.html"],
|
||||
"options": {
|
||||
"parser": "html"
|
||||
"parser": "go-template"
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
|
|
@ -1,19 +1,29 @@
|
|||
{{ define "main" }}
|
||||
<div class="post">
|
||||
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
<div class="post">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h1>
|
||||
<div class="post-content">
|
||||
<p>{{ "Hmm... Sorry, this page seems to be missing." | markdownify }}
|
||||
{{ if .Site.Taxonomies.tags }}
|
||||
{{ "Maybe these tags will help you find what you're looking for. :smile:" | markdownify | emojify }}</p>
|
||||
<p>
|
||||
{{ "Hmm... Sorry, this page seems to be missing." | markdownify }}
|
||||
</p>
|
||||
|
||||
{{ if .Site.Taxonomies.tags }}
|
||||
<p>
|
||||
{{ "Maybe these tags will help you find what you're looking for. :smile:" | markdownify | emojify }}
|
||||
</p>
|
||||
<h2>Tags</h2>
|
||||
<div class="terms">
|
||||
<ul class="terms__list">
|
||||
{{ range .Site.Taxonomies.tags }}
|
||||
<li class="terms__term"><a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a><span class="terms__term-count">{{ .Count }}</span></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<ul class="terms__list">
|
||||
{{ range .Site.Taxonomies.tags }}
|
||||
<li class="terms__term">
|
||||
<a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a
|
||||
><span class="terms__term-count">{{ .Count }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
<html lang="{{ $.Site.Language }}">
|
||||
<head>
|
||||
{{ block "title" . }}
|
||||
<title>{{ if .IsHome }}{{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}{{ else }}{{ .Title }} :: {{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}{{ end }}</title>
|
||||
<title>
|
||||
{{ if .IsHome }}{{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} —
|
||||
{{ . }}{{ end }}{{ else }}{{ .Title }} ::
|
||||
{{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}{{ end }}
|
||||
</title>
|
||||
{{ end }}
|
||||
{{ partial "head.html" . }}
|
||||
</head>
|
||||
|
@ -11,8 +15,7 @@
|
|||
{{ partial "header.html" . }}
|
||||
|
||||
<div class="content">
|
||||
{{ block "main" . }}
|
||||
{{ end }}
|
||||
{{ block "main" . }} {{ end }}
|
||||
</div>
|
||||
|
||||
{{ block "footer" . }}
|
||||
|
|
|
@ -28,7 +28,11 @@
|
|||
{{ partial "lastmod.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
|
||||
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,59 +1,70 @@
|
|||
{{ define "main" }}
|
||||
<div class="posts">
|
||||
{{ range .Pages }}
|
||||
<div class="post on-list">
|
||||
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
<div class="post-meta">
|
||||
{{ if .Date }}
|
||||
<span class="post-date">
|
||||
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
||||
<div class="post on-list">
|
||||
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
<div class="post-meta">
|
||||
{{ if .Date }}
|
||||
<span class="post-date">
|
||||
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
||||
</span>
|
||||
|
||||
{{ if $.Site.Params.LastModDisplay }}
|
||||
{{ partial "lastmod.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author"
|
||||
>— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span
|
||||
>{{ end }}
|
||||
|
||||
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="post-read-time"
|
||||
>— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
#<a href="{{ (urlize (printf "tags/%s" . )) | absURL }}/">{{ . }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
|
||||
{{ if $.Site.Params.LastModDisplay }}
|
||||
{{ partial "lastmod.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
#<a href="{{ (urlize (printf "tags/%s" . )) | absURL }}/">{{ . }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
<figure class="post-cover">
|
||||
{{ if .Params.UseRelativeCover }}
|
||||
{{ if .Params.Cover }}
|
||||
<figure class="post-cover">
|
||||
{{ if .Params.UseRelativeCover }}
|
||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
|
||||
{{ else }}
|
||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.CoverCaption }}
|
||||
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
{{ if .Params.CoverCaption }}
|
||||
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ with .Description }}
|
||||
{{ . | markdownify }}
|
||||
{{ else }}
|
||||
{{ if .Truncated }}
|
||||
{{ .Summary | markdownify }}
|
||||
<div class="post-content">
|
||||
{{ with .Description }}
|
||||
{{ . | markdownify }}
|
||||
{{ else }}
|
||||
{{ if .Truncated }}
|
||||
{{ .Summary | markdownify }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if not .Params.hideReadMore }}
|
||||
<div>
|
||||
<a class="read-more button" href="{{ .RelPermalink }}"
|
||||
>{{ $.Site.Params.ReadMore | default "Read more" }} →</a
|
||||
>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if not .Params.hideReadMore }}
|
||||
<div><a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore | default "Read more" }} →</a></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
|
|
|
@ -17,9 +17,16 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author"
|
||||
>— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span
|
||||
>{{ end }}
|
||||
|
||||
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>
|
||||
<span class="post-read-time"
|
||||
>— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
|
@ -56,7 +63,9 @@
|
|||
{{ if or .NextInSection .PrevInSection }}
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts | default "Read other posts" }}</span>
|
||||
<span class="pagination__title-h"
|
||||
>{{ $.Site.Params.ReadOtherPosts | default "Read other posts" }}</span
|
||||
>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
|
@ -81,12 +90,10 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ if not (eq .Params.Comments "false") }}
|
||||
{{ if or (eq .Type $.Site.Params.contentTypeName) (.Params.Comments) }}
|
||||
{{ partial "comments.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
{{ define "main" }}
|
||||
|
||||
<div class="terms">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<ul class="terms__list">
|
||||
{{ $type := .Type }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
{{ $name := .Name }}
|
||||
{{ $count := .Count }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||
<li class="terms__term">
|
||||
<a href="{{ .Permalink }}">#{{ .Name }} <span class="terms__term-count">{{ $count }}</span></a>
|
||||
</li>
|
||||
<div class="terms">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<ul class="terms__list">
|
||||
{{ $type := .Type }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
{{ $name := .Name }}
|
||||
{{ $count := .Count }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||
<li class="terms__term">
|
||||
<a href="{{ .Permalink }}"
|
||||
>#{{ .Name }} <span class="terms__term-count">{{ $count }}</span></a
|
||||
>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,47 +1,49 @@
|
|||
{{ define "main" }}
|
||||
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
||||
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
|
||||
|
||||
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
||||
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
|
||||
|
||||
<div class="archive">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ range .Site.RegularPages.GroupByPublishDate "2006" }}
|
||||
{{ if ne .Key "0001" }}
|
||||
<div class="archive__group-year">
|
||||
<h2 class="archive__group-year-header">{{ replace .Key "0001" "" }}</h2>
|
||||
{{ range .Pages.GroupByDate "January" }}
|
||||
<div class="archive__group-month">
|
||||
<h3 class="archive__group-month-header">{{ .Key }}</h3>
|
||||
<div class="archive__group-posts">
|
||||
{{ range where .Pages "Type" $contentTypeName }}
|
||||
{{ if eq .Kind "page" }}
|
||||
<div class="archive__post">
|
||||
<h3 class="archive__post-title"><a
|
||||
href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h3>
|
||||
<div class="archive__post-meta">
|
||||
<span class="archive__post-date">
|
||||
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
||||
</span>
|
||||
{{ with .Params.Author }}
|
||||
<span class="archive__post-author">—
|
||||
{{ $.Site.Params.WrittenBy | default "Written by" }}
|
||||
{{ . }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="archive__post-read-time">— {{ .ReadingTime }}
|
||||
{{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="archive">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ range .Site.RegularPages.GroupByPublishDate "2006" }}
|
||||
{{ if ne .Key "0001" }}
|
||||
<div class="archive__group-year">
|
||||
<h2 class="archive__group-year-header">{{ replace .Key "0001" "" }}</h2>
|
||||
{{ range .Pages.GroupByDate "January" }}
|
||||
<div class="archive__group-month">
|
||||
<h3 class="archive__group-month-header">{{ .Key }}</h3>
|
||||
<div class="archive__group-posts">
|
||||
{{ range where .Pages "Type" $contentTypeName }}
|
||||
{{ if eq .Kind "page" }}
|
||||
<div class="archive__post">
|
||||
<h3 class="archive__post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h3>
|
||||
<div class="archive__post-meta">
|
||||
<span class="archive__post-date">
|
||||
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
||||
</span>
|
||||
{{ with .Params.Author }}
|
||||
<span class="archive__post-author"
|
||||
>—
|
||||
{{ $.Site.Params.WrittenBy | default "Written by" }}
|
||||
{{ . }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="archive__post-read-time"
|
||||
>— {{ .ReadingTime }}
|
||||
{{ $.Site.Params.MinuteReadingTime | default "min read" }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '{{.}}', 'auto');
|
||||
ga('create', '{{ . }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
|
|
|
@ -4,5 +4,4 @@ Hugo directory and insert:
|
|||
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
|
||||
or whatever comment engine you want -> https://gohugo.io/content-management/comments/#readout
|
||||
-->
|
||||
or whatever comment engine you want -> https://gohugo.io/content-management/comments/#readout -->
|
||||
|
|
|
@ -2,13 +2,19 @@
|
|||
<div class="footer__inner">
|
||||
{{ if $.Site.Copyright }}
|
||||
<div class="copyright copyright--user">{{ $.Site.Copyright | safeHTML }}</div>
|
||||
{{else}}
|
||||
{{ else }}
|
||||
{{ partial "logo.html" . }}
|
||||
<div class="copyright">
|
||||
<span>© {{ now.Year }} Powered by <a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a></span>
|
||||
<span>Theme created by <a href="https://twitter.com/panr" target="_blank" rel="noopener">panr</a></span>
|
||||
<span
|
||||
>© {{ now.Year }} Powered by
|
||||
<a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a></span
|
||||
>
|
||||
<span
|
||||
>Theme created by
|
||||
<a href="https://twitter.com/panr" target="_blank" rel="noopener">panr</a></span
|
||||
>
|
||||
</div>
|
||||
{{end}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" class="greater-icon" viewBox="0 0 44 44">
|
||||
<path fill="none" d="M15 8l14.729 14.382L15 35.367"/>
|
||||
<path fill="none" d="M15 8l14.729 14.382L15 35.367" />
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 146 B |
|
@ -1,21 +1,39 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}"/>
|
||||
<meta name="keywords" content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}"/>
|
||||
<meta name="robots" content="noodp"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
name="description"
|
||||
content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}"
|
||||
/>
|
||||
<meta
|
||||
name="keywords"
|
||||
content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}"
|
||||
/>
|
||||
<meta name="robots" content="noodp" />
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
|
||||
<!-- head custom -->
|
||||
{{- partial "prepended_head.html" . }}
|
||||
|
||||
<!-- Theme CSS -->
|
||||
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
|
||||
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}" />
|
||||
<!-- Custom CSS to override theme properties (/static/style.css) -->
|
||||
<link rel="stylesheet" href="{{ "style.css" | absURL }}">
|
||||
<link rel="stylesheet" href="{{ "style.css" | absURL }}" />
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ "img/apple-touch-icon-144-precomposed.png" | absURL }}">
|
||||
<link rel="shortcut icon" href="{{ "img/favicon.png" | absURL }}">
|
||||
<link
|
||||
rel="apple-touch-icon-precomposed"
|
||||
sizes="144x144"
|
||||
href="{{ "img/apple-touch-icon-144-precomposed.png" | absURL }}"
|
||||
/>
|
||||
<link rel="shortcut icon" href="{{ "img/favicon.png" | absURL }}" />
|
||||
|
||||
<!-- Fonts -->
|
||||
<link href="{{ "assets/Inter-Italic.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/Inter-Regular.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/Inter-Medium.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/Inter-MediumItalic.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/Inter-Bold.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/Inter-BoldItalic.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
|
||||
<!-- Twitter Card -->
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
|
@ -25,7 +43,7 @@
|
|||
|
||||
<!-- RSS | JSON -->
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
<!-- head custom -->
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
{{ partial "menu.html" . }}
|
||||
<span class="menu-trigger">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
|
||||
</svg>
|
||||
</span>
|
||||
{{ end }}
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
{{ if gt .Lastmod (add (time .Date).Unix $hourInSec) }}
|
||||
{{ with .Lastmod }}
|
||||
<span class="post-moddate">
|
||||
({{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }})
|
||||
({{ $.Site.Params.LastModDisplay }}
|
||||
{{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }})
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
<a href="{{ if $.Site.Params.Logo.LogoHomeLink }}{{ $.Site.Params.Logo.LogoHomeLink }}{{else}}{{ $.Site.BaseURL }}{{ end }}" class="logo" style="text-decoration: none;">
|
||||
<a
|
||||
href="{{ if $.Site.Params.Logo.LogoHomeLink }}{{ $.Site.Params.Logo.LogoHomeLink }}{{ else }}{{ $.Site.BaseURL }}{{ end }}"
|
||||
class="logo"
|
||||
style="text-decoration: none;"
|
||||
>
|
||||
{{ if $.Site.Params.Logo.path }}
|
||||
<img src="{{ $.Site.Params.Logo.path }}" alt="{{ $.Site.Params.Logo.alt }}" />
|
||||
{{ else }}
|
||||
{{ else }}
|
||||
<span class="logo__mark">{{ partial "greater-icon.html" . }}</span>
|
||||
<span class="logo__text">{{ with $.Site.Params.Logo.logoText }}{{ . }}{{ else }}hello friend{{ end }}</span>
|
||||
<span class="logo__text"
|
||||
>{{ with $.Site.Params.Logo.logoText }}{{ . }}{{ else }}hello friend{{ end }}</span
|
||||
>
|
||||
<span class="logo__cursor"></span>
|
||||
{{ end }}
|
||||
</a>
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
<ul class="menu__sub-inner">
|
||||
<li class="menu__sub-inner-more-trigger">
|
||||
{{ $.Site.Params.MenuMore | default "Show more" }}
|
||||
<span class="menu__sub-inner-more-trigger-icon">{{ partial "greater-icon.html" . }}</span>
|
||||
<span class="menu__sub-inner-more-trigger-icon"
|
||||
>{{ partial "greater-icon.html" . }}</span
|
||||
>
|
||||
</li>
|
||||
|
||||
<ul class="menu__sub-inner-more hidden">
|
||||
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
|
@ -22,7 +23,7 @@
|
|||
</ul>
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ else }}
|
||||
{{ range $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
<svg class="theme-toggler" width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M22 41C32.4934 41 41 32.4934 41 22C41 11.5066 32.4934 3 22
|
||||
<svg
|
||||
class="theme-toggler"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 48 48"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M22 41C32.4934 41 41 32.4934 41 22C41 11.5066 32.4934 3 22
|
||||
3C11.5066 3 3 11.5066 3 22C3 32.4934 11.5066 41 22 41ZM7 22C7
|
||||
13.7157 13.7157 7 22 7V37C13.7157 37 7 30.2843 7 22Z"/>
|
||||
13.7157 13.7157 7 22 7V37C13.7157 37 7 30.2843 7 22Z"
|
||||
/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 317 B After Width: | Height: | Size: 337 B |
|
@ -1,25 +1,30 @@
|
|||
{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
|
||||
{{ $command := .Get 1 }}
|
||||
{{ $options := .Get 2 }}
|
||||
{{ $position := .Get 3}}
|
||||
{{ $position := .Get 3 }}
|
||||
|
||||
{{ if eq $command "Fit"}}
|
||||
{{ if eq $command "Fit" }}
|
||||
{{ .Scratch.Set "image" ($original.Fit $options) }}
|
||||
{{ else if eq $command "Resize"}}
|
||||
{{ else if eq $command "Resize" }}
|
||||
{{ .Scratch.Set "image" ($original.Resize $options) }}
|
||||
{{ else if eq $command "Fill"}}
|
||||
{{ else if eq $command "Fill" }}
|
||||
{{ .Scratch.Set "image" ($original.Fill $options) }}
|
||||
{{ else }}
|
||||
{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}}
|
||||
{{ else }}
|
||||
{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize." }}
|
||||
{{ end }}
|
||||
|
||||
{{ $image := .Scratch.Get "image" }}
|
||||
|
||||
<figure class="{{ with $position }}{{ . }}{{ else -}} left {{- end }}" >
|
||||
<img style="max-width: 100%; width: auto; height: auto; border-radius: 8px;" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
|
||||
{{ with .Inner }}
|
||||
<figure class="{{ with $position }}{{ . }}{{ else -}} left {{- end }}">
|
||||
<img
|
||||
style="max-width: 100%; width: auto; height: auto; border-radius: 8px;"
|
||||
src="{{ $image.RelPermalink }}"
|
||||
width="{{ $image.Width }}"
|
||||
height="{{ $image.Height }}"
|
||||
/>
|
||||
{{ with .Inner }}
|
||||
<figcaption>
|
||||
{{ . }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</figure>
|
||||
|
|
|
@ -44,7 +44,9 @@
|
|||
"postcss-preset-env": "^6.7.0",
|
||||
"postcss-reporter": "^6.0.1",
|
||||
"postcss-url": "^8.0.0",
|
||||
"prettier": "^2.1.1",
|
||||
"prettier-eslint-cli": "^5.0.0",
|
||||
"prettier-plugin-go-template": "^0.0.9",
|
||||
"ramda": "^0.27.1",
|
||||
"style-loader": "^1.2.1",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
|
|
|
@ -1 +1,122 @@
|
|||
!function(n){var o={};function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,n){n(1),e.exports=n(2)},function(e,t){function n(){return window.matchMedia(l).matches}function o(){c&&c.classList.toggle("hidden",!n()),i&&i.classList.toggle("hidden",n()),u&&u.classList.toggle("hidden",!n())}var r=document.querySelector(".container"),i=document.querySelector(".menu"),c=document.querySelector(".menu-trigger"),d=(document.querySelector(".menu__inner--desktop"),document.querySelector(".menu__sub-inner-more-trigger")),u=document.querySelector(".menu__sub-inner-more"),l=getComputedStyle(document.body).getPropertyValue("--phoneWidth");i&&i.addEventListener("click",function(e){return e.stopPropagation()}),u&&u.addEventListener("click",function(e){return e.stopPropagation()}),o(),document.body.addEventListener("click",function(){n()||!u||u.classList.contains("hidden")?n()&&!i.classList.contains("hidden")&&i.classList.add("hidden"):u.classList.add("hidden")}),window.addEventListener("resize",o),c&&c.addEventListener("click",function(e){e.stopPropagation(),i&&i.classList.toggle("hidden")}),d&&d.addEventListener("click",function(e){e.stopPropagation(),u&&u.classList.toggle("hidden"),u&&u.getBoundingClientRect().right>r.getBoundingClientRect().right&&(u.style.left="auto",u.style.right=0)})},function(e,t){var n=window.localStorage&&window.localStorage.getItem("theme"),o=document.querySelector(".theme-toggle"),r="dark"===n;null!==n&&document.body.classList.toggle("dark-theme",r),o.addEventListener("click",function(){document.body.classList.toggle("dark-theme"),window.localStorage&&window.localStorage.setItem("theme",document.body.classList.contains("dark-theme")?"dark":"light")})}]);
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./assets/js/menu.js":
|
||||
/*!***************************!*\
|
||||
!*** ./assets/js/menu.js ***!
|
||||
\***************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
eval("var container = document.querySelector(\".container\");\nvar menu = document.querySelector(\".menu\");\nvar mobileMenuTrigger = document.querySelector(\".menu-trigger\");\nvar desktopMenu = document.querySelector(\".menu__inner--desktop\");\nvar desktopMenuTrigger = document.querySelector(\".menu__sub-inner-more-trigger\");\nvar menuMore = document.querySelector(\".menu__sub-inner-more\");\nvar mobileQuery = getComputedStyle(document.body).getPropertyValue(\"--phoneWidth\");\n\nvar isMobile = function isMobile() {\n return window.matchMedia(mobileQuery).matches;\n};\n\nvar isMobileMenu = function isMobileMenu() {\n mobileMenuTrigger && mobileMenuTrigger.classList.toggle(\"hidden\", !isMobile());\n menu && menu.classList.toggle(\"hidden\", isMobile());\n menuMore && menuMore.classList.toggle(\"hidden\", !isMobile());\n}; // Common\n\n\nmenu && menu.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nmenuMore && menuMore.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nisMobileMenu();\ndocument.body.addEventListener(\"click\", function () {\n if (!isMobile() && menuMore && !menuMore.classList.contains(\"hidden\")) {\n menuMore.classList.add(\"hidden\");\n } else if (isMobile() && !menu.classList.contains(\"hidden\")) {\n menu.classList.add(\"hidden\");\n }\n});\nwindow.addEventListener(\"resize\", isMobileMenu); // Mobile menu\n\nmobileMenuTrigger && mobileMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menu && menu.classList.toggle(\"hidden\");\n}); // Desktop menu\n\ndesktopMenuTrigger && desktopMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menuMore && menuMore.classList.toggle(\"hidden\");\n\n if (menuMore && menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {\n menuMore.style.left = \"auto\";\n menuMore.style.right = 0;\n }\n});\n\n//# sourceURL=webpack:///./assets/js/menu.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./assets/js/theme.js":
|
||||
/*!****************************!*\
|
||||
!*** ./assets/js/theme.js ***!
|
||||
\****************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
eval("// Toggle theme\nvar getTheme = window.localStorage && window.localStorage.getItem(\"theme\");\nvar themeToggle = document.querySelector(\".theme-toggle\");\nvar isDark = getTheme === \"dark\";\n\nif (getTheme !== null) {\n document.body.classList.toggle(\"dark-theme\", isDark);\n}\n\nthemeToggle.addEventListener(\"click\", function () {\n document.body.classList.toggle(\"dark-theme\");\n window.localStorage && window.localStorage.setItem(\"theme\", document.body.classList.contains(\"dark-theme\") ? \"dark\" : \"light\");\n});\n\n//# sourceURL=webpack:///./assets/js/theme.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 0:
|
||||
/*!******************************************************!*\
|
||||
!*** multi ./assets/js/menu.js ./assets/js/theme.js ***!
|
||||
\******************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
eval("__webpack_require__(/*! /Users/radek/Documents/Git/Moje/hello-friend/themes/hello-friend/assets/js/menu.js */\"./assets/js/menu.js\");\nmodule.exports = __webpack_require__(/*! /Users/radek/Documents/Git/Moje/hello-friend/themes/hello-friend/assets/js/theme.js */\"./assets/js/theme.js\");\n\n\n//# sourceURL=webpack:///multi_./assets/js/menu.js_./assets/js/theme.js?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -45,6 +45,7 @@ module.exports = (env, { mode }) => ({
|
|||
loader: "url-loader",
|
||||
options: {
|
||||
limit: 8192,
|
||||
name: '[name].[ext]'
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -5683,11 +5683,21 @@ prettier-eslint@^9.0.0:
|
|||
typescript "^3.2.1"
|
||||
vue-eslint-parser "^2.0.2"
|
||||
|
||||
prettier-plugin-go-template@^0.0.9:
|
||||
version "0.0.9"
|
||||
resolved "https://registry.yarnpkg.com/prettier-plugin-go-template/-/prettier-plugin-go-template-0.0.9.tgz#6d500e821a42d22de03a5d5e29c497c8f514f039"
|
||||
integrity sha512-wjYU5Ofu7lrIOyXoidQCnZD8fj2yBv2GBHK3HWWhii5POkbPdpN+J3kByMx39SVbBQuPSC78WRNkma4jdencEw==
|
||||
|
||||
prettier@^1.7.0:
|
||||
version "1.19.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
|
||||
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
|
||||
|
||||
prettier@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6"
|
||||
integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==
|
||||
|
||||
pretty-error@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3"
|
||||
|
|
Loading…
Reference in a new issue