refactor(layout): refactor single page layout and partials categorization

This commit is contained in:
Cell
2026-03-25 15:45:32 +08:00
parent 7338930c9f
commit cfa9bef6ac
55 changed files with 566 additions and 430 deletions
+22 -15
View File
@@ -3,7 +3,6 @@
font-size: 0.75rem;
background-color: fixit-var(global-background-color);
display: flex;
gap: 0.5rem;
@include z-index(sticky);
&:has(~ main[data-reverse]) {
@@ -23,40 +22,48 @@
&.sticky {
position: sticky;
top: fixit-var(header-height);
top: 0px;
transition: top 0.5s ease;
@include media('sm', 'up') {
body:not([data-header-desktop='sticky']) & {
top: 0;
[data-header-desktop='sticky'] &,
[data-header-desktop='auto'] & {
top: fixit-var(header-height);
}
// adjust the scroll margin top of the content anchors on the page
body:not([data-header-desktop='auto']) &+.fi-container .content [id] {
scroll-margin-top: calc(#{fixit-var(scroll-mt)} + #{fixit-var(breadcrumb-height)});
[data-header-desktop='auto']:has(#header-desktop.animate__fadeOutUp) & {
top: 0px;
}
}
@include media('xs') {
body:not([data-header-mobile='sticky']) & {
top: 0;
[data-header-mobile='sticky'] &,
[data-header-mobile='auto'] & {
top: fixit-var(header-height);
}
// adjust the scroll margin top of the content anchors on the page
body:not([data-header-mobile='auto']) &+.fi-container .content [id] {
scroll-margin-top: calc(#{fixit-var(scroll-mt)} + #{fixit-var(breadcrumb-height)});
[data-header-mobile='auto']:has(#header-mobile.animate__fadeOutUp) & {
top: 0px;
}
}
@include media('reduce-motion') {
transition: none;
}
}
.breadcrumb {
display: flex;
flex-wrap: wrap;
padding: 0.5rem 0;
flex-wrap: nowrap;
padding: 0.5rem;
margin: 0 auto;
list-style: none;
border-bottom: 1px inset fixit-var(global-border-color);
box-shadow: inset 0 -1px 0 fixit-var(global-border-color);
overflow-x: auto;
overflow-y: hidden;
@extend %page-style;
.breadcrumb-item {
display: flex;
flex-shrink: 0;
+ .breadcrumb-item::before {
content: attr(data-separator);
+28
View File
@@ -0,0 +1,28 @@
#comments {
padding: 2rem 1rem;
display: flex;
&::before,
&::after {
content: '';
flex: 1;
padding-inline: 0.5rem;
@include media('sm', 'down') {
display: none;
}
}
.comment {
padding-inline: 0.5rem;
@extend %page-style;
iframe {
width: 100%;
}
}
@include media('print') {
display: none !important;
}
}
+14 -8
View File
@@ -27,7 +27,6 @@
align-items: flex-start;
justify-content: center;
padding-inline: 1rem;
gap: 0.5rem;
&[data-reverse] {
flex-direction: row-reverse;
@@ -53,22 +52,28 @@
}
}
// adjust breadcrumb flex when asides are empty
&:has(main > aside:first-child:empty ~ aside:not(:empty)) .breadcrumb-container {
.breadcrumb {
// when left aside is hidden: expand content and remove left spacer
&:has(main > aside:first-child:empty ~ aside:not(:empty)) {
.breadcrumb-container .breadcrumb,
#comments .comment {
flex: 3;
}
&::before {
.breadcrumb-container::before,
#comments::before {
display: none;
}
}
&:has(main > aside:first-child:not(:empty) ~ aside#toc-auto:empty) .breadcrumb-container {
.breadcrumb {
// when right aside is hidden: expand content and remove right spacer
&:has(main > aside:first-child:not(:empty) ~ aside#toc-auto:empty) {
.breadcrumb-container .breadcrumb,
#comments .comment {
flex: 3;
}
&::after {
.breadcrumb-container::after,
#comments::after {
display: none;
}
}
@@ -79,4 +84,5 @@
@import "breadcrumb";
@import "page-style";
@import "pagination";
@import "comment";
@import "footer";
+1
View File
@@ -6,5 +6,6 @@
@import 'loading';
@import 'media';
@import 'scrollbar-width';
@import 'sticky-top';
@import 'theme-vars';
@import 'z-index';
+56
View File
@@ -0,0 +1,56 @@
/// Apply the shared sticky top offset used by TOC, collections, and code headers.
///
/// @param {boolean} $transition - Whether to include the transition for top changes (default: true).
///
/// Top offset rules:
/// - Base: keep space for the breadcrumb bar when no sticky header override applies.
/// - Desktop auto: offset by header height while the header is visible.
/// - Desktop auto hidden: reset to 0 when the auto header has faded out.
/// - Desktop/mobile sticky: offset by header height plus breadcrumb height.
@mixin sticky-top-offset($transition: true) {
$sticky-top-bar-offset: calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height, 0px)});
$base-top-offset: fixit-var(breadcrumb-height, 0px);
// Base offset reserved for the breadcrumb bar.
top: $base-top-offset;
@include media('sm', 'up') {
[data-header-desktop='sticky'] &,
[data-header-desktop='auto'] & {
// Sticky or auto desktop header uses the same combined header and breadcrumb offset.
top: $sticky-top-bar-offset;
}
[data-header-desktop='auto']:has(#header-desktop.animate__fadeOutUp) & {
// Once the auto header is hidden, remove the extra top offset.
top: $base-top-offset;
}
}
@include media('xs') {
[data-header-mobile='sticky'] &,
[data-header-mobile='auto'] & {
// Sticky or auto mobile header uses the same combined header and breadcrumb offset.
top: $sticky-top-bar-offset;
}
[data-header-mobile='auto']:has(#header-mobile.animate__fadeOutUp) & {
// Once the auto header is hidden, remove the extra top offset.
top: $base-top-offset;
}
}
[data-header-mobile='sticky'] & {
@include media('xs') {
// Sticky mobile header uses the same combined header and breadcrumb offset.
top: $sticky-top-bar-offset;
}
}
@if $transition {
transition: top 0.5s ease;
@include media('reduce-motion') {
transition: none;
}
}
}
+4 -3
View File
@@ -26,7 +26,6 @@
global-font-size: $global-font-size,
global-font-weight: $global-font-weight,
global-line-height: $global-line-height,
global-scroll-margin-top: $global-scroll-margin-top,
global-border-radius: $global-border-radius,
// Header
@@ -59,10 +58,12 @@
bezier: cubic-bezier(.4, 0, .2, 1),
// Other utilities
breadcrumb-height: 0px,
divider-edge-weak: linear-gradient(to right, transparent, fixit-var(divider-bg, #d0d0d5), transparent),
scroll-mt: calc(#{fixit-var(header-height)} + #{fixit-var(global-scroll-margin-top)}),
));
&:has(.breadcrumb-container.sticky) {
@include set-fixit-var(breadcrumb-height, 2.5rem);
}
}
// ----------------------------------------
+20 -7
View File
@@ -1,20 +1,33 @@
.page {
position: relative;
padding-inline: 0.5rem;
@extend %page-style;
.content {
[id] {
scroll-margin-top: fixit-var(scroll-mt);
scroll-margin-top: fixit-var(scroll-margin-top, 0.5rem);
[data-header-desktop='normal'] & {
@include media('xs', 'up') {
@include set-fixit-var(scroll-mt, fixit-var(global-scroll-margin-top));
@include media('sm', 'up') {
[data-header-desktop='sticky'] &,
[data-header-desktop='auto'] & {
@include set-fixit-var(scroll-margin-top, calc(#{fixit-var(header-height)} + 0.5rem));
}
[data-header-desktop='sticky']:has(.breadcrumb-container.sticky) &,
[data-header-desktop='auto']:has(.breadcrumb-container.sticky) & {
@include set-fixit-var(scroll-margin-top, calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height, 0px)} + 0.5rem));
}
}
[data-header-mobile='normal'] & {
@include media('xs') {
@include set-fixit-var(scroll-mt, fixit-var(global-scroll-margin-top));
@include media('xs') {
[data-header-mobile='sticky'] &,
[data-header-mobile='auto'] & {
@include set-fixit-var(scroll-margin-top, calc(#{fixit-var(header-height)} + 0.5rem));
}
[data-header-mobile='sticky']:has(.breadcrumb-container.sticky) &,
[data-header-mobile='auto']:has(.breadcrumb-container.sticky) & {
@include set-fixit-var(scroll-margin-top, calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height, 0px)} + 0.5rem));
}
}
}
+9 -29
View File
@@ -159,6 +159,10 @@ pre {
line-start: attr(data-line-start number, 1),
line-digit: attr(data-line-digit number, 1),
));
@include media('reduce-motion') {
transition: none;
}
}
// code preview
@@ -183,11 +187,11 @@ pre {
color: fixit-var(code-header-color);
background-color: fixit-var(code-header-background-color);
position: sticky;
top: fixit-var(breadcrumb-height);
transition: border-radius 0s;
cursor: pointer;
@include z-index(base);
@include z-index(base, 1);
@include border-radius(top);
@include sticky-top-offset;
+ .code-wrapper {
@include border-radius(bottom);
@@ -226,7 +230,7 @@ pre {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include z-index(base, 1);
@include z-index(base, 2);
}
}
@@ -268,18 +272,6 @@ pre {
}
}
[data-header-desktop='sticky'] & {
@include media('sm', 'up') {
top: calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height)});
}
}
[data-header-mobile='sticky'] & {
@include media('xs') {
top: calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height)});
}
}
@include media('print') {
top: initial !important;
}
@@ -618,9 +610,9 @@ pre {
color: fixit-var(code-header-color);
background-color: fixit-var(code-header-background-color);
position: sticky;
top: fixit-var(breadcrumb-height);
@include z-index(base);
@include z-index(base, 1);
@include border-radius(top);
@include sticky-top-offset;
.tabs-items {
display: flex;
@@ -698,18 +690,6 @@ pre {
}
}
[data-header-desktop='sticky'] & {
@include media('sm', 'up') {
top: calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height)});
}
}
[data-header-mobile='sticky'] & {
@include media('xs') {
top: calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height)});
}
}
@include media('print') {
top: initial !important;
}
+2 -1
View File
@@ -89,10 +89,11 @@
// Collection aside container
.aside-collection {
position: sticky;
top: calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height)});
box-sizing: border-box;
margin-bottom: 8rem;
@include overflow-wrap(break-word);
@include blur;
@include sticky-top-offset;
@include media('print') {
display: none !important;
-11
View File
@@ -1,11 +0,0 @@
> #comments {
padding: 2rem 0;
iframe {
width: 100%;
}
@include media('print') {
display: none !important;
}
}
+1 -1
View File
@@ -543,7 +543,7 @@
@import 'diagram-copy-btn';
@import 'reward';
@import 'footer';
@import 'comment';
// @import 'comment';
}
.lg-toolbar .lg-icon::after {
+2 -5
View File
@@ -89,15 +89,12 @@
#toc-auto {
display: block;
position: sticky;
top: calc(#{fixit-var(header-height)} + #{fixit-var(breadcrumb-height)});
box-sizing: border-box;
visibility: hidden;
margin-bottom: 8rem;
@include overflow-wrap(break-word);
@include blur;
[data-header-desktop='normal'] & {
@include set-fixit-var(scroll-mt, fixit-var(global-scroll-margin-top));
}
@include sticky-top-offset;
.toc-title {
margin-block: 0 0.5em;
-3
View File
@@ -14,9 +14,6 @@ $global-font-size: 16px !default;
$global-font-weight: 400 !default;
$global-line-height: 1.5rem !default;
// scroll-margin-top of content anchor
$global-scroll-margin-top: 0.5rem !default;
// Radius of the border
$global-border-radius: 5px !default;
+4 -16
View File
@@ -399,14 +399,6 @@ class FixIt {
initAutosearch();
}
initBreadcrumb() {
const $breadcrumbContainer = document.querySelector('.breadcrumb-container.sticky')
this.breadcrumbHeight = $breadcrumbContainer?.clientHeight ?? 0;
if (this.breadcrumbHeight) {
document.querySelector('main.fi-container')?.style.setProperty('--fi-breadcrumb-height', `${this.breadcrumbHeight}px`);
}
}
initDetails(target = document) {
forEach(target.querySelectorAll('.details:not(.disabled)'), ($details) => {
const $summary = $details.querySelector('.details-summary');
@@ -860,14 +852,11 @@ class FixIt {
const $toc = document.getElementById('toc-auto');
$toc.style.visibility = 'visible';
animateCSS($toc, ['animate__fadeIn', 'animate__faster'], true);
const $postMeta = document.querySelector('.post-meta');
$toc.style.marginTop = `${$postMeta.offsetTop + $postMeta.clientHeight}px`;
document.querySelector('.fi-container').addEventListener('resize', () => {
$toc.style.marginBottom = `${document.querySelector('.fi-container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;
});
// document.querySelector('.fi-container').addEventListener('resize', () => {
// $toc.style.marginBottom = `${document.querySelector('.fi-container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;
// });
this._tocOnScroll = this._tocOnScroll || (() => {
$toc.style.marginBottom = `${document.querySelector('.fi-container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;
// $toc.style.marginBottom = `${document.querySelector('.fi-container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;
this._updateTocActiveState($tocCore, $headingElements, INDEX_OFFSET);
});
this._tocOnScroll();
@@ -1694,7 +1683,6 @@ class FixIt {
this.initMenu();
this.initSwitchTheme();
this.initSearch();
this.initBreadcrumb();
this.initCookieconsent();
this.initSiteTime();
this.initServiceWorker();
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Hugo-Version ist zu niedrig.\n\nAktuelle Hugo-Version ist {{ .Current }}, die minimal unterstützte Version für FixIt ist {{ .Minimal }}.\n\nWenn Sie Hugo auf Ihrem eigenen Computer ausführen, schauen Sie sich https://gohugo.io/getting-started/installing/#upgrade-hugo für eine Upgrade-Anleitung an.\n\nWenn Sie auf einer Drittanbieterplattform bereitstellen, konfigurieren Sie bitte die Hugo-Version entsprechend."
hugoExtendedWarn = "Die Hugo Extended-Version ist für die Unterstützung von SCSS erforderlich."
configurationError = "Konfigurationsfehler\nSie haben den FixIt-Versionsparameter noch nicht korrekt konfiguriert. Siehe https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Kompatibilitätsfehler ({{ .From }} -> {{ .To }}):\nSie haben ein inkompatibles Update. Siehe https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Sie verwenden eine Entwicklungsversion von FixIt. Bitte erwägen Sie die Verwendung einer stabilen Version.\nSiehe https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -3,6 +3,8 @@
# === init ===
[init]
hugoVersionError = "Hugo version is too low.\n\nCurrent Hugo version is {{ .Current }}, the minimum supported version for FixIt is {{ .Minimal }}.\n\nIf you are running Hugo on your own computer, check out https://gohugo.io/getting-started/installing/#upgrade-hugo for upgrading guide.\n\nIf you are deploying on a third-party platform, please configure Hugo version accordingly."
hugoExtendedWarn = "The Hugo Extended version is necessary for SCSS support."
configurationError = "Configuration Error\nYou haven't configured the FixIt version param correctly yet. See https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Compatibility Error ({{ .From }} -> {{ .To }}):\nYou have an incompatible update. See https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "You are using a development version of FixIt. Please consider using a stable version.\nSee https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Hugo versión es demasiado baja.\n\nLa versión actual de Hugo es {{ .Current }}, la versión mínima compatible para FixIt es {{ .Minimal }}.\n\nSi estás ejecutando Hugo en tu propia computadora, consulta https://gohugo.io/getting-started/installing/#upgrade-hugo para obtener una guía de actualización.\n\nSi estás desplegando en una plataforma de terceros, por favor configura la versión de Hugo en consecuencia."
hugoExtendedWarn = "La versión extendida de Hugo es necesaria para el soporte de SCSS."
configurationError = "Error de configuración\nAún no ha configurado correctamente el parámetro de versión de FixIt. Consulte https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Error de compatibilidad ({{ .From }} -> {{ .To }}):\nTiene una actualización incompatible. Consulte https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Está utilizando una versión de desarrollo de FixIt. Considere usar una versión estable.\nConsulte https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "La version de Hugo est trop ancienne.\n\nLa version actuelle de Hugo est {{ .Current }}, la version minimale requise pour FixIt est {{ .Minimal }}.\n\nSi vous utilisez Hugo sur votre ordinateur, consultez le guide de mise à niveau à l'adresse https://gohugo.io/getting-started/installing/#upgrade-hugo.\n\nSi vous déployez sur une plateforme tierce, veuillez configurer la version de Hugo en conséquence."
hugoExtendedWarn = "La version étendue de Hugo est nécessaire pour la prise en charge de SCSS."
configurationError = "Erreur de configuration\nVous n'avez pas configuré la version de FixIt correctement. Voir https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Erreur de compatibilité ({{ .From }} -> {{ .To }}):\nVous avez une mise à jour incompatible. Voir https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Vous utilisez une version de développement de FixIt. Veuillez considérer l'utilisation d'une version stable.\nVoir https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Hugo संस्करण बहुत पुराना है।\n\nवर्तमान में उपयोग किया जा रहा Hugo संस्करण {{ .Current }} है, जबकि FixIt के लिए न्यूनतम आवश्यक संस्करण {{ .Minimal }} है।\n\nयदि आप अपने कंप्यूटर पर Hugo का उपयोग कर रहे हैं, तो कृपया अपग्रेड गाइड देखें: https://gohugo.io/getting-started/installing/#upgrade-hugo\n\nयदि आप किसी तृतीय-पक्ष प्लेटफ़ॉर्म पर तैनात कर रहे हैं, तो कृपया Hugo संस्करण को तदनुसार कॉन्फ़िगर करें। "
hugoExtendedWarn = "SCSS समर्थन के लिए Hugo Extended संस्करण आवश्यक है।"
configurationError = "कन्फ़िग्यरेशन त्रुटि \nआपने फिक्सइट संस्करण पैरामीटर को सही ढंग से कॉन्फ़िगर नहीं किया है।. यह देखें: https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "संगतता त्रुटि ({{ .From }} -> {{ .To }}):\nआपके पास एक असंगत अपडेट है. यह देखें: https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "आप फिक्सइट के डिवेलपर संस्करण का उपयोग कर रहे हैं। कृपया एक स्थिर संस्करण का उपयोग करने पर विचार करें।\nयह देखें: https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "La versione di Hugo è troppo bassa.\n\nLa versione attuale di Hugo è {{ .Current }}, la versione minima supportata per FixIt è {{ .Minimal }}.\n\nSe stai eseguendo Hugo sul tuo computer, consulta https://gohugo.io/getting-started/installing/#upgrade-hugo per la guida all'aggiornamento.\n\nSe stai distribuendo su una piattaforma di terze parti, configura la versione di Hugo di conseguenza."
hugoExtendedWarn = "La versione Hugo Extended è necessaria per il supporto SCSS."
configurationError = "Errore di configurazione\nNon hai ancora configurato correttamente il parametro della versione di FixIt. Vedi https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Errore di compatibilità ({{ .From }} -> {{ .To }}):\nHai un aggiornamento incompatibile. Vedi https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Stai utilizzando una versione di sviluppo di FixIt. Si prega di considerare l'utilizzo di una versione stabile.\nVedi https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Hugo のバージョンが低すぎます。\n\n現在の Hugo バージョンは {{ .Current }} ですが、FixIt がサポートする最小バージョンは {{ .Minimal }} です。\n\n自分のコンピューターで Hugo を実行している場合は、https://gohugo.io/getting-started/installing/#upgrade-hugo でアップグレードガイドを参照してください。\n\nサードパーティプラットフォームにデプロイしている場合は、Hugo バージョンを適切に設定してください。"
hugoExtendedWarn = "SCSS サポートには Hugo Extended バージョンが必要です。"
configurationError = "設定ファイルエラー\nまだ FixIt のバージョンパラメータを正しく設定していません。 https://fixit.lruihao.cn/zh-cn/documentation/basics/#theme-configuration を参照してください"
compatibilityError = "互換性エラー ({{ .From }} -> {{ .To }}):\n互換性のない更新が行われました。 https://github.com/hugo-fixit/FixIt/releases を参照してください"
devVersionWarn = "開発版の FixIt を使用しています。安定版の使用を検討してください。\n https://github.com/hugo-fixit/FixIt/releases を参照"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Hugo 버전이 너무 낮습니다.\n\n현재 Hugo 버전은 {{ .Current }}이며, FixIt의 최소 지원 버전은 {{ .Minimal }}입니다.\n\n자신의 컴퓨터에서 Hugo를 실행 중이라면 https://gohugo.io/getting-started/installing/#upgrade-hugo에서 업그레이드 가이드를 확인하세요.\n\n타사 플랫폼에 배포 중이라면 Hugo 버전을 적절히 설정해 주세요."
hugoExtendedWarn = "SCSS 지원을 위해 Hugo Extended 버전이 필요합니다."
configurationError = "구성 파일 오류\n아직 FixIt의 버전 매개변수를 올바르게 구성하지 않았습니다. https://fixit.lruihao.cn/ko/documentation/basics/#theme-configuration을 참조하세요."
compatibilityError = "호환성 오류 ({{ .From }} -> {{ .To }}):\n비호환 업데이트를 수행했습니다. https://github.com/hugo-fixit/FixIt/releases를 참조하세요."
devVersionWarn = "현재 개발 버전의 FixIt을 사용 중입니다. 안정적인 버전을 사용하는 것이 좋습니다.\n자세한 내용은 https://github.com/hugo-fixit/FixIt/releases를 참조하세요."
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Wersja Hugo jest zbyt niska.\n\nAktualna wersja Hugo to {{ .Current }}, minimalna obsługiwana wersja dla FixIt to {{ .Minimal }}.\n\nJeśli uruchamiasz Hugo na własnym komputerze, zapoznaj się z przewodnikiem aktualizacji na stronie https://gohugo.io/getting-started/installing/#upgrade-hugo.\n\nJeśli wdrażasz na platformie zewnętrznej, skonfiguruj odpowiednio wersję Hugo."
hugoExtendedWarn = "Wersja Hugo Extended jest wymagana do obsługi SCSS."
configurationError = "Błąd konfiguracji\nNie skonfigurowałeś jeszcze poprawnie parametru wersji FixIt. Zobacz https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Błąd zgodności ({{ .From }} -> {{ .To }}):\nMasz niekompatybilną aktualizację. Zobacz https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Używasz wersji deweloperskiej FixIt. Proszę rozważyć użycie stabilnej wersji.\nZobacz https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "A versão do Hugo é muito baixa.\n\nA versão atual do Hugo é {{ .Current }}, a versão mínima suportada pelo FixIt é {{ .Minimal }}.\n\nSe você está executando o Hugo em seu computador, consulte https://gohugo.io/getting-started/installing/#upgrade-hugo para obter um guia de atualização.\n\nSe você está implantando em uma plataforma de terceiros, configure a versão do Hugo adequadamente."
hugoExtendedWarn = "A versão Hugo Extended é necessária para o suporte a SCSS."
configurationError = "Erro de configuração\nVocê ainda não configurou o parâmetro da versão do FixIt corretamente. Consulte https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Erro de compatibilidade ({{ .From }} -> {{ .To }}):\nVocê tem uma atualização incompatível. Consulte https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Você está usando a versão de desenvolvedor do FixIt. Por favor, use uma versão estável. \nConsulte https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Versiunea Hugo este prea veche.\n\nVersiunea curentă Hugo este {{ .Current }}, versiunea minimă compatibilă cu FixIt este {{ .Minimal }}.\n\nDacă rulați Hugo pe propriul computer, consultați https://gohugo.io/getting-started/installing/#upgrade-hugo pentru ghidul de actualizare.\n\nDacă implementați pe o platformă terță, configurați versiunea Hugo corespunzător."
hugoExtendedWarn = "Versiunea Hugo Extended este necesară pentru suportul SCSS."
configurationError = "Eroare de configurare\nNu ați configurat corect parametrul versiunii FixIt. Consultați https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Eroare de compatibilitate ({{ .From }} -> {{ .To }}):\nAveți o actualizare incompatibilă. Consultați https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Utilizați o versiune de dezvoltare a FixIt. Vă rugăm să luați în considerare utilizarea unei versiuni stabile.\nConsultați https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Версия Hugo слишком низкая.\n\nТекущая версия Hugo — {{ .Current }}, минимальная поддерживаемая версия для FixIt — {{ .Minimal }}.\n\nЕсли вы запускаете Hugo на своём компьютере, ознакомьтесь с руководством по обновлению по адресу https://gohugo.io/getting-started/installing/#upgrade-hugo.\n\nЕсли вы развёртываете на сторонней платформе, настройте версию Hugo соответствующим образом."
hugoExtendedWarn = "Для поддержки SCSS необходима версия Hugo Extended."
configurationError = "Ошибка конфигурации\nВы еще не настроили параметр версии FixIt правильно. См. https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Ошибка совместимости ({{ .From }} -> {{ .To }}):\nУ вас есть несовместимое обновление. См. https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Вы используете версию разработки FixIt. Пожалуйста, рассмотрите возможность использования стабильной версии.\nСм. https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -4,6 +4,8 @@
# === init ===
[init]
hugoVersionError = "Верзија Hugo-а је прениска.\n\nТренутна верзија Hugo-а је {{ .Current }}, а минимална подржана верзија за FixIt је {{ .Minimal }}.\n\nАко покрећете Hugo на свом рачунару, погледајте https://gohugo.io/getting-started/installing/#upgrade-hugo за водич за надоградњу.\n\nАко постављате на платформу треће стране, конфигуришите верзију Hugo-а у складу с тим."
hugoExtendedWarn = "Верзија Hugo Extended је неопходна за подршку SCSS-а."
configurationError = "Грешка у конфигурацији\nНисте правилно конфигурисали параметар верзије FixIt. Погледајте https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Грешка у компатибилности ({{ .From }} -> {{ .To }}):\nИмате некомпатибилно ажурирање. Погледајте https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Користите развојну верзију FixIt. Размотрите коришћење стабилне верзије.\nПогледајте https://github.com/hugo-fixit/FixIt/releases"
+2
View File
@@ -3,6 +3,8 @@
# === init ===
[init]
hugoVersionError = "Phiên bản Hugo quá thấp.\n\nPhiên bản Hugo hiện tại là {{ .Current }}, phiên bản tối thiểu được hỗ trợ cho FixIt là {{ .Minimal }}.\n\nNếu bạn đang chạy Hugo trên máy tính của mình, hãy xem https://gohugo.io/getting-started/installing/#upgrade-hugo để biết hướng dẫn nâng cấp.\n\nNếu bạn đang triển khai trên nền tảng của bên thứ ba, vui lòng cấu hình phiên bản Hugo cho phù hợp."
hugoExtendedWarn = "Phiên bản Hugo Extended là cần thiết để hỗ trợ SCSS."
configurationError = "Lỗi cấu hình\nBạn chưa cấu hình tham số phiên bản FixIt đúng cách. Xem https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
compatibilityError = "Lỗi tương thích ({{ .From }} -> {{ .To }}):\nBạn có một bản cập nhật không tương thích. Xem https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "Bạn đang sử dụng một phiên bản phát triển của FixIt. Vui lòng xem xét sử dụng một phiên bản ổn định.\nXem https://github.com/hugo-fixit/FixIt/releases"
+8 -6
View File
@@ -4,9 +4,11 @@
# === init ===
[init]
configurationError = "配置文件错误\n您还没有正确配置 FixIt 的版本参数。参考 https://fixit.lruihao.cn/zh-cn/documentation/basics/#theme-configuration"
compatibilityError = "兼容性错误 ({{ .From }} -> {{ .To }}):\n您进行了一次不兼容的更新。参考 https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "您正在使用开发版的 FixIt,请考虑使用稳定版。\n见 https://github.com/hugo-fixit/FixIt/releases"
hugoVersionError = "Hugo 版本过低。\n\n目前使用的 Hugo 版本为 {{ .Current }}FixIt 支持的最低的 Hugo 版本为 {{ .Minimal }}。\n\n如果你正在自己的计算机上运行 Hugo,请访问 https://gohugo.io/getting-started/installing/#upgrade-hugo 以查阅升级指南。\n\n如果你正在第三方平台上部署,请按照相应文档配置 Hugo 版本。"
hugoExtendedWarn = "需要使用 Hugo Extended 版本来获得 SCSS 支持。"
configurationError = "配置文件错误\n你还没有正确配置 FixIt 的版本参数。参考 https://fixit.lruihao.cn/zh-cn/documentation/basics/#theme-configuration"
compatibilityError = "兼容性错误 ({{ .From }} -> {{ .To }}):\n你进行了一次不兼容的更新。参考 https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "你正在使用开发版的 FixIt,请考虑使用稳定版。\n见 https://github.com/hugo-fixit/FixIt/releases"
devEnvWarn = "当前运行环境是“development”。“评论系统”、“PWA”、“CDN”、“fingerprint”和“统计”不会启用。"
quicklyUpgrade = "使用命令快速升级:"
# === init ===
@@ -103,7 +105,7 @@ toggleCodeEditable = "切换可编辑代码块"
downloadCode = "下载代码"
toggleCodeFullscreen = "切换代码块全屏"
expandCode = "展开或折叠代码块"
cookieconsentMessage = "本网站使用 Cookies 来改善的浏览体验。"
cookieconsentMessage = "本网站使用 Cookies 来改善的浏览体验。"
cookieconsentDismiss = "同意"
cookieconsentLink = "了解更多"
# === partials/assets.html ===
@@ -166,7 +168,7 @@ bitcoin = "比特币"
other = "页面没找到"
[pageNotFoundText]
other = "抱歉,要查找的页面不存在。"
other = "抱歉,要查找的页面不存在。"
# === 404.html ===
# === offline ===
@@ -174,7 +176,7 @@ other = "抱歉,您要查找的页面不存在。"
other = "离线"
[offlineText]
other = "没有连接到 Internet,只有缓存的页面可用。"
other = "没有连接到 Internet,只有缓存的页面可用。"
# === offline ===
# === GitHub Alert ===
+8 -6
View File
@@ -4,9 +4,11 @@
# === init ===
[init]
configurationError = "配置文件錯誤\n您還沒有正確配置 FixIt 的版本參數。參考 https://fixit.lruihao.cn/zh-cn/documentation/basics/#theme-configuration"
compatibilityError = "兼容性錯誤 ({{ .From }} -> {{ .To }}):\n您進行了一次不兼容的更新。参考 https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "您正在使用開發版的 FixIt,請考慮使用穩定版。\n見 https://github.com/hugo-fixit/FixIt/releases"
hugoVersionError = "Hugo 版本過低。\n\n目前使用的 Hugo 版本為 {{ .Current }}FixIt 支持的最老的 Hugo 版本為 {{ .Minimal }}。\n\n如果你正在自己的計算機上運行 Hugo,請訪問 https://gohugo.io/getting-started/installing/#upgrade-hugo 以查閱升級指南。\n\n如果你正在第三方平台上部署,請按照相應文檔配置 Hugo 版本。"
hugoExtendedWarn = "需要使用 Hugo Extended 版本來獲得 SCSS 支持。"
configurationError = "配置文件錯誤\n你還沒有正確配置 FixIt 的版本參數。參考 https://fixit.lruihao.cn/zh-cn/documentation/basics/#theme-configuration"
compatibilityError = "兼容性錯誤 ({{ .From }} -> {{ .To }}):\n你進行了一次不兼容的更新。参考 https://github.com/hugo-fixit/FixIt/releases"
devVersionWarn = "你正在使用開發版的 FixIt,請考慮使用穩定版。\n見 https://github.com/hugo-fixit/FixIt/releases"
devEnvWarn = "當前運行環境是“development”。“評論系統”、“PWA”、“CDN”、“fingerprint”和“統計”不會啟用。"
quicklyUpgrade = "使用命令快速升級:"
# === init ===
@@ -103,7 +105,7 @@ toggleCodeEditable = "切換可編輯程式碼區塊"
downloadCode = "下載程式碼"
toggleCodeFullscreen = "切換程式碼區塊全螢幕"
expandCode = "展開或摺疊程式碼區塊"
cookieconsentMessage = "本網站使用 Cookies 來改善的流覽體驗。"
cookieconsentMessage = "本網站使用 Cookies 來改善的流覽體驗。"
cookieconsentDismiss = "同意"
cookieconsentLink = "瞭解更多"
# === partials/assets.html ===
@@ -166,7 +168,7 @@ bitcoin = "比特幣"
other = "找不到網頁"
[pageNotFoundText]
other = "抱歉,要查找的頁面不存在。"
other = "抱歉,要查找的頁面不存在。"
# === 404.html ===
# === offline ===
@@ -174,7 +176,7 @@ other = "抱歉,您要查找的頁面不存在。"
other = "離線"
[offlineText]
other = "沒有連接到 Internet,只有緩存的頁面可用。"
other = "沒有連接到 Internet,只有緩存的頁面可用。"
# === offline ===
# === GitHub Alert ===
@@ -1,6 +1,6 @@
{{- /*
Render template call stack for debugging purpose.
Call the partial from any template: {{- partial "devtools/template-call-stack.html" . -}}
Call the partial from any template: {{- partial "_debug/template-call-stack.html" . -}}
*/ -}}
{{- $debug := (site.Store.Get "devOpts").debug -}}
-61
View File
@@ -1,61 +0,0 @@
{{- $cdn := .Site.Store.Get "cdn" | default dict -}}
{{- $fingerprint := .Site.Store.Get "fingerprint" -}}
{{- $title := printf "%s %s %s" .Title .Site.Params.titleDelimiter .Site.Title -}}
{{- if .IsHome -}}
{{- $title = site.Title -}}
{{- end -}}
{{- if not .Site.Params.app.noFavicon -}}
{{- $relURL := relURL "" -}}
{{- with .Site.Params.app.svgFavicon -}}
<link rel="icon" href="{{ . }}">
{{- else -}}
<link rel="shortcut icon" type="image/x-icon" href="{{ $relURL }}favicon.ico" />
<link rel="icon" type="image/png" sizes="32x32" href="{{ $relURL }}favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{ $relURL }}favicon-16x16.png">
{{- end -}}
<link rel="apple-touch-icon" sizes="180x180" href="{{ $relURL }}apple-touch-icon.png">
{{- with .Site.Params.app.iconColor -}}
<link rel="mask-icon" href="{{ $relURL }}safari-pinned-tab.svg" color="{{ . }}">
{{- end -}}
{{- if eq .Site.Params.enablePWA true -}}
<link rel="manifest" href="{{ $relURL }}site.webmanifest">
{{- end -}}
{{- end -}}
<link rel="canonical" type="text/html" href="{{ .Permalink }}" title="{{ $title }}" />
{{- with .Prev -}}
<link rel="prev" type="text/html" href="{{ .Permalink }}" title="{{ .Title }}" />
{{- end -}}
{{- with .Next -}}
<link rel="next" type="text/html" href="{{ .Permalink }}" title="{{ .Title }}" />
{{- end -}}
{{- range .AlternativeOutputFormats -}}
{{- printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink $title | safeHTML -}}
{{- end -}}
{{- /* Compatible with https://github.com/hugo-fixit/hugo-json-feed */ -}}
{{- with .OutputFormats.Get "jsonfeed" -}}
<link rel="alternate" type="application/feed+json" href="{{ .Permalink }}" title="{{ $title }}" />
{{- end -}}
{{- /* config.min.css */ -}}
{{- $options := dict "Source" "css/config.template.scss" "Template" "css/config.scss" "Fingerprint" $fingerprint -}}
{{- $toCSS := dict "targetPath" "css/config.min.css" "enableSourceMap" true -}}
{{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}}
{{- partial "plugin/style.html" $options -}}
{{- /* style.min.css */ -}}
{{- $options := dict "Source" "css/style.scss" "Fingerprint" $fingerprint -}}
{{- $toCSS := dict "targetPath" "css/style.min.css" "enableSourceMap" true -}}
{{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}}
{{- partial "plugin/style.html" $options -}}
{{- /* Font Awesome */ -}}
{{- $source := $cdn.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}}
{{- partial "plugin/style.html" $options -}}
{{- /* Animate.css */ -}}
{{- $source := $cdn.animateCSS | default "lib/animate/animate.min.css" -}}
{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}}
{{- partial "plugin/style.html" $options -}}
-54
View File
@@ -1,54 +0,0 @@
{{- $author := partial "function/get-author-map.html" .Params.author -}}
<meta name="author" content="{{ $author.name }}">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage | and .Summary }}{{ .Summary | plainify }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
{{- $keywords := .Keywords -}}
{{- if not $keywords -}}
{{- if .IsPage | and .Params.tags -}}
{{- $keywords = .Params.tags -}}
{{- else -}}
{{- $keywords = .Site.Params.keywords -}}
{{- end -}}
{{- end -}}
{{- with $keywords -}}
<meta name="keywords" content='{{ delimit . ", " }}'>
{{- end -}}
{{- template "_internal/schema.html" . -}}
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
{{- with .Site.Params.social.Twitter -}}
<meta name="twitter:creator" content="@{{ . }}" />
{{- end -}}
<meta name="application-name" content="{{ .Site.Params.app.title | default .Site.Title }}">
<meta name="apple-mobile-web-app-title" content="{{ .Site.Params.app.title | default .Site.Title }}">
{{- with .Site.Params.app.themeColor -}}
{{- $color := . -}}
{{- if ne (len $color) 2 -}}
{{- $color = dict "light" . "dark" . -}}
{{- end -}}
<meta name="theme-color" data-light="{{ $color.light }}" data-dark="{{ $color.dark }}" content="{{ $color.light }}">
{{- end -}}
{{- with .Site.Params.app.tileColor -}}
<meta name="msapplication-TileColor" content="{{ . }}">
{{- end -}}
{{- /* Mastodon Validation for the site */ -}}
{{- with .Site.Params.social.Mastodon -}}
{{- $id := "" -}}
{{- $prefix := "https://mastodon.social/" -}}
{{- if reflect.IsMap . -}}
{{- $id = .Id | default .id -}}
{{- $prefix = .Prefix | default .prefix | default $prefix -}}
{{- end -}}
{{- if $id | and $prefix -}}
{{- $link := printf "%s/%s" $prefix $id -}}
{{- $email := printf "%s@%s" (strings.TrimPrefix "@" $id) (urls.Parse $prefix).Host -}}
<link rel="me" href="{{ $link }}" />
<meta name="fediverse:creator" content="{{ $email }}" />
{{- end -}}
{{- end -}}
-9
View File
@@ -1,9 +0,0 @@
{{- $fingerprint := .Site.Store.Get "fingerprint" -}}
{{- /* Check theme isDark before body rendering */ -}}
{{- $options := dict "targetPath" "js/head/color-scheme.min.js" "minify" hugo.IsProduction -}}
{{- $options := dict "defaultTheme" .Site.Params.defaulttheme | dict "params" | merge $options -}}
{{- if not hugo.IsProduction -}}
{{- $options = dict "sourceMap" "external" | merge $options -}}
{{- end -}}
{{- dict "Source" (resources.Get "js/head/color-scheme.js") "Build" $options "Fingerprint" $fingerprint | partial "plugin/script.html" -}}
-167
View File
@@ -1,167 +0,0 @@
{{- $params := partial "function/params.html" -}}
{{- with .Site.Params.verification.google -}}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.bing -}}
<meta name="msvalidate.01" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.yandex -}}
<meta name="yandex-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.pinterest -}}
<meta name="p:domain_verify" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.baidu -}}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.so -}}
<meta name="360-site-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.sogou -}}
<meta name="sogou_site_verification" content="{{ . }}" />
{{- end -}}
{{- /* Home SEO */ -}}
{{- if .IsHome -}}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "{{ .Permalink }}",
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
{{- with .Site.Params.author.name -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
},
{{- end -}}
{{- with .Site.Params.description -}}
"description": {{ . | safeHTML }},
{{- end -}}
{{- $image := .Site.Params.seo.image -}}
{{- with dict "Path" $image | partial "function/resource.html" -}}
"image": {
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
},
{{- else -}}
{{- with $image -}}
"image": "{{ . | absURL }}",
{{- end -}}
{{- end -}}
{{- with .Site.Params.seo.thumbnailUrl -}}
{{- with dict "Path" . | partial "function/resource.html" -}}
"thumbnailUrl": "{{ .Permalink }}",
{{- else -}}
"thumbnailUrl": "{{ . | absURL }}",
{{- end -}}
{{- end -}}
{{- with .Site.Copyright -}}
"license": "{{ . | safeHTML }}",
{{- end -}}
"name": {{ .Site.Title | safeHTML }}
}
</script>
{{- /* Page SEO */ -}}
{{- else if .IsPage -}}
{{- $authorName := .Site.Params.author.name | default (T "single.author") -}}
{{- with .Params.author -}}
{{- if reflect.IsMap . -}}
{{- $authorName = cond (isset . "name") .name $authorName -}}
{{- else -}}
{{- $authorName = . -}}
{{- end -}}
{{- end -}}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": {{ .Title | safeHTML }},
"inLanguage": "{{ .Site.LanguageCode }}",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- $images := $params.seo.images | default slice -}}
{{- if not $images -}}
{{- with .Resources.GetMatch "featured-image-preview" -}}
{{- $images = slice "featured-image-preview" -}}
{{- end -}}
{{- with .Resources.GetMatch "featured-image" -}}
{{- $images = slice "featured-image" -}}
{{- end -}}
{{- end -}}
{{- with .Site.Params.seo.image -}}
{{- $images = $images | default (slice .) -}}
{{- end -}}
{{- with $images -}}
"image": [
{{- range $index, $value := . -}}
{{- if gt $index 0 }},{{ end -}}
{{- with dict "Path" $value | partial "function/resource.html" -}}
{
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
}
{{- else -}}
{{- with $value -}}
"{{ . | absURL }}"
{{- end -}}
{{- end -}}
{{- end -}}
],
{{- end -}}
"genre": "{{ .Type }}",
{{- with .Params.tags -}}
"keywords": "{{ delimit . ", " }}",
{{- end -}}
"wordcount": {{ .WordCount }},
"url": "{{ .Permalink }}",
{{- if not .PublishDate.IsZero -}}
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- else if not .Date.IsZero -}}
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- end -}}
{{- with .Lastmod -}}
"dateModified": {{ .Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- end -}}
{{- with .Site.Copyright -}}
"license": {{ . | safeHTML }},
{{- end -}}
{{- $publisher := $authorName | dict "name" -}}
{{- $publisher = $params.seo.publisher | default dict | merge $publisher -}}
"publisher": {
"@type": "Organization",
"name": {{ $publisher.name | safeHTML }}
{{- $logo := $publisher.logoUrl -}}
{{- with dict "Path" $logo | partial "function/resource.html" -}}
,"logo": {
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
}
{{- else -}}
{{- with $logo -}}
,"logo": "{{ . | absURL }}"
{{- end -}}
{{- end -}}
},
{{- with $authorName -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
},
{{- end -}}
"description": {{ .Description | safeHTML }}
}
</script>
{{- end -}}
@@ -2,6 +2,17 @@
{{- $latest := $version -}}
{{- $devOpts := .Site.Store.Get "devOpts" -}}
{{- /* Check Hugo version */ -}}
{{- $MINIMAL_HUGO_VERSION := "0.156.0" -}}
{{- if lt hugo.Version $MINIMAL_HUGO_VERSION -}}
{{- errorf "\n\n%v\n\n" (dict "Current" hugo.Version "Minimal" $MINIMAL_HUGO_VERSION | T "init.hugoVersionError") -}}
{{- end -}}
{{- /* Check Hugo extend */ -}}
{{- if eq hugo.IsExtended false -}}
{{- warnf "\n\n%v\n\n" (T "init.hugoExtendedWarn") -}}
{{- end -}}
{{- /* Check for updates */ -}}
{{- if $devOpts.c4u -}}
{{- $url := "https://api.github.com/repos/hugo-fixit/FixIt/releases/latest" -}}
+1 -2
View File
@@ -6,5 +6,4 @@
{{- partial "init/detection-deprecated.html" . -}}
{{- partial "init/global.html" . -}}
{{- partial "init/patch.html" . -}}
{{- partial "plugin/compatibility.html" . -}}
{{- partial "init/compatibility.html" . -}}
+318
View File
@@ -0,0 +1,318 @@
{{- /*
Head Partial - Comprehensive head section template
This partial consolidates all head-related content including:
- META: Meta tags for SEO, Open Graph, Twitter Cards, and app metadata
- LINK: Favicon, canonical links, RSS feeds, and CSS stylesheet loading
- SEO: Schema.org structured data for pages and homepage
- SCRIPT: Early-loaded scripts (e.g., theme color scheme detection)
Called from: layouts/baseof.html
*/ -}}
{{- $fingerprint := .Site.Store.Get "fingerprint" -}}
{{- $cdn := .Site.Store.Get "cdn" | default dict -}}
{{- /* ========== META: Meta Tags ========== */ -}}
{{- $author := partial "function/get-author-map.html" .Params.author -}}
<meta name="author" content="{{ $author.name }}">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage | and .Summary }}{{ .Summary | plainify }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
{{- $keywords := .Keywords -}}
{{- if not $keywords -}}
{{- if .IsPage | and .Params.tags -}}
{{- $keywords = .Params.tags -}}
{{- else -}}
{{- $keywords = .Site.Params.keywords -}}
{{- end -}}
{{- end -}}
{{- with $keywords -}}
<meta name="keywords" content='{{ delimit . ", " }}'>
{{- end -}}
{{- template "_internal/schema.html" . -}}
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
{{- with .Site.Params.social.Twitter -}}
<meta name="twitter:creator" content="@{{ . }}" />
{{- end -}}
<meta name="application-name" content="{{ .Site.Params.app.title | default .Site.Title }}">
<meta name="apple-mobile-web-app-title" content="{{ .Site.Params.app.title | default .Site.Title }}">
{{- with .Site.Params.app.themeColor -}}
{{- $color := . -}}
{{- if ne (len $color) 2 -}}
{{- $color = dict "light" . "dark" . -}}
{{- end -}}
<meta name="theme-color" data-light="{{ $color.light }}" data-dark="{{ $color.dark }}" content="{{ $color.light }}">
{{- end -}}
{{- with .Site.Params.app.tileColor -}}
<meta name="msapplication-TileColor" content="{{ . }}">
{{- end -}}
{{- /* Mastodon Verification */ -}}
{{- with .Site.Params.social.Mastodon -}}
{{- $id := "" -}}
{{- $prefix := "https://mastodon.social/" -}}
{{- if reflect.IsMap . -}}
{{- $id = .Id | default .id -}}
{{- $prefix = .Prefix | default .prefix | default $prefix -}}
{{- end -}}
{{- if $id | and $prefix -}}
{{- $link := printf "%s/%s" $prefix $id -}}
{{- $email := printf "%s@%s" (strings.TrimPrefix "@" $id) (urls.Parse $prefix).Host -}}
<link rel="me" href="{{ $link }}" />
<meta name="fediverse:creator" content="{{ $email }}" />
{{- end -}}
{{- end -}}
{{- /* ========== LINK: Favicon, Canonical, Feeds, Stylesheets ========== */ -}}
{{- $title := printf "%s %s %s" .Title .Site.Params.titleDelimiter .Site.Title -}}
{{- if .IsHome -}}
{{- $title = .Site.Title -}}
{{- end -}}
{{- /* Favicon links */ -}}
{{- if not .Site.Params.app.noFavicon -}}
{{- $relURL := relURL "" -}}
{{- with .Site.Params.app.svgFavicon -}}
<link rel="icon" href="{{ . }}">
{{- else -}}
<link rel="shortcut icon" type="image/x-icon" href="{{ $relURL }}favicon.ico" />
<link rel="icon" type="image/png" sizes="32x32" href="{{ $relURL }}favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{ $relURL }}favicon-16x16.png">
{{- end -}}
<link rel="apple-touch-icon" sizes="180x180" href="{{ $relURL }}apple-touch-icon.png">
{{- with .Site.Params.app.iconColor -}}
<link rel="mask-icon" href="{{ $relURL }}safari-pinned-tab.svg" color="{{ . }}">
{{- end -}}
{{- if eq .Site.Params.enablePWA true -}}
<link rel="manifest" href="{{ $relURL }}site.webmanifest">
{{- end -}}
{{- end -}}
{{- /* Canonical and pagination links */ -}}
<link rel="canonical" type="text/html" href="{{ .Permalink }}" title="{{ $title }}" />
{{- with .Prev -}}
<link rel="prev" type="text/html" href="{{ .Permalink }}" title="{{ .Title }}" />
{{- end -}}
{{- with .Next -}}
<link rel="next" type="text/html" href="{{ .Permalink }}" title="{{ .Title }}" />
{{- end -}}
{{- /* Alternative output formats (Atom, RSS, etc.) */ -}}
{{- range .AlternativeOutputFormats -}}
{{- printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink $title | safeHTML -}}
{{- end -}}
{{- /* JSON Feed support */ -}}
{{- with .OutputFormats.Get "jsonfeed" -}}
<link rel="alternate" type="application/feed+json" href="{{ .Permalink }}" title="{{ $title }}" />
{{- end -}}
{{- /* Core stylesheets */ -}}
{{- /* Config CSS */ -}}
{{- $options := dict "Source" "css/config.template.scss" "Template" "css/config.scss" "Fingerprint" $fingerprint -}}
{{- $toCSS := dict "targetPath" "css/config.min.css" "enableSourceMap" true -}}
{{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}}
{{- partial "plugin/style.html" $options -}}
{{- /* Theme CSS */ -}}
{{- $options := dict "Source" "css/style.scss" "Fingerprint" $fingerprint -}}
{{- $toCSS := dict "targetPath" "css/style.min.css" "enableSourceMap" true -}}
{{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}}
{{- partial "plugin/style.html" $options -}}
{{- /* Font Awesome Icons */ -}}
{{- $source := $cdn.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}}
{{- partial "plugin/style.html" $options -}}
{{- /* Animate.css Animation Library */ -}}
{{- $source := $cdn.animateCSS | default "lib/animate/animate.min.css" -}}
{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}}
{{- partial "plugin/style.html" $options -}}
{{- /* ========== SEO: Structured Data (Schema.org) ========== */ -}}
{{- $params := partial "function/params.html" -}}
{{- /* Search Engine Verification */ -}}
{{- with .Site.Params.verification.google -}}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.bing -}}
<meta name="msvalidate.01" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.yandex -}}
<meta name="yandex-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.pinterest -}}
<meta name="p:domain_verify" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.baidu -}}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.so -}}
<meta name="360-site-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.sogou -}}
<meta name="sogou_site_verification" content="{{ . }}" />
{{- end -}}
{{- /* Homepage Structured Data */ -}}
{{- if .IsHome -}}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "{{ .Permalink }}",
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
{{- with .Site.Params.author.name -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
},
{{- end -}}
{{- with .Site.Params.description -}}
"description": {{ . | safeHTML }},
{{- end -}}
{{- $image := .Site.Params.seo.image -}}
{{- with dict "Path" $image | partial "function/resource.html" -}}
"image": {
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
},
{{- else -}}
{{- with $image -}}
"image": "{{ . | absURL }}",
{{- end -}}
{{- end -}}
{{- with .Site.Params.seo.thumbnailUrl -}}
{{- with dict "Path" . | partial "function/resource.html" -}}
"thumbnailUrl": "{{ .Permalink }}",
{{- else -}}
"thumbnailUrl": "{{ . | absURL }}",
{{- end -}}
{{- end -}}
{{- with .Site.Copyright -}}
"license": "{{ . | safeHTML }}",
{{- end -}}
"name": {{ .Site.Title | safeHTML }}
}
</script>
{{- /* Page (Article) Structured Data */ -}}
{{- else if .IsPage -}}
{{- $authorName := .Site.Params.author.name | default (T "single.author") -}}
{{- with .Params.author -}}
{{- if reflect.IsMap . -}}
{{- $authorName = cond (isset . "name") .name $authorName -}}
{{- else -}}
{{- $authorName = . -}}
{{- end -}}
{{- end -}}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": {{ .Title | safeHTML }},
"inLanguage": "{{ .Site.LanguageCode }}",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- $images := $params.seo.images | default slice -}}
{{- if not $images -}}
{{- with .Resources.GetMatch "featured-image-preview" -}}
{{- $images = slice "featured-image-preview" -}}
{{- end -}}
{{- with .Resources.GetMatch "featured-image" -}}
{{- $images = slice "featured-image" -}}
{{- end -}}
{{- end -}}
{{- with .Site.Params.seo.image -}}
{{- $images = $images | default (slice .) -}}
{{- end -}}
{{- with $images -}}
"image": [
{{- range $index, $value := . -}}
{{- if gt $index 0 }},{{ end -}}
{{- with dict "Path" $value | partial "function/resource.html" -}}
{
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
}
{{- else -}}
{{- with $value -}}
"{{ . | absURL }}"
{{- end -}}
{{- end -}}
{{- end -}}
],
{{- end -}}
"genre": "{{ .Type }}",
{{- with .Params.tags -}}
"keywords": "{{ delimit . ", " }}",
{{- end -}}
"wordcount": {{ .WordCount }},
"url": "{{ .Permalink }}",
{{- if not .PublishDate.IsZero -}}
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- else if not .Date.IsZero -}}
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- end -}}
{{- with .Lastmod -}}
"dateModified": {{ .Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- end -}}
{{- with .Site.Copyright -}}
"license": {{ . | safeHTML }},
{{- end -}}
{{- $publisher := $authorName | dict "name" -}}
{{- $publisher = $params.seo.publisher | default dict | merge $publisher -}}
"publisher": {
"@type": "Organization",
"name": {{ $publisher.name | safeHTML }}
{{- $logo := $publisher.logoUrl -}}
{{- with dict "Path" $logo | partial "function/resource.html" -}}
,"logo": {
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
}
{{- else -}}
{{- with $logo -}}
,"logo": "{{ . | absURL }}"
{{- end -}}
{{- end -}}
},
{{- with $authorName -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
},
{{- end -}}
"description": {{ .Description | safeHTML }}
}
</script>
{{- end -}}
{{- /* ========== SCRIPT: Early-Loaded Head Scripts ========== */ -}}
{{- /* Theme Color Scheme Detection (runs before page render) */ -}}
{{- $options := dict "targetPath" "js/head/color-scheme.min.js" "minify" hugo.IsProduction -}}
{{- $options := dict "defaultTheme" .Site.Params.defaulttheme | dict "params" | merge $options -}}
{{- if not hugo.IsProduction -}}
{{- $options = dict "sourceMap" "external" | merge $options -}}
{{- end -}}
{{- dict "Source" (resources.Get "js/head/color-scheme.js") "Build" $options "Fingerprint" $fingerprint | partial "plugin/script.html" -}}
+9 -9
View File
@@ -11,10 +11,7 @@
<meta name="robots" content="noodp" />
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{- partial "head/meta.html" . -}}
{{- partial "head/link.html" . -}}
{{- partial "head/seo.html" . -}}
{{- partial "head/script.html" . -}}
{{- partial "layout/head.html" . -}}
{{- /* TODO preload script https://developer.mozilla.org/zh-CN/docs/Web/HTML/Attributes/rel/preload */ -}}
{{- /* Custom head */ -}}
{{- block "custom-head" . }}{{ end -}}
@@ -22,19 +19,22 @@
<body data-instant-intensity="viewport" data-header-desktop="{{ .Site.Params.header.desktopMode }}" data-header-mobile="{{ .Site.Params.header.mobileMode }}">
{{- /* Body wrapper */ -}}
<div class="wrapper" data-page-style="{{ (partial `function/params.html`).pageStyle | default `normal` }}">
{{- partial "header.html" . -}}
{{- partial "breadcrumb.html" . -}}
{{- partial "layout/header.html" . -}}
{{- partial "layout/breadcrumb.html" . -}}
{{- $toc := .Store.Get "toc" -}}
<main class="fi-container"{{ if (eq $toc.enable true) | and (eq $toc.position `left`) }} data-reverse{{ end }}>
{{- block "content" . }}{{ end -}}
</main>
{{- partialCached "footer.html" . -}}
{{- /* Comment */ -}}
{{- block "comments" . }}{{ end -}}
{{- /* Footer */ -}}
{{- partialCached "layout/footer.html" . -}}
</div>
{{- /* Theme widgets */ -}}
{{- partial "widgets.html" . -}}
{{- partial "layout/widgets.html" . -}}
{{- /* Load JavaScript scripts and CSS */ -}}
{{- partial "assets.html" . -}}
{{- partial "layout/assets.html" . -}}
</body>
</html>
+4 -3
View File
@@ -34,8 +34,9 @@
<div class="content" id="content">
{{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
</div>
{{- /* Comment */ -}}
{{- partial "single/comment.html" . -}}
</article>
{{- end -}}
{{- define "comments" -}}
{{- partial "layout/comment.html" . -}}
{{- end -}}
+2 -2
View File
@@ -39,7 +39,7 @@
{{- else -}}
{{- $pages = .Paginate $pages -}}
{{- end -}}
{{- partial "recently-updated.html" . -}}
{{- partial "section/recently-updated.html" . -}}
{{- range $pages.PageGroups -}}
<h2 class="group-title">
{{- dict "Class" "fa-regular fa-calendar me-1" | partial "plugin/icon.html" -}}
@@ -61,7 +61,7 @@
</article>
{{- end -}}
{{- end -}}
{{- partial "paginator.html" . -}}
{{- partial "layout/paginator.html" . -}}
{{- end -}}
</div>
{{- end -}}
+1 -1
View File
@@ -49,7 +49,7 @@
{{- range $pages.Pages -}}
{{- .Render "summary" -}}
{{- end -}}
{{- partial "paginator.html" . -}}
{{- partial "layout/paginator.html" . -}}
{{- end -}}
</div>
{{- end -}}
+4 -3
View File
@@ -24,8 +24,9 @@
{{- /* Content Encryption */ -}}
{{- dict "Content" $content "Password" $params.password "Message" $params.message "Page" . | partial "plugin/fixit-encryptor.html" -}}
{{- /* Comment */ -}}
{{- partial "single/comment.html" . -}}
</article>
{{- end -}}
{{- define "comments" -}}
{{- partial "layout/comment.html" . -}}
{{- end -}}
+4 -3
View File
@@ -218,9 +218,6 @@
{{- /* Custom block after post footer */ -}}
{{- block "custom-post__footer:after" . }}{{ end -}}
{{- /* Comment */ -}}
{{- partial "single/comment.html" . -}}
</article>
<aside class="toc" id="toc-auto" aria-label="{{ T "single.contents" }}">
@@ -252,3 +249,7 @@
</dialog>
{{- end -}}
{{- end -}}
{{- define "comments" -}}
{{- partial "layout/comment.html" . -}}
{{- end -}}
+2 -2
View File
@@ -40,7 +40,7 @@
{{- else -}}
{{- $pages = .Paginate $pages -}}
{{- end -}}
{{- partial "recently-updated.html" . -}}
{{- partial "section/recently-updated.html" . -}}
{{- range $pages.PageGroups -}}
<h2 class="group-title">
{{- dict "Class" "fa-regular fa-calendar me-1" | partial "plugin/icon.html" -}}
@@ -61,7 +61,7 @@
</article>
{{- end -}}
{{- end -}}
{{- partial "paginator.html" . -}}
{{- partial "layout/paginator.html" . -}}
{{- end -}}
</div>
{{- end -}}
+2 -2
View File
@@ -34,7 +34,7 @@
{{- else -}}
{{- $pages = .Paginate $pages -}}
{{- end -}}
{{- partial "recently-updated.html" . -}}
{{- partial "section/recently-updated.html" . -}}
{{- range $pages.PageGroups -}}
<h2 class="group-title">
{{- dict "Class" "fa-regular fa-calendar me-1" | partial "plugin/icon.html" -}}
@@ -55,7 +55,7 @@
</article>
{{- end -}}
{{- end -}}
{{- partial "paginator.html" . -}}
{{- partial "layout/paginator.html" . -}}
{{- end -}}
</div>
{{- end -}}