8000 Fix site indexes and taxonomy placement by dominicusin · Pull Request #438 · dominicusin/dominicusin.github.io · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,24 @@ html:not(.dark) {
@media (prefers-reduced-motion: reduce) {
.home- 8000 button, .home-topic, .home-topic-arrow { transition: none; }
}
/* Knowledge graph explorer */
#kg-root .kg-controls { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
#kg-root .kg-search { min-width: 14rem; flex: 1; border: 1px solid #94a3b8; border-radius: .65rem; padding: .6rem .8rem; color: inherit; background: transparent; }
#kg-root .kg-btn, #kg-root .kg-chip { border: 1px solid #94a3b8; border-radius: 999px; padding: .45rem .8rem; color: inherit; background: transparent; cursor: pointer; }
#kg-root .kg-chips, #kg-root .kg-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: 1rem 0; }
#kg-root .kg-chip.kg-active { border-color: var(--chip); box-shadow: inset 0 0 0 1px var(--chip); }
#kg-root .kg-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem); min-height: 32rem; overflow: hidden; border: 1px solid rgba(148,163,184,.35); border-radius: 1rem; }
#kg-root .kg-svg { min-width: 0; min-height: 32rem; background: radial-gradient(circle at center, rgba(148,163,184,.08), transparent 70%); }
#kg-root .kg-svg-el { width: 100%; height: 100%; min-height: 32rem; }
#kg-root .kg-label { font: 11px system-ui,sans-serif; fill: currentColor; pointer-events: none; }
#kg-root .kg-node { cursor: pointer; }
#kg-root .kg-node.kg-dim, #kg-root .kg-edge.kg-dim { opacity: .12; }
#kg-root .kg-edge-hi { stroke: #f59e0b; stroke-width: 2.5; }
#kg-root .kg-node.kg-selected circle { stroke: #f59e0b; stroke-width: 3; }
#kg-root .kg-panel { padding: 1rem; border-left: 1px solid rgba(148,163,184,.35); background: rgba(148,163,184,.04); }
#kg-root .kg-panel-title { margin: 0 0 .5rem; font-size: 1.1rem; font-weight: 700; }
#kg-root .kg-panel-type, #kg-root .kg-panel-date, #kg-root .kg-panel-sub { font-size: .85rem; color: #64748b; }
#kg-root .kg-panel-rel { padding-left: 1rem; font-size: .9rem; }
#kg-root .kg-leg { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; }
#kg-root .kg-leg-dot { width: .55rem; height: .55rem; border-radius: 50%; }
@media (max-width: 760px) { #kg-root .kg-stage { grid-template-columns: 1fr; } #kg-root .kg-panel { border-top: 1px solid rgba(148,163,184,.35); border-left: 0; } }
7 changes: 7 additions & 0 deletions content/archives/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Архив публикаций
description: Все публикации блога по годам.
layout: archives
---

Все статьи и заметки, собранные по годам.
2 changes: 1 addition & 1 deletion content/awesome/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Awesome
title: Подборки
description: "Курируемые awesome-списки из внешних репозиториев, сгруппированные по темам."
layout: awesome
# menu defined in config/_default/menus.ru.toml to avoid duplicate
Expand Down
6 changes: 6 additions & 0 deletions content/categories/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Категории
description: Тематические разделы публикаций.
---

Публикации сгруппированы по основным областям интереса.
18 changes: 18 additions & 0 deletions content/community/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Сообщество
description: Где следить за проектами, обсуждать материалы и связываться с автором.
---

Открытые проекты и публикации живут в GitHub. Вопросы и предложения можно оставить в обсуждениях репозитория сайта; для личной связи доступны Telegram и LinkedIn.

## Участвовать

- [Обсуждения сайта на GitHub](https://github.com/dominicusin/dominicusin.github.io/discussions) — идеи, вопросы и предложения по материалам.
- [Задачи и ошибки](https://github.com/dominicusin/dominicusin.github.io/issues) — сообщить о проблеме или предложить улучшение.
- [Репозитории проектов](/repositories/) — код, документация и открытые проекты.
- [Подборки](/awesome/) — рекомендованные инструменты и ресурсы.

## Связаться

- [Telegram](https://t.me/dominicusin)
- [LinkedIn](https://www.linkedin.com/in/dominicusin)
6 changes: 6 additions & 0 deletions content/gists/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Гисты
description: Короткие скрипты, заметки и фрагменты кода автора на GitHub Gist.
---

Кодовые фрагменты и заметки, отсортированные по дате обновления.
13 changes: 8 additions & 5 deletions content/knowledge-graph/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Knowledge Graph
title: Граф знаний
date: '2025-12-29T20:01:00.000Z'
slug: knowledge-graph
image: /images/og-default.png
Expand All @@ -9,7 +9,7 @@ alt: "Knowledge Graph"
Интерактивная карта взаимосвязей между постами, концепциями, людьми и проектами.
Визуализирует семантические связи по тегам, категориям и датам.

<div id="knowledge-graph-svg" class="mt-8">
<div id="kg-root" class="mt-8" aria-live="polite">
<!-- D3.js visualization loads here via JS -->
<noscript>
<p class="mb-4">Визуализация графа требует JavaScript. Вот текстовая версия связей:</p>
Expand All @@ -23,6 +23,9 @@ alt: "Knowledge Graph"
</noscript>
</div>

<script defer src="/js/d3.v7.min.js"></script>
<script defer src="/js/knowledge-graph.js"></script>

## Как работает

Данный раздел генерируется из реестра тегов и категорий. Каждый узел — это пост,
Expand All @@ -31,6 +34,6 @@ alt: "Knowledge Graph"

## Статистика

- **{{ len .Site.Pages }}** страниц в блоге
- **{{ len .Site.Tags }}** уникальных тегов
- **{{ len .Site.Categories }}** уникальных категорий
- **{{ len (where .Site.RegularPages "Section" "blog") }}** публикаций в блоге
- **{{ len .Site.Taxonomies.tags }}** уникальных тегов
- **{{ len .Site.Taxonomies.categories }}** уникальных категорий
7 changes: 7 additions & 0 deletions content/ontology/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Онтология сайта
description: "Тематическая модель сайта: категории, теги, статьи, GitHub-репозитории и гисты."
layout: ontology
---

Онтология связывает публикации с темами, а темы — с проектами и кодом. Она строится из таксономии сайта и публичных данных GitHub.
6 changes: 6 additions & 0 deletions content/people/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Люди
description: Авторы и участники, связанные с публикациями и проектами сайта.
---

Здесь собраны авторы и участники, чьи профили используются в материалах сайта.
6 changes: 6 additions & 0 deletions content/repositories/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Репозитории
description: Публичные проекты автора и связанных организаций на GitHub.
---

Каталог публичных репозиториев. Откройте карточку, чтобы посмотреть описание проекта, или перейдите прямо к исходному коду на GitHub.
6 changes: 6 additions & 0 deletions content/tags/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Теги
description: Темы, технологии и ключевые понятия публикаций.
---

Теги помогают найти материалы по конкретной теме или технологии.
33 changes: 33 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,38 @@ <h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ end }}
{{ end }}

{{/* GitHub indexes use their source names instead of Hugo's page title. */}}
{{ if eq .Section "repositories" }}
<section class="grid w-full gap-4 sm:grid-cols-2 lg:grid-cols-3">
{{ range (.Paginate (.Pages.ByTitle)).Pages }}
{{ $name := .Params.repo_name | default .LinkTitle | default .Title }}
<article class="rounded-xl border border-neutral-200 bg-white p-5 shadow-sm dark:border-neutral-700 dark:bg-neutral-800">
<h2 class="mt-0 text-xl font-bold"><a href="{{ .RelPermalink }}">{{ $name }}</a></h2>
{{ with .Params.description }}<p class="mt-2 text-sm text-neutral-600 dark:text-neutral-300">{{ . | plainify | htmlEscape }}</p>{{ end }}
<div class="mt-4 flex flex-wrap gap-3 text-sm">
<a href="{{ .Params.repo_url }}" target="_blank" rel="noopener noreferrer">GitHub ↗</a>
{{ with .Params.language }}<span>{{ . }}</span>{{ end }}
{{ with .Params.stars }}<span>★ {{ . }}</span>{{ end }}
</div>
</article>
{{ end }}
</section>
{{ else if eq .Section "gists" }}
<section class="grid w-full gap-4 sm:grid-cols-2 lg:grid-cols-3">
{{ range (.Paginate ((.Pages.ByParam "updated_at").Reverse)).Pages }}
{{ $name := .Params.description | default .Title }}
{{ if eq $name .Params.gist_id }}{{ $name = .Params.gist_name | default $name }}{{ end }}
<article class="rounded-xl border border-neutral-200 bg-white p-5 shadow-sm dark:border-neutral-700 dark:bg-neutral-800">
<h2 class="mt-0 text-xl font-bold"><a href="{{ .RelPermalink }}">{{ $name | plainify | htmlEscape }}</a></h2>
{{ with .Params.updated_at }}<p class="mt-2 text-sm text-neutral-500">Обновлён {{ (time .).Format "02.01.2006" }}</p>{{ end }}
<div class="mt-4 flex flex-wrap gap-3 text-sm">
<a href="{{ .Params.gist_url }}" target="_blank" rel="noopener noreferrer">Открыть gist ↗</a>
{{ with .Params.files }}<span>{{ len . }} файлов</span>{{ end }}
</div>
</article>
{{ end }}
</section>
{{ else }}
{{/* Articles grid */}}
{{ if gt .Pages 0 }}
{{ $cardView := .Params.cardView | default (site.Params.list.cardView | default false) }}
Expand Down Expand Up @@ -112,6 +144,7 @@ <h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutra
</p>
</section>
{{ end }}
{{ end }}

{{/* Pagination */}}
{{ partial "pagination.html" . }}
Expand Down
140 changes: 140 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "single" }}
{{ $showReadingProgress := site.Params.article.showReadingProgress | default false }}
{{ if isset .Params "showreadingprogress" }}
{{ $showReadingProgress = .Params.showReadingProgress }}
{{ end }}
{{ if $showReadingProgress }}
{{ partial "reading-progress.html" . }}
{{ end }}
<article>
{{/* Hero */}}
{{ if .Params.showHero | default (site.Params.article.showHero | default false) }}
{{ $heroStyle := .Params.heroStyle }}
{{ if not $heroStyle }}{{ $heroStyle = site.Params.article.heroStyle }}{{ end }}
{{ $heroStyle := print "hero/" $heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{ end }}

{{/* Header */}}
<header id="single_header" class="mt-5 max-w-prose">
{{ if .Params.showBreadcrumbs | default (site.Params.article.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ .Title | emojify }}
</h1>
{{ partial "article-taxonomies/categories.html" . }}
<div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }}
</div>
{{ if not (.Params.showAuthorBottom | default (site.Params.article.showAuthorBottom | default false)) }}
{{ template "SingleAuthor" . }}
{{ end }}
</header>

{{/* Body */}}
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
{{ $enableToc := site.Params.article.showTableOfContents | default false }}
{{ $enableToc = .Params.showTableOfContents | default $enableToc }}
{{ $showToc := and $enableToc (in .TableOfContents "<ul") }}
{{ $topClass := cond (or (hasPrefix site.Params.header.layout "fixed") (eq site.Params.header.layout "floating")) "lg:top-[140px]" "lg:top-10" }}
{{ if $showToc }}
<div class="order-first lg:ms-auto px-0 lg:order-last lg:ps-8 lg:max-w-2xs">
<div class="toc ps-5 print:hidden lg:sticky {{ $topClass }}">
{{ partial "toc.html" . }}
</div>
</div>
{{ end }}


<div class="min-w-0 min-h-0 max-w-fit">
{{ partial "series/series.html" . }}
<div class="article-content max-w-prose mb-20">
{{ .Content }}
{{ $defaultReplyByEmail := site.Params.replyByEmail }}
{{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }}
{{ if $replyByEmail }}
{{ $replySubject := i18n "article.reply_to" (dict "Title" .Title) | default (printf "Reply to %s" .Title) }}
<strong class="block mt-8">
<a
class="email-link m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
href="#"
data-email="{{ site.Params.Author.email | base64Encode }}"
data-subject="{{ replace $replySubject "\"" "'" }}">
{{ i18n "article.reply_by_email" | default "Reply by Email" }}
</a>
<noscript>
<span
class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300">
{{ i18n "article.reply_by_email" | default "Reply by Email" }} (require JavaScript)
</span>
</noscript>
</strong>
{{ end }}
</div>
{{ if (.Params.showAuthorBottom | default (site.Params.article.showAuthorBottom | default false)) }}
{{ template "SingleAuthor" . }}
{{ end }}
{{ partial "series/series-closed.html" . }}
{{ partial "sharing-links.html" . }}
{{ partial "related.html" . }}
</div>
</section>

