feat(series): серия «Октябрь без слежки» (Opt Out October) + страница всех серий и пункт меню
deploy-dedinit / Build & SFTP Deploy (push) Successful in 10m5s
wiki-sync / Publish docs/wiki to Gitea wiki (push) Successful in 18s

- 22 поста Opt Out October: series + series_order 1…22
- layouts/partials/series_nav.html: русское имя серии из title термина, «N из M», prev/next
- layouts/series/term.html: порядок по series_order, без пагинации
- content/series/_index.md («Серии») и content/series/opt-out-october/_index.md («Октябрь без слежки»)
- terms.html показывает .Title термина, пункт меню «Серии» → /series/
- сборка: hugo --minify --cleanDestinationDir (CI + README + docs), мусорные термины ушли из public/
- openspec change series-opt-out-october
This commit is contained in:
2026-11-05 09:43:46 +00:00
parent 7380f84b38
commit e5014d4b52
41 changed files with 481 additions and 39 deletions
+13 -5
View File
@@ -5,6 +5,8 @@
series: ["Имя серии"]
series_order: 1
Выводит блок «Серия: N из M» со ссылками на предыдущую/следующую часть.
Отображаемое имя берётся из title страницы серии (content/series/<slug>/_index.md),
поэтому серия может иметь латинский slug и русское название.
Если серий нет или пост не в серии — выводит пустоту.
*/ -}}
{{- $series := .Params.series -}}
@@ -17,6 +19,7 @@
{{- if not $term }}{{- $term = site.GetPage (printf "/series/%s" ($seriesName | lower)) -}}{{- end -}}
{{- if $term -}}
{{- $pages := (sort $term.Pages "Params.series_order" "asc") -}}
{{- $display := $term.Title | default $seriesName -}}
{{- $current := $.Params.series_order -}}
{{- $total := $pages | len -}}
{{- $idx := 0 -}}
@@ -25,18 +28,23 @@
{{- range $i, $p := $pages -}}
{{- if eq $current $p.Params.series_order -}}
{{- $idx = add $i 1 -}}
{{- $prev = (index $pages (sub $i 1)) | default "" -}}
{{- $next = (index $pages (add $i 1)) | default "" -}}
{{- if gt $i 0 }}{{ $prev = (index $pages (sub $i 1)) }}{{ end -}}
{{- if lt (add $i 1) $total }}{{ $next = (index $pages (add $i 1)) }}{{ end -}}
{{- end -}}
{{- end -}}
<div class="series-nav" data-series="{{ $seriesName }}" data-order="{{ $current }}" data-total="{{ $total }}">
<div class="series-title">Серия: <a href="{{ $term.Permalink }}">{{ $seriesName }}</a></div>
<div class="series-progress">часть {{ $idx }} из {{ $total }}</div>
<div class="series-head">
<span class="series-label">Серия</span>
<a class="series-title" href="{{ $term.Permalink }}">{{ $display }}</a>
<span class="series-progress">{{ $idx }} из {{ $total }}</span>
</div>
{{- if or $prev $next }}
<div class="series-links">
{{- if $prev }}<a class="series-prev" href="{{ $prev.Permalink }}">← {{ $prev.Title }}</a>{{- end }}
{{- if $next }}<a class="series-next" href="{{ $next.Permalink }}">{{ $next.Title }} →</a>{{- end }}
</div>
{{- end }}
</div>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
+125
View File
@@ -0,0 +1,125 @@
{{- /* Страница серии: статьи в порядке series_order, все на одной странице. */ -}}
{{- define "main" }}
{{- if (and site.Params.profileMode.enabled .IsHome) }}
{{- partial "index_profile.html" . }}
{{- else }} {{/* if not profileMode */}}
{{- if not .IsHome | and .Title }}
<header class="page-header">
{{- partial "breadcrumbs.html" . }}
<h1>
{{ .Title }}
{{- if and (or (eq .Kind `term`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }}
{{- with .OutputFormats.Get "rss" }}
<a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9" />
<path d="M4 4a16 16 0 0 1 16 16" />
<circle cx="5" cy="19" r="1" />
</svg>
</a>
{{- end }}
{{- end }}
</h1>
{{- if .Description }}
<div class="post-description">
{{ .Description | markdownify }}
</div>
{{- end }}
</header>
{{- end }}
{{- if .Content }}
<div class="post-content">
{{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }}
</div>
{{- end }}
{{- $pages := union .RegularPages .Sections }}
{{- if .IsHome }}
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }}
{{- end }}
{{- if eq .Type "series" }}
{{- $pages = sort .RegularPages "Params.series_order" "asc" }}
{{- end }}
{{- $paginator := .Paginate $pages 100 }}
{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
{{- partial "home_info.html" . }}
{{- end }}
{{- $term := .Data.Term }}
{{- range $index, $page := $paginator.Pages }}
{{- $class := "post-entry" }}
{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }}
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }}
{{- $class = "first-entry" }}
{{- else if $term }}
{{- $class = "post-entry tag-entry" }}
{{- end }}
<article class="{{ $class }}">
{{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }}
{{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
<header class="entry-header">
<h2 class="entry-hint-parent">
{{- .Title }}
{{- if .Draft }}
<span class="entry-hint" title="Draft">
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" fill="currentColor">
<path
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
</svg>
</span>
{{- end }}
</h2>
</header>
{{- if (ne (.Param "hideSummary") true) }}
<div class="entry-content">
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
</div>
{{- end }}
{{- if not (.Param "hideMeta") }}
<footer class="entry-footer">
{{- partial "post_meta.html" . -}}
</footer>
{{- end }}
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
</article>
{{- end }}
{{- if gt $paginator.TotalPages 1 }}
<footer class="page-footer">
<nav class="pagination">
{{- if $paginator.HasPrev }}
<a class="prev" href="{{ $paginator.Prev.URL | absURL }}">
«&nbsp;{{ i18n "prev_page" }}&nbsp;
{{- if (.Param "ShowPageNums") }}
{{- sub $paginator.PageNumber 1 }}/{{ $paginator.TotalPages }}
{{- end }}
</a>
{{- end }}
{{- if $paginator.HasNext }}
<a class="next" href="{{ $paginator.Next.URL | absURL }}">
{{- i18n "next_page" }}&nbsp;
{{- if (.Param "ShowPageNums") }}
{{- add 1 $paginator.PageNumber }}/{{ $paginator.TotalPages }}
{{- end }}&nbsp;»
</a>
{{- end }}
</nav>
</footer>
{{- end }}
{{- end }}{{/* end profileMode */}}
{{- end }}{{- /* end main */ -}}