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 | |
parent | 74b65dd83f7c66d1f67f961b1fee65400b1fc334 (diff) |
Обновил стиль
-rw-r--r-- | content/posts/2024-11-17-obsidian.md | 11 | ||||
-rw-r--r-- | go.mod | 5 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | hugo.toml | 3 | ||||
-rw-r--r-- | themes/neonxp/assets/css/main.css | 10 | ||||
-rw-r--r-- | themes/neonxp/assets/icons/rss.svg | 17 | ||||
-rw-r--r-- | themes/neonxp/assets/js/main.js | 1 | ||||
-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 |
15 files changed, 114 insertions, 33 deletions
diff --git a/content/posts/2024-11-17-obsidian.md b/content/posts/2024-11-17-obsidian.md index 9b15053..9d4a45c 100644 --- a/content/posts/2024-11-17-obsidian.md +++ b/content/posts/2024-11-17-obsidian.md @@ -152,20 +152,21 @@ ___ и переходя к сегодняшней заметке я сразу получаю такую заготовку: -![](/img/posts/obsidian/templater.png) +{{< figure src="/img/posts/obsidian/templater.png" title="Заметка из шаблона" >}} ### Остальные плагины Остальные тоже крутые, но я их приведу просто списком: -- [obsidian-tasks-plugin](https://publish.obsidian.md/tasks/Introduction) — помогает более богато управлять +- [tasks](https://publish.obsidian.md/tasks/Introduction) — помогает более богато управлять задачами. В частности, у меня проставляет дату завершения задачи, и проставляет даты дедлайна и прочее. -- [obsidian-reminder-plugin](https://uphy.github.io/obsidian-reminder/) — трекает и напоминает про задачи +- [reminder](https://uphy.github.io/obsidian-reminder/) — трекает и напоминает про задачи - [calendar](https://github.com/liamcain/obsidian-calendar-plugin) — просто миникалендарь в боковой панели - [homepage](https://github.com/mirnovov/obsidian-homepage) — позволяет задать произвольную заметку "домашней" -- [obsidian-icon-folder](https://github.com/timolins/obsidian-icon-folder) — позволяет задавать директориям и заметкам +- [icon-folder](https://github.com/timolins/obsidian-icon-folder) — позволяет задавать директориям и заметкам произвольные иконки. Пример есть как раз на скриншоте выше. - [pomodoro-timer](https://github.com/eatgrass/obsidian-pomodoro-timer) — думаю, из названия и так понятно +- [kanban](https://publish.obsidian.md/kanban/) — шикарнейший канбан плагин ### А что же мне не хватает? @@ -178,7 +179,7 @@ ___ «Но Hugo это же генератор статичных сайтов, куда ты ему будешь отправлять заметку для публикации?» — можешь спросить меня ты. А я отвечу что у меня вот такой план: -![план-кабан](/img/posts/obsidian/publish.png) +{{< figure src="/img/posts/obsidian/publish.png" title="план-кабан" >}} То что выделено красным — ещё не существует в природе. @@ -1,5 +0,0 @@ -module git.neonxp.ru/neonxp/blog - -go 1.23.2 - -require github.com/CaiJimmy/hugo-theme-stack/v3 v3.29.0 // indirect @@ -1,2 +0,0 @@ -github.com/CaiJimmy/hugo-theme-stack/v3 v3.29.0 h1:6Ahvbvlyi0HrstfDt2yk6BfcAEnW107lWOUjPjD/ye4= -github.com/CaiJimmy/hugo-theme-stack/v3 v3.29.0/go.mod h1:IPmCXiIxlFSLFYS0tOmYP6ySLviyeNVSabyvSuaxD+I= @@ -100,8 +100,7 @@ tabWidth = 4 [outputs] page = ["html"] home = ["html"] -sections = ["html", "rss"] -post = ["html"] +section = ["html", "rss"] [pagination] disableAliases = false 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 |