{{/* Footer */}}
<footer class="pt-8 max-w-prose print:hidden">
{{ partial "article-taxonomies/tags.html" . }}
{{ partial "article-pagination.html" . }}
{{ partial "article-comments.html" . }}
</footer>
</article>
{{ end }}

{{ define "SingleAuthor" }}
{{ $authorsData := hugo.Data.authors }}
{{ $taxonomies := site.Taxonomies.authors }}
{{ $baseURL := site.BaseURL }}
{{ $taxonomyLink := 0 }}
{{ $showAuthor := 0 }}
{{ $isAuthorBottom := (.Params.showAuthorBottom | default ( site.Params.article.showAuthorBottom | default false)) }}

{{ if not (strings.HasSuffix $baseURL "/") }}
{{ $baseURL = delimit (slice $baseURL "/") "" }}
{{ end }}

{{ if .Page.Params.authors }}
{{ range $author := .Page.Params.authors }}
{{ $authorData := index $authorsData $author }}
{{- if $authorData -}}
{{ range $taxonomyname, $taxonomy := $taxonomies }}
{{ if (eq $taxonomyname $author) }}
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }}
{{ end }}
{{ end }}

{{ $finalLink := $taxonomyLink }}
{{ $currentLang := site.Language.Name }}
{{ if eq site.LanguagePrefix "" }}
{{ $finalLink = printf "%sauthors/%s/" $baseURL $author }}
{{ else }}
{{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }}
{{ end }}
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }}
{{- end -}}
{{ end }}
{{ else }}
{{ if .Params.showAuthor | default (site.Params.article.showAuthor | default true) }}
{{ $showAuthor = 1 }}
{{ partial "author.html" . }}
{{ end }}
{{ end }}

