diff --git a/README.md b/README.md index 7cc837d..e45e465 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ hugo server Visit [stack.jimmycai.com](https://stack.jimmycai.com) +Список моих изменений описан [тут](https://buliway.ru/p/мои-изменения-в-теме-hugo-stack/) + ## Copyright **Licensed under the GNU General Public License v3.0** diff --git a/assets/icons/at.svg b/assets/icons/at.svg new file mode 100644 index 0000000..bb17d1c --- /dev/null +++ b/assets/icons/at.svg @@ -0,0 +1,20 @@ + + + + + diff --git a/assets/icons/brand-cashapp.svg b/assets/icons/brand-cashapp.svg new file mode 100644 index 0000000..f87e589 --- /dev/null +++ b/assets/icons/brand-cashapp.svg @@ -0,0 +1,19 @@ + + + + diff --git a/assets/icons/brand-discord.svg b/assets/icons/brand-discord.svg new file mode 100644 index 0000000..fa03c86 --- /dev/null +++ b/assets/icons/brand-discord.svg @@ -0,0 +1,22 @@ + + + + + + + diff --git a/assets/icons/brand-hugo.svg b/assets/icons/brand-hugo.svg new file mode 100644 index 0000000..b0f5650 --- /dev/null +++ b/assets/icons/brand-hugo.svg @@ -0,0 +1,21 @@ + + + + + + + diff --git a/assets/icons/brand-telegram.svg b/assets/icons/brand-telegram.svg new file mode 100644 index 0000000..6c0b40b --- /dev/null +++ b/assets/icons/brand-telegram.svg @@ -0,0 +1,19 @@ + + + + diff --git a/assets/icons/coin-bitcoin.svg b/assets/icons/coin-bitcoin.svg new file mode 100644 index 0000000..fe4b9d6 --- /dev/null +++ b/assets/icons/coin-bitcoin.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/assets/icons/coin-monero.svg b/assets/icons/coin-monero.svg new file mode 100644 index 0000000..b4e0f32 --- /dev/null +++ b/assets/icons/coin-monero.svg @@ -0,0 +1,20 @@ + + + + + diff --git a/assets/icons/coin.svg b/assets/icons/coin.svg new file mode 100644 index 0000000..c981c32 --- /dev/null +++ b/assets/icons/coin.svg @@ -0,0 +1,21 @@ + + + + + + diff --git a/assets/icons/credit-card.svg b/assets/icons/credit-card.svg new file mode 100644 index 0000000..64012e8 --- /dev/null +++ b/assets/icons/credit-card.svg @@ -0,0 +1,22 @@ + + + + + + + diff --git a/assets/icons/currency-dollar.svg b/assets/icons/currency-dollar.svg new file mode 100644 index 0000000..53c4b51 --- /dev/null +++ b/assets/icons/currency-dollar.svg @@ -0,0 +1,20 @@ + + + + + diff --git a/assets/icons/mail-fast.svg b/assets/icons/mail-fast.svg new file mode 100644 index 0000000..358fe87 --- /dev/null +++ b/assets/icons/mail-fast.svg @@ -0,0 +1,22 @@ + + + + + + + diff --git a/assets/icons/mail-opened.svg b/assets/icons/mail-opened.svg new file mode 100644 index 0000000..07d877e --- /dev/null +++ b/assets/icons/mail-opened.svg @@ -0,0 +1,22 @@ + + + + + + + diff --git a/assets/icons/mail.svg b/assets/icons/mail.svg new file mode 100644 index 0000000..96d3c77 --- /dev/null +++ b/assets/icons/mail.svg @@ -0,0 +1,20 @@ + + + + + diff --git a/assets/icons/pig-money.svg b/assets/icons/pig-money.svg new file mode 100644 index 0000000..e226115 --- /dev/null +++ b/assets/icons/pig-money.svg @@ -0,0 +1,21 @@ + + + + + + diff --git a/assets/icons/premium-rights.svg b/assets/icons/premium-rights.svg new file mode 100644 index 0000000..34de799 --- /dev/null +++ b/assets/icons/premium-rights.svg @@ -0,0 +1,21 @@ + + + + + + + diff --git a/assets/icons/wallet.svg b/assets/icons/wallet.svg new file mode 100644 index 0000000..939a188 --- /dev/null +++ b/assets/icons/wallet.svg @@ -0,0 +1,19 @@ + + + + + diff --git a/assets/scss/general.scss b/assets/scss/general.scss index e12bb0e..5d30137 100644 --- a/assets/scss/general.scss +++ b/assets/scss/general.scss @@ -18,9 +18,6 @@ a { .section-title { text-transform: uppercase; - margin-top: 0; - margin-bottom: 10px; - display: block; font-size: 1.6rem; font-weight: bold; color: var(--body-text-color); diff --git a/assets/scss/partials/article.scss b/assets/scss/partials/article.scss index e2c05a4..8330816 100644 --- a/assets/scss/partials/article.scss +++ b/assets/scss/partials/article.scss @@ -33,15 +33,13 @@ } } } + } +} - @for $i from 1 through length($defaultTagBackgrounds) { - &:nth-child(#{length($defaultTagBackgrounds)}n + #{$i}) { - .article-category a { - background: nth($defaultTagBackgrounds, $i); - color: nth($defaultTagColors, $i); - } - } - } +@for $i from 1 through length($defaultTagBackgrounds) { + .article-category:nth-child(#{length($defaultTagBackgrounds)}n + #{$i}) a { + background: nth($defaultTagBackgrounds, $i); + color: nth($defaultTagColors, $i); } } diff --git a/assets/scss/partials/widgets.scss b/assets/scss/partials/widgets.scss index 42cfcc2..e570115 100644 --- a/assets/scss/partials/widgets.scss +++ b/assets/scss/partials/widgets.scss @@ -3,6 +3,9 @@ flex-direction: column; .widget-icon { + display: flex; + align-items: center; /* Центрирование по вертикали */ + gap: 10px; /* Расстояние между SVG и текстом */ svg { width: 32px; height: 32px; diff --git a/exampleSite/content/_index.zh-cn.md b/exampleSite/content/_index.zh-cn.md deleted file mode 100644 index e4b59a8..0000000 --- a/exampleSite/content/_index.zh-cn.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -menu: - main: - name: 主页 - weight: -100 - params: - icon: home ---- \ No newline at end of file diff --git a/exampleSite/content/post/Markdown Syntax Guide/index.ru.md b/exampleSite/content/post/Markdown Syntax Guide/index.ru.md index 201bf45..0937976 100644 --- a/exampleSite/content/post/Markdown Syntax Guide/index.ru.md +++ b/exampleSite/content/post/Markdown Syntax Guide/index.ru.md @@ -13,17 +13,19 @@ links: description: Поддержать меня на Boosty website: https://boosty.to/buliway image: /boosty.png -series: ["Hugo Guide"] -math: true +series: ["Hugo Guide"] # Серия статей на какую-то тему +math: true # Вкл/Выкл KaTeX рендеринг +# lastmod: # Дата редактирования поста # image: string # Изображение поста -# comments: bool # Вкл/Выкл комментариев под данным постом -# toc: bool # Вкл/Выкл навигацию по заголовкам справа от поста +# comments: false # Вкл/Выкл комментариев под данным постом +# toc: false # Вкл/Выкл навигацию по заголовкам справа от поста # keywords: []string # Keywords of the page. Useful for SEO. +# draft: true # Если вкл, то не рендерит эту страницу. Для недописанных постов --- ## Введение -Эта статья содержит в себе сборник всех изначально встроенных статей в эту тему Hugo. Тут будет всё о markdown для написания статей. Как именно это написать в `.md` файле я показывать буду лишь частично. Эта статья скорее для меня как для админа, чтоб я мог вернуться и глянуть как пишется какой-либо функционал. +Эта статья содержит в себе сборник всех изначально встроенных статей в эту тему Hugo. Тут будет всё о markdown для написания статей. Как именно это написать в `.md` файле я показывать буду лишь частично. Полностью можно посмотреть в [файле на github](https://raw.githubusercontent.com/Buliway/hugo-theme-stack/master/exampleSite/content/post/Markdown%20Syntax%20Guide/index.ru.md). Эта статья скорее для меня как для админа, чтоб я мог вернуться и глянуть как пишется какой-либо функционал. В начале статьи надо добавить поле, которое называется [frontmatter](https://gohugo.io/content-management/front-matter/). В документации написаны все возможные параметры, которые туда можно написать. Выделить настройки можно либо через `---`, либо через `+++`. Разница в том, что `---` будет иметь синтаксис `yaml` формата, а `+++` будет иметь синтаксис `toml`. В настройки, например, можно добавить поле `series = ["Themes Guide"]`. Это будет означать серию статей о какой-то теме, чтоб читатели могли видеть связанный контент. Как я понимаю, речь про рекомендации в конце поста. Хотя рекомендации, в теории, должны работать и без этого, просто по общим категориям и тегам. diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index a1e3829..2eb1e46 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -1,46 +1,25 @@ -baseurl: https://example.com -languageCode: en-us +baseurl: https://buliway.ru +languageCode: ru-RU theme: hugo-theme-stack -paginate: 3 -title: Example Site -copyright: Example Person +paginate: 10 +title: Buliway +copyright: Buliway # Theme i18n support # Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw -DefaultContentLanguage: en +DefaultContentLanguage: ru # Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko] # This will make .Summary and .WordCount behave correctly for CJK languages. hasCJKLanguage: false languages: - en: - languageName: English - title: Example Site + ru: + languageName: Russian weight: 1 + timeZone: Europe/Moscow params: - description: Example description - zh-cn: - languageName: 中文 - title: 演示站点 - weight: 2 - params: - description: 演示说明 - ar: - languageName: عربي - languagedirection: rtl - title: موقع تجريبي - weight: 3 - params: - description: وصف تجريبي - -services: - # Change it to your Disqus shortname before using - disqus: - shortname: "hugo-theme-stack" - # GA Tracking ID - googleAnalytics: - id: + description: Блог о программировании # Это описание сайта, а не языка permalinks: post: /p/:slug/ @@ -51,19 +30,15 @@ params: - post featuredImageField: image rssFullContent: true - favicon: # e.g.: favicon placed in `static/favicon.ico` of your site folder, then set this field to `/favicon.ico` (`/` is necessary) + favicon: # Это иконка сайта. Сначала создаём `static/favicon.ico`, потом пишем в это поле `/favicon.ico` (/ обязателен) footer: - since: 2020 + since: 2024 customText: - dateFormat: - published: Jan 02, 2006 - lastUpdated: Jan 02, 2006 15:04 MST - sidebar: - emoji: 🍥 - subtitle: Lorem ipsum dolor sit amet, consectetur adipiscing elit. + # emoji: 🍥 + subtitle: Текст под сайтом avatar: enabled: true local: true @@ -78,8 +53,8 @@ params: default: Licensed under CC BY-NC-SA 4.0 comments: - enabled: true - provider: disqus + enabled: false + provider: remark42 disqusjs: shortname: @@ -163,15 +138,15 @@ params: widgets: homepage: - type: search - - type: archives - params: - limit: 5 - type: categories params: limit: 10 - type: tag-cloud params: - limit: 10 + limit: 20 + - type: archives + params: + limit: 5 page: - type: toc @@ -194,7 +169,7 @@ params: toggle: true # Available values: auto, light, dark - default: auto + default: dark imageProcessing: cover: @@ -211,15 +186,34 @@ menu: social: - identifier: github name: GitHub - url: https://github.com/CaiJimmy/hugo-theme-stack + url: https://github.com/Buliway/ params: icon: brand-github - - identifier: twitter - name: Twitter - url: https://twitter.com + - identifier: discord + name: Discord + url: https://discord.gg/MwKdpYujYh params: - icon: brand-twitter + icon: brand-discord + + - identifier: telegram + name: Telegram + url: https://t.me/+q6STihSO6XQ4Mzhi + params: + icon: brand-telegram + + - identifier: email + name: Email + url: mailto:example@example.com + params: + icon: mail + + - identifier: boosty + name: Boosty + url: https://boosty.to/buliway + params: + icon: coin + related: includeNewer: true @@ -249,3 +243,5 @@ markup: lineNos: true lineNumbersInTable: true tabWidth: 4 + +enableGitInfo: true diff --git a/i18n/en.yaml b/i18n/en.yaml index fb07328..7a0b527 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -71,3 +71,7 @@ footer: designedBy: other: Theme {{ .Theme }} designed by {{ .DesignedBy }} + +tags: + web: Web + hugo: Hugo diff --git a/i18n/ru.yaml b/i18n/ru.yaml index b1f1e51..79afb2f 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -2,7 +2,7 @@ toggleMenu: other: Показать/скрыть меню darkMode: - other: Тёмный режим + other: Тёмная тема list: page: @@ -47,6 +47,9 @@ widget: tagCloud: title: other: Теги + categoriesCloud: + title: + other: Категории search: title: @@ -61,3 +64,7 @@ footer: other: Создано при помощи {{ .Generator }} designedBy: other: Тема {{ .Theme }}, дизайн {{ .DesignedBy }} + +tags: + web: Веб + hugo: Hugo diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index 5d5243c..1b203f9 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -4,7 +4,7 @@ {{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}} {{- $terms := $taxonomy.Pages -}} {{ if $terms }} -

{{ $taxonomy.Title }}

+

{{ T "widget.categoriesCloud.title" }}

{{ range $terms }} @@ -15,6 +15,19 @@ {{ end }} +
+

{{ T "widget.tagCloud.title" }}

+
+ {{ range first 1000 $.Site.Taxonomies.tags.ByCount }} + {{ $tagID := printf "tags.%s" (.Page.Title | urlize | lower) }} + {{ $translation := i18n $tagID }} + + {{ $translation }} + + {{ end }} +
+
+ {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} {{ $filtered := ($pages | intersect $notHidden) }} diff --git a/layouts/page/search.json b/layouts/page/search.json index 5d4e627..79020f3 100644 --- a/layouts/page/search.json +++ b/layouts/page/search.json @@ -1,5 +1,5 @@ -{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} -{{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}} +{{- $pages := where .Site.AllPages "Type" "in" .Site.Params.mainSections -}} +{{- $notHidden := where .Site.AllPages "Params.hidden" "!=" true -}} {{- $filtered := ($pages | intersect $notHidden) -}} {{- $result := slice -}} diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html index cc0a0fc..d42ec14 100644 --- a/layouts/partials/article/components/details.html +++ b/layouts/partials/article/components/details.html @@ -1,13 +1,4 @@
- {{ if .Params.categories }} - - {{ end }}

@@ -32,7 +23,7 @@
{{ partial "helper/icon" "date" }}
{{ end }} @@ -58,4 +49,14 @@

{{ end }} + + {{ if .Params.categories }} + + {{ end }}
diff --git a/layouts/partials/article/components/footer.html b/layouts/partials/article/components/footer.html index 6853921..c20de04 100644 --- a/layouts/partials/article/components/footer.html +++ b/layouts/partials/article/components/footer.html @@ -12,7 +12,7 @@
{{ partial "helper/icon" "clock" }} - {{ T "article.lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }} + {{ T "article.lastUpdatedOn" }} {{ time.Format "02 January 2006 15:04" .Lastmod }}
{{- end -}} diff --git a/layouts/partials/article/components/tags.html b/layouts/partials/article/components/tags.html index aae38b4..d7cfcec 100644 --- a/layouts/partials/article/components/tags.html +++ b/layouts/partials/article/components/tags.html @@ -1,7 +1,9 @@ {{ if .Params.Tags }} {{ end }} \ No newline at end of file diff --git a/layouts/partials/widget/archives.html b/layouts/partials/widget/archives.html index 1f2abc5..72ced12 100644 --- a/layouts/partials/widget/archives.html +++ b/layouts/partials/widget/archives.html @@ -6,8 +6,8 @@
{{ partial "helper/icon" "infinity" }} +

{{ T "widget.archives.title" }}

-

{{ T "widget.archives.title" }}

{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }} {{ $notHidden := where $context.Site.RegularPages "Params.hidden" "!=" true }} diff --git a/layouts/partials/widget/categories.html b/layouts/partials/widget/categories.html index 10c8a35..6ad8088 100644 --- a/layouts/partials/widget/categories.html +++ b/layouts/partials/widget/categories.html @@ -3,8 +3,8 @@
{{ partial "helper/icon" "categories" }} +

{{ T "widget.categoriesCloud.title" }}

-

{{ T "widget.categoriesCloud.title" }}

{{ range first $limit $context.Site.Taxonomies.categories.ByCount }} diff --git a/layouts/partials/widget/tag-cloud.html b/layouts/partials/widget/tag-cloud.html index e64e5e2..459fe49 100644 --- a/layouts/partials/widget/tag-cloud.html +++ b/layouts/partials/widget/tag-cloud.html @@ -3,14 +3,17 @@
{{ partial "helper/icon" "tag" }} +

{{ T "widget.tagCloud.title" }}

-

{{ T "widget.tagCloud.title" }}

{{ range first $limit $context.Site.Taxonomies.tags.ByCount }} + {{ $tagID := printf "tags.%s" (.Page.Title | urlize | lower) }} + {{ $translation := i18n $tagID }} - {{ .Page.Title }} + {{ $translation }} {{ end }}
+
\ No newline at end of file diff --git a/layouts/partials/widget/toc.html b/layouts/partials/widget/toc.html index e311de3..2c3c6ef 100644 --- a/layouts/partials/widget/toc.html +++ b/layouts/partials/widget/toc.html @@ -2,8 +2,8 @@
{{ partial "helper/icon" "hash" }} +

{{ T "article.tableOfContents" }}

-

{{ T "article.tableOfContents" }}

{{ .Context.TableOfContents }}