diff options
author | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-11-20 03:20:47 +0300 |
---|---|---|
committer | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-11-20 03:20:47 +0300 |
commit | 8b78390987476352a6459460e00d5c4cdc0717c2 (patch) | |
tree | 77fd218ddd7203b10b4e4969ed8ede2fb4753d24 /themes/neonxp/layouts | |
parent | 74b65dd83f7c66d1f67f961b1fee65400b1fc334 (diff) |
Обновил стиль
Diffstat (limited to 'themes/neonxp/layouts')
-rw-r--r-- | themes/neonxp/layouts/_default/home.html | 7 | ||||
-rw-r--r-- | themes/neonxp/layouts/_default/list.html | 7 | ||||
-rw-r--r-- | themes/neonxp/layouts/_default/single.html | 8 | ||||
-rw-r--r-- | themes/neonxp/layouts/partials/icon.html | 6 | ||||
-rw-r--r-- | themes/neonxp/layouts/partials/list.html | 16 | ||||
-rw-r--r-- | themes/neonxp/layouts/shortcodes/figure.html | 38 | ||||
-rw-r--r-- | themes/neonxp/layouts/shortcodes/gist.html | 1 | ||||
-rw-r--r-- | themes/neonxp/layouts/shortcodes/quote.html | 15 |
8 files changed, 86 insertions, 12 deletions
diff --git a/themes/neonxp/layouts/_default/home.html b/themes/neonxp/layouts/_default/home.html index 9d97e21..d1ec7bc 100644 --- a/themes/neonxp/layouts/_default/home.html +++ b/themes/neonxp/layouts/_default/home.html @@ -8,8 +8,11 @@ </div> <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8"> <article> - <header class="p-name"> - {{ .Title }} + <header> + <div class="row between-sm"> + <span class="p-name"> {{ .Title }} </span> + <a href="/posts/index.xml">{{ partial "icon.html" "rss" }}</a> + </div> </header> <div class="e-content"> {{ .Content }} diff --git a/themes/neonxp/layouts/_default/list.html b/themes/neonxp/layouts/_default/list.html index 6a399e7..208d565 100644 --- a/themes/neonxp/layouts/_default/list.html +++ b/themes/neonxp/layouts/_default/list.html @@ -9,7 +9,12 @@ <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8"> {{ if .Title }} <article> - <header>{{ .Title }}</header> + <header> + <div class="row between-sm"> + <span class="p-name"> {{ .Title }} </span> + <a href="index.xml">{{ partial "icon.html" "rss" }}</a> + </div> + </header> {{ .Content }} </article> {{ end }} diff --git a/themes/neonxp/layouts/_default/single.html b/themes/neonxp/layouts/_default/single.html index 1508d26..e959051 100644 --- a/themes/neonxp/layouts/_default/single.html +++ b/themes/neonxp/layouts/_default/single.html @@ -14,17 +14,20 @@ </div> <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8"> <article> - <header class="space-between"> + <header> + <div class="row between-sm"> <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> <div class="p-summary">{{ .Summary }}</div> <div class="e-content">{{ .Content }}</div> - <footer class="space-between"> + <footer> + <div class="row between-sm"> <span> {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} </span> @@ -34,6 +37,7 @@ {{ if .Params.Location }} <span class="p-location">@ {{.Params.Location}}</span> {{ end }} + </div> </footer> </article> {{ if .Params.comments }} {{ partial "comments.html" . }} {{ end }} diff --git a/themes/neonxp/layouts/partials/icon.html b/themes/neonxp/layouts/partials/icon.html new file mode 100644 index 0000000..72162e8 --- /dev/null +++ b/themes/neonxp/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/themes/neonxp/layouts/partials/list.html b/themes/neonxp/layouts/partials/list.html index 72d546c..3c5811e 100644 --- a/themes/neonxp/layouts/partials/list.html +++ b/themes/neonxp/layouts/partials/list.html @@ -1,11 +1,13 @@ <article> - <header class="space-between"> - <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> - {{ if .Date }} - <span> - {{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}} - </span> - {{ end }} + <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 }} diff --git a/themes/neonxp/layouts/shortcodes/figure.html b/themes/neonxp/layouts/shortcodes/figure.html new file mode 100644 index 0000000..a4bae51 --- /dev/null +++ b/themes/neonxp/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/themes/neonxp/layouts/shortcodes/gist.html b/themes/neonxp/layouts/shortcodes/gist.html new file mode 100644 index 0000000..783fa1e --- /dev/null +++ b/themes/neonxp/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/themes/neonxp/layouts/shortcodes/quote.html b/themes/neonxp/layouts/shortcodes/quote.html new file mode 100644 index 0000000..09bb07c --- /dev/null +++ b/themes/neonxp/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 |