forked from drowl87/hextra_mirror
Compare commits
14 Commits
sidebar-da
...
37a135f38a
Author | SHA1 | Date | |
---|---|---|---|
37a135f38a | |||
8ecd48d391 | |||
0c9c900018 | |||
1200a7bee4 | |||
1313415c8b | |||
3cba6b9820 | |||
6ee6ddeacb | |||
db92de0f1b | |||
b2bc4f7098 | |||
857c4e4ca1 | |||
d3f251b621 | |||
d43ac66494 | |||
4eca719b0b | |||
daaf281012 |
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@ -57,7 +57,7 @@ We recommend that you search existing [issues][issues] or discussions before ope
|
||||
|
||||
### Local development setup
|
||||
|
||||
- [Hugo][hugo] >= v0.115.0 (extended version)
|
||||
- [Hugo][hugo] >= v0.124.0 (extended version)
|
||||
- [Node.js][nodejs]
|
||||
- [Go][go]
|
||||
|
||||
|
2
.github/workflows/pages.yml
vendored
2
.github/workflows/pages.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HUGO_VERSION: 0.124.1
|
||||
HUGO_VERSION: 0.126.1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
@ -9,6 +9,11 @@ github: >
|
||||
<path d="M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z"></path>
|
||||
</svg>
|
||||
|
||||
gitea: >
|
||||
<svg fill="currentColor" viewBox="75 100 824 824">
|
||||
<path d="M762.2 350.3c-100.9 5.3-160.7 8-212 8.5v114.1l-16-7.9-.1-106.1c-58.9 0-110.7-3.1-209.1-8.6-12.3-.1-29.5-2.4-47.9-2.5-47.1-.1-110.2 33.5-106.7 118C175.8 597.6 296 609.9 344 610.9c5.3 24.7 61.8 110.1 103.6 114.6H631c109.9-8.2 192.3-373.8 131.2-375.2zm-546 117.3c-4.7-36.6 11.8-74.8 73.2-73.2C296.1 462 307 501.5 329 561.9c-56.2-7.4-104-25.7-112.8-94.3zm415.6 83.5-51.3 105.6c-6.5 13.4-22.7 19-36.2 12.5l-105.6-51.3c-13.4-6.5-19-22.7-12.5-36.2l51.3-105.6c6.5-13.4 22.7-19 36.2-12.5l105.6 51.3c13.4 6.6 19 22.8 12.5 36.2z M555 609.9c.1-.2.2-.3.2-.5 17.2-35.2 24.3-49.8 19.8-62.4-3.9-11.1-15.5-16.6-36.7-26.6-.8-.4-1.7-.8-2.5-1.2.2-2.3-.1-4.7-1-7-.8-2.3-2.1-4.3-3.7-6l13.6-27.8-11.9-5.8-13.7 28.4c-2 0-4.1.3-6.2 1-8.9 3.2-13.5 13-10.3 21.9.7 1.9 1.7 3.5 2.8 5l-23.6 48.4c-1.9 0-3.8.3-5.7 1-8.9 3.2-13.5 13-10.3 21.9 3.2 8.9 13 13.5 21.9 10.3 8.9-3.2 13.5-13 10.3-21.9-.9-2.5-2.3-4.6-4-6.3l23-47.2c2.5.2 5 0 7.5-.9 2.1-.8 3.9-1.9 5.5-3.3.9.4 1.9.9 2.7 1.3 17.4 8.2 27.9 13.2 30 19.1 2.6 7.5-5.1 23.4-19.3 52.3-.1.2-.2.5-.4.7-2.2-.1-4.4.2-6.5 1-8.9 3.2-13.5 13-10.3 21.9 3.2 8.9 13 13.5 21.9 10.3 8.9-3.2 13.5-13 10.3-21.9-.6-2-1.9-4-3.4-5.7z"></path>
|
||||
</svg>
|
||||
|
||||
codeberg: >
|
||||
<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.955.49A12 12 0 0 0 0 12.49a12 12 0 0 0 1.832 6.373L11.838 5.928a.187.14 0 0 1 .324 0l10.006 12.935A12 12 0 0 0 24 12.49a12 12 0 0 0-12-12 12 12 0 0 0-.045 0zm.375 6.467 4.416 16.553a12 12 0 0 0 5.137-4.213z"/>
|
||||
|
@ -251,6 +251,23 @@ Options for `flexsearch.index`:
|
||||
- `heading` - level 1 and level 2 headings
|
||||
- `title` - only include the page title
|
||||
|
||||
To customize the search tokenize, set the `params.search.flexsearch.tokenize` parameter in the config file:
|
||||
|
||||
```yaml {filename="hugo.yaml"}
|
||||
params:
|
||||
# ...
|
||||
flexsearch:
|
||||
# full | forward | reverse | strict
|
||||
tokenize: forward
|
||||
```
|
||||
|
||||
Options for [`flexsearch.tokenize`](https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search):
|
||||
|
||||
- `strict` - index whole words
|
||||
- `forward` - incrementally index words in forward direction
|
||||
- `reverse` - incrementally index words in both directions
|
||||
- `full` - index every possible combination
|
||||
|
||||
To exclude a page from the search index, set the `excludeSearch: true` in the front matter of the page:
|
||||
|
||||
```yaml {filename="content/docs/guide/configuration.md"}
|
||||
|
@ -219,6 +219,25 @@ params:
|
||||
- `heading` - 一级和二级标题
|
||||
- `title` - 仅搜索标题
|
||||
|
||||
要自定义检索分词,请在配置文件中设置`params.search.flexsearch.tokenize`:
|
||||
|
||||
```hugo.yaml
|
||||
params:
|
||||
# ...
|
||||
flexsearch:
|
||||
# full | forward | reverse | strict
|
||||
tokenize: forward
|
||||
```
|
||||
|
||||
[`flexsearch.tokenize`](https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search)的可选项:
|
||||
|
||||
- `strict` - 严格单词匹配
|
||||
- `forward` - 单词前缀匹配
|
||||
- `reverse` - 单词前后缀匹配
|
||||
- `full` - 单词子串匹配。
|
||||
|
||||
> 在默认的分词逻辑下,中文一句话就是一个“单词”
|
||||
|
||||
要从搜索索引中排除页面,更改 front matter 中的 `excludeSearch: true`:
|
||||
|
||||
```yaml {filename="content/docs/guide/configuration.md"}
|
||||
|
@ -14,7 +14,7 @@ Hugo supports [Markdown](https://en.wikipedia.org/wiki/Markdown) syntax for form
|
||||
| Style | Syntax | Example | Output |
|
||||
| -------- | -------- | ------ | ------ |
|
||||
| Bold | `**bold text**` | `**bold text**` | **bold text** |
|
||||
| Italic | `*italicized text*` | `*italicized text* | *italicized text* |
|
||||
| Italic | `*italicized text*` | `*italicized text*` | *italicized text* |
|
||||
| Strikethrough | `~~strikethrough text~~` | `~~strikethrough text~~` | ~~strikethrough text~~ |
|
||||
| Subscript | `<sub></sub>` | `This is a <sub>subscript</sub> text` | This is a <sub>subscript</sub> text |
|
||||
| Superscript | `<sup></sup>` | `This is a <sup>superscript</sup> text` | This is a <sup>superscript</sup> text |
|
||||
|
@ -82,6 +82,45 @@ weight: 2
|
||||
It is recommended to keep the sidebar not too deep. If you have a lot of content, consider **splitting them into multiple sections**.
|
||||
{{< /callout >}}
|
||||
|
||||
## Breadcrumb Navigation
|
||||
|
||||
Breadcrumbs are auto-generated based on the directory structure of `/content`.
|
||||
|
||||
For example, consider the file structure [demonstrated above](#directory-structure). Given that structure, the breadcrumbs atop the page at `/docs/guide/organize-files/` would appear automatically as follows:
|
||||
|
||||
```
|
||||
Documentation > Guide > Organize Files
|
||||
```
|
||||
|
||||
### Customizing Breadcrumb Link Titles
|
||||
|
||||
By default, each breadcrumb link is generated based on that page's `title` parameter. You can customize this by specifying a `linkTitle`.
|
||||
|
||||
For example, if instead of `Organize Files` we wanted the breadcrumb to be `Foo Bar`:
|
||||
|
||||
```yaml {filename="content/docs/guide/organize-files.md"}
|
||||
---
|
||||
linkTitle: Foo Bar
|
||||
title: Organize Files
|
||||
---
|
||||
```
|
||||
|
||||
This would now generate the following breadcrumbs:
|
||||
```
|
||||
Documentation > Guide > Foo Bar
|
||||
```
|
||||
|
||||
### Hiding Breadcrumbs
|
||||
|
||||
You can hide breadcrumbs completely from a page by specfying `breadcrumbs: false` in its front matter:
|
||||
|
||||
```yaml {filename="content/docs/guide/organize-files.md"}
|
||||
---
|
||||
breadcrumbs: false
|
||||
title: Organize Files
|
||||
---
|
||||
```
|
||||
|
||||
## Configure Content Directory
|
||||
|
||||
By default, the root `content/` directory is used by Hugo to build the site.
|
||||
|
@ -13,6 +13,13 @@ Open source projects powered by Hextra
|
||||
|
||||
{{< cards >}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/axivo/website"
|
||||
title="AXIVO Docs"
|
||||
image="https://github.com/imfing/hextra/assets/19806136/f22f0710-23a0-430b-8bad-616283b8a3e5"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/infracourse/web"
|
||||
title="Stanford CS 40"
|
||||
|
@ -13,6 +13,13 @@ layout: wide
|
||||
|
||||
{{< cards >}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/axivo/website"
|
||||
title="AXIVO Docs"
|
||||
image="https://github.com/imfing/hextra/assets/19806136/f22f0710-23a0-430b-8bad-616283b8a3e5"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/infracourse/web"
|
||||
title="Stanford CS 40"
|
||||
|
14
i18n/he.yaml
Normal file
14
i18n/he.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
backToTop: "גלול למעלה"
|
||||
changeLanguage: "שנה שפה"
|
||||
changeTheme: "שנה ערכת צבעים"
|
||||
copyCode: "העתק קוד"
|
||||
copyright: "© 2024 פרוייקט Hextra"
|
||||
dark: "כהה"
|
||||
editThisPage: "← ערוך עמוד זה בגיטהאב"
|
||||
lastUpdated: "עודכן לאחרונה ב"
|
||||
light: "בהיר"
|
||||
noResultsFound: "לא נמצאו תוצאות."
|
||||
onThisPage: "בעמוד זה"
|
||||
poweredBy: "Hextra מופעל על-ידי"
|
||||
readMore: "← קרא עוד"
|
||||
searchPlaceholder: "חיפוש..."
|
14
i18n/nl.yaml
Normal file
14
i18n/nl.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
backToTop: "Terug naar boven"
|
||||
changeLanguage: "Taal veranderen"
|
||||
changeTheme: "Thema aanpassen"
|
||||
copyCode: "Kopieer code"
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "Donker"
|
||||
editThisPage: "Bewerk deze pagina op GitHub →"
|
||||
lastUpdated: "Laatst bijgewerkt op"
|
||||
light: "Licht"
|
||||
noResultsFound: "Geen resultaten gevonden."
|
||||
onThisPage: "Op deze pagina"
|
||||
poweredBy: "Mogelijk gemaakt door Hextra"
|
||||
readMore: "Lees meer →"
|
||||
searchPlaceholder: "Zoeken..."
|
14
i18n/uk.yaml
Normal file
14
i18n/uk.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
backToTop: "Прокрутити до початку"
|
||||
changeLanguage: "Змінити мову"
|
||||
changeTheme: "Змінити тему"
|
||||
copyCode: "Скопіювати код"
|
||||
copyright: "2024 Проєкт Hextra."
|
||||
dark: "Темна"
|
||||
editThisPage: "Редагувати цю сторінку на Github →"
|
||||
lastUpdated: "Востаннє оновлено"
|
||||
light: "Світла"
|
||||
noResultsFound: "Не знайдено результатів"
|
||||
onThisPage: "На цій сторінці"
|
||||
poweredBy: "Працює завдяки Hextra"
|
||||
readMore: "Читати більше →"
|
||||
searchPlaceholder: "Пошук..."
|
@ -1,13 +1,15 @@
|
||||
<div class="hx-mt-1.5 hx-flex hx-items-center hx-gap-1 hx-overflow-hidden hx-text-sm hx-text-gray-500 dark:hx-text-gray-400 contrast-more:hx-text-current">
|
||||
{{- range .Ancestors.Reverse }}
|
||||
{{- if not .IsHome }}
|
||||
<div class="hx-whitespace-nowrap hx-transition-colors hx-min-w-[24px] hx-overflow-hidden hx-text-ellipsis hover:hx-text-gray-900 dark:hover:hx-text-gray-100">
|
||||
<a href="{{ .Permalink }}">{{- partial "utils/title" . -}}</a>
|
||||
</div>
|
||||
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"hx-w-3.5 hx-shrink-0 rtl:-hx-rotate-180\"") -}}
|
||||
{{- if (default true .Params.breadcrumbs) }}
|
||||
<div class="hx-mt-1.5 hx-flex hx-items-center hx-gap-1 hx-overflow-hidden hx-text-sm hx-text-gray-500 dark:hx-text-gray-400 contrast-more:hx-text-current">
|
||||
{{- range .Ancestors.Reverse }}
|
||||
{{- if not .IsHome }}
|
||||
<div class="hx-whitespace-nowrap hx-transition-colors hx-min-w-[24px] hx-overflow-hidden hx-text-ellipsis hover:hx-text-gray-900 dark:hover:hx-text-gray-100">
|
||||
<a href="{{ .RelPermalink }}">{{- partial "utils/title" . -}}</a>
|
||||
</div>
|
||||
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"hx-w-3.5 hx-shrink-0 rtl:-hx-rotate-180\"") -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
<div class="hx-whitespace-nowrap hx-transition-colors hx-font-medium hx-text-gray-700 contrast-more:hx-font-bold contrast-more:hx-text-current dark:hx-text-gray-100 contrast-more:dark:hx-text-current">
|
||||
{{- partial "utils/title" . -}}
|
||||
<div class="hx-whitespace-nowrap hx-transition-colors hx-font-medium hx-text-gray-700 contrast-more:hx-font-bold contrast-more:hx-text-current dark:hx-text-gray-100 contrast-more:dark:hx-text-current">
|
||||
{{- partial "utils/title" . -}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end -}}
|
||||
|
@ -20,7 +20,7 @@
|
||||
{{- partial "language-switch.html" (dict "context" .) -}}
|
||||
{{- with $displayThemeToggle }}{{ partial "theme-toggle.html" }}{{ end -}}
|
||||
</div>
|
||||
{{- if or site.IsMultiLingual $displayThemeToggle -}}
|
||||
{{- if or hugo.IsMultilingual $displayThemeToggle -}}
|
||||
<hr class="dark:hx-border-neutral-800" />
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
{{- $changeLanguage := (T "changeLanguage") | default "Change language" -}}
|
||||
|
||||
{{- if site.IsMultiLingual -}}
|
||||
{{- if hugo.IsMultilingual -}}
|
||||
<div class="hx-flex hx-justify-items-start {{ if $grow }}hx-grow{{ end }}">
|
||||
<button
|
||||
title="{{ $changeLanguage }}"
|
||||
|
@ -43,9 +43,9 @@
|
||||
{{ $switchesClass := cond $disableSidebar "md:hx-hidden" "" -}}
|
||||
{{ $displayThemeToggle := (site.Params.theme.displayToggle | default true) -}}
|
||||
|
||||
{{ if or site.IsMultiLingual $displayThemeToggle }}
|
||||
<div class="{{ $switchesClass }} {{ with site.IsMultiLingual }}hx-justify-end{{ end }} hx-sticky hx-bottom-0 hx-bg-white dark:hx-bg-dark hx-mx-4 hx-py-4 hx-shadow-[0_-12px_16px_#fff] hx-flex hx-items-center hx-gap-2 dark:hx-border-neutral-800 dark:hx-shadow-[0_-12px_16px_#111] contrast-more:hx-border-neutral-400 contrast-more:hx-shadow-none contrast-more:dark:hx-shadow-none hx-border-t" data-toggle-animation="show">
|
||||
{{- with site.IsMultiLingual -}}
|
||||
{{ if or hugo.IsMultilingual $displayThemeToggle }}
|
||||
<div class="{{ $switchesClass }} {{ with hugo.IsMultilingual }}hx-justify-end{{ end }} hx-sticky hx-bottom-0 hx-bg-white dark:hx-bg-dark hx-mx-4 hx-py-4 hx-shadow-[0_-12px_16px_#fff] hx-flex hx-items-center hx-gap-2 dark:hx-border-neutral-800 dark:hx-shadow-[0_-12px_16px_#111] contrast-more:hx-border-neutral-400 contrast-more:hx-shadow-none contrast-more:dark:hx-shadow-none hx-border-t" data-toggle-animation="show">
|
||||
{{- with hugo.IsMultilingual -}}
|
||||
{{- partial "language-switch" (dict "context" $context "grow" true) -}}
|
||||
{{- with $displayThemeToggle }}{{ partial "theme-toggle" (dict "hideLabel" true) }}{{ end -}}
|
||||
{{- else -}}
|
||||
|
38
layouts/shortcodes/hextra/hero-container.html
Normal file
38
layouts/shortcodes/hextra/hero-container.html
Normal file
@ -0,0 +1,38 @@
|
||||
{{- $class := .Get "class" -}}
|
||||
{{- $cols := .Get "cols" | default 2 -}}
|
||||
{{- $image := .Get "image" -}}
|
||||
{{- $imageCard := .Get "imageCard" | default false -}}
|
||||
{{- $imageClass := .Get "imageClass" -}}
|
||||
{{- $imageLink := .Get "imageLink" -}}
|
||||
{{- $imageLinkExternal := hasPrefix $imageLink "http" -}}
|
||||
{{- $imageStyle := .Get "imageStyle" -}}
|
||||
{{- $imageTitle := .Get "imageTitle" -}}
|
||||
{{- $imageWidth := .Get "imageWidth" | default 350 -}}
|
||||
{{- $imageHeight := .Get "imageHeight" | default 350 -}}
|
||||
{{- $style := .Get "style" -}}
|
||||
|
||||
{{- $css := printf "--hextra-feature-grid-cols: %v; %s" $cols $style -}}
|
||||
{{- $href := cond (hasPrefix $imageLink "/") ($imageLink | relURL) $imageLink -}}
|
||||
{{- if hasPrefix $image "/" -}}
|
||||
{{- $image = relURL (strings.TrimPrefix "/" $image) -}}
|
||||
{{- end -}}
|
||||
|
||||
<div
|
||||
class="{{ $class }} hextra-feature-grid hx-grid sm:max-lg:hx-grid-cols-2 max-sm:hx-grid-cols-1 hx-gap-4 hx-w-full not-prose"
|
||||
{{ with $css }}style="{{ . | safeCSS }}"{{ end }}
|
||||
>
|
||||
<div class="hx-w-full">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
{{- with $image }}
|
||||
<div class="hx-mx-auto">
|
||||
<a
|
||||
{{ with $imageLink }}href="{{ $href }}" {{ with $imageLinkExternal }} target="_blank" rel="noreferrer"{{ end }}{{ end }}
|
||||
{{ with $imageStyle }}style="{{ . | safeCSS }}"{{ end }}
|
||||
class="{{ $imageClass }} {{ if $imageCard }}hextra-feature-card not-prose hx-block hx-relative hx-p-6 hx-overflow-hidden hx-rounded-3xl hx-border hx-border-gray-200 hover:hx-border-gray-300 dark:hx-border-neutral-800 dark:hover:hx-border-neutral-700 before:hx-pointer-events-none before:hx-absolute before:hx-inset-0 before:hx-bg-glass-gradient{{ end }}"
|
||||
>
|
||||
<img src="{{ $image }}" width="{{ $imageWidth }}" height="{{ $imageHeight }}" {{ with $imageTitle }}alt="{{ $imageTitle }}"{{ end }}/>
|
||||
</a>
|
||||
</div>
|
||||
{{ end -}}
|
||||
</div>
|
@ -7,4 +7,6 @@ command = "cd exampleSite && hugo --gc --minify --themesDir ../.. -b ${DEPLOY_PR
|
||||
ignore = "false"
|
||||
|
||||
[build.environment]
|
||||
HUGO_VERSION = "0.117.0"
|
||||
HUGO_VERSION = "0.126.1"
|
||||
GO_VERSION = "1.22.3"
|
||||
NODE_VERSION = "22.2.0"
|
||||
|
@ -9,7 +9,7 @@ homepage = "https://github.com/imfing/hextra/"
|
||||
demosite = "https://imfing.github.io/hextra/"
|
||||
tags = ["Modern", "Elegant", "Blog", "Documentation", "Responsive", "Clean", "Light", "Dark", "Minimal"]
|
||||
features = ["Responsive", "Dark Mode", "Search", "Syntax Highlighting", "Multilingual", "Social", "Blog", "RSS", "Customization"]
|
||||
min_version = "0.111.0"
|
||||
min_version = "0.124.0"
|
||||
|
||||
[author]
|
||||
name = "Xin"
|
||||
|
Reference in New Issue
Block a user