From 6c4cbf8578d8a94964ca7327a7826c7c094f94fc Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Mon, 2 Feb 2026 18:57:20 +0300 Subject: Fix images --- themes/neonxp/layouts/home.html | 5 ----- themes/neonxp/layouts/pages/section.html | 23 +++++++++++++++++++++++ themes/neonxp/layouts/projects/section.html | 23 +++++++++++++++++++++++ themes/neonxp/layouts/shortcodes/img.html | 21 +++++++++++++++++++++ 4 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 themes/neonxp/layouts/pages/section.html create mode 100644 themes/neonxp/layouts/projects/section.html create mode 100644 themes/neonxp/layouts/shortcodes/img.html (limited to 'themes/neonxp/layouts') diff --git a/themes/neonxp/layouts/home.html b/themes/neonxp/layouts/home.html index 1f26b97..c643012 100644 --- a/themes/neonxp/layouts/home.html +++ b/themes/neonxp/layouts/home.html @@ -7,11 +7,6 @@ {{ range .Pages }}

{{ .LinkTitle }}

- {{if .Date }} - {{ $dateMachine := .Date | time.Format "2006-01-02 15:04:05-07:00" }} - {{ $dateHuman := .Date | time.Format ":date_long" }} - - {{end}}
{{ .Summary }}
diff --git a/themes/neonxp/layouts/pages/section.html b/themes/neonxp/layouts/pages/section.html new file mode 100644 index 0000000..cc60509 --- /dev/null +++ b/themes/neonxp/layouts/pages/section.html @@ -0,0 +1,23 @@ +{{ define "main" }} +
+

{{ .Title }}

+ {{ .Content }} +
+
+ + {{ range .Pages }} +
+

{{ .LinkTitle }}

+ {{if .Date }} + {{ $dateMachine := .Date | time.Format "2006-01-02 15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + + {{end}} +
+ {{ .Summary }} +
+ Читать дальше... +
+ {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/themes/neonxp/layouts/projects/section.html b/themes/neonxp/layouts/projects/section.html new file mode 100644 index 0000000..cc60509 --- /dev/null +++ b/themes/neonxp/layouts/projects/section.html @@ -0,0 +1,23 @@ +{{ define "main" }} +
+

{{ .Title }}

+ {{ .Content }} +
+
+ + {{ range .Pages }} +
+

{{ .LinkTitle }}

+ {{if .Date }} + {{ $dateMachine := .Date | time.Format "2006-01-02 15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + + {{end}} +
+ {{ .Summary }} +
+ Читать дальше... +
+ {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/themes/neonxp/layouts/shortcodes/img.html b/themes/neonxp/layouts/shortcodes/img.html new file mode 100644 index 0000000..994e30f --- /dev/null +++ b/themes/neonxp/layouts/shortcodes/img.html @@ -0,0 +1,21 @@ +{{- $alt := .Get "alt" -}} +{{- $res := .Page.Resources.Get (.Get "src") -}} + +{{- $ws := slice 480 800 -}} +{{- $srcset := slice -}} +{{- range $ws -}} +{{- if (le . $res.Width) -}} +{{- $w := printf "%dx" . -}} +{{- $url := ($res.Resize $w).RelPermalink | safeURL -}} +{{- $fmt := printf "%s %dw" $url . -}} +{{- $srcset = $srcset | append $fmt -}} +{{- end -}} +{{- end -}} + +{{- $set := delimit $srcset "," -}} + +
+ {{ $alt }} +
{{ $alt }}
+
\ No newline at end of file -- cgit v1.2.3