fix: соцсети в меню теперь видны, логотип печатает реальные теги сайта

- extend_footer.html: убран inline display:none у блока соцсетей (перебивал
  CSS при переносе); слова логотипа = site.Taxonomies.tags (топ-24 по числу
  постов, без служебных тегов) вместо [params.typewriter].words
- typewriter.css: скрытие #__social-icons{display:none} (JS снимает id при
  переносе в nav -> блок видим через класс), order:2 у .social-icons-inline
- hugo.toml: удалён устаревший [params.typewriter]
This commit is contained in:
2026-09-20 19:51:15 +00:00
parent 0fbc0f93a4
commit dfc4c403fa
4 changed files with 36 additions and 15 deletions
+5 -1
View File
@@ -61,12 +61,16 @@ article.first-entry {
} }
/* 3) social icons inside the header nav (moved there by JS in /* 3) social icons inside the header nav (moved there by JS in
extend_footer.html). Sizing matches the logo/menu scale. */ extend_footer.html). Sizing matches the logo/menu scale.
Hidden while server-rendered in footer (id present); the JS moves
the block into .nav and clears the id — then class rules apply. */
#__social-icons { display: none; }
.social-icons-inline { .social-icons-inline {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 6px; gap: 6px;
margin-inline-start: 14px; margin-inline-start: 14px;
order: 2;
} }
.social-icon { .social-icon {
display: inline-flex; display: inline-flex;
-4
View File
@@ -37,10 +37,6 @@ draft = false
# Полный текст постов в RSS-ленте (content:encoded) # Полный текст постов в RSS-ленте (content:encoded)
ShowFullTextinRSS = true ShowFullTextinRSS = true
# Типографика логотипа dedinit(): темы, печатаемые в скобках (typewriter)
[params.typewriter]
words = ["linux", "llm", "politics", "homelab", "nix", "devops"]
# Настройки PaperMod # Настройки PaperMod
defaultTheme = "auto" defaultTheme = "auto"
disableThemeToggle = false disableThemeToggle = false
+16 -3
View File
@@ -1,10 +1,23 @@
{{- /* dedinit() typewriter: animated topics inside logo parens. {{- /* dedinit() typewriter: animated topics inside logo parens.
Pure JS + CSS, no Alpine. Progressive enhancement — no-JS keeps Pure JS + CSS, no Alpine. Progressive enhancement — no-JS keeps
the plain "dedinit()" logo. Words configurable via hugo.toml. the plain "dedinit()" logo. Words = live site tags (popularity
first), so the logo always reflects the actual blog taxonomy.
Also: moves theme toggle to the right end of .nav and injects Also: moves theme toggle to the right end of .nav and injects
social icons (from [params.socialIcons]) next to the menu. social icons (from [params.socialIcons]) next to the menu.
Icons are rendered server-side via the theme's svg.html partial. */ -}} Icons are rendered server-side via the theme's svg.html partial. */ -}}
{{- $tw_words := site.Params.typewriter.words | default (slice "linux" "llm" "politics" "homelab" "nix") -}} {{- /* Слова для печати: реальные теги сайта, популярные первыми.
Исключаем служебные/технические теги, которых много и они неинтересны. */ -}}
{{- $skip := slice "deprecated" "frontmatter" "google-analytics" "aux" "hermes" "herdr" "howto" -}}
{{- $tags := slice -}}
{{- range $t, $pages := site.Taxonomies.tags -}}
{{- if not (in $skip $t) -}}
{{- $tags = $tags | append (dict "name" $t "count" (len $pages)) -}}
{{- end -}}
{{- end -}}
{{- $tags = sort $tags "count" "desc" -}}
{{- if gt (len $tags) 24 }}{{- $tags = first 24 $tags -}}{{- end -}}
{{- $tw_words := slice -}}
{{- range $tags -}}{{- $tw_words = $tw_words | append .name -}}{{- end -}}
{{- $social := site.Params.socialIcons | default (slice) -}} {{- $social := site.Params.socialIcons | default (slice) -}}
<script> <script>
(() => { (() => {
@@ -79,7 +92,7 @@
{{- /* server-rendered social icons; moved into the nav by the JS above. {{- /* server-rendered social icons; moved into the nav by the JS above.
display:none so no-JS visitors never see a stray block. */ -}} display:none so no-JS visitors never see a stray block. */ -}}
{{- if $social -}} {{- if $social -}}
<div id="__social-icons" class="social-icons-inline" style="display:none"> <div id="__social-icons" class="social-icons-inline">
{{- range $social -}} {{- range $social -}}
<a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me" <a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me"
title="{{ (.title | default .name) | title }}" class="social-icon"> title="{{ (.title | default .name) | title }}" class="social-icon">
@@ -20,12 +20,20 @@
- [x] 3.1 Добавить `[params.socialIcons]` в `hugo.toml` (github, telegram, rss) - [x] 3.1 Добавить `[params.socialIcons]` в `hugo.toml` (github, telegram, rss)
- [x] 3.2 В `extend_footer.html` добавить server-rendered блок иконок - [x] 3.2 В `extend_footer.html` добавить server-rendered блок иконок
(`social_icons` через `svg.html` темы) и JS-перенос в `.nav` рядом с меню (`social_icons` через `svg.html` темы) и JS-перенос в `.nav` рядом с меню
- [x] 3.3 ФИКС: убрать inline `style="display:none"` (перебивал CSS при переносе),
скрытие через `#__social-icons` (CSS), JS снимает id → блок видим
## 4. Проверка и деплой ## 4. Теги в логотипе (typewriter)
- [x] 4.1 `make build` без ошибок - [x] 4.1 Слова печати = реальные `site.Taxonomies.tags` (популярные первыми,
- [x] 4.2 Локальные проверки: series-nav на странице серии (2 поста — prev/next топ-24, без служебных) вместо хардкода `[params.typewriter].words`
работают), таксономия `/series/` собрана, соцсети в шапке, переключатель - [x] 4.2 Удалить устаревший `[params.typewriter]` из `hugo.toml`
переносится JS
- [ ] 4.3 `git commit` + push ## 5. Проверка и деплой
- [ ] 4.4 `make deploy`
- [x] 5.1 `make build` без ошибок
- [x] 5.2 Локальные проверки: series-nav на странице серии (2 поста — prev/next
работают), таксономия `/series/` собрана, соцсети в шапке (CSS-скрытие +
снятие id), переключатель переносится JS, теги в JS-массиве
- [ ] 5.3 `git commit` + push
- [ ] 5.4 `make deploy`