{{ if or $taxonomyLink $showAuthor }}
<div class="{{ cond $isAuthorBottom "mb-10" "mb-5" }}"></div>
{{ end }}
{{ end }}
20 changes: 20 additions & 0 deletions layouts/archives/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ define "main" }}
<header class="mb-10">
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="prose mt-4 dark:prose-invert">{{ .Content }}</div>
</header>
{{ $posts := where site.RegularPages "Section" "blog" }}
{{ range $posts.GroupByDate "2006" }}
<section class="mb-12">
<h2 class="mb-5 border-b border-neutral-200 pb-2 text-2xl font-bold dark:border-neutral-700">{{ .Key }} <span class="text-base font-normal text-neutral-500">{{ len .Pages }}</span></h2>
<ol class="space-y-3">
{{ range .Pages }}
<li class="flex flex-wrap items-baseline gap-x-4 gap-y-1">
<time class="min-w-24 text-sm text-neutral-500" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02 Jan" }}</time>
<a class="font-medium hover:text-primary-600" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
8 </ol>
</section>
{{ end }}
{{ end }}
6 changes: 6 additions & 0 deletions layouts/community/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ define "main" }}
<header class="mb-8 max-w-prose">
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="prose mt-4 dark:prose-invert">{{ .Content }}</div>
</header>
{{ end }}
11 changes: 11 additions & 0 deletions layouts/ontology/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ define "main" }}
<header class="mb-8 max-w-prose">
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="prose mt-4 dark:prose-invert">{{ .Content }}</div>
</header>
<div id="ontology-root" class="space-y-8" aria-live="polite">
<p class="text-neutral-500">Загружаю тематический указатель…</p>
<noscript><p>Включите JavaScript, чтобы открыть категории и связанные с ними темы.</p></noscript>
</div>
<script defer src="/js/ontology.js"></script>
{{ end }}
Loading
Loading
0