mirror of
https://github.com/imfing/hextra.git
synced 2025-05-15 11:48:25 -04:00
Compare commits
33 Commits
aecb4ee503
...
6c23b4f314
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6c23b4f314 | ||
![]() |
168ecf91f4 | ||
![]() |
4c4f43779c | ||
![]() |
ff85e6951d | ||
![]() |
ec37876f4d | ||
![]() |
f65aca556d | ||
![]() |
7b7eb0f1f3 | ||
![]() |
80fae9f86d | ||
![]() |
1358c5b945 | ||
![]() |
b4d292010b | ||
![]() |
37089d237a | ||
![]() |
2565f372d1 | ||
![]() |
a97a1791cc | ||
![]() |
97ea67198b | ||
![]() |
9e7b13a0da | ||
![]() |
66489e5274 | ||
![]() |
2004648076 | ||
![]() |
0da6f97e99 | ||
![]() |
a4bfa2d97e | ||
![]() |
3a2ce0b5c0 | ||
![]() |
55af474f51 | ||
![]() |
b91cc79674 | ||
![]() |
68e1e25119 | ||
![]() |
8c789626be | ||
![]() |
a1c7acd6b5 | ||
![]() |
e444156bb9 | ||
![]() |
33f2cf653b | ||
![]() |
63f153999e | ||
![]() |
c62b1fd401 | ||
![]() |
fdfdef69b5 | ||
![]() |
462cc5b68d | ||
![]() |
f40c7fd5d4 | ||
![]() |
74fb165358 |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -17,6 +17,8 @@ assignees: ''
|
||||
2.
|
||||
3.
|
||||
|
||||
<!-- Provide a minimal example or link to a repository that reproduces the bug -->
|
||||
|
||||
**Expected Behavior**
|
||||
|
||||
<!-- What should have happened? -->
|
||||
|
15
.github/workflows/pages.yml
vendored
15
.github/workflows/pages.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HUGO_VERSION: 0.131.0
|
||||
HUGO_VERSION: 0.136.5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@ -41,10 +41,10 @@ jobs:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
go-version: '1.23'
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v4
|
||||
uses: actions/configure-pages@v5
|
||||
- name: Setup Hugo
|
||||
run: |
|
||||
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
|
||||
@ -54,11 +54,12 @@ jobs:
|
||||
# For maximum backward compatibility with Hugo modules
|
||||
HUGO_ENVIRONMENT: production
|
||||
HUGO_ENV: production
|
||||
# Use the latest release of the theme to build exampleSite
|
||||
run: |
|
||||
hugo \
|
||||
--minify \
|
||||
--themesDir=../.. --source=exampleSite \
|
||||
--baseURL "${{ steps.pages.outputs.base_url }}/"
|
||||
cd exampleSite && rm go.mod
|
||||
hugo mod init github.com/imfing/hextra/exampleSite
|
||||
hugo mod get -u github.com/imfing/hextra
|
||||
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
|
@ -21,7 +21,7 @@
|
||||
- **响应式布局和深色模式支持** - 在任何设备上看起来都足够美观, 无论是手机, 平板电脑或者电脑. 深色模式的支持使 Hextra 可以应对各种照明环境.
|
||||
- **快速且轻量** - 由 Hugo 强力支持, Hugo 是一个快如闪电的静态站点生成器, 这一切都只需一个可执行文件, Hextra 始终保持最小化, 无需 Javascript 或者 Node.js.
|
||||
- **全文搜索** - 集成了 Flexsearch 的全文搜索, 无需额外的配置.
|
||||
- **网站中的瑞士军刀** - Markdown, 代码高亮, LaTex 数学公式, diagrams 图表和 Shortcodes 都可以用于丰富你的内容. 目录, 面包屑导航, 分页, 侧边栏等均由 Hextra 自动生成。
|
||||
- **功能齐全** - Markdown, 代码高亮, LaTex 数学公式, diagrams 图表和 Shortcodes 都可以用于丰富你的内容. 目录, 面包屑导航, 分页, 侧边栏等均由 Hextra 自动生成。
|
||||
- **多语言和 SEO Ready** - Hugo 的多语言模式使得构建多语言网站更简单. 具有 SEO tags, Open Graph, 和 Twitter Cards 等诸多开箱即用的功能.
|
||||
|
||||
## 快速开始
|
||||
|
@ -1006,18 +1006,18 @@ video {
|
||||
}
|
||||
.hx-bg-primary-100 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / var(--tw-bg-opacity));
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 44) / var(--tw-bg-opacity));
|
||||
}
|
||||
.hx-bg-primary-400 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 66% / var(--tw-bg-opacity));
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 16) / var(--tw-bg-opacity));
|
||||
}
|
||||
.hx-bg-primary-600 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-bg-opacity));
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-bg-opacity));
|
||||
}
|
||||
.hx-bg-primary-700\/5 {
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 39% / 0.05);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 39) / 0.05);
|
||||
}
|
||||
.hx-bg-red-100 {
|
||||
--tw-bg-opacity: 1;
|
||||
@ -1274,7 +1274,7 @@ video {
|
||||
}
|
||||
.hx-text-primary-800 {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) 32% / var(--tw-text-opacity));
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 32) / var(--tw-text-opacity));
|
||||
}
|
||||
.hx-text-red-900 {
|
||||
--tw-text-opacity: 1;
|
||||
@ -1449,7 +1449,7 @@ video {
|
||||
}
|
||||
}
|
||||
.content :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)):is(html[class~="dark"] *) {
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / 0.1);
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 44) / 0.1);
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(241 245 249 / var(--tw-text-opacity));
|
||||
}
|
||||
@ -1517,7 +1517,7 @@ video {
|
||||
}
|
||||
.content :where(a):not(:where([class~=not-prose],[class~=not-prose] *)) {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-text-opacity));
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-text-opacity));
|
||||
text-decoration-line: underline;
|
||||
text-decoration-thickness: from-font;
|
||||
text-underline-position: from-font;
|
||||
@ -1551,7 +1551,7 @@ video {
|
||||
margin-bottom: 1rem;
|
||||
overflow-x: auto;
|
||||
border-radius: 0.75rem;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 39% / 0.05);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 39) / 0.05);
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
font-size: .9em;
|
||||
@ -1563,18 +1563,18 @@ video {
|
||||
|
||||
.content :where(pre):not(:where(.hextra-code-block pre, [class~=not-prose],[class~=not-prose] *)) {
|
||||
border-width: 1px;
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 24% / 0.2);
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 24) / 0.2);
|
||||
--tw-contrast: contrast(1.5);
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
||||
}
|
||||
}
|
||||
.content :where(pre):not(:where(.hextra-code-block pre, [class~=not-prose],[class~=not-prose] *)):is(html[class~="dark"] *) {
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 77% / 0.1);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 27) / 0.1);
|
||||
}
|
||||
@media (prefers-contrast: more) {
|
||||
|
||||
.content :where(pre):not(:where(.hextra-code-block pre, [class~=not-prose],[class~=not-prose] *)):is(html[class~="dark"] *) {
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / 0.4);
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 44) / 0.4);
|
||||
}
|
||||
}
|
||||
.content :where(code):not(:where(.hextra-code-block code, [class~=not-prose],[class~=not-prose] *)) {
|
||||
@ -2135,7 +2135,7 @@ article details > summary::before {
|
||||
}
|
||||
.hextra-code-block pre {
|
||||
overflow-x: auto;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 39% / 0.05);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 39) / 0.05);
|
||||
font-size: .9em;
|
||||
font-weight: 500;
|
||||
-webkit-font-smoothing: auto;
|
||||
@ -2145,18 +2145,18 @@ article details > summary::before {
|
||||
|
||||
.hextra-code-block pre {
|
||||
border-width: 1px;
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 24% / 0.2);
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 24) / 0.2);
|
||||
--tw-contrast: contrast(1.5);
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
||||
}
|
||||
}
|
||||
.hextra-code-block pre:is(html[class~="dark"] *) {
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 77% / 0.1);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 27) / 0.1);
|
||||
}
|
||||
@media (prefers-contrast: more) {
|
||||
|
||||
.hextra-code-block pre:is(html[class~="dark"] *) {
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / 0.4);
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 44) / 0.4);
|
||||
}
|
||||
}
|
||||
.hextra-code-block .filename {
|
||||
@ -2169,7 +2169,7 @@ article details > summary::before {
|
||||
white-space: nowrap;
|
||||
border-top-left-radius: 0.75rem;
|
||||
border-top-right-radius: 0.75rem;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 39% / 0.05);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 39) / 0.05);
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
padding-left: 1rem;
|
||||
@ -2179,7 +2179,7 @@ article details > summary::before {
|
||||
color: rgb(55 65 81 / var(--tw-text-opacity));
|
||||
}
|
||||
.hextra-code-block .filename:is(html[class~="dark"] *) {
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 77% / 0.1);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 27) / 0.1);
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(229 231 235 / var(--tw-text-opacity));
|
||||
}
|
||||
@ -2236,7 +2236,7 @@ article details > summary::before {
|
||||
.chroma .hl {
|
||||
display: block;
|
||||
width: 100%;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 32% / 0.1);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 32) / 0.1);
|
||||
}
|
||||
.hextra-cards {
|
||||
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--hextra-cards-grid-cols))), 1fr));
|
||||
@ -2348,13 +2348,13 @@ article details > summary::before {
|
||||
}
|
||||
.search-wrapper li .active {
|
||||
border-radius: 0.375rem;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 50% / 0.1);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 50) / 0.1);
|
||||
}
|
||||
@media (prefers-contrast: more) {
|
||||
|
||||
.search-wrapper li .active {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 50% / var(--tw-border-opacity));
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 50) / var(--tw-border-opacity));
|
||||
}
|
||||
}
|
||||
.search-wrapper .no-result {
|
||||
@ -2441,7 +2441,7 @@ article details > summary::before {
|
||||
}
|
||||
.search-wrapper .match {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-text-opacity));
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-text-opacity));
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.sidebar-container {
|
||||
@ -2621,12 +2621,14 @@ body:is(html[class~="dark"] *) {
|
||||
:root {
|
||||
--primary-hue: 212deg;
|
||||
--primary-saturation: 100%;
|
||||
--primary-lightness: 50%;
|
||||
--navbar-height: 4rem;
|
||||
--menu-height: 3.75rem;
|
||||
}
|
||||
.dark {
|
||||
--primary-hue: 204deg;
|
||||
--primary-saturation: 100%;
|
||||
--primary-lightness: 50%;
|
||||
}
|
||||
.placeholder\:hx-text-gray-500::-moz-placeholder {
|
||||
--tw-text-opacity: 1;
|
||||
@ -2723,11 +2725,11 @@ body:is(html[class~="dark"] *) {
|
||||
}
|
||||
.hover\:hx-bg-primary-50:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 97% / var(--tw-bg-opacity));
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 47) / var(--tw-bg-opacity));
|
||||
}
|
||||
.hover\:hx-bg-primary-700:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 39% / var(--tw-bg-opacity));
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 39) / var(--tw-bg-opacity));
|
||||
}
|
||||
.hover\:hx-bg-slate-50:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
@ -2747,7 +2749,7 @@ body:is(html[class~="dark"] *) {
|
||||
}
|
||||
.hover\:hx-text-primary-600:hover {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-text-opacity));
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-text-opacity));
|
||||
}
|
||||
.hover\:hx-opacity-60:hover {
|
||||
opacity: 0.6;
|
||||
@ -2784,7 +2786,7 @@ body:is(html[class~="dark"] *) {
|
||||
}
|
||||
.focus\:hx-ring-primary-300:focus {
|
||||
--tw-ring-opacity: 1;
|
||||
--tw-ring-color: hsl(var(--primary-hue) var(--primary-saturation) 77% / var(--tw-ring-opacity));
|
||||
--tw-ring-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 27) / var(--tw-ring-opacity));
|
||||
}
|
||||
.active\:hx-bg-gray-400\/20:active {
|
||||
background-color: rgb(156 163 175 / 0.2);
|
||||
@ -2829,11 +2831,11 @@ body:is(html[class~="dark"] *) {
|
||||
}
|
||||
.data-\[state\=selected\]\:hx-border-primary-500[data-state="selected"] {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 50% / var(--tw-border-opacity));
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 50) / var(--tw-border-opacity));
|
||||
}
|
||||
.data-\[state\=selected\]\:hx-text-primary-600[data-state="selected"] {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-text-opacity));
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-text-opacity));
|
||||
}
|
||||
.hx-group[data-theme="dark"] .group-data-\[theme\=dark\]\:hx-hidden {
|
||||
display: none;
|
||||
@ -2872,7 +2874,7 @@ body:is(html[class~="dark"] *) {
|
||||
|
||||
.contrast-more\:hx-border-primary-500 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 50% / var(--tw-border-opacity));
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 50) / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.contrast-more\:hx-border-transparent {
|
||||
@ -2987,14 +2989,14 @@ body:is(html[class~="dark"] *) {
|
||||
background-color: rgb(251 146 60 / 0.2);
|
||||
}
|
||||
.dark\:hx-bg-primary-300\/10:is(html[class~="dark"] *) {
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 77% / 0.1);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 27) / 0.1);
|
||||
}
|
||||
.dark\:hx-bg-primary-400\/10:is(html[class~="dark"] *) {
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 66% / 0.1);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 16) / 0.1);
|
||||
}
|
||||
.dark\:hx-bg-primary-600:is(html[class~="dark"] *) {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-bg-opacity));
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-bg-opacity));
|
||||
}
|
||||
.dark\:hx-bg-red-900\/30:is(html[class~="dark"] *) {
|
||||
background-color: rgb(127 29 29 / 0.3);
|
||||
@ -3048,7 +3050,7 @@ body:is(html[class~="dark"] *) {
|
||||
}
|
||||
.dark\:hx-text-primary-600:is(html[class~="dark"] *) {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-text-opacity));
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-text-opacity));
|
||||
}
|
||||
.dark\:hx-text-red-200:is(html[class~="dark"] *) {
|
||||
--tw-text-opacity: 1;
|
||||
@ -3137,14 +3139,14 @@ body:is(html[class~="dark"] *) {
|
||||
background-color: rgb(23 23 23 / var(--tw-bg-opacity));
|
||||
}
|
||||
.dark\:hover\:hx-bg-primary-100\/5:hover:is(html[class~="dark"] *) {
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / 0.05);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * 44) / 0.05);
|
||||
}
|
||||
.dark\:hover\:hx-bg-primary-700:hover:is(html[class~="dark"] *) {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 39% / var(--tw-bg-opacity));
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 39) / var(--tw-bg-opacity));
|
||||
}
|
||||
.hover\:dark\:hx-bg-primary-500\/10:is(html[class~="dark"] *):hover {
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) 50% / 0.1);
|
||||
background-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 50) / 0.1);
|
||||
}
|
||||
.dark\:hover\:hx-text-gray-100:hover:is(html[class~="dark"] *) {
|
||||
--tw-text-opacity: 1;
|
||||
@ -3172,7 +3174,7 @@ body:is(html[class~="dark"] *) {
|
||||
}
|
||||
.hover\:dark\:hx-text-primary-600:is(html[class~="dark"] *):hover {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-text-opacity));
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-text-opacity));
|
||||
}
|
||||
.dark\:hover\:hx-shadow-none:hover:is(html[class~="dark"] *) {
|
||||
--tw-shadow: 0 0 #0000;
|
||||
@ -3185,7 +3187,7 @@ body:is(html[class~="dark"] *) {
|
||||
}
|
||||
.dark\:focus\:hx-ring-primary-800:focus:is(html[class~="dark"] *) {
|
||||
--tw-ring-opacity: 1;
|
||||
--tw-ring-color: hsl(var(--primary-hue) var(--primary-saturation) 32% / var(--tw-ring-opacity));
|
||||
--tw-ring-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 32) / var(--tw-ring-opacity));
|
||||
}
|
||||
@media (prefers-contrast: more) {
|
||||
|
||||
@ -3205,7 +3207,7 @@ body:is(html[class~="dark"] *) {
|
||||
|
||||
.contrast-more\:dark\:hx-border-primary-500:is(html[class~="dark"] *) {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 50% / var(--tw-border-opacity));
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 50) / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.dark\:contrast-more\:hx-border-neutral-400:is(html[class~="dark"] *) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
@media (max-width: 767px) {
|
||||
.sidebar-container {
|
||||
.hextra-sidebar-container {
|
||||
@apply hx-fixed hx-pt-[calc(var(--navbar-height))] hx-top-0 hx-w-full hx-bottom-0 hx-z-[15] hx-overscroll-contain hx-bg-white dark:hx-bg-dark;
|
||||
transition: transform 0.8s cubic-bezier(0.52, 0.16, 0.04, 1);
|
||||
will-change: transform, opacity;
|
||||
@ -8,7 +8,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-container {
|
||||
.hextra-sidebar-container {
|
||||
li > div {
|
||||
@apply hx-h-0;
|
||||
}
|
||||
@ -18,4 +18,19 @@
|
||||
li.open > a > span > svg > path {
|
||||
@apply hx-rotate-90;
|
||||
}
|
||||
|
||||
.hextra-sidebar-item-list {
|
||||
@apply hx-relative hx-flex hx-flex-col hx-gap-1 before:hx-absolute before:hx-inset-y-1 before:hx-w-px before:hx-bg-gray-200 ltr:hx-ml-3 ltr:hx-pl-3 ltr:before:hx-left-0 rtl:hx-mr-3 rtl:hx-pr-3 rtl:before:hx-right-0 dark:before:hx-bg-neutral-800;
|
||||
}
|
||||
|
||||
.hextra-sidebar-item-link {
|
||||
@apply hx-flex hx-items-center hx-justify-between hx-gap-2 hx-cursor-pointer hx-rounded hx-px-2 hx-py-1.5 hx-text-sm hx-transition-colors;
|
||||
|
||||
&.active {
|
||||
@apply hx-bg-primary-100 hx-font-semibold hx-text-primary-800 contrast-more:hx-border contrast-more:hx-border-primary-500 dark:hx-bg-primary-400/10 dark:hx-text-primary-600 contrast-more:dark:hx-border-primary-500;
|
||||
}
|
||||
&.inactive {
|
||||
@apply hx-text-gray-500 hover:hx-bg-gray-100 hover:hx-text-gray-900 contrast-more:hx-border contrast-more:hx-border-transparent contrast-more:hx-text-gray-900 contrast-more:hover:hx-border-gray-900 dark:hx-text-neutral-400 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50 contrast-more:dark:hx-text-gray-50 contrast-more:dark:hover:hx-border-gray-50;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ body {
|
||||
:root {
|
||||
--primary-hue: 212deg;
|
||||
--primary-saturation: 100%;
|
||||
--primary-lightness: 50%;
|
||||
--navbar-height: 4rem;
|
||||
--menu-height: 3.75rem;
|
||||
}
|
||||
@ -33,4 +34,5 @@ body {
|
||||
.dark {
|
||||
--primary-hue: 204deg;
|
||||
--primary-saturation: 100%;
|
||||
--primary-lightness: 50%;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
cache: 100,
|
||||
document: {
|
||||
id: 'id',
|
||||
store: ['title'],
|
||||
store: ['title', 'crumb'],
|
||||
index: "content"
|
||||
}
|
||||
});
|
||||
@ -210,7 +210,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
cache: 100,
|
||||
document: {
|
||||
id: 'id',
|
||||
store: ['title', 'content', 'url', 'display'],
|
||||
store: ['title', 'content', 'url', 'display', 'crumb'],
|
||||
index: "content",
|
||||
tag: 'pageId'
|
||||
}
|
||||
@ -222,6 +222,30 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
for (const route in data) {
|
||||
let pageContent = '';
|
||||
++pageId;
|
||||
const urlParts = route.split('/').filter(x => x != "" && !x.startsWith('#'));
|
||||
|
||||
let crumb = '';
|
||||
let searchUrl = '/'
|
||||
for (let i = 0; i < urlParts.length; i++) {
|
||||
const urlPart = urlParts[i];
|
||||
searchUrl += urlPart + '/'
|
||||
|
||||
const crumbData = data[searchUrl];
|
||||
if (!crumbData) {
|
||||
console.warn('Excluded page', searchUrl, '- will not be included for search result breadcrumb for', route);
|
||||
continue;
|
||||
}
|
||||
|
||||
let title = data[searchUrl].title;
|
||||
if (title == "_index") {
|
||||
title = urlPart.split("-").map(x => x).join(" ");
|
||||
}
|
||||
crumb += title;
|
||||
|
||||
if (i < urlParts.length - 1) {
|
||||
crumb += ' > ';
|
||||
}
|
||||
}
|
||||
|
||||
for (const heading in data[route].data) {
|
||||
const [hash, text] = heading.split('#');
|
||||
@ -235,6 +259,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
id: url,
|
||||
url,
|
||||
title,
|
||||
crumb,
|
||||
pageId: `page_${pageId}`,
|
||||
content: title,
|
||||
...(paragraphs[0] && { display: paragraphs[0] })
|
||||
@ -245,6 +270,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
id: `${url}_${i}`,
|
||||
url,
|
||||
title,
|
||||
crumb,
|
||||
pageId: `page_${pageId}`,
|
||||
content: paragraphs[i]
|
||||
});
|
||||
@ -256,6 +282,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
window.pageIndex.add({
|
||||
id: pageId,
|
||||
title: data[route].title,
|
||||
crumb,
|
||||
content: pageContent
|
||||
});
|
||||
|
||||
@ -308,7 +335,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
_page_rk: i,
|
||||
_section_rk: j,
|
||||
route: url,
|
||||
prefix: isFirstItemOfPage ? result.doc.title : undefined,
|
||||
prefix: isFirstItemOfPage ? result.doc.crumb : undefined,
|
||||
children: { title, content }
|
||||
})
|
||||
isFirstItemOfPage = false
|
||||
|
@ -3,7 +3,7 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const menu = document.querySelector('.hamburger-menu');
|
||||
const overlay = document.querySelector('.mobile-menu-overlay');
|
||||
const sidebarContainer = document.querySelector('.sidebar-container');
|
||||
const sidebarContainer = document.querySelector('.hextra-sidebar-container');
|
||||
|
||||
// Initialize the overlay
|
||||
const overlayClasses = ['hx-fixed', 'hx-inset-0', 'hx-z-10', 'hx-bg-black/80', 'dark:hx-bg-black/60'];
|
||||
|
@ -1,12 +1,78 @@
|
||||
/**
|
||||
* Check if the element is visible.
|
||||
* @param {Element} element Dom element
|
||||
* @returns boolean
|
||||
*/
|
||||
function isVisible(element) {
|
||||
return element.offsetWidth > 0 || element.offsetHeight > 0;
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
scrollToActiveItem();
|
||||
enableCollapsibles();
|
||||
});
|
||||
|
||||
function enableCollapsibles() {
|
||||
const buttons = document.querySelectorAll(".hextra-sidebar-collapsible-button");
|
||||
buttons.forEach(function (button) {
|
||||
button.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
const list = button.parentElement.parentElement;
|
||||
if (list) {
|
||||
list.classList.toggle("open")
|
||||
list.classList.toggle("open");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const isCached = "{{- site.Params.page.sidebar.cache | default false -}}" === "true";
|
||||
const currentPagePath = window.location.href;
|
||||
|
||||
if (isCached) {
|
||||
// find the current page in the sidebar and open the parent lists
|
||||
const sidebar = document.querySelector(".hextra-sidebar-container");
|
||||
if (sidebar) {
|
||||
// find a tags and compare href with current page path
|
||||
const links = sidebar.querySelectorAll("a");
|
||||
links.forEach(function (link) {
|
||||
const linkPath = link.href;
|
||||
|
||||
if (currentPagePath === linkPath) {
|
||||
// add active class to the link
|
||||
link.classList.add("active");
|
||||
link.classList.remove("inactive");
|
||||
|
||||
if (!isVisible(link)) {
|
||||
return;
|
||||
}
|
||||
// recursively open parent lists
|
||||
let parent = link.parentElement;
|
||||
while (parent && !parent.classList.contains("hextra-sidebar-container")) {
|
||||
if (parent.tagName === "LI" && parent.classList.contains("hextra-sidebar-item")) {
|
||||
parent.classList.add("open");
|
||||
}
|
||||
parent = parent.parentElement;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function scrollToActiveItem() {
|
||||
const sidebarScrollbar = document.querySelector("aside.sidebar-container > .hextra-scrollbar");
|
||||
const activeItems = document.querySelectorAll(".sidebar-active-item");
|
||||
const visibleActiveItem = Array.from(activeItems).find(function (activeItem) {
|
||||
return activeItem.getBoundingClientRect().height > 0;
|
||||
});
|
||||
|
||||
if (!visibleActiveItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
const yOffset = visibleActiveItem.clientHeight;
|
||||
const yDistance = visibleActiveItem.getBoundingClientRect().top - sidebarScrollbar.getBoundingClientRect().top;
|
||||
sidebarScrollbar.scrollTo({
|
||||
behavior: "instant",
|
||||
top: yDistance - yOffset,
|
||||
});
|
||||
}
|
||||
|
1752
assets/lib/mermaid/mermaid.min.js
vendored
1752
assets/lib/mermaid/mermaid.min.js
vendored
File diff suppressed because one or more lines are too long
@ -34,12 +34,13 @@ The color of text mixed with `other text` can customized with:
|
||||
|
||||
### Primary Color
|
||||
|
||||
The primary color of the theme can be customized by setting the `--primary-hue` and `--primary-saturation` variables:
|
||||
The primary color of the theme can be customized by setting the `--primary-hue`, `--primary-saturation` and `--primary-lightness` variables:
|
||||
|
||||
```css {filename="assets/css/custom.css"}
|
||||
:root {
|
||||
--primary-hue: 100deg;
|
||||
--primary-saturation: 90%;
|
||||
--primary-lightness: 50%;
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -12,6 +12,12 @@ Open source projects powered by Hextra
|
||||
</p>
|
||||
|
||||
{{< cards >}}
|
||||
{{< card
|
||||
link="https://github.com/mightymoud/sidekick"
|
||||
title="Sidekick"
|
||||
image="https://github.com/user-attachments/assets/4ae2a9d7-77b6-42eb-a9d7-5c4599f0f812"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/welding-torch/installc"
|
||||
|
@ -4,7 +4,7 @@ changeTheme: "Darstellung ändern"
|
||||
copyCode: "Code kopieren"
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "Dunkel"
|
||||
editThisPage: "Diese Seite auf Github bearbeiten →"
|
||||
editThisPage: "Diese Seite auf GitHub bearbeiten →"
|
||||
lastUpdated: "Zuletzt aktualisiert am"
|
||||
light: "Hell"
|
||||
noResultsFound: "Keine Ergebnisse gefunden."
|
||||
|
@ -3,7 +3,7 @@ changeLanguage: "언어변경"
|
||||
changeTheme: "테마변경"
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "어두운 테마"
|
||||
editThisPage: "Github에서 편집하기 →"
|
||||
editThisPage: "GitHub에서 편집하기 →"
|
||||
lastUpdated: "마지막 수정일자"
|
||||
light: "밝은 테마"
|
||||
noResultsFound: "결과 없음"
|
||||
|
14
i18n/ru.yaml
Normal file
14
i18n/ru.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: 'Поиск...'
|
@ -4,7 +4,7 @@ changeTheme: "Змінити тему"
|
||||
copyCode: "Скопіювати код"
|
||||
copyright: "2024 Проєкт Hextra."
|
||||
dark: "Темна"
|
||||
editThisPage: "Редагувати цю сторінку на Github →"
|
||||
editThisPage: "Редагувати цю сторінку на GitHub →"
|
||||
lastUpdated: "Востаннє оновлено"
|
||||
light: "Світла"
|
||||
noResultsFound: "Не знайдено результатів"
|
||||
|
12
layouts/partials/components/sidebar/bottom.html
Normal file
12
layouts/partials/components/sidebar/bottom.html
Normal file
@ -0,0 +1,12 @@
|
||||
{{- range site.Menus.sidebar }}
|
||||
{{- $name := or (T .Identifier) .Name }}
|
||||
{{- if eq .Params.type "separator" }}
|
||||
<li class="[word-break:break-word] hx-mt-5 hx-mb-2 hx-px-2 hx-py-1.5 hx-text-sm hx-font-semibold hx-text-gray-900 first:hx-mt-0 dark:hx-text-gray-100">
|
||||
<span class="hx-cursor-default">{{ $name }}</span>
|
||||
</li>
|
||||
{{- else }}
|
||||
<li>
|
||||
{{- partial "components/sidebar/item-link" (dict "active" false "title" $name "link" (.URL | relLangURL)) -}}
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end -}}
|
@ -0,0 +1,5 @@
|
||||
<span class="hextra-sidebar-collapsible-button">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="hx-h-[18px] hx-min-w-[18px] hx-rounded-sm hx-p-0.5 hover:hx-bg-gray-800/5 dark:hover:hx-bg-gray-100/5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" class="hx-origin-center hx-transition-transform rtl:-hx-rotate-180"></path>
|
||||
</svg>
|
||||
</span>
|
@ -0,0 +1,51 @@
|
||||
{{- $context := . -}}
|
||||
|
||||
{{- $pages := union .RegularPages .Sections -}}
|
||||
{{- $pages = where $pages "Params.sidebar.exclude" "!=" true -}}
|
||||
|
||||
{{- $data := slice -}}
|
||||
|
||||
{{- range $pages.ByWeight -}}
|
||||
{{ $structure := (partial "sidebar/section-walk" .) | unmarshal -}}
|
||||
{{ $data = $data | append $structure -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- define "partials/sidebar/section-walk" -}}
|
||||
{{- with . -}}
|
||||
{
|
||||
"title": "{{ partial "utils/title" . }}",
|
||||
"link": "{{ .RelPermalink }}",
|
||||
"toc": {{ partial "sidebar/section-page-toc" . }},
|
||||
"open": {{ .Params.sidebar.open | default false }}
|
||||
{{- if .IsSection }},
|
||||
"items": [
|
||||
{{ $pages := union .RegularPages .Sections -}}
|
||||
{{ $pages = where $pages "Params.sidebar.exclude" "!=" true -}}
|
||||
{{ range $index, $page := $pages.ByWeight -}}
|
||||
{{ partial "sidebar/section-walk" . }}{{ if not (ge $index (sub (len $pages) 1)) }},{{ end -}}
|
||||
{{ end -}}
|
||||
]
|
||||
{{ end -}}
|
||||
}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "partials/sidebar/section-page-toc" -}}
|
||||
{{/* Get level 2 headings list used mainly for mobile navigation */}}
|
||||
[
|
||||
{{- with .Fragments.Headings -}}
|
||||
{{/* Loop over level 1 headings */}}
|
||||
{{- range . }}
|
||||
{{- with .Headings }}
|
||||
{{ $headings := . }}
|
||||
{{- range $index, $heading := $headings }}
|
||||
{{ $heading.Title | jsonify (dict "noHTMLEscape" true) }}
|
||||
{{- if not (ge $index (sub (len $headings) 1)) }},{{ end -}}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
]
|
||||
{{- end -}}
|
||||
|
||||
{{ return ($data | jsonify (dict "noHTMLEscape" true)) }}
|
20
layouts/partials/components/sidebar/get-section-data.html
Normal file
20
layouts/partials/components/sidebar/get-section-data.html
Normal file
@ -0,0 +1,20 @@
|
||||
{{/* Get section sidebar config from Hugo `data` directory
|
||||
|
||||
If the site is multilingual, the sidebar data is stored in a language-specific
|
||||
directory. For example, the English sidebar data is stored in `data/en/sidebar.yaml`.
|
||||
*/}}
|
||||
{{ $data := "" }}
|
||||
{{ $section := .Section | default "index" }}
|
||||
{{ $filename := "sidebar" }}
|
||||
|
||||
{{ if hugo.IsMultilingual }}
|
||||
{{ with (index site.Data site.Language.Lang $filename $section) }}
|
||||
{{ $data = . }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ with (index site.Data $filename $section) }}
|
||||
{{ $data = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $data }}
|
18
layouts/partials/components/sidebar/item-link.html
Normal file
18
layouts/partials/components/sidebar/item-link.html
Normal file
@ -0,0 +1,18 @@
|
||||
{{- $external := strings.HasPrefix .link "http" -}}
|
||||
|
||||
{{- $activeClass := cond (.active) "active" "inactive" -}}
|
||||
|
||||
|
||||
<a
|
||||
class="hextra-sidebar-item-link {{ $activeClass }} [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] [word-break:break-word]"
|
||||
href="{{ .link }}"
|
||||
{{ if $external }}target="_blank" rel="noreferer"{{ end }}
|
||||
>
|
||||
{{- .title -}}
|
||||
{{- with .context }}
|
||||
{{- if or .RegularPages .Sections }}
|
||||
{{- partialCached "components/sidebar/collapsible-button" . }}
|
||||
{{- end }}
|
||||
{{ end -}}
|
||||
{{- with .items }}{{- partialCached "components/sidebar/collapsible-button" site.Home }}{{ end -}}
|
||||
</a>
|
16
layouts/partials/components/sidebar/render-data.html
Normal file
16
layouts/partials/components/sidebar/render-data.html
Normal file
@ -0,0 +1,16 @@
|
||||
{{- $page := .page -}}
|
||||
{{- $pageLink := $page.RelPermalink -}}
|
||||
{{- $cached := .cached | default false }}
|
||||
|
||||
{{- range .data -}}
|
||||
{{- $active := and (not $cached) (or (eq $pageLink .link) (eq (strings.TrimSuffix "/" $pageLink) .link)) -}}
|
||||
{{- $containsPage := hasPrefix $pageLink .link -}}
|
||||
{{- $shouldOpen := or (.open) $containsPage $active | default false -}}
|
||||
|
||||
<li class="hextra-sidebar-item {{ if $shouldOpen }}open{{ end }}">
|
||||
{{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
|
||||
{{- if .items -}}
|
||||
{{- partial "components/sidebar/render-items" (dict "items" .items "link" $pageLink "cached" $cached) -}}
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{ end }}
|
21
layouts/partials/components/sidebar/render-items.html
Normal file
21
layouts/partials/components/sidebar/render-items.html
Normal file
@ -0,0 +1,21 @@
|
||||
{{- $items := .items -}}
|
||||
{{- $pageLink := .link -}}
|
||||
{{- $cached := .cached | default false }}
|
||||
|
||||
|
||||
<div class="ltr:hx-pr-0 hx-overflow-hidden">
|
||||
<ul class="hextra-sidebar-item-list">
|
||||
{{- range $items }}
|
||||
{{- $active := and (not $cached) (or (eq $pageLink .link) (eq (strings.TrimSuffix "/" $pageLink) .link)) -}}
|
||||
{{- $containsPage := hasPrefix $pageLink .link -}}
|
||||
{{- $shouldOpen := or (.open) $containsPage $active | default false -}}
|
||||
|
||||
<li class="hextra-sidebar-item hx-flex hx-flex-col {{ if $shouldOpen }}open{{ end }}">
|
||||
{{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
|
||||
{{- if .items -}}
|
||||
{{- partial "components/sidebar/render-items" (dict "items" .items "link" $pageLink "cached" $cached) -}}
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
</div>
|
@ -6,7 +6,7 @@
|
||||
{{ else -}}
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
{{ end -}}
|
||||
{{ partialCached "favicons.html" . }}
|
||||
{{ partialCached "favicons.html" . -}}
|
||||
<title>
|
||||
{{- if .IsHome -}}
|
||||
{{ .Site.Title -}}
|
||||
@ -17,17 +17,17 @@
|
||||
</title>
|
||||
<meta name="description" content="{{ partial "utils/page-description.html" . }}" />
|
||||
|
||||
{{ with .Params.canonical }}
|
||||
{{- with .Params.canonical -}}
|
||||
<link rel="canonical" href="{{ . }}" itemprop="url" />
|
||||
{{ else }}
|
||||
{{- else -}}
|
||||
<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{ partial "opengraph.html" . }}
|
||||
{{ template "_internal/schema.html" . -}}
|
||||
{{ template "_internal/twitter_cards.html" . -}}
|
||||
{{- partial "opengraph.html" . -}}
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
||||
|
||||
{{ partialCached "head-css.html" . }}
|
||||
{{- partialCached "head-css.html" . -}}
|
||||
|
||||
|
||||
<!-- Google Analytics -->
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
{{/* Display icon menu item */}}
|
||||
{{- if .Params.icon -}}
|
||||
{{- $rel := cond (eq .Params.icon "mastodon") "noreferer me" "noreferer" }}
|
||||
{{- $rel := cond (eq .Params.icon "mastodon") "noreferrer me" "noreferrer" }}
|
||||
<a class="hx-p-2 hx-text-current" {{ if $external }}target="_blank" rel="{{ $rel }}"{{ end }} href="{{ $link }}" title="{{ or (T .Identifier) .Name | safeHTML }}">
|
||||
{{- partial "utils/icon.html" (dict "name" .Params.icon "attributes" "height=24") -}}
|
||||
<span class="hx-sr-only">{{ or (T .Identifier) .Name | safeHTML }}</span>
|
||||
@ -53,7 +53,7 @@
|
||||
<a
|
||||
title="{{ or (T .Identifier) .Name | safeHTML }}"
|
||||
href="{{ $link }}"
|
||||
{{ if $external }}target="_blank" rel="noreferer"{{ end }}
|
||||
{{ if $external }}target="_blank" rel="noreferrer"{{ end }}
|
||||
class="hx-text-sm contrast-more:hx-text-gray-700 contrast-more:dark:hx-text-gray-100 hx-relative -hx-ml-2 hx-hidden hx-whitespace-nowrap hx-p-2 md:hx-inline-block {{ $activeClass }}"
|
||||
>
|
||||
<span class="hx-text-center">{{ or (T .Identifier) .Name | safeHTML }}</span>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{{- $jsLang := resources.Get "js/lang.js" -}}
|
||||
{{- $jsCodeCopy := resources.Get "js/code-copy.js" -}}
|
||||
{{- $jsFileTree := resources.Get "js/filetree.js" -}}
|
||||
{{- $jsSidebar := resources.Get "js/sidebar.js" -}}
|
||||
{{- $jsSidebar := resources.Get "js/sidebar.js" | resources.ExecuteAsTemplate "sidebar.js" . -}}
|
||||
{{- $jsBackToTop := resources.Get "js/back-to-top.js" -}}
|
||||
|
||||
{{- $scripts := slice $jsTheme $jsMenu $jsCodeCopy $jsTabs $jsLang $jsFileTree $jsSidebar $jsBackToTop | resources.Concat "js/main.js" -}}
|
||||
|
6
layouts/partials/shortcodes/cards.html
Normal file
6
layouts/partials/shortcodes/cards.html
Normal file
@ -0,0 +1,6 @@
|
||||
{{- $cols := .cols | default 3 -}}
|
||||
{{- $content := .content -}}
|
||||
|
||||
<div class="hextra-cards hx-mt-4 hx-gap-4 hx-grid not-prose" style="--hextra-cards-grid-cols: {{ $cols }};">
|
||||
{{- $content -}}
|
||||
</div>
|
95
layouts/partials/sidebar-ng.html
Normal file
95
layouts/partials/sidebar-ng.html
Normal file
@ -0,0 +1,95 @@
|
||||
{{- $context := .context -}}
|
||||
|
||||
{{- $disableSidebar := .disableSidebar | default false -}}
|
||||
{{- $displayPlaceholder := .displayPlaceholder | default false -}}
|
||||
|
||||
{{- $sidebarClass := cond $disableSidebar (cond $displayPlaceholder "md:hx-hidden xl:hx-block" "md:hx-hidden") "md:hx-sticky" -}}
|
||||
|
||||
{{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}}
|
||||
{{- $pageURL := $context.RelPermalink -}}
|
||||
|
||||
{{- $data := slice -}}
|
||||
{{- $dataMobile := slice -}}
|
||||
|
||||
{{- if (eq site.Params.page.sidebar.source "data") -}}
|
||||
{{ $data = partialCached "components/sidebar/get-section-data" $context $context.Section }}
|
||||
{{- $dataMobile = $data -}}
|
||||
{{- else -}}
|
||||
{{- $data = (partialCached "components/sidebar/generate-section-data" $navRoot $navRoot) | unmarshal -}}
|
||||
{{- $dataMobile = (partialCached "components/sidebar/generate-section-data" site.Home site.Home) | unmarshal -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $shouldCache := site.Params.page.sidebar.cache | default false -}}
|
||||
|
||||
{{/* EXPERIMENTAL */}}
|
||||
{{- if .context.Params.sidebar.hide -}}
|
||||
{{- $disableSidebar = true -}}
|
||||
{{- $displayPlaceholder = true -}}
|
||||
{{- end -}}
|
||||
|
||||
<div class="mobile-menu-overlay [transition:background-color_1.5s_ease] hx-fixed hx-inset-0 hx-z-10 hx-bg-black/80 dark:hx-bg-black/60 hx-hidden"></div>
|
||||
|
||||
<aside class="hextra-sidebar-container hx-flex hx-flex-col print:hx-hidden md:hx-top-16 md:hx-shrink-0 md:hx-w-64 md:hx-self-start max-md:[transform:translate3d(0,-100%,0)] {{ $sidebarClass }}">
|
||||
{{/* Search bar on small screen */}}
|
||||
{{- partialCached "components/sidebar/mobile-search" . -}}
|
||||
|
||||
|
||||
<div class="hextra-scrollbar hx-overflow-y-auto hx-overflow-x-hidden hx-p-4 hx-grow md:hx-h-[calc(100vh-var(--navbar-height)-var(--menu-height))]">
|
||||
{{/* Mobile Navigation */}}
|
||||
<ul class="hx-flex hx-flex-col hx-gap-1 md:hx-hidden">
|
||||
{{- with $dataMobile -}}
|
||||
{{- partial "components/sidebar/render-data" (dict "data" . "page" $context) -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
|
||||
{{/* Sidebar on large screen */}}
|
||||
{{- if $disableSidebar -}}
|
||||
{{- if $displayPlaceholder }}<div class="max-xl:hx-hidden hx-h-0 hx-w-64 hx-shrink-0"></div>{{ end -}}
|
||||
{{ .context.Scratch.Set "enableFooterSwitches" true }}
|
||||
{{- else -}}
|
||||
<ul class="hx-flex hx-flex-col hx-gap-1 max-md:hx-hidden">
|
||||
{{- with $data -}}
|
||||
{{- if $shouldCache -}}
|
||||
{{- partialCached "components/sidebar/render-data" (dict "data" . "page" $context "cached" $shouldCache) $navRoot -}}
|
||||
{{- else -}}
|
||||
{{- partial "components/sidebar/render-data" (dict "data" . "page" $context "cached" $shouldCache) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- partialCached "components/sidebar/bottom" $context site.Home -}}
|
||||
</ul>
|
||||
{{ end -}}
|
||||
</div>
|
||||
{{- partial "components/sidebar/switches" (dict "context" $context "disableSidebar" $disableSidebar) -}}
|
||||
</aside>
|
||||
|
||||
{{- define "partials/components/sidebar/mobile-search" -}}
|
||||
<div class="hx-px-4 hx-pt-4 md:hx-hidden">
|
||||
{{- partialCached "search.html" . -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- define "partials/components/sidebar/switches" -}}
|
||||
{{- $context := .context -}}
|
||||
{{- $disableSidebar := .disableSidebar -}}
|
||||
{{/* Hide theme switch when sidebar is disabled */}}
|
||||
{{ $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 -}}
|
||||
{{- partial "language-switch" (dict "context" $context "grow" true) -}}
|
||||
{{- with $displayThemeToggle }}{{ partial "theme-toggle" (dict "hideLabel" true) }}{{ end -}}
|
||||
{{- else -}}
|
||||
{{- with $displayThemeToggle -}}
|
||||
<div class="hx-flex hx-grow hx-flex-col">{{ partial "theme-toggle" }}</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
@ -160,7 +160,7 @@
|
||||
hx-text-gray-500 hover:hx-bg-gray-100 hover:hx-text-gray-900 contrast-more:hx-border contrast-more:hx-border-transparent contrast-more:hx-text-gray-900 contrast-more:hover:hx-border-gray-900 dark:hx-text-neutral-400 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50 contrast-more:dark:hx-text-gray-50 contrast-more:dark:hover:hx-border-gray-50
|
||||
{{- end -}}"
|
||||
href="{{ .link }}"
|
||||
{{ if $external }}target="_blank" rel="noreferer"{{ end }}
|
||||
{{ if $external }}target="_blank" rel="noreferrer"{{ end }}
|
||||
>
|
||||
{{- .title -}}
|
||||
{{- with .context }}
|
||||
|
@ -38,7 +38,7 @@
|
||||
{{- $editURL = urls.JoinPath $editURL $sourceDir $path -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<a class="hx-text-xs hx-font-medium hx-text-gray-500 hover:hx-text-gray-900 dark:hx-text-gray-400 dark:hover:hx-text-gray-100 contrast-more:hx-text-gray-800 contrast-more:dark:hx-text-gray-50" href="{{ $editURL }}" target="_blank" rel="noreferer">{{ $editThisPage }}</a>
|
||||
<a class="hx-text-xs hx-font-medium hx-text-gray-500 hover:hx-text-gray-900 dark:hx-text-gray-400 dark:hover:hx-text-gray-100 contrast-more:hx-text-gray-800 contrast-more:dark:hx-text-gray-50" href="{{ $editURL }}" target="_blank" rel="noreferrer">{{ $editThisPage }}</a>
|
||||
{{- end -}}
|
||||
{{/* Scroll To Top */}}
|
||||
<button aria-hidden="true" id="backToTop" onClick="scrollUp();" class="hx-transition-all hx-duration-75 hx-opacity-0 hx-text-xs hx-font-medium hx-text-gray-500 hover:hx-text-gray-900 dark:hx-text-gray-400 dark:hover:hx-text-gray-100 contrast-more:hx-text-gray-800 contrast-more:dark:hx-text-gray-50">
|
||||
|
@ -1,5 +1,3 @@
|
||||
{{- $cols := .Get "cols" | default 3 -}}
|
||||
|
||||
<div class="hextra-cards hx-mt-4 hx-gap-4 hx-grid not-prose" style="--hextra-cards-grid-cols: {{ $cols }};">
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
{{- partial "shortcodes/cards" (dict "cols" $cols "content" .Inner) -}}
|
||||
|
@ -3,10 +3,18 @@ const colors = require('tailwindcss/colors')
|
||||
const makePrimaryColor =
|
||||
l =>
|
||||
({ opacityValue }) => {
|
||||
return (
|
||||
`hsl(var(--primary-hue) var(--primary-saturation) ${l}%` +
|
||||
(opacityValue ? ` / ${opacityValue})` : ')')
|
||||
)
|
||||
let result = "hsl(var(--primary-hue) var(--primary-saturation) ";
|
||||
if (l <= 50) {
|
||||
// Interpolate between lower values
|
||||
result+= `calc(calc(var(--primary-lightness) / 50) * ${l})`;
|
||||
}
|
||||
else {
|
||||
// Interpolate between higher values
|
||||
result+= `calc(var(--primary-lightness) + calc(calc(100% - var(--primary-lightness)) / 50) * ${l - 50})`;
|
||||
}
|
||||
|
||||
result += (opacityValue ? ` / ${opacityValue})` : ')');
|
||||
return result;
|
||||
}
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
|
@ -25,4 +25,4 @@ tasks:
|
||||
- curl -o assets/lib/katex/katex.min.css https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
|
||||
- curl -o assets/lib/katex/auto-render.min.js https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js
|
||||
- curl -o assets/lib/katex/mhchem.min.js https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mhchem.min.js
|
||||
- curl -o assets/lib/mermaid/mermaid.min.js https://cdn.jsdelivr.net/npm/mermaid@10.9.0/dist/mermaid.min.js
|
||||
- curl -o assets/lib/mermaid/mermaid.min.js https://cdn.jsdelivr.net/npm/mermaid@11.3.0/dist/mermaid.min.js
|
||||
|
Loading…
x
Reference in New Issue
Block a user