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:
@@ -61,12 +61,16 @@ article.first-entry {
|
||||
}
|
||||
|
||||
/* 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 {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-inline-start: 14px;
|
||||
order: 2;
|
||||
}
|
||||
.social-icon {
|
||||
display: inline-flex;
|
||||
|
||||
@@ -37,10 +37,6 @@ draft = false
|
||||
# Полный текст постов в RSS-ленте (content:encoded)
|
||||
ShowFullTextinRSS = true
|
||||
|
||||
# Типографика логотипа dedinit(): темы, печатаемые в скобках (typewriter)
|
||||
[params.typewriter]
|
||||
words = ["linux", "llm", "politics", "homelab", "nix", "devops"]
|
||||
|
||||
# Настройки PaperMod
|
||||
defaultTheme = "auto"
|
||||
disableThemeToggle = false
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
{{- /* dedinit() typewriter: animated topics inside logo parens.
|
||||
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
|
||||
social icons (from [params.socialIcons]) next to the menu.
|
||||
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) -}}
|
||||
<script>
|
||||
(() => {
|
||||
@@ -79,7 +92,7 @@
|
||||
{{- /* server-rendered social icons; moved into the nav by the JS above.
|
||||
display:none so no-JS visitors never see a stray block. */ -}}
|
||||
{{- if $social -}}
|
||||
<div id="__social-icons" class="social-icons-inline" style="display:none">
|
||||
<div id="__social-icons" class="social-icons-inline">
|
||||
{{- range $social -}}
|
||||
<a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me"
|
||||
title="{{ (.title | default .name) | title }}" class="social-icon">
|
||||
|
||||
@@ -20,12 +20,20 @@
|
||||
- [x] 3.1 Добавить `[params.socialIcons]` в `hugo.toml` (github, telegram, rss)
|
||||
- [x] 3.2 В `extend_footer.html` добавить server-rendered блок иконок
|
||||
(`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.2 Локальные проверки: series-nav на странице серии (2 поста — prev/next
|
||||
работают), таксономия `/series/` собрана, соцсети в шапке, переключатель
|
||||
переносится JS
|
||||
- [ ] 4.3 `git commit` + push
|
||||
- [ ] 4.4 `make deploy`
|
||||
- [x] 4.1 Слова печати = реальные `site.Taxonomies.tags` (популярные первыми,
|
||||
топ-24, без служебных) вместо хардкода `[params.typewriter].words`
|
||||
- [x] 4.2 Удалить устаревший `[params.typewriter]` из `hugo.toml`
|
||||
|
||||
## 5. Проверка и деплой
|
||||
|
||||
- [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`
|
||||
Reference in New Issue
Block a user