From 8b78390987476352a6459460e00d5c4cdc0717c2 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Wed, 20 Nov 2024 03:20:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D0=BB=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/posts/2024-11-17-obsidian.md | 11 +++--- go.mod | 5 --- go.sum | 2 -- hugo.toml | 3 +- themes/neonxp/assets/css/main.css | 10 +++--- themes/neonxp/assets/icons/rss.svg | 17 +++++++++ themes/neonxp/assets/js/main.js | 1 - themes/neonxp/layouts/_default/home.html | 7 ++-- themes/neonxp/layouts/_default/list.html | 7 +++- themes/neonxp/layouts/_default/single.html | 8 +++-- themes/neonxp/layouts/partials/icon.html | 6 ++++ themes/neonxp/layouts/partials/list.html | 16 +++++---- themes/neonxp/layouts/shortcodes/figure.html | 38 ++++++++++++++++++++ themes/neonxp/layouts/shortcodes/gist.html | 1 + themes/neonxp/layouts/shortcodes/quote.html | 15 ++++++++ 15 files changed, 114 insertions(+), 33 deletions(-) delete mode 100644 go.mod delete mode 100644 go.sum create mode 100644 themes/neonxp/assets/icons/rss.svg create mode 100644 themes/neonxp/layouts/partials/icon.html create mode 100644 themes/neonxp/layouts/shortcodes/figure.html create mode 100644 themes/neonxp/layouts/shortcodes/gist.html create mode 100644 themes/neonxp/layouts/shortcodes/quote.html 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="план-кабан" >}} То что выделено красным — ещё не существует в природе. diff --git a/go.mod b/go.mod deleted file mode 100644 index 36838f0..0000000 --- a/go.mod +++ /dev/null @@ -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 diff --git a/go.sum b/go.sum deleted file mode 100644 index 2d68b37..0000000 --- a/go.sum +++ /dev/null @@ -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= diff --git a/hugo.toml b/hugo.toml index 90ddc5f..74f2f9c 100644 --- a/hugo.toml +++ b/hugo.toml @@ -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 @@ + + + + + + \ 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 @@
-
- {{ .Title }} +
+
+ {{ .Title }} + {{ partial "icon.html" "rss" }} +
{{ .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 @@
{{ if .Title }} {{ 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 @@
-
+
+
{{ .Title }} {{ 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") }} {{ end }} +
{{ .Summary }}
{{ .Content }}
-
+
+
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} @@ -34,6 +37,7 @@ {{ if .Params.Location }} @ {{.Params.Location}} {{ end }} +
{{ 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 @@
-
- {{ .LinkTitle }} - {{ if .Date }} - - {{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}} - - {{ end }} +
+
+ {{ .LinkTitle }} + {{ if .Date }} + + {{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}} + + {{ end }} +
{{ 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 @@ + + {{- if .Get "link" -}} + + {{- 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 -}} + + {{ with .Get + {{- if .Get "link" }}{{ end -}} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} +
+ {{ with (.Get "title") -}} + {{ . }} + {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}

+ {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" }} + + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}{{ end }}

+ {{- end }} +
+ {{- end }} + \ 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 @@ + \ 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 @@ +
+

{{ .Inner | markdownify }}

+ {{- if or (.Get "author") (.Get "source") -}} + + {{- if .Get "author" -}} + + {{- .Get "author" -}}{{- if .Get "source" -}}, {{ end -}} + + {{- end -}} + {{- with .Get "url" -}}{{- end -}} + {{ .Get "source" }} + {{- if .Get "url" -}}{{- end -}} + + {{- end -}} +
\ No newline at end of file