diff options
Diffstat (limited to '')
| -rw-r--r-- | themes/neonxp/archetypes/default.md | 13 | ||||
| -rw-r--r-- | themes/neonxp/assets/css/main.css | 90 | ||||
| -rw-r--r-- | themes/neonxp/assets/css/paper.css | 4 | ||||
| -rw-r--r-- | themes/neonxp/layouts/home.html | 5 | ||||
| -rw-r--r-- | themes/neonxp/layouts/pages/section.html | 23 | ||||
| -rw-r--r-- | themes/neonxp/layouts/projects/section.html | 23 | ||||
| -rw-r--r-- | themes/neonxp/layouts/shortcodes/img.html | 21 |
7 files changed, 90 insertions, 89 deletions
diff --git a/themes/neonxp/archetypes/default.md b/themes/neonxp/archetypes/default.md index 25b6752..51ad09a 100644 --- a/themes/neonxp/archetypes/default.md +++ b/themes/neonxp/archetypes/default.md @@ -1,5 +1,8 @@ -+++ -date = '{{ .Date }}' -draft = true -title = '{{ replace .File.ContentBaseName "-" " " | title }}' -+++ +--- +title: +date: "{{ .Date }}" +tags: + - +categories: + - +--- diff --git a/themes/neonxp/assets/css/main.css b/themes/neonxp/assets/css/main.css index 8402203..de6f9d5 100644 --- a/themes/neonxp/assets/css/main.css +++ b/themes/neonxp/assets/css/main.css @@ -14,116 +14,52 @@ nav { } nav ul { - display: flex; padding: 0; margin: 0; } nav ul li { list-style: none; + display: inline-block; + border: 0.1px solid var(--link-color); + border-radius: var(--border-radius); } nav ul li a { padding: 0.5rem 1rem; - margin: 0 1rem; - border: 0.1px solid var(--link-color); - border-radius: var(--border-radius); text-decoration: none; + display: inline-block; + width: auto; + line-height: 1.5rem; } nav ul li a:hover { background-color: color-mix(in srgb, var(--link-color) 10%, transparent); } -nav ul li:first-child a { - margin-left: 0; -} - -@media (max-width: 900px) { - nav ul { - display: block; - } - - - nav ul li a { - margin: 0rem 0rem !important; - display: block; - border-radius: 0; - } - - nav ul li:first-child a { - border-top-left-radius: var(--border-radius); - border-top-right-radius: var(--border-radius); - } - - nav ul li:last-child a { - border-bottom-left-radius: var(--border-radius); - border-bottom-right-radius: var(--border-radius); - } -} - -@media (max-width: 480px) { - - header, - footer { - padding: 1rem !important; - } - - nav ul { - display: block; - } - - nav ul li a { - margin: 0rem 0rem !important; - display: block; - border-radius: 0; - } - - nav ul li:first-child a { - border-top-left-radius: var(--border-radius); - border-top-right-radius: var(--border-radius); - } - - nav ul li:last-child a { - border-bottom-left-radius: var(--border-radius); - border-bottom-right-radius: var(--border-radius); - } +nav ul li a.active { + background-color: color-mix(in srgb, var(--link-color) 10%, transparent); } ul.taxonomy { - display: flex; + display: block; padding: 0; margin: 0.5rem 0; } ul.taxonomy li { list-style: none; + display: inline; } -ul.taxonomy li a { - padding: 0.5rem 1rem; - margin: 0 1rem; - border: 0.1px solid var(--link-color); - border-radius: var(--border-radius); - text-decoration: none; -} - -ul.taxonomy li a:hover { - background-color: color-mix(in srgb, var(--link-color) 10%, transparent); -} - -ul.taxonomy li:first-child a { - margin-left: 0; -} - - ul.pagination { - display: flex; + display: block; padding: 0; margin: 0.5rem 0; } ul.pagination li { + display: inline; list-style: none; } @@ -133,10 +69,10 @@ ul.pagination li.active a { ul.pagination li a { padding: 0.5rem 1rem; - margin: 0 1rem; border: 0.1px solid var(--link-color); border-radius: var(--border-radius); text-decoration: none; + line-height: 3rem; } ul.pagination li a:hover { diff --git a/themes/neonxp/assets/css/paper.css b/themes/neonxp/assets/css/paper.css index 91d9eef..47ba42b 100644 --- a/themes/neonxp/assets/css/paper.css +++ b/themes/neonxp/assets/css/paper.css @@ -133,8 +133,8 @@ p { widows: 4; } -img { - max-width: 100%; +figure img { + max-width: 600px; } @media (max-width: 900px) { 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 }} <article class="h-entry"> <h2 class="p-name"><a class="u-url" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> - {{if .Date }} - {{ $dateMachine := .Date | time.Format "2006-01-02 15:04:05-07:00" }} - {{ $dateHuman := .Date | time.Format ":date_long" }} - <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> - {{end}} <div class="p-summary"> {{ .Summary }} </div> 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" }} +<article> + <h1>{{ .Title }}</h1> + {{ .Content }} +</article> +<div class="h-feed"> + + {{ range .Pages }} + <article class="h-entry"> + <h2 class="p-name"><a class="u-url" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> + {{if .Date }} + {{ $dateMachine := .Date | time.Format "2006-01-02 15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> + {{end}} + <div class="p-summary"> + {{ .Summary }} + </div> + <a class="btn-primary" href="{{ .RelPermalink }}">Читать дальше...</a> + </article> + {{ end }} +</div> +{{ 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" }} +<article> + <h1>{{ .Title }}</h1> + {{ .Content }} +</article> +<div class="h-feed"> + + {{ range .Pages }} + <article class="h-entry"> + <h2 class="p-name"><a class="u-url" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> + {{if .Date }} + {{ $dateMachine := .Date | time.Format "2006-01-02 15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> + {{end}} + <div class="p-summary"> + {{ .Summary }} + </div> + <a class="btn-primary" href="{{ .RelPermalink }}">Читать дальше...</a> + </article> + {{ end }} +</div> +{{ 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 "," -}} + +<figure> + <img srcset="{{ $set }}" sizes="(max-width: 480px) 480px, 100vw" src="{{ $res.RelPermalink }}" alt="{{ $alt }}" + height="auto" /> + <figcaption>{{ $alt }}</figcaption> +</figure>
\ No newline at end of file |
