aboutsummaryrefslogtreecommitdiff
path: root/themes/neonxp
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-11-20 03:20:47 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-11-20 03:20:47 +0300
commit8b78390987476352a6459460e00d5c4cdc0717c2 (patch)
tree77fd218ddd7203b10b4e4969ed8ede2fb4753d24 /themes/neonxp
parent74b65dd83f7c66d1f67f961b1fee65400b1fc334 (diff)
Обновил стиль
Diffstat (limited to 'themes/neonxp')
-rw-r--r--themes/neonxp/assets/css/main.css10
-rw-r--r--themes/neonxp/assets/icons/rss.svg17
-rw-r--r--themes/neonxp/assets/js/main.js1
-rw-r--r--themes/neonxp/layouts/_default/home.html7
-rw-r--r--themes/neonxp/layouts/_default/list.html7
-rw-r--r--themes/neonxp/layouts/_default/single.html8
-rw-r--r--themes/neonxp/layouts/partials/icon.html6
-rw-r--r--themes/neonxp/layouts/partials/list.html16
-rw-r--r--themes/neonxp/layouts/shortcodes/figure.html38
-rw-r--r--themes/neonxp/layouts/shortcodes/gist.html1
-rw-r--r--themes/neonxp/layouts/shortcodes/quote.html15
11 files changed, 107 insertions, 19 deletions
diff --git a/themes/neonxp/assets/css/main.css b/themes/neonxp/assets/css/main.css
index 23daadd..989086c 100644
--- a/themes/neonxp/assets/css/main.css
+++ b/themes/neonxp/assets/css/main.css
@@ -1,9 +1,3 @@
-.space-between {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
-}
-
.p-summary {
display: none;
}
@@ -16,6 +10,10 @@
display: none;
}
+figcaption {
+ text-align: center;
+}
+
@media print {
.sidebar {
display: none;
diff --git a/themes/neonxp/assets/icons/rss.svg b/themes/neonxp/assets/icons/rss.svg
new file mode 100644
index 0000000..baa793a
--- /dev/null
+++ b/themes/neonxp/assets/icons/rss.svg
@@ -0,0 +1,17 @@
+<svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ class="icon icon-tabler icons-tabler-outline icon-tabler-rss"
+>
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
+ <path d="M5 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
+ <path d="M4 4a16 16 0 0 1 16 16" />
+ <path d="M4 11a9 9 0 0 1 9 9" />
+</svg> \ No newline at end of file
diff --git a/themes/neonxp/assets/js/main.js b/themes/neonxp/assets/js/main.js
index e2aac52..e69de29 100644
--- a/themes/neonxp/assets/js/main.js
+++ b/themes/neonxp/assets/js/main.js
@@ -1 +0,0 @@
-console.log('This site was generated by Hugo.');
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