Compare commits

..

42 Commits

Author SHA1 Message Date
Xin
7191e25958 fix: set top margin to zero for nested list (#276) 2024-02-03 09:09:16 -05:00
Xin
c630805511 fix: details toggle display issue (#273)
when more than two lines of summary are provided
2024-02-02 23:37:54 +00:00
cb274c8ac5 feat: add canonical to head.html (#269)
By adding `canonical` parameter to the front matter and specifying the URL, the canonical URL is added. 
If no canonical URL is needed to be specified, the layout will use the current page address for canonical tag. 

Example: 

```
---
title: "Page Title"
description: "Page description"
canonical: "https://canonicalurl.com"
---
2024-02-01 22:52:41 +00:00
fbe1aac123 i18n: add german translation (#271)
Signed-off-by: Achim Krämer <39946364+pxlfrk@users.noreply.github.com>
2024-02-01 22:48:22 +00:00
Xin
ff8f2537ca fix: accurate editURL resolution in translated sites (#264) 2024-01-21 10:33:49 +00:00
728fe21ef1 chore: add canonical URL to head template (#261) 2024-01-19 21:56:21 +00:00
fc964f11a6 showcase: clever cloud documentation (#262) 2024-01-19 21:34:32 +00:00
09e9f52019 chore(i18n): add Czech translation (#246)
Czech translation
2024-01-10 14:52:58 +00:00
f5e4283961 chore: add rel="me" attribute to Mastodon navbar icon (#243)
* Add rel="me" attribute to Mastodon navbar icon

The rel="me" attribute enables verified links on the linked Mastodon profile

* Set $rel based on icon name
2024-01-08 18:25:54 +00:00
10f1d85ab4 docs: update zh-cn translation (#236)
* Update customization.zh-cn.md

* Translate: Update translation of outdated docs

* Fix error
2024-01-08 18:24:38 +00:00
fd9a87a86a fix(docs): add editURL.enable = true (#245)
The MR documents the requirement to enable editURL setting.


[A  prior commit](04a5c7378a (diff-5311bf4e1519696010f8298385d9de30210dfcd9dee8785f6deba3a084b62eecL26)) the behavior changed from a default of "disable = false" to a default of "enabled = false".
2024-01-08 18:22:15 +00:00
1f9e7c8b39 chore: add Codeberg icon (#244) 2024-01-08 18:19:37 +00:00
7772313a53 docs: correct editURL config instruction (#215)
* docs: fix the documentation error about editURL

* docs: fix the documentation error about editURL

* Update configuration.md

* Update configuration.zh-cn.md

---------

Co-authored-by: Xin <xin@imfing.com>
2023-11-21 20:50:29 +00:00
7f0a35ab48 chore: add Osuny to showcase (#218) 2023-11-21 08:36:06 -05:00
35c733b7ee chore: increase time for "copied" animation duration (#214)
* align-logo-footer

add vertical align 2px for logo footer

* modify logo align in footer

* noobie things

* modify logo & vertical align

* build css

* revert change in icons.yaml

* increase duration for copied button effect

* Update hugo_stats.json

* Update main.css

* Update footer.html

* modify timeout to 1000 (1sec)
2023-11-21 00:07:14 +00:00
aad68d8afd chore(style): better footer logo alignment (#212) 2023-11-18 15:31:30 +00:00
Xin
d58a8b5469 feat: exclude page from sidebar (#209)
* feat: allow excluding page from sidebar

* chore: tidy up

* docs: add instruction for excluding a page from sidebar

* feat: allow hiding sidebar for pages

* chore: add comment
2023-11-17 23:00:05 +00:00
Xin
64ac97b2d6 feat: allow overriding poweredBy in footer (#207) 2023-11-17 02:03:40 +00:00
Xin
27c976bcc1 feat: display author avatar images in blog post (#204)
* feat: support displaying author images in blog post

* chore: fix typo

* chore: run build:css

* refactor: support both plain author list

* chore: run build:css

* chore: add support for local avatar images

* chore: update css classes
2023-11-17 01:49:18 +00:00
Xin
d675d3bc7b feat: support separator in sidebar (#199)
* feat: support adding pages as separator for sidebar

* Update sidebar.html
2023-11-12 14:03:30 +00:00
456c96921a typo: fix typos in sidebar.html (#203)
@OliverWu515 finds this issue, I help pr this. Hope it helps. The theme helps a lot for our org to build our documents. We found this issue when we use it.
2023-11-12 13:47:20 +00:00
Xin
c2d7ba8ce5 fix: code copy issue for code blocks in shortcode (#201)
* chore: add translation key for copy code button title

* chore: remove id from code block elements

* fix: copy the correct code target in code-copy.js

* chore: update details.md

* chore: remove console.log :)

* chore: remove `$` in shell commands

* chore: update docs
2023-11-12 01:14:39 +00:00
Xin
8801a04ebe feat: add include shortcode (#198) 2023-11-11 00:10:32 +00:00
Xin
21b0acdec5 chore: improve cards compatibility with steps (#197) 2023-11-10 23:45:42 +00:00
Xin
c0a1bc32dd fix: ensure relref in search index is properly rendered (#196)
* fix: ensure relref in search index is properly rendered

* chore: remove empty whitespace
2023-11-10 22:21:54 +00:00
Xin
4ea18168e3 fix: correctly set editURL in front-matter (#195) 2023-11-10 22:03:08 +00:00
Xin
23c84e124c fix: navbar url for multi-lang site (#193)
* fix: image URL in feature card

* fix: use relLangURL of pageRef for navbar entries
2023-11-10 17:45:44 +00:00
Xin
678f0b86ee fix: htmlUnescape toc title (#190) 2023-11-05 10:26:00 +00:00
defc9bc11b fix(docs): showcase starter template URL (#189)
* Update URl for Hextra Starter Template

* Update index.md

---------

Co-authored-by: Saurabh Mishra <saurabh.m@mailfence.com>
Co-authored-by: Xin <xin@imfing.com>
2023-11-05 10:09:58 +00:00
Xin
363c8c91ee fix: scroll bug due to incorrect toggle state (#186)
* fix: add mobile menu overlay to toggle body scroll

* chore: update styles
2023-11-03 20:39:36 +00:00
Xin
088e9f7821 fix(style): add backdrop to code copy button (#185)
* fix(style): add backdrop to code copy button

* chore: run build:css
2023-11-02 22:43:50 +00:00
7be079f504 i18n: update es.yaml (#180)
* Update es.yaml

Update spanish translations, using keys from `zh-cn.yaml`.

* Update es.yaml

---------

Co-authored-by: Xin <xin@imfing.com>
2023-11-01 20:28:29 +00:00
Xin
10ba5533e5 i18n: refactor translations for docs site (#181)
* i18n: move some translations under example site

* chore: update i18n/ja.yaml

* i18n: update zh-tw.yaml

* i18n: update fr.yaml

* i18n: update pt.yaml

* i18n: update ko.yaml

* i18n: update nb.yaml and nn.yaml

* i18n: update sw.yaml

* i18n: update vi.yaml

* i18n: update sw.yaml

* docs: clean up ja site as it's incomplete
2023-11-01 20:26:54 +00:00
Xin
433beed666 fix: plainify Toc headings (#178) 2023-10-31 23:14:42 +00:00
56a87e559d i18n: update pt.yaml (#174)
Update the Portuguese translation.
2023-10-31 09:15:51 +00:00
Xin
9d68f7c71a docs: minor update deploy site doc 2023-10-31 09:14:46 +00:00
Xin
e3f6069968 chore: support services.googleAnalytics.ID (#173)
* chore: support `services.googleAnalytics.ID`

and deprecate `site.googleAnalytics`

* chore: remove warning
2023-10-30 23:48:48 +00:00
de1286c7fc i18n: Add language strings for Norwegian bokmål and Norwegian nynorsk (#172)
The two main written languages in Norway.
2023-10-30 22:42:30 +00:00
c0a1d5cb67 chore(i18n): add French translation (#166)
* Create fr-fr.yaml

* Rename fr-fr.yaml to fr.yaml

* Modify Showcase

showcase ressemble a vitrine mais je pense que laissé showcase n'est pas problématique

* Remove comments

* Resolve duplicate

duplicate

Co-authored-by: Xin <fuxin1997@gmail.com>

* correction

résultats à la place de résulats (classique)

Co-authored-by: Xin <fuxin1997@gmail.com>

---------

Co-authored-by: Xin <fuxin1997@gmail.com>
2023-10-29 17:57:45 +00:00
Xin
50f1b084ae chore(icons): add linkedin
[skip ci]
2023-10-29 17:55:27 +00:00
Xin
0d629b67b9 docs: add instructions for configuring layouts (#167) 2023-10-29 17:52:34 +00:00
Xin
7c902b4eb9 chore(style): enhance not-prose elements styling (#163)
* chore(css): improve not-prose tags styling

* fix: typo

* chore(style): improve appearance in prose

* feat: support icon in callout shortcode

* chore: add RSS badge to blog list page

* chore: run build:css

* chore: run build:css

* chore: remove unused CSS

* chore: add footer.enable explicitly to config

* chore: use `where` pseudo class for more prose elements

* chore: run build:css

* chore: remove blank space

* chore: rebuild css

* chore: update figure css
2023-10-29 15:19:31 +00:00
63 changed files with 839 additions and 427 deletions

View File

@ -499,6 +499,9 @@ video {
.pointer-events-none { .pointer-events-none {
pointer-events: none; pointer-events: none;
} }
.fixed {
position: fixed;
}
.absolute { .absolute {
position: absolute; position: absolute;
} }
@ -508,6 +511,9 @@ video {
.sticky { .sticky {
position: sticky; position: sticky;
} }
.inset-0 {
inset: 0px;
}
.inset-x-0 { .inset-x-0 {
left: 0px; left: 0px;
right: 0px; right: 0px;
@ -543,6 +549,9 @@ video {
.top-full { .top-full {
top: 100%; top: 100%;
} }
.z-10 {
z-index: 10;
}
.z-20 { .z-20 {
z-index: 20; z-index: 20;
} }
@ -625,6 +634,9 @@ video {
.ml-4 { .ml-4 {
margin-left: 1rem; margin-left: 1rem;
} }
.mr-1 {
margin-right: 0.25rem;
}
.mr-2 { .mr-2 {
margin-right: 0.5rem; margin-right: 0.5rem;
} }
@ -839,6 +851,9 @@ video {
.flex-col { .flex-col {
flex-direction: column; flex-direction: column;
} }
.flex-wrap {
flex-wrap: wrap;
}
.items-start { .items-start {
align-items: flex-start; align-items: flex-start;
} }
@ -869,6 +884,17 @@ video {
.gap-4 { .gap-4 {
gap: 1rem; gap: 1rem;
} }
.gap-x-1 {
-moz-column-gap: 0.25rem;
column-gap: 0.25rem;
}
.gap-x-1\.5 {
-moz-column-gap: 0.375rem;
column-gap: 0.375rem;
}
.gap-y-2 {
row-gap: 0.5rem;
}
.overflow-auto { .overflow-auto {
overflow: auto; overflow: auto;
} }
@ -966,6 +992,9 @@ video {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(254 249 195 / var(--tw-border-opacity)); border-color: rgb(254 249 195 / var(--tw-border-opacity));
} }
.bg-black\/80 {
background-color: rgb(0 0 0 / 0.8);
}
.bg-black\/\[\.05\] { .bg-black\/\[\.05\] {
background-color: rgb(0 0 0 / .05); background-color: rgb(0 0 0 / .05);
} }
@ -1154,6 +1183,9 @@ video {
.align-text-bottom { .align-text-bottom {
vertical-align: text-bottom; vertical-align: text-bottom;
} }
.align-\[-2\.5px\] {
vertical-align: -2.5px;
}
.font-mono { .font-mono {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
} }
@ -1396,13 +1428,13 @@ video {
-webkit-hyphens: auto; -webkit-hyphens: auto;
hyphens: auto; hyphens: auto;
} }
.\[text-underline-position\:from-font\] { .\[transition\:background-color_1\.5s_ease\] {
text-underline-position: from-font; transition: background-color 1.5s ease;
} }
.\[word-break\:break-word\] { .\[word-break\:break-word\] {
word-break: break-word; word-break: break-word;
} }
.content h1 { .content :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 0.5rem; margin-top: 0.5rem;
font-size: 2.25rem; font-size: 2.25rem;
font-weight: 700; font-weight: 700;
@ -1410,11 +1442,11 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(15 23 42 / var(--tw-text-opacity)); color: rgb(15 23 42 / var(--tw-text-opacity));
} }
:is(html[class~="dark"] .content h1) { :is(html[class~="dark"] .content :where(h1):not(:where([class~=not-prose],[class~=not-prose] *))) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(241 245 249 / var(--tw-text-opacity)); color: rgb(241 245 249 / var(--tw-text-opacity));
} }
.content h2 { .content :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 2.5rem; margin-top: 2.5rem;
border-bottom-width: 1px; border-bottom-width: 1px;
border-color: rgb(229 229 229 / 0.7); border-color: rgb(229 229 229 / 0.7);
@ -1427,24 +1459,24 @@ video {
} }
@media (prefers-contrast: more) { @media (prefers-contrast: more) {
.content h2 { .content :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)) {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(163 163 163 / var(--tw-border-opacity)); border-color: rgb(163 163 163 / var(--tw-border-opacity));
} }
} }
:is(html[class~="dark"] .content h2) { :is(html[class~="dark"] .content :where(h2):not(:where([class~=not-prose],[class~=not-prose] *))) {
border-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / 0.1); border-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / 0.1);
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(241 245 249 / var(--tw-text-opacity)); color: rgb(241 245 249 / var(--tw-text-opacity));
} }
@media (prefers-contrast: more) { @media (prefers-contrast: more) {
:is(html[class~="dark"] .content h2) { :is(html[class~="dark"] .content :where(h2):not(:where([class~=not-prose],[class~=not-prose] *))) {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(163 163 163 / var(--tw-border-opacity)); border-color: rgb(163 163 163 / var(--tw-border-opacity));
} }
} }
.content h3 { .content :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 2rem; margin-top: 2rem;
font-size: 1.5rem; font-size: 1.5rem;
font-weight: 600; font-weight: 600;
@ -1452,11 +1484,11 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(15 23 42 / var(--tw-text-opacity)); color: rgb(15 23 42 / var(--tw-text-opacity));
} }
:is(html[class~="dark"] .content h3) { :is(html[class~="dark"] .content :where(h3):not(:where([class~=not-prose],[class~=not-prose] *))) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(241 245 249 / var(--tw-text-opacity)); color: rgb(241 245 249 / var(--tw-text-opacity));
} }
.content h4 { .content :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 2rem; margin-top: 2rem;
font-size: 1.25rem; font-size: 1.25rem;
font-weight: 600; font-weight: 600;
@ -1464,11 +1496,11 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(15 23 42 / var(--tw-text-opacity)); color: rgb(15 23 42 / var(--tw-text-opacity));
} }
:is(html[class~="dark"] .content h4) { :is(html[class~="dark"] .content :where(h4):not(:where([class~=not-prose],[class~=not-prose] *))) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(241 245 249 / var(--tw-text-opacity)); color: rgb(241 245 249 / var(--tw-text-opacity));
} }
.content h5 { .content :where(h5):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 2rem; margin-top: 2rem;
font-size: 1.125rem; font-size: 1.125rem;
font-weight: 600; font-weight: 600;
@ -1476,11 +1508,11 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(15 23 42 / var(--tw-text-opacity)); color: rgb(15 23 42 / var(--tw-text-opacity));
} }
:is(html[class~="dark"] .content h5) { :is(html[class~="dark"] .content :where(h5):not(:where([class~=not-prose],[class~=not-prose] *))) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(241 245 249 / var(--tw-text-opacity)); color: rgb(241 245 249 / var(--tw-text-opacity));
} }
.content h6 { .content :where(h6):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 2rem; margin-top: 2rem;
font-size: 1rem; font-size: 1rem;
font-weight: 600; font-weight: 600;
@ -1488,33 +1520,25 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(15 23 42 / var(--tw-text-opacity)); color: rgb(15 23 42 / var(--tw-text-opacity));
} }
:is(html[class~="dark"] .content h6) { :is(html[class~="dark"] .content :where(h6):not(:where([class~=not-prose],[class~=not-prose] *))) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(241 245 249 / var(--tw-text-opacity)); color: rgb(241 245 249 / var(--tw-text-opacity));
} }
.content p { .content :where(p):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 1.5rem; margin-top: 1.5rem;
line-height: 1.75rem; line-height: 1.75rem;
} }
.content p:first-child { .content :where(p):not(:where([class~=not-prose],[class~=not-prose] *)):first-child {
margin-top: 0px; margin-top: 0px;
} }
.content .not-prose p { .content :where(a):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 0px;
line-height: 1.5;
}
.content a {
--tw-text-opacity: 1; --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) 45% / var(--tw-text-opacity));
text-decoration-line: underline; text-decoration-line: underline;
text-decoration-thickness: from-font; text-decoration-thickness: from-font;
text-underline-position: from-font; text-underline-position: from-font;
} }
.content .not-prose a { .content :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)) {
color: currentColor;
text-decoration-line: none;
}
.content blockquote {
margin-top: 1.5rem; margin-top: 1.5rem;
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity)); border-color: rgb(209 213 219 / var(--tw-border-opacity));
@ -1522,24 +1546,24 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(55 65 81 / var(--tw-text-opacity)); color: rgb(55 65 81 / var(--tw-text-opacity));
} }
.content blockquote:first-child { .content :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)):first-child {
margin-top: 0px; margin-top: 0px;
} }
:is([dir="ltr"] .content blockquote) { :is([dir="ltr"] .content :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))) {
border-left-width: 2px; border-left-width: 2px;
padding-left: 1.5rem; padding-left: 1.5rem;
} }
:is([dir="rtl"] .content blockquote) { :is([dir="rtl"] .content :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))) {
border-right-width: 2px; border-right-width: 2px;
padding-right: 1.5rem; padding-right: 1.5rem;
} }
:is(html[class~="dark"] .content blockquote) { :is(html[class~="dark"] .content :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))) {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(55 65 81 / var(--tw-border-opacity)); border-color: rgb(55 65 81 / var(--tw-border-opacity));
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity)); color: rgb(156 163 175 / var(--tw-text-opacity));
} }
.content pre:not(.code-block pre) { .content :where(pre):not(:where(.code-block pre, [class~=not-prose],[class~=not-prose] *)) {
margin-bottom: 1rem; margin-bottom: 1rem;
overflow-x: auto; overflow-x: auto;
border-radius: 0.75rem; border-radius: 0.75rem;
@ -1553,23 +1577,23 @@ video {
} }
@media (prefers-contrast: more) { @media (prefers-contrast: more) {
.content pre:not(.code-block pre) { .content :where(pre):not(:where(.code-block pre, [class~=not-prose],[class~=not-prose] *)) {
border-width: 1px; border-width: 1px;
border-color: hsl(var(--primary-hue) var(--primary-saturation) 24% / 0.2); border-color: hsl(var(--primary-hue) var(--primary-saturation) 24% / 0.2);
--tw-contrast: contrast(1.5); --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); 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);
} }
} }
:is(html[class~="dark"] .content pre:not(.code-block pre)) { :is(html[class~="dark"] .content :where(pre):not(:where(.code-block pre, [class~=not-prose],[class~=not-prose] *))) {
background-color: hsl(var(--primary-hue) var(--primary-saturation) 77% / 0.1); background-color: hsl(var(--primary-hue) var(--primary-saturation) 77% / 0.1);
} }
@media (prefers-contrast: more) { @media (prefers-contrast: more) {
:is(html[class~="dark"] .content pre:not(.code-block pre)) { :is(html[class~="dark"] .content :where(pre):not(:where(.code-block pre, [class~=not-prose],[class~=not-prose] *))) {
border-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / 0.4); border-color: hsl(var(--primary-hue) var(--primary-saturation) 94% / 0.4);
} }
} }
.content code:not(.code-block code) { .content :where(code):not(:where(.code-block code, [class~=not-prose],[class~=not-prose] *)) {
overflow-wrap: break-word; overflow-wrap: break-word;
border-radius: 0.375rem; border-radius: 0.375rem;
border-width: 1px; border-width: 1px;
@ -1583,38 +1607,38 @@ video {
padding-right: .25em; padding-right: .25em;
font-size: .9em; font-size: .9em;
} }
:is(html[class~="dark"] .content code:not(.code-block code)) { :is(html[class~="dark"] .content :where(code):not(:where(.code-block code, [class~=not-prose],[class~=not-prose] *))) {
border-color: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.1);
background-color: rgb(255 255 255 / 0.1); background-color: rgb(255 255 255 / 0.1);
} }
.content table:not(.code-block table) { .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) {
margin-top: 1.5rem; margin-top: 1.5rem;
display: block; display: block;
overflow-x: auto; overflow-x: auto;
padding: 0px; padding: 0px;
} }
.content table:not(.code-block table):first-child { .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)):first-child {
margin-top: 0px; margin-top: 0px;
} }
.content table:not(.code-block table) tr { .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) tr {
margin: 0px; margin: 0px;
border-top-width: 1px; border-top-width: 1px;
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity)); border-color: rgb(209 213 219 / var(--tw-border-opacity));
padding: 0px; padding: 0px;
} }
.content table:not(.code-block table) tr:nth-child(even) { .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) tr:nth-child(even) {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity)); background-color: rgb(243 244 246 / var(--tw-bg-opacity));
} }
:is(html[class~="dark"] .content table:not(.code-block table) tr) { :is(html[class~="dark"] .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) tr) {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(75 85 99 / var(--tw-border-opacity)); border-color: rgb(75 85 99 / var(--tw-border-opacity));
} }
:is(html[class~="dark"] .content table:not(.code-block table) tr):nth-child(even) { :is(html[class~="dark"] .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) tr):nth-child(even) {
background-color: rgb(75 85 99 / 0.2); background-color: rgb(75 85 99 / 0.2);
} }
.content table:not(.code-block table) th { .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) th {
margin: 0px; margin: 0px;
border-width: 1px; border-width: 1px;
--tw-border-opacity: 1; --tw-border-opacity: 1;
@ -1625,11 +1649,11 @@ video {
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
font-weight: 600; font-weight: 600;
} }
:is(html[class~="dark"] .content table:not(.code-block table) th) { :is(html[class~="dark"] .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) th) {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(75 85 99 / var(--tw-border-opacity)); border-color: rgb(75 85 99 / var(--tw-border-opacity));
} }
.content table:not(.code-block table) td { .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) td {
margin: 0px; margin: 0px;
border-width: 1px; border-width: 1px;
--tw-border-opacity: 1; --tw-border-opacity: 1;
@ -1639,52 +1663,51 @@ video {
padding-top: 0.5rem; padding-top: 0.5rem;
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
} }
:is(html[class~="dark"] .content table:not(.code-block table) td) { :is(html[class~="dark"] .content :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) td) {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(75 85 99 / var(--tw-border-opacity)); border-color: rgb(75 85 99 / var(--tw-border-opacity));
} }
.content ol { .content :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 1.5rem; margin-top: 1.5rem;
list-style-type: decimal; list-style-type: decimal;
} }
.content ol:first-child { .content :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)):first-child {
margin-top: 0px; margin-top: 0px;
} }
:is([dir="ltr"] .content ol) { :is([dir="ltr"] .content :where(ol):not(:where([class~=not-prose],[class~=not-prose] *))) {
margin-left: 1.5rem; margin-left: 1.5rem;
} }
:is([dir="rtl"] .content ol) { :is([dir="rtl"] .content :where(ol):not(:where([class~=not-prose],[class~=not-prose] *))) {
margin-right: 1.5rem; margin-right: 1.5rem;
} }
.content ol li { .content :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)) li {
margin-top: 0.5rem; margin-top: 0.5rem;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
.content ul { .content :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 1.5rem; margin-top: 1.5rem;
list-style-type: disc; list-style-type: disc;
} }
.content ul:first-child { .content :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)):first-child {
margin-top: 0px; margin-top: 0px;
} }
:is([dir="ltr"] .content ul) { :is([dir="ltr"] .content :where(ul):not(:where([class~=not-prose],[class~=not-prose] *))) {
margin-left: 1.5rem; margin-left: 1.5rem;
} }
:is([dir="rtl"] .content ul) { :is([dir="rtl"] .content :where(ul):not(:where([class~=not-prose],[class~=not-prose] *))) {
margin-right: 1.5rem; margin-right: 1.5rem;
} }
.content ul li { .content :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)) li {
margin-top: 0.5rem; margin-top: 0.5rem;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
.content .not-prose ul, .content .not-prose ol { /* This CSS rule targets the first nested unordered (ul) or ordered (ol) list
margin: 0px; inside the first list item (li) of any parent ul or ol.
list-style-type: none; The rule sets the top margin of the selected list to zero. */
.content :where(ul, ol) > li:first-child > :where(ul, ol):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-top: 0px;
} }
.content .not-prose ul li, .content .not-prose ol li { .content :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin: 0px;
}
.content kbd {
overflow-wrap: break-word; overflow-wrap: break-word;
border-radius: 0.375rem; border-radius: 0.375rem;
border-width: 1px; border-width: 1px;
@ -1698,29 +1721,25 @@ video {
padding-right: .25em; padding-right: .25em;
font-size: .9em; font-size: .9em;
} }
:is(html[class~="dark"] .content kbd) { :is(html[class~="dark"] .content :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *))) {
border-color: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.1);
background-color: rgb(255 255 255 / 0.1); background-color: rgb(255 255 255 / 0.1);
} }
.content pre:not(.code-block pre).mermaid { .content :where(pre.mermaid):not(:where(.code-block pre, [class~=not-prose],[class~=not-prose] *)) {
border-radius: 0px; border-radius: 0px;
background-color: transparent; background-color: transparent;
} }
:is(html[class~="dark"] .content pre:not(.code-block pre).mermaid) { :is(html[class~="dark"] .content :where(pre.mermaid):not(:where(.code-block pre, [class~=not-prose],[class~=not-prose] *))) {
background-color: transparent; background-color: transparent;
} }
.content img { .content :where(img):not(:where([class~=not-prose],[class~=not-prose] *)) {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
margin-top: 1rem; margin-top: 1rem;
margin-bottom: 1rem; margin-bottom: 1rem;
border-radius: 0.375rem; border-radius: 0.375rem;
} }
.content .not-prose img { .content :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)) figcaption {
margin: 0px;
border-radius: 0px;
}
.content figure figcaption {
margin-top: 0.5rem; margin-top: 0.5rem;
display: block; display: block;
text-align: center; text-align: center;
@ -1728,7 +1747,7 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity)); color: rgb(107 114 128 / var(--tw-text-opacity));
} }
:is(html[class~="dark"] .content figure figcaption) { :is(html[class~="dark"] .content :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)) figcaption) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity)); color: rgb(156 163 175 / var(--tw-text-opacity));
} }
@ -1777,50 +1796,6 @@ span:target + .subheading-anchor:after {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(115 115 115 / var(--tw-text-opacity)); color: rgb(115 115 115 / var(--tw-text-opacity));
} }
article.typesetting-article {
font-size: 17px;
font-feature-settings:
'rlig' 1,
'calt' 1;
}
article.typesetting-article h1 {
margin-top: 1.5rem;
margin-bottom: 1rem;
text-align: center;
font-size: 2.5rem;
}
article.typesetting-article h2 {
border-style: none;
}
article.typesetting-article a {
text-decoration-line: none;
}
article.typesetting-article a:hover {
text-decoration-line: underline;
}
article.typesetting-article p {
line-height: 2rem;
}
article.typesetting-article code {
border-style: none;
}
:is(html[class~="dark"] article.typesetting-article code) {
--tw-bg-opacity: 1;
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
}
:is(html[class~="dark"] article.typesetting-article pre code) {
background-color: transparent;
}
article.typesetting-article .subheading-anchor + a {
text-decoration-line: none;
}
article.typesetting-article .subheading-anchor + a::after {
content: var(--tw-content);
display: none;
}
article.typesetting-article .subheading-anchor + a:hover {
text-decoration-line: none;
}
article details > summary::-webkit-details-marker { article details > summary::-webkit-details-marker {
display: none; display: none;
} }
@ -2564,6 +2539,19 @@ nav .search-wrapper {
--tw-shadow-color: rgb(115 115 115 / 0.4); --tw-shadow-color: rgb(115 115 115 / 0.4);
--tw-shadow: var(--tw-shadow-colored); --tw-shadow: var(--tw-shadow-colored);
} }
@supports (
((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px)))
) {
.code-copy-btn {
--tw-bg-opacity: .85;
--tw-backdrop-blur: blur(12px);
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}
:is(html[class~="dark"] .code-copy-btn) {
--tw-bg-opacity: 0.8;
}
}
html { html {
font-size: 1rem; font-size: 1rem;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
@ -2770,6 +2758,9 @@ body {
--tw-rotate: 90deg; --tw-rotate: 90deg;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
.group:hover .group-hover\:underline {
text-decoration-line: underline;
}
.group\/code:hover .group-hover\/code\:opacity-100 { .group\/code:hover .group-hover\/code\:opacity-100 {
opacity: 1; opacity: 1;
} }
@ -3040,6 +3031,9 @@ body {
:is(html[class~="dark"] .dark\:border-yellow-200\/30) { :is(html[class~="dark"] .dark\:border-yellow-200\/30) {
border-color: rgb(254 240 138 / 0.3); border-color: rgb(254 240 138 / 0.3);
} }
:is(html[class~="dark"] .dark\:bg-black\/60) {
background-color: rgb(0 0 0 / 0.6);
}
:is(html[class~="dark"] .dark\:bg-blue-900\/30) { :is(html[class~="dark"] .dark\:bg-blue-900\/30) {
background-color: rgb(30 58 138 / 0.3); background-color: rgb(30 58 138 / 0.3);
} }

View File

@ -0,0 +1,7 @@
@supports (
(-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
.code-copy-btn {
@apply backdrop-blur-md bg-opacity-[.85] dark:bg-opacity-80;
}
}

View File

@ -8,6 +8,7 @@
@import "components/sidebar.css"; @import "components/sidebar.css";
@import "components/navbar.css"; @import "components/navbar.css";
@import "components/scrollbar.css"; @import "components/scrollbar.css";
@import "components/code-copy.css";
html { html {
@apply text-base antialiased; @apply text-base antialiased;

View File

@ -1,44 +1,38 @@
.content { .content {
h1 { :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100; @apply mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100;
} }
h2 { :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-10 border-b pb-1 text-3xl border-neutral-200/70 contrast-more:border-neutral-400 dark:border-primary-100/10 contrast-more:dark:border-neutral-400; @apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-10 border-b pb-1 text-3xl border-neutral-200/70 contrast-more:border-neutral-400 dark:border-primary-100/10 contrast-more:dark:border-neutral-400;
} }
h3 { :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-2xl; @apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-2xl;
} }
h4 { :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-xl; @apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-xl;
} }
h5 { :where(h5):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-lg; @apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-lg;
} }
h6 { :where(h6):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-base; @apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-base;
} }
p { :where(p):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply mt-6 leading-7 first:mt-0; @apply mt-6 leading-7 first:mt-0;
} }
.not-prose p { :where(a):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply mt-0 leading-normal;
}
a {
@apply text-primary-600 underline decoration-from-font [text-underline-position:from-font]; @apply text-primary-600 underline decoration-from-font [text-underline-position:from-font];
} }
.not-prose a { :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply text-current no-underline;
}
blockquote {
@apply mt-6 border-gray-300 italic text-gray-700 dark:border-gray-700 dark:text-gray-400 first:mt-0 ltr:border-l-2 ltr:pl-6 rtl:border-r-2 rtl:pr-6; @apply mt-6 border-gray-300 italic text-gray-700 dark:border-gray-700 dark:text-gray-400 first:mt-0 ltr:border-l-2 ltr:pl-6 rtl:border-r-2 rtl:pr-6;
} }
pre:not(.code-block pre) { :where(pre):not(:where(.code-block pre, [class~=not-prose],[class~=not-prose] *)) {
@apply bg-primary-700/5 mb-4 overflow-x-auto rounded-xl font-medium subpixel-antialiased dark:bg-primary-300/10 text-[.9em] contrast-more:border contrast-more:border-primary-900/20 contrast-more:contrast-150 contrast-more:dark:border-primary-100/40 py-4; @apply bg-primary-700/5 mb-4 overflow-x-auto rounded-xl font-medium subpixel-antialiased dark:bg-primary-300/10 text-[.9em] contrast-more:border contrast-more:border-primary-900/20 contrast-more:contrast-150 contrast-more:dark:border-primary-100/40 py-4;
} }
code:not(.code-block code) { :where(code):not(:where(.code-block code, [class~=not-prose],[class~=not-prose] *)) {
@apply border-black border-opacity-[0.04] bg-opacity-[0.03] bg-black break-words rounded-md border py-0.5 px-[.25em] text-[.9em] dark:border-white/10 dark:bg-white/10; @apply border-black border-opacity-[0.04] bg-opacity-[0.03] bg-black break-words rounded-md border py-0.5 px-[.25em] text-[.9em] dark:border-white/10 dark:bg-white/10;
} }
table:not(.code-block table) { :where(table):not(:where(.code-block table, [class~=not-prose],[class~=not-prose] *)) {
@apply block overflow-x-auto mt-6 p-0 first:mt-0; @apply block overflow-x-auto mt-6 p-0 first:mt-0;
tr { tr {
@ -51,37 +45,34 @@
@apply m-0 border border-gray-300 px-4 py-2 dark:border-gray-600; @apply m-0 border border-gray-300 px-4 py-2 dark:border-gray-600;
} }
} }
ol { :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply mt-6 list-decimal first:mt-0 ltr:ml-6 rtl:mr-6; @apply mt-6 list-decimal first:mt-0 ltr:ml-6 rtl:mr-6;
li { li {
@apply my-2; @apply my-2;
} }
} }
ul { :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply mt-6 list-disc first:mt-0 ltr:ml-6 rtl:mr-6; @apply mt-6 list-disc first:mt-0 ltr:ml-6 rtl:mr-6;
li { li {
@apply my-2; @apply my-2;
} }
} }
.not-prose ul, .not-prose ol { /* This CSS rule targets the first nested unordered (ul) or ordered (ol) list
@apply m-0 list-none; inside the first list item (li) of any parent ul or ol.
li { The rule sets the top margin of the selected list to zero. */
@apply m-0; :where(ul, ol) > li:first-child > :where(ul, ol):not(:where([class~=not-prose],[class~=not-prose] *)) {
} @apply mt-0;
} }
kbd { :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply border-black border-opacity-[0.04] bg-opacity-[0.03] bg-black break-words rounded-md border py-0.5 px-[.25em] text-[.9em] dark:border-white/10 dark:bg-white/10; @apply border-black border-opacity-[0.04] bg-opacity-[0.03] bg-black break-words rounded-md border py-0.5 px-[.25em] text-[.9em] dark:border-white/10 dark:bg-white/10;
} }
pre:not(.code-block pre).mermaid { :where(pre.mermaid):not(:where(.code-block pre, [class~=not-prose],[class~=not-prose] *)) {
@apply bg-transparent rounded-none dark:bg-transparent; @apply bg-transparent rounded-none dark:bg-transparent;
} }
img { :where(img):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply mx-auto my-4 rounded-md; @apply mx-auto my-4 rounded-md;
} }
.not-prose img { :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply m-0 rounded-none;
}
figure {
figcaption { figcaption {
@apply text-sm text-gray-500 dark:text-gray-400 mt-2 block text-center; @apply text-sm text-gray-500 dark:text-gray-400 mt-2 block text-center;
} }
@ -115,35 +106,6 @@
} }
} }
article.typesetting-article {
font-size: 17px;
font-feature-settings:
'rlig' 1,
'calt' 1;
h1 {
@apply mt-6 mb-4 text-center;
font-size: 2.5rem;
}
h2 {
@apply border-none;
}
a {
@apply no-underline hover:underline;
}
p {
@apply leading-8;
}
code {
@apply border-none dark:bg-neutral-700;
}
pre code {
@apply dark:bg-transparent;
}
.subheading-anchor + a {
@apply no-underline hover:no-underline after:hidden;
}
}
article details > summary { article details > summary {
&::-webkit-details-marker { &::-webkit-details-marker {
@apply hidden; @apply hidden;
@ -153,5 +115,6 @@ article details > summary {
height: 1.2em; height: 1.2em;
width: 1.2em; width: 1.2em;
vertical-align: -4px; vertical-align: -4px;
padding: 0 0.6em;
} }
} }

View File

@ -33,8 +33,8 @@ document.addEventListener('DOMContentLoaded', function () {
// Add click event listener for copy button // Add click event listener for copy button
button.addEventListener('click', function (e) { button.addEventListener('click', function (e) {
e.preventDefault(); e.preventDefault();
const targetId = button.getAttribute('data-clipboard-target'); // Get the code target
const target = document.querySelector(targetId); const target = button.parentElement.previousElementSibling;
let codeElement; let codeElement;
if (target.tagName === 'CODE') { if (target.tagName === 'CODE') {
codeElement = target; codeElement = target;
@ -44,14 +44,17 @@ document.addEventListener('DOMContentLoaded', function () {
codeElement = codeElements[codeElements.length - 1]; codeElement = codeElements[codeElements.length - 1];
} }
if (codeElement) { if (codeElement) {
let code = codeElement.innerText;
// Replace double newlines with single newlines in the innerText // Replace double newlines with single newlines in the innerText
// as each line inside <span> has trailing newline '\n' // as each line inside <span> has trailing newline '\n'
const code = codeElement.innerText.replace(/\n\n/g, '\n'); if ("lang" in codeElement.dataset) {
code = code.replace(/\n\n/g, '\n');
}
navigator.clipboard.writeText(code).then(function () { navigator.clipboard.writeText(code).then(function () {
button.classList.add('copied'); button.classList.add('copied');
setTimeout(function () { setTimeout(function () {
button.classList.remove('copied'); button.classList.remove('copied');
}, 500); }, 1000);
}).catch(function (err) { }).catch(function (err) {
console.error('Failed to copy text: ', err); console.error('Failed to copy text: ', err);
}); });

View File

@ -1,19 +1,49 @@
// Hamburger menu for mobile navigation // Hamburger menu for mobile navigation
const menu = document.querySelector('.hamburger-menu'); document.addEventListener('DOMContentLoaded', function () {
const menu = document.querySelector('.hamburger-menu');
menu.addEventListener('click', (e) => { const overlay = document.querySelector('.mobile-menu-overlay');
e.preventDefault();
const sidebarContainer = document.querySelector('.sidebar-container'); const sidebarContainer = document.querySelector('.sidebar-container');
// Toggle the hamburger menu // Initialize the overlay
menu.querySelector('svg').classList.toggle('open'); const overlayClasses = ['fixed', 'inset-0', 'z-10', 'bg-black/80', 'dark:bg-black/60'];
overlay.classList.add('bg-transparent');
overlay.classList.remove("hidden", ...overlayClasses);
// When the menu is open, we want to show the navigation sidebar function toggleMenu() {
sidebarContainer.classList.toggle('max-md:[transform:translate3d(0,-100%,0)]'); // Toggle the hamburger menu
sidebarContainer.classList.toggle('max-md:[transform:translate3d(0,0,0)]'); menu.querySelector('svg').classList.toggle('open');
// When the menu is open, we want to prevent the body from scrolling // When the menu is open, we want to show the navigation sidebar
document.body.classList.toggle('overflow-hidden'); sidebarContainer.classList.toggle('max-md:[transform:translate3d(0,-100%,0)]');
document.body.classList.toggle('md:overflow-auto'); sidebarContainer.classList.toggle('max-md:[transform:translate3d(0,0,0)]');
// When the menu is open, we want to prevent the body from scrolling
document.body.classList.toggle('overflow-hidden');
document.body.classList.toggle('md:overflow-auto');
}
menu.addEventListener('click', (e) => {
e.preventDefault();
toggleMenu();
if (overlay.classList.contains('bg-transparent')) {
// Show the overlay
overlay.classList.add(...overlayClasses);
overlay.classList.remove('bg-transparent');
} else {
// Hide the overlay
overlay.classList.remove(...overlayClasses);
overlay.classList.add('bg-transparent');
}
});
overlay.addEventListener('click', (e) => {
e.preventDefault();
toggleMenu();
// Hide the overlay
overlay.classList.remove(...overlayClasses);
overlay.classList.add('bg-transparent');
});
}); });

View File

@ -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> <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> </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"/>
</svg>
hextra: <svg viewBox="0 0 180 180" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="m 105.50024,22.224647 c -9.59169,-5.537563 -21.40871,-5.537563 -31.000093,0 L 39.054693,42.689119 C 29.463353,48.226675 23.55484,58.460531 23.55484,69.535642 v 40.928918 c 0,11.07542 5.908513,21.3092 15.499853,26.84652 l 35.445453,20.46446 c 9.591313,5.53732 21.408404,5.53732 31.000094,0 l 35.44507,-20.46446 c 9.59131,-5.53732 15.49985,-15.7711 15.49985,-26.84652 V 69.535642 c 0,-11.075111 -5.90854,-21.308967 -15.49985,-26.846523 z M 34.112797,85.737639 c -1.384445,2.397827 -1.384445,5.352099 0,7.749927 l 24.781554,42.922974 c 1.38437,2.39783 3.942853,3.87496 6.711592,3.87496 h 49.563107 c 2.76905,0 5.3273,-1.47713 6.71144,-3.87496 l 24.78194,-42.922974 c 1.38414,-2.397828 1.38414,-5.3521 0,-7.749927 L 121.88049,42.814746 c -1.38414,-2.397828 -3.94239,-3.874964 -6.71144,-3.874964 H 65.605944 c -2.768739,0 -5.327223,1.477059 -6.711592,3.874964 z" style="stroke-width:0.774993" /></svg> hextra: <svg viewBox="0 0 180 180" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="m 105.50024,22.224647 c -9.59169,-5.537563 -21.40871,-5.537563 -31.000093,0 L 39.054693,42.689119 C 29.463353,48.226675 23.55484,58.460531 23.55484,69.535642 v 40.928918 c 0,11.07542 5.908513,21.3092 15.499853,26.84652 l 35.445453,20.46446 c 9.591313,5.53732 21.408404,5.53732 31.000094,0 l 35.44507,-20.46446 c 9.59131,-5.53732 15.49985,-15.7711 15.49985,-26.84652 V 69.535642 c 0,-11.075111 -5.90854,-21.308967 -15.49985,-26.846523 z M 34.112797,85.737639 c -1.384445,2.397827 -1.384445,5.352099 0,7.749927 l 24.781554,42.922974 c 1.38437,2.39783 3.942853,3.87496 6.711592,3.87496 h 49.563107 c 2.76905,0 5.3273,-1.47713 6.71144,-3.87496 l 24.78194,-42.922974 c 1.38414,-2.397828 1.38414,-5.3521 0,-7.749927 L 121.88049,42.814746 c -1.38414,-2.397828 -3.94239,-3.874964 -6.71144,-3.874964 H 65.605944 c -2.768739,0 -5.327223,1.477059 -6.711592,3.874964 z" style="stroke-width:0.774993" /></svg>
hugo: <svg viewBox="0 0 370 391" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m207.5 22.4 114.4 66.6c13.5 7.9 21.9 22.4 21.9 38v136.4c0 17.3-9.3 33.3-24.5 41.8l-113.5 63.9a49.06 49.06 0 0 1 -48.5-.2l-104.5-60.1c-16.4-9.5-26.6-27-26.6-45.9v-129.5c0-19.1 9.9-36.8 26.1-46.8l102.8-63.5c16-9.9 36.2-10.1 52.4-.7z" fill="#ff4088" stroke="#c9177e" stroke-width="27" /><path d="m105.6 298.2v-207.2h43.4v75.5h71.9v-75.5h43.5v207.2h-43.5v-90.6h-71.9v90.6z" fill="#fff" /></g></svg> hugo: <svg viewBox="0 0 370 391" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m207.5 22.4 114.4 66.6c13.5 7.9 21.9 22.4 21.9 38v136.4c0 17.3-9.3 33.3-24.5 41.8l-113.5 63.9a49.06 49.06 0 0 1 -48.5-.2l-104.5-60.1c-16.4-9.5-26.6-27-26.6-45.9v-129.5c0-19.1 9.9-36.8 26.1-46.8l102.8-63.5c16-9.9 36.2-10.1 52.4-.7z" fill="#ff4088" stroke="#c9177e" stroke-width="27" /><path d="m105.6 298.2v-207.2h43.4v75.5h71.9v-75.5h43.5v207.2h-43.5v-90.6h-71.9v90.6z" fill="#fff" /></g></svg>
@ -270,3 +275,4 @@ twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill=
mastodon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"></path></svg> mastodon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"></path></svg>
youtube: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104l.022.26l.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105l-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006l-.087-.004l-.171-.007l-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103l.003-.052l.008-.104l.022-.26l.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007l.172-.006l.086-.003l.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z"/></svg> youtube: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104l.022.26l.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105l-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006l-.087-.004l-.171-.007l-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103l.003-.052l.008-.104l.022-.26l.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007l.172-.006l.086-.003l.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z"/></svg>
x-twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg> x-twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg>
linkedin: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037c-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85c3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065a2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>

View File

@ -57,7 +57,7 @@ layout: hextra-home
subtitle="No dependency or Node.js is needed to use Hextra. Powered by Hugo, one of *the fastest* static site generators, building your site in just seconds with a single binary." subtitle="No dependency or Node.js is needed to use Hextra. Powered by Hugo, one of *the fastest* static site generators, building your site in just seconds with a single binary."
>}} >}}
{{< hextra/feature-card {{< hextra/feature-card
title="Reponsive with Dark Mode Included" title="Responsive with Dark Mode Included"
subtitle="Looks great on different screen sizes. Built-in dark mode support, with auto-switching based on user's system preference." subtitle="Looks great on different screen sizes. Built-in dark mode support, with auto-switching based on user's system preference."
>}} >}}
{{< hextra/feature-card {{< hextra/feature-card

View File

@ -1,20 +0,0 @@
---
title: "このサイトについて"
toc: false
---
Hextraは、現代的な静的ウェブサイトを構築するためのシンプルで高速で柔軟なテーマとして設計されています。特にドキュメンテーションウェブサイトに適していますが、ブログ、ポートフォリオなどのさまざまなタイプのサイトにも使用できます。
Hugoは、Jekyllと同様に静的サイトジェネレーターです。Hugoの特徴は、単一のバイナリであることで、さまざまなプラットフォームで簡単にインストールして実行できることです。また、数千ページのサイトをミリ秒単位でレンダリングできるほど非常に高速で信頼性があります。
Hextraは、最小限のフットプリントに焦点を当てた考え方で構築されています。始めるためには、Node.jsのような追加の依存関係は必要ありません。必要なのは、単一のYAML設定ファイルと、Markdownのコンテンツだけです。そのため、ツールのセットアップではなく、質の高いコンテンツの作成に集中できます。
## クレジット
Hextraをビルドするには、次のツールとインスピレーションが必要です
- [Hugo](https://gohugo.io/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Heroicons](https://heroicons.com/)
- [Nextra](https://nextra.vercel.app/)
- [Next.js](https://nextjs.org/)

View File

@ -1,3 +1,10 @@
--- ---
title: "Blog" title: "Blog"
--- ---
<div style="text-align: center; margin-top: 1em;">
{{< hextra/hero-badge link="index.xml" >}}
<span>RSS Feed</span>
{{< icon name="rss" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
</div>

View File

@ -2,8 +2,12 @@
title: Markdown Syntax Guide title: Markdown Syntax Guide
date: 2020-01-01 date: 2020-01-01
authors: authors:
- name: John Doe - name: imfing
link: https://example.com/johndoe link: https://github.com/imfing
image: https://github.com/imfing.png
- name: Octocat
link: https://github.com/octocat
image: https://github.com/octocat.png
tags: tags:
- Markdown - Markdown
- Example - Example

View File

@ -1,17 +0,0 @@
---
linkTitle: "ドキュメンテーション"
title: Hextraへようこそ
---
👋 こんにちはHextraドキュメンテーションへようこそ
<!--more-->
## Hextraとは
Hextraは、[Hugo][hugo]テーマの一つで、[Tailwind CSS][tailwind-css]を使用して作られた、現代的で高速なバッテリー内蔵のテーマです。
ドキュメンテーション、ブログ、ウェブサイトの美しいウェブサイトを構築するために設計され、様々な要件に対応するための機能と柔軟性を提供します。
[hugo]: https://gohugo.io/
[flex-search]: https://github.com/nextapps-de/flexsearch
[tailwind-css]: https://tailwindcss.com/

View File

@ -0,0 +1,39 @@
---
title: 评论系统
linkTitle: Comments
---
Hextra 支持在你的网站中添加评论系统。
目前已经支持 [giscus](https://giscus.app/).
<!--more-->
## giscus
[giscus](https://giscus.app/) 是由 [GitHub Discussions](https://docs.github.com/en/discussions)驱动的评论系统。Giscus 免费并且开源。
如需启用 Giscus, 你需要在配置文件中添加以下内容:
```yaml {filename="hugo.yaml"}
params:
comments:
enable: false
type: giscus
giscus:
repo: <repository>
repoId: <repository ID>
category: <category>
categoryId: <category ID>
```
Giscus 配置可以参考 [giscus.app](https://giscus.app/),还可以在那里找到更多详细信息。
可以在 front matter 中启用或禁用特定页面的评论:
```yaml {filename="content/docs/about.md"}
---
title: About
comments: true
---
```

View File

@ -47,8 +47,8 @@ The primary color of the theme can be customized by setting the `--primary-hue`
List of available syntax highlighting themes are available at [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html). The stylesheet can be generated using the command: List of available syntax highlighting themes are available at [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html). The stylesheet can be generated using the command:
```bash ```shell
$ hugo gen chromastyles --style=github hugo gen chromastyles --style=github
``` ```
To override the default syntax highlighting theme, we can add the generated styles to the custom CSS file. To override the default syntax highlighting theme, we can add the generated styles to the custom CSS file.
@ -70,4 +70,4 @@ For further information, refer to the [Hugo Templates](https://gohugo.io/templat
## Further Customization ## Further Customization
Didn't find what you were looking for? Feel free to [open an issue](https://github.com/imfing/hextra/issues) or make a contribution to the theme! Didn't find what you were looking for? Feel free to [open a discussion](https://github.com/imfing/hextra/discussions) or make a contribution to the theme!

View File

@ -30,10 +30,10 @@ Hextra 在 `hugo.yaml` 中提供了一些自定义选项来配置主题。
### 代码高亮 ### 代码高亮
代码高亮风格的详细信息可在 [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html) 中找到。 可以使用以下命令生成样式表: 代码高亮风格的详细信息可在 [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html) 中找到。可以使用以下命令生成样式表:
```bash ```shell
$ hugo gen chromastyles --style=github hugo gen chromastyles --style=github
``` ```
可将生成的样式添加到自定义 CSS 文件中以覆盖默认代码高亮样式。 可将生成的样式添加到自定义 CSS 文件中以覆盖默认代码高亮样式。
@ -55,4 +55,4 @@ layouts/partials/custom/head-end.html
## 进一步定制 Hextra ## 进一步定制 Hextra
没有找到你想修改的东西?在 GitHub 上[创建 Issues](https://github.com/imfing/hextra/issues) 或为 Hextra 贡献你的智慧! 没有找到你想修改的内容?在 GitHub 上[创建 Discussion](https://github.com/imfing/hextra/discussions) 或为 Hextra 贡献你的智慧!

View File

@ -1,6 +0,0 @@
---
title: はじめに
weight: 1
---
プロジェクトの紹介。

View File

@ -43,18 +43,18 @@ Before starting, you need to have the following software installed:
### Initialize a new Hugo site ### Initialize a new Hugo site
```shell ```shell
$ hugo new site my-site --format=yaml hugo new site my-site --format=yaml
``` ```
### Configure Hextra theme via module ### Configure Hextra theme via module
```shell ```shell
# initialize hugo module # initialize hugo module
$ cd my-site cd my-site
$ hugo mod init github.com/username/my-site hugo mod init github.com/username/my-site
# add Hextra theme # add Hextra theme
$ hugo mod get github.com/imfing/hextra hugo mod get github.com/imfing/hextra
``` ```
Configure `hugo.yaml` to use Hextra theme by adding the following: Configure `hugo.yaml` to use Hextra theme by adding the following:
@ -70,14 +70,14 @@ module:
Create new content page for the home page and the documentation page: Create new content page for the home page and the documentation page:
```shell ```shell
$ hugo new content/_index.md hugo new content/_index.md
$ hugo new content/docs/_index.md hugo new content/docs/_index.md
``` ```
### Preview the site locally ### Preview the site locally
```shell ```shell
$ hugo server --buildDrafts --disableFastRender hugo server --buildDrafts --disableFastRender
``` ```
Voila, your new site preview is available at `http://localhost:1313/`. Voila, your new site preview is available at `http://localhost:1313/`.
@ -90,7 +90,7 @@ Voila, your new site preview is available at `http://localhost:1313/`.
To update all Hugo modules in your project to their latest versions, run the following command: To update all Hugo modules in your project to their latest versions, run the following command:
```shell ```shell
$ hugo mod get -u hugo mod get -u
``` ```
To update Hextra to the [latest released version](https://github.com/imfing/hextra/releases), run the following command: To update Hextra to the [latest released version](https://github.com/imfing/hextra/releases), run the following command:
@ -119,7 +119,7 @@ Before starting, you need to have the following software installed:
### Initialize a new Hugo site ### Initialize a new Hugo site
```shell ```shell
$ hugo new site my-site --format=yaml hugo new site my-site --format=yaml
``` ```
### Add Hextra theme as a Git submodule ### Add Hextra theme as a Git submodule
@ -139,14 +139,14 @@ theme: hextra
Create new content page for the home page and the documentation page: Create new content page for the home page and the documentation page:
```shell ```shell
$ hugo new content/_index.md hugo new content/_index.md
$ hugo new content/docs/_index.md hugo new content/docs/_index.md
``` ```
### Preview the site locally ### Preview the site locally
```shell ```shell
$ hugo server --buildDrafts --disableFastRender hugo server --buildDrafts --disableFastRender
``` ```
Your new site preview is available at `http://localhost:1313/`. Your new site preview is available at `http://localhost:1313/`.
@ -168,7 +168,7 @@ Failure to run this command results in the theme folder not being populated with
To update all submodules in your repository to their latest commits, run the following command: To update all submodules in your repository to their latest commits, run the following command:
```shell ```shell
$ git submodule update --remote git submodule update --remote
``` ```
To update Hextra to the latest commit, run the following command: To update Hextra to the latest commit, run the following command:

View File

@ -26,23 +26,21 @@ prev: /docs
[Hugo 模块](https://gohugo.io/hugo-modules/)是管理 Hugo 主题的推荐方式。要使用 Hugo 模块,我们需要安装 [Git](https://git-scm.com/) 和 [Go](https://go.dev/)。 [Hugo 模块](https://gohugo.io/hugo-modules/)是管理 Hugo 主题的推荐方式。要使用 Hugo 模块,我们需要安装 [Git](https://git-scm.com/) 和 [Go](https://go.dev/)。
{{% steps %}}
### 初始化 Hugo 站点 ### 初始化 Hugo 站点
```bash ```shell
$ hugo new site my-site --format=yaml hugo new site my-site --format=yaml
``` ```
### 通过模块配置 Hextra 主题 ### 通过 Hugo Module 安装
```shell ```shell
# 初始化 Hugo 模块 # 初始化 Hugo 模块
$ cd my-site cd my-site
$ hugo mod init github.com/username/my-site hugo mod init github.com/username/my-site
# 添加 Hextra # 添加 Hextra
$ hugo mod get github.com/imfing/hextra hugo mod get github.com/imfing/hextra
``` ```
编辑 `hugo.yaml` 以启用 Hextra 编辑 `hugo.yaml` 以启用 Hextra
@ -53,31 +51,92 @@ module:
- path: github.com/imfing/hextra - path: github.com/imfing/hextra
``` ```
### 通过 Git Submodule 安装
#### 先决条件
在我们开始之前,你必须先确保以下软件已经安装:
- [Hugo (extended version)](https://gohugo.io/installation/)
- [Git](https://git-scm.com/)
#### 步骤
{{% steps %}}
### 初始化 Hugo 站点
```shell
hugo new site my-site --format=yaml
```
### 将 Hextra 添加为 Git Submodule
```shell
git submodule add https://github.com/imfing/hextra.git themes/hextra
```
添加以下内容来配置 `hugo.yaml` 以使用 Hextra
```yaml
theme: hextra
```
### 创建你的第一个内容页 ### 创建你的第一个内容页
让我们为主页和文档页面创建一个新的内容页面: 让我们为主页和文档页面创建一个新的内容页面:
```shell ```shell
$ hugo new content/_index.md hugo new content/_index.md
$ hugo new content/docs/_index.md hugo new content/docs/_index.md
``` ```
### 在本地预览站点 ### 在本地预览站点
```shell ```shell
$ hugo server --buildDrafts --disableFastRender hugo server --buildDrafts --disableFastRender
``` ```
瞧!你现在可以在 `http://localhost:1313/` 看到你的新站点。 瞧!你现在可以在 `http://localhost:1313/` 看到你的新站点。
{{% /steps %}} {{% /steps %}}
使用 [CI/CD](https://en.wikipedia.org/wiki/CI/CD) 进行部署时,必须确保在运行 `hugo` 命令之前执行以下命令。
```shell
git submodule update --init
```
如果不运行此命令theme 中将不会存在 Hextra 文件,进而导致构建失败。
{{% details title="如何更新主题?" %}}
如需把项目中所有的 Hugo Modules 都升级到最新,在终端中运行此命令:
```shell
hugo mod get -u
```
如需把 Hextra 升级到[最新的发行版本](https://github.com/imfing/hextra/releases), 在终端中运行此命令:
```shell
hugo mod get -u github.com/imfing/hextra
```
如果你需要获得更多信息,参见 [Hugo Modules](https://gohugo.io/hugo-modules/use-modules/#update-all-modules).
{{% /details %}}
## 接下来 ## 接下来
你可以探索以下部分来添加更多内容: 探索这些文档以便添加更多内容:
{{< cards >}} {{< cards >}}
{{< card link="../guide/organize-files" title="目录结构" icon="document-duplicate" >}} {{< card link="../guide/organize-files" title="Organize Files" icon="document-duplicate" >}}
{{< card link="../guide/configuration" title="配置文件指南" icon="adjustments" >}} {{< card link="../guide/configuration" title="Configuration" icon="adjustments" >}}
{{< card link="../guide/markdown" title="Markdown" icon="markdown" >}} {{< card link="../guide/markdown" title="Markdown" icon="markdown" >}}
{{< /cards >}} {{< /cards >}}

View File

@ -90,6 +90,16 @@ params:
For the main sidebar, it is automatically generated from the structure of the content directory. For the main sidebar, it is automatically generated from the structure of the content directory.
See the [Organize Files](/docs/guide/organize-files) page for more details. See the [Organize Files](/docs/guide/organize-files) page for more details.
To exclude a single page from the left sidebar, set the `sidebar.exclude` parameter in the front matter of the page:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
sidebar:
exclude: true
---
```
### Extra Links ### Extra Links
Sidebar extra links are defined under the `menu.sidebar` section in the config file: Sidebar extra links are defined under the `menu.sidebar` section in the config file:
@ -129,17 +139,17 @@ To configure the page edit link, we can set the `params.editURL.base` parameter
```yaml {filename="hugo.yaml"} ```yaml {filename="hugo.yaml"}
params: params:
editURL: editURL:
enable: true
base: "https://github.com/your-username/your-repo/edit/main" base: "https://github.com/your-username/your-repo/edit/main"
``` ```
The edit links will be automatically generated for each page based on the provided url as root directory. The edit links will be automatically generated for each page based on the provided url as root directory.
If you want to set edit link for a specific page, you can set the `params.editURL` parameter in the front matter of the page: If you want to set edit link for a specific page, you can set the `editURL` parameter in the front matter of the page:
```yaml {filename="content/docs/guide/configuration.md"} ```yaml {filename="content/docs/guide/configuration.md"}
--- ---
title: Configuration title: Configuration
params: editURL: "https://example.com/edit/this/page"
editURL: "https://example.com/edit/this/page"
--- ---
``` ```
@ -252,8 +262,10 @@ excludeSearch: true
### Google Analytics ### Google Analytics
To enable Google Analytics, set the `googleAnalytics` parameter in the config file: To enable [Google Analytics](https://marketingplatform.google.com/about/analytics/), set `services.googleAnalytics.ID` flag in `hugo.yaml`:
```yaml {filename="hugo.yaml"} ```yaml {filename="hugo.yaml"}
googleAnalytics: G-XXXXXXXXXX services:
googleAnalytics:
ID: G-MEASUREMENT_ID
``` ```

View File

@ -38,7 +38,7 @@ menu:
icon: github icon: github
``` ```
有几种不同类型的菜单项: 有几种不同类型的菜单项
1. Link to a page in the site with `pageRef` 1. Link to a page in the site with `pageRef`
```yaml ```yaml
@ -114,12 +114,126 @@ params:
``` ```
将为每个页面自动生成编辑链接。 将为每个页面自动生成编辑链接。
如需为特定页面设置编辑链接,可以在页面的 `front matter` 中设置 `params.editURL` 如需为特定页面设置编辑链接,可以在页面的 `front matter` 中设置 `editURL`
```yaml {filename="content/docs/guide/configuration.md"} ```yaml {filename="content/docs/guide/configuration.md"}
--- ---
title: Configuration title: Configuration
params: editURL: "https://example.com/edit/this/page"
editURL: "https://example.com/edit/this/page"
--- ---
``` ```
## Footer
### 版权声明
如需修改网站页脚中显示的版权文本您需要创建一个名为“i18n/en.yaml”的文件。
在此文件中,填写新的版权文本,像这样:
```yaml {filename="i18n/en.yaml"}
copyright: "© 2023 YOUR TEXT HERE"
```
你可以在 GitHub 存储库中找到示例 [`i18n/en.yaml`](https://github.com/imfing/hextra/blob/main/i18n/en.yaml) 文件。另外,你可以在版权文本中使用 Markdown 格式。
## 其他
### Favicon
如需自定义 [favicon](https://en.wikipedia.org/wiki/Favicon),请将图标文件放在 `static` 文件夹下以覆盖 [主题中的默认 favicon](https://github.com/imfing/hextra/tree/main/static)
{{< filetree/container >}}
{{< filetree/folder name="static" >}}
{{< filetree/file name="android-chrome-192x192.png" >}}
{{< filetree/file name="android-chrome-512x512.png" >}}
{{< filetree/file name="apple-touch-icon.png" >}}
{{< filetree/file name="favicon-16x16.png" >}}
{{< filetree/file name="favicon-32x32.png" >}}
{{< filetree/file name="favicon-dark.svg" >}}
{{< filetree/file name="favicon.ico" >}}
{{< filetree/file name="favicon.svg" >}}
{{< filetree/file name="site.webmanifest" >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
在您的项目中包含 `favicon.ico` 和 `favicon.svg` 文件,以确保网站的网站图标正确显示。
虽然 `favicon.ico` 通常适用于较旧的浏览器,但 `favicon.svg` 受到现代浏览器的支持,所以更现代的做法是添加 `favicon-dark.svg` 以便在黑暗模式下提供较好的体验体验。
请随意使用 [favicon.io](https://favicon.io/) 或 [favycon](https://github.com/ruisaraiva19/favycon) 等工具来生成这些图标。
### 颜色主题配置
使用`theme`设置来配置默认主题模式和切换按钮,允许访问者在浅色或深色模式之间切换。
```yaml {filename="hugo.yaml"}
params:
theme:
# light | dark | system
default: system
displayToggle: true
```
`theme.default` 的可选项:
- `light` - 仅使用浅色模式
- `dark` - 仅使用神色模式
- `system` - 跟随系统
`theme.displayToggle` 控制显示用于更改主题的切换按钮。
当设置为“true”时访问者可以在浅色或深色模式之间切换覆盖默认设置。
### 页宽
页面的宽度可以通过配置文件中的`params.page.width`参数来调整:
```yaml {filename="hugo.yaml"}
params:
page:
# full (100%), wide (90rem), normal (1280px)
width: wide
```
有三个可选项:`full`, `wide`, and `normal`. 默认的页宽模式是 `normal`.
同样的,导航栏和 `footer` 的宽度也可通过 `params.navbar.width` 和 `params.footer.width` 调整。
### 搜索
默认情况下启用由 [FlexSearch](https://github.com/nextapps-de/flexsearch) 提供全文搜索。
要自定义搜索索引,请在配置文件中设置 `params.search.flexsearch.index`
```yaml {filename="hugo.yaml"}
params:
# Search
search:
enable: true
type: flexsearch
flexsearch:
# index page by: content | summary | heading | title
index: content
```
`flexsearch.index` 的可选项:
- `content` - 全内容搜索
- `summary` - 概述 [Hugo Content Summaries](https://gohugo.io/content-management/summaries/)
- `heading` - 一级和二级标题
- `title` - 仅搜索标题
要从搜索索引中排除页面,更改 front matter 中的 `excludeSearch: true`:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
excludeSearch: true
---
```
### Google Analytics
要启用 [Google Analytics](https://marketingplatform.google.com/about/analytics/),设置 `services.googleAnalytics.ID`:
```yaml {filename="hugo.yaml"}
services:
googleAnalytics:
ID: G-MEASUREMENT_ID
```

View File

@ -14,11 +14,11 @@ This page provides guides for deploying your Hextra site on various platforms.
[GitHub Pages](https://docs.github.com/pages) is the recommended way to deploy and host your website for free. [GitHub Pages](https://docs.github.com/pages) is the recommended way to deploy and host your website for free.
If you bootstrap the site using [hextra-starter-template][hextra-starter-template], it has provided GitHub Actions workflow out-of-the-box that helps automatically deploy to GitHub Pages. If you bootstrap the site using [hextra-starter-template](https://github.com/imfing/hextra-starter-template), it has provided GitHub Actions workflow out-of-the-box that helps automatically deploy to GitHub Pages.
{{% details title="GitHub Actions Configuration" closed="true" %}} {{% details title="GitHub Actions Configuration" closed="true" %}}
Below is an example configuration from [hextra-starter-template][hextra-starter-template]: Below is an example configuration from [hextra-starter-template](https://github.com/imfing/hextra-starter-template):
```yaml {filename=".github/workflows/pages.yaml"} ```yaml {filename=".github/workflows/pages.yaml"}
# Sample workflow for building and deploying a Hugo site to GitHub Pages # Sample workflow for building and deploying a Hugo site to GitHub Pages
@ -104,7 +104,7 @@ jobs:
![](https://user-images.githubusercontent.com/5097752/266784808-99676430-884e-42ab-b901-f6534a0d6eee.png) ![](https://user-images.githubusercontent.com/5097752/266784808-99676430-884e-42ab-b901-f6534a0d6eee.png)
{{< /callout >}} {{< /callout >}}
By default, the above GitHub Actions workflow assumes that the site is deploying to `https://<USERNAME>.github.io/<REPO>/`. By default, the above GitHub Actions workflow `.github/workflows/pages.yaml` assumes that the site is deploying to `https://<USERNAME>.github.io/<REPO>/`.
If you are deploying to `https://<USERNAME>.github.io/` then modify the `--baseURL`: If you are deploying to `https://<USERNAME>.github.io/` then modify the `--baseURL`:
@ -158,6 +158,4 @@ Check [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/)
1. Set Build Command to `hugo --gc --minify` 1. Set Build Command to `hugo --gc --minify`
2. Set Install Command to `yum install golang` 2. Set Install Command to `yum install golang`
![image](https://github.com/imfing/hextra/assets/5097752/887d949b-8d05-413f-a2b4-7ab92192d0b3) ![Vercel Deployment Configuration](https://github.com/imfing/hextra/assets/5097752/887d949b-8d05-413f-a2b4-7ab92192d0b3)
[hextra-starter-template]: https://github.com/imfing/hextra-starter-template

View File

@ -7,7 +7,7 @@ prev: /docs/guide
## Directory Structure ## Directory Structure
By default, Hugo searches for Markdown files in the `content` directory, and the structure of the directory determines the final output structure of your website. By default, Hugo searches for Markdown files in the `content` directory, and the structure of the directory determines the final output structure of your website.
Take the example site as an example: Take this site as an example:
<!--more--> <!--more-->
@ -45,6 +45,28 @@ content
└── post-1.md // <- /blog/post-1/ └── post-1.md // <- /blog/post-1/
``` ```
## Layouts
Hextra offers three layouts for different content types:
| Layout | Directory | Features |
| :-------- | :-------------------- | :--------------------------------------------------------------- |
| `docs` | `content/docs/` | Ideal for structured documentation, same as this section. |
| `blog` | `content/blog/` | For blog postings, with both listing and detailed article views. |
| `default` | All other directories | Single-page article view without sidebar. |
To customize a section to mirror the behavior of a built-in layout, specify the desired type in the front matter of the section's `_index.md`.
```yaml {filename="content/my-docs/_index.md"}
---
title: My Docs
cascade:
type: docs
---
```
The above example configuration ensures that the content files inside `content/my-docs/` will be treated as documentation (`docs` type) by default.
## Sidebar Navigation ## Sidebar Navigation
The sidebar navigation is generated automatically based on the content organization alphabetically. To manually configure the sidebar order, we can use the `weight` parameter in the front matter of the Markdown files. The sidebar navigation is generated automatically based on the content organization alphabetically. To manually configure the sidebar order, we can use the `weight` parameter in the front matter of the Markdown files.
@ -62,7 +84,8 @@ weight: 2
## Configure Content Directory ## Configure Content Directory
If we need to use a different directory for our content, we can do so by setting the [`contentDir`](https://gohugo.io/getting-started/configuration/#contentdir) parameter in our site configuration file. By default, the root `content/` directory is used by Hugo to build the site.
If you need to use a different directory for content, for example `docs/`, this can be done by setting the [`contentDir`](https://gohugo.io/getting-started/configuration/#contentdir) parameter in the site configuration `hugo.yaml`.
## Add Images ## Add Images

View File

@ -1,6 +0,0 @@
---
title: コンポーネント
weight: 2
---
Hextraは、[Hugo Shortcodes](https://gohugo.io/content-management/shortcodes/)に基づいたさまざまな組み込みコンポーネントを提供しています。

View File

@ -24,7 +24,7 @@ This will be hidden by default.
## Usage ## Usage
```` ````markdown
{{%/* details title="Details" */%}} {{%/* details title="Details" */%}}
This is the content of the details. This is the content of the details.
@ -34,7 +34,7 @@ Markdown is **supported**.
{{%/* /details */%}} {{%/* /details */%}}
```` ````
```` ````markdown
{{%/* details title="Click me to reveal" closed="true" */%}} {{%/* details title="Click me to reveal" closed="true" */%}}
This will be hidden by default. This will be hidden by default.

View File

@ -12,7 +12,9 @@ Open source projects powered by Hextra.
</p> </p>
{{< cards >}} {{< cards >}}
{{< card link="https://developers.osuny.org" title="Osuny" image="https://raw.githubusercontent.com/noesya/osuny-developers/main/static/images/showcase-hextra/screenshot.png" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
{{< card link="https://getporter.org/" title="Porter" image="https://repository-images.githubusercontent.com/155893691/aa249c80-fcf3-11ea-93b0-30079e8d7de4" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} {{< card link="https://getporter.org/" title="Porter" image="https://repository-images.githubusercontent.com/155893691/aa249c80-fcf3-11ea-93b0-30079e8d7de4" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
{{< card link="https://lutheranconfessions.org/" title="LutheranConfessions" image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} {{< card link="https://lutheranconfessions.org/" title="LutheranConfessions" image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
{{< card link="/" title="Hextra Starter Template" image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} {{< card link="https://github.com/imfing/hextra-starter-template/" title="Hextra Starter Template" image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
{{< card link="https://developers.clever-cloud.com/" title="Clever Cloud Documentation" image="https://cellar-c2.services.clever-cloud.com/documentation/doc-screenshot.png" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
{{< /cards >}} {{< /cards >}}

View File

@ -12,6 +12,7 @@ layout: wide
</p> </p>
{{< cards >}} {{< cards >}}
{{< card link="https://developers.osuny.org" title="Osuny" image="https://raw.githubusercontent.com/noesya/osuny-developers/main/static/images/showcase-hextra/screenshot.png" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
{{< card link="https://getporter.org/" title="Porter" image="https://repository-images.githubusercontent.com/155893691/aa249c80-fcf3-11ea-93b0-30079e8d7de4" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} {{< card link="https://getporter.org/" title="Porter" image="https://repository-images.githubusercontent.com/155893691/aa249c80-fcf3-11ea-93b0-30079e8d7de4" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
{{< card link="https://lutheranconfessions.org/" title="LutheranConfessions" image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} {{< card link="https://lutheranconfessions.org/" title="LutheranConfessions" image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
{{< card link="https://github.com/imfing/hextra-starter-template" title="Hextra Starter Template" image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} {{< card link="https://github.com/imfing/hextra-starter-template" title="Hextra Starter Template" image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}

View File

@ -7,7 +7,9 @@ enableGitInfo: true
# enableEmoji: false # enableEmoji: false
hasCJKLanguage: true hasCJKLanguage: true
# googleAnalytics: G-XXXXXXXXXX # services:
# googleAnalytics:
# ID: G-MEASUREMENT_ID
outputs: outputs:
home: [HTML] home: [HTML]
@ -20,14 +22,10 @@ languages:
languageName: English languageName: English
weight: 1 weight: 1
title: Hextra title: Hextra
ja:
languageName: 日本語
weight: 2
title: "Hextra テーマ"
zh-cn: zh-cn:
languageName: 简体中文 languageName: 简体中文
languageCode: zh-CN languageCode: zh-CN
weight: 3 weight: 2
title: Hextra title: Hextra
module: module:
@ -115,6 +113,7 @@ params:
displayToggle: true displayToggle: true
footer: footer:
enable: true
displayCopyright: true displayCopyright: true
displayPoweredBy: true displayPoweredBy: true
width: normal width: normal

View File

@ -66,13 +66,14 @@
"[-webkit-touch-callout:none]", "[-webkit-touch-callout:none]",
"[counter-reset:step]", "[counter-reset:step]",
"[hyphens:auto]", "[hyphens:auto]",
"[text-underline-position:from-font]", "[transition:background-color_1.5s_ease]",
"[word-break:break-word]", "[word-break:break-word]",
"absolute", "absolute",
"active:bg-gray-400/20", "active:bg-gray-400/20",
"active:opacity-50", "active:opacity-50",
"active:shadow-gray-200", "active:shadow-gray-200",
"active:shadow-sm", "active:shadow-sm",
"align-[-2.5px]",
"align-text-bottom", "align-text-bottom",
"appearance-none", "appearance-none",
"aspect-auto", "aspect-auto",
@ -90,6 +91,7 @@
"before:pointer-events-none", "before:pointer-events-none",
"before:transition-transform", "before:transition-transform",
"before:w-px", "before:w-px",
"bg-black/80",
"bg-black/[.05]", "bg-black/[.05]",
"bg-blue-100", "bg-blue-100",
"bg-clip-text", "bg-clip-text",
@ -159,6 +161,7 @@
"cursor-pointer", "cursor-pointer",
"dark:before:bg-neutral-800", "dark:before:bg-neutral-800",
"dark:before:invert", "dark:before:invert",
"dark:bg-black/60",
"dark:bg-blue-900/30", "dark:bg-blue-900/30",
"dark:bg-dark", "dark:bg-dark",
"dark:bg-dark/50", "dark:bg-dark/50",
@ -235,8 +238,10 @@
"ease-in", "ease-in",
"filename", "filename",
"first:mt-0", "first:mt-0",
"fixed",
"flex", "flex",
"flex-col", "flex-col",
"flex-wrap",
"focus:bg-white", "focus:bg-white",
"focus:outline-none", "focus:outline-none",
"focus:ring-4", "focus:ring-4",
@ -254,6 +259,8 @@
"gap-1", "gap-1",
"gap-2", "gap-2",
"gap-4", "gap-4",
"gap-x-1.5",
"gap-y-2",
"grid", "grid",
"grid-cols-1", "grid-cols-1",
"group", "group",
@ -262,6 +269,7 @@
"group-data-[theme=dark]:hidden", "group-data-[theme=dark]:hidden",
"group-data-[theme=light]:hidden", "group-data-[theme=light]:hidden",
"group-hover/code:opacity-100", "group-hover/code:opacity-100",
"group-hover:underline",
"group-open:before:rotate-90", "group-open:before:rotate-90",
"group/code", "group/code",
"group/copybtn", "group/copybtn",
@ -311,6 +319,7 @@
"inline", "inline",
"inline-block", "inline-block",
"inline-flex", "inline-flex",
"inset-0",
"inset-x-0", "inset-x-0",
"inset-y-0", "inset-y-0",
"items-center", "items-center",
@ -401,6 +410,8 @@
"min-w-full", "min-w-full",
"ml-1", "ml-1",
"ml-4", "ml-4",
"mobile-menu-overlay",
"mr-1",
"mr-2", "mr-2",
"mt-1", "mt-1",
"mt-1.5", "mt-1.5",
@ -585,6 +596,7 @@
"w-screen", "w-screen",
"whitespace-nowrap", "whitespace-nowrap",
"xl:block", "xl:block",
"z-10",
"z-20", "z-20",
"z-[-1]" "z-[-1]"
], ],

View File

@ -0,0 +1,6 @@
documentation: "文档"
showcase: "项目展示"
blog: "博客"
about: "关于"
more: "更多"
hugoDocs: "Hugo 文档 ↗"

14
i18n/cs.yaml Normal file
View File

@ -0,0 +1,14 @@
backToTop: "Zpět nahoru"
changeLanguage: "Změnit jazyk"
changeTheme: "Změnit vzhled"
copyCode: "Zkopírovat kód"
copyright: "© 2023 Hextra Project."
dark: "Tmavý"
editThisPage: "Upravit tuto stránku na GitHubu →"
lastUpdated: "Naposledy změněno"
light: "Světlý"
noResultsFound: "Nebylo nic nalezeno."
onThisPage: "Na této stránce"
poweredBy: "Powered by Hextra"
readMore: "Přečíst víc →"
searchPlaceholder: "Hledat..."

14
i18n/de.yaml Normal file
View File

@ -0,0 +1,14 @@
backToTop: "Nach oben"
changeLanguage: "Sprache ändern"
changeTheme: "Darstellung ändern"
copyCode: "Code kopieren"
copyright: "© 2024 Hextra Project."
dark: "Dunkel"
editThisPage: "Diese Seite auf Github bearbeiten →"
lastUpdated: "Zuletzt aktualisiert am"
light: "Hell"
noResultsFound: "Keine Ergebnisse gefunden."
onThisPage: "Auf dieser Seite"
poweredBy: "Unterstützt durch Hextra"
readMore: "Mehr lesen →"
searchPlaceholder: "Suchen..."

View File

@ -1,10 +1,14 @@
backToTop: "Scroll to top" backToTop: "Scroll to top"
changeLanguage: "Change language" changeLanguage: "Change language"
changeTheme: "Change theme" changeTheme: "Change theme"
copyCode: "Copy code"
copyright: "© 2023 Hextra Project." copyright: "© 2023 Hextra Project."
dark: "Dark"
editThisPage: "Edit this page on GitHub →" editThisPage: "Edit this page on GitHub →"
lastUpdated: "Last updated on" lastUpdated: "Last updated on"
light: "Light"
noResultsFound: "No results found." noResultsFound: "No results found."
onThisPage: "On this page" onThisPage: "On this page"
poweredBy: "Powered by Hextra"
readMore: "Read more →" readMore: "Read more →"
searchPlaceholder: "Search..." searchPlaceholder: "Search..."

View File

@ -1,7 +1,13 @@
onThisPage: "En esta página" backToTop: "Subir al inicio"
changeLanguage: "Cambiar idioma"
changeTheme: "Cambiar tema"
copyright: "© 2023 Proyecto Hextra."
dark: "Oscuro"
editThisPage: "Edita esta página en GitHub →" editThisPage: "Edita esta página en GitHub →"
lastUpdated: "Última actualización" lastUpdated: "Última actualización"
light: "Claro"
backToTop: "Subir al inicio" noResultsFound: "No hubo resultados."
onThisPage: "En esta página"
copyright: "© 2023 Hextra Project." poweredBy: "Con tecnología de Hextra"
readMore: "Leer más →"
searchPlaceholder: "Buscar..."

13
i18n/fr.yaml Normal file
View File

@ -0,0 +1,13 @@
backToTop: "Revenir en haut"
changeLanguage: "Changer la langue"
changeTheme: "Thème d'affichage"
copyright: "© 2023 Hextra Project."
dark: "Sombre"
editThisPage: "Modifier cette page sur GitHub →"
lastUpdated: "Dernière modification"
light: "Clair"
noResultsFound: "Pas de résultats trouvés"
onThisPage: "Sur cette page"
poweredBy: "Propulsé par Hextra"
readMore: "Lire plus →"
searchPlaceholder: "Rechercher..."

View File

@ -1,16 +1,13 @@
# Navbar backToTop: "トップにスクロール"
documentation: "ドキュメンテーション" changeLanguage: "言語を変更"
blog: "ブログ" changeTheme: "テーマを変更"
about: "このサイトについて" copyright: "© 2023 Hextra プロジェクト。"
dark: "ダーク"
more: "もっと" editThisPage: "このページをGitHubで編集 →"
hugoDocs: "Hugoドキュメント ↗"
searchPlaceholder: "検索ドキュメント..."
noResultsFound: "検索結果が見つかりませんでした"
onThisPage: "このページでは"
editThisPage: "このページをGitHubで編集する →"
lastUpdated: "最終更新日" lastUpdated: "最終更新日"
light: "ライト"
copyright: "© 2023 Hextra Project." noResultsFound: "結果が見つかりませんでした。"
onThisPage: "このページの内容"
poweredBy: "提供元 Hextra"
readMore: "もっと読む →"
searchPlaceholder: "検索..."

View File

@ -2,8 +2,12 @@ backToTop: "맨위로 스크롤"
changeLanguage: "언어변경" changeLanguage: "언어변경"
changeTheme: "테마변경" changeTheme: "테마변경"
copyright: "© 2023 Hextra Project." copyright: "© 2023 Hextra Project."
dark: "어두운 테마"
editThisPage: "Github에서 편집하기 →" editThisPage: "Github에서 편집하기 →"
lastUpdated: "마지막 수정일자" lastUpdated: "마지막 수정일자"
light: "밝은 테마"
noResultsFound: "결과 없음"
onThisPage: "페이지 목차" onThisPage: "페이지 목차"
poweredBy: "제공 Hextra"
readMore: "더보기 →" readMore: "더보기 →"
searchPlaceholder: "검색..." searchPlaceholder: "검색..."

13
i18n/nb.yaml Normal file
View File

@ -0,0 +1,13 @@
backToTop: "Gå til toppen"
changeLanguage: "Endre språk"
changeTheme: "Endre tema"
copyright: "© 2023 Hextra-prosjektet."
dark: "Mørk"
editThisPage: "Rediger denne siden på GitHub →"
lastUpdated: "Sist oppdatert"
light: "Lys"
noResultsFound: "Fant ingen treff."
onThisPage: "På denne siden"
poweredBy: "Powered by Hextra"
readMore: "Les mer →"
searchPlaceholder: "Søk..."

13
i18n/nn.yaml Normal file
View File

@ -0,0 +1,13 @@
backToTop: "Gå til toppen"
changeLanguage: "Endre språk"
changeTheme: "Endre tema"
copyright: "© 2023 Hextra-prosjektet."
dark: "Mørk"
editThisPage: "Rediger denne sida på GitHub →"
lastUpdated: "Sist oppdatert"
light: "Ljos"
noResultsFound: "Fann ingen treff."
onThisPage: "På denne sida"
poweredBy: "Powered by Hextra"
readMore: "Les meir →"
searchPlaceholder: "Søk..."

View File

@ -1,7 +1,13 @@
onThisPage: "Nesta página"
editThisPage: "Edita esta página no GitHub →"
lastUpdated: "Última actualização"
backToTop: "Voltar ao topo" backToTop: "Voltar ao topo"
changeLanguage: "Mudar a língua"
changeTheme: "Mudar tema"
copyright: "© 2023 Projecto Hextra." copyright: "© 2023 Projecto Hextra."
dark: "Escuro"
editThisPage: "Edita esta página no GitHub →"
lastUpdated: "Última modificação"
light: "Claro"
noResultsFound: "Nenhum resultado encontrado"
onThisPage: "Nesta página"
poweredBy: "Com a tecnologia de Hextra"
readMore: "Ler mais →"
searchPlaceholder: "Procurar..."

View File

@ -1,5 +1,13 @@
onThisPage: "Kwenye ukurasa huu" backToTop: "Tembeza hadi juu"
changeLanguage: "Badilisha lugha"
changeTheme: "Badilisha mandhari"
copyright: "© 2023 Hextra Project."
dark: "Meusi"
editThisPage: "Hariri ukurasa huu kwenye GitHub →" editThisPage: "Hariri ukurasa huu kwenye GitHub →"
lastUpdated: "Ilisasishwa mwisho" lastUpdated: "Ilisasishwa mwisho"
backToTop: "Tembeza hadi juu" light: "Nuru"
copyright: "© 2023 Hextra Project." noResultsFound: "Hakuna matokeo yalipopatikana."
onThisPage: "Kwenye ukurasa huu"
poweredBy: "Inaendeshwa na Hextra"
readMore: "Soma zaidi →"
searchPlaceholder: "Tafuta..."

View File

@ -1,7 +1,13 @@
onThisPage: "Ở trang này" backToTop: "Lướt lên đầu trang"
changeLanguage: "Đổi ngôn ngữ"
changeTheme: "Đổi chủ đề"
copyright: "© 2023 Hextra Project."
dark: "Tối"
editThisPage: "Sửa trang này trên GitHub →" editThisPage: "Sửa trang này trên GitHub →"
lastUpdated: "Lần cuối cập nhật lúc" lastUpdated: "Lần cuối cập nhật lúc"
light: "Sáng"
backToTop: "Lướt lên đầu trang" noResultsFound: "Không tìm thấy kết quả."
onThisPage: "Ở trang này"
copyright: "© 2023 Hextra Project." poweredBy: "Chạy bởi Hextra"
readMore: "Đọc thêm →"
searchPlaceholder: "Tìm kiếm..."

View File

@ -1,10 +1,3 @@
documentation: "文档"
showcase: "项目展示"
blog: "博客"
about: "关于"
more: "更多"
hugoDocs: "Hugo 文档 ↗"
backToTop: "返回顶部" backToTop: "返回顶部"
changeLanguage: "切换语言" changeLanguage: "切换语言"
changeTheme: "切换主题" changeTheme: "切换主题"

View File

@ -1,15 +1,13 @@
documentation: "文檔" backToTop: "返回頂部"
blog: "博客" changeLanguage: "切換語言"
about: "關於" changeTheme: "切換主題"
copyright: "© 2023 Hextra Project."
more: "更多" dark: "深色"
hugoDocs: "Hugo 文檔 ↗"
searchPlaceholder: "搜索文檔..."
noResultsFound: "無結果"
onThisPage: "此頁上"
editThisPage: "在 GitHub 上編輯此頁 →" editThisPage: "在 GitHub 上編輯此頁 →"
lastUpdated: "最後更新於" lastUpdated: "最後更新於"
light: "淺色"
copyright: "© 2023 Hextra Project." noResultsFound: "無結果"
onThisPage: "此頁上"
poweredBy: "由 Hextra 驅動"
readMore: "更多 →"
searchPlaceholder: "搜尋文檔..."

View File

@ -1,6 +1,7 @@
{{- $class := .Attributes.class | default "" -}} {{- $class := .Attributes.class | default "" -}}
{{- $filename := .Attributes.filename | default "" -}} {{- $filename := .Attributes.filename | default "" -}}
{{- $lang := .Attributes.lang | default .Type -}} {{- $lang := .Attributes.lang | default .Type -}}
{{- $copyCode := (T "copyCode") | default "Copy code" -}}
<div class="code-block relative mt-6 first:mt-0 group/code"> <div class="code-block relative mt-6 first:mt-0 group/code">
@ -8,17 +9,14 @@
<div class="filename">{{ $filename }}</div> <div class="filename">{{ $filename }}</div>
{{- end -}} {{- end -}}
{{- if transform.CanHighlight $lang -}} {{- if transform.CanHighlight $lang -}}
<div id="code-block-{{ .Ordinal }}"> <div>{{- highlight .Inner $lang .Options -}}</div>
{{- highlight .Inner $lang .Options -}}
</div>
{{- else -}} {{- else -}}
<pre><code id="code-block-{{ .Ordinal }}">{{ .Inner }}</code></pre> <pre><code>{{ .Inner }}</code></pre>
{{- end -}} {{- end -}}
<div class="opacity-0 transition group-hover/code:opacity-100 flex gap-1 absolute m-[11px] right-0 {{ if $filename }}top-8{{ else }}top-0{{ end }}"> <div class="opacity-0 transition group-hover/code:opacity-100 flex gap-1 absolute m-[11px] right-0 {{ if $filename }}top-8{{ else }}top-0{{ end }}">
<button <button
class="code-copy-btn group/copybtn transition-all active:opacity-50 bg-primary-700/5 border border-black/5 text-gray-600 hover:text-gray-900 rounded-md p-1.5 dark:bg-primary-300/10 dark:border-white/10 dark:text-gray-400 dark:hover:text-gray-50" class="code-copy-btn group/copybtn transition-all active:opacity-50 bg-primary-700/5 border border-black/5 text-gray-600 hover:text-gray-900 rounded-md p-1.5 dark:bg-primary-300/10 dark:border-white/10 dark:text-gray-400 dark:hover:text-gray-50"
title="Copy code" title="{{ $copyCode }}"
data-clipboard-target="#code-block-{{ .Ordinal }}"
> >
<div class="group-[.copied]/copybtn:hidden copy-icon pointer-events-none h-4 w-4"></div> <div class="group-[.copied]/copybtn:hidden copy-icon pointer-events-none h-4 w-4"></div>
<div class="hidden group-[.copied]/copybtn:block success-icon pointer-events-none h-4 w-4"></div> <div class="hidden group-[.copied]/copybtn:block success-icon pointer-events-none h-4 w-4"></div>

View File

@ -1,13 +1,13 @@
{{- $alt := .PlainText | safeHTML -}} {{- $alt := .PlainText | safeHTML -}}
{{- $lazyLoading := .Page.Site.Params.enableImagelazyLoading | default true -}} {{- $lazyLoading := .Page.Site.Params.enableImageLazyLoading | default true -}}
{{- $dest := .Destination -}} {{- $dest := .Destination -}}
{{- $isRemote := not (urls.Parse $dest).Scheme -}} {{- $isLocal := not (urls.Parse $dest).Scheme -}}
{{- $isPage := and (eq .Page.Kind "page") (not .Page.BundleType) -}} {{- $isPage := and (eq .Page.Kind "page") (not .Page.BundleType) -}}
{{- $startsWithSlash := hasPrefix $dest "/" -}} {{- $startsWithSlash := hasPrefix $dest "/" -}}
{{- $startsWithRelative := hasPrefix $dest "../" -}} {{- $startsWithRelative := hasPrefix $dest "../" -}}
{{- if and $dest $isRemote -}} {{- if and $dest $isLocal -}}
{{- if $startsWithSlash -}} {{- if $startsWithSlash -}}
{{/* Images under static directory */}} {{/* Images under static directory */}}
{{- $dest = (relURL (strings.TrimPrefix "/" $dest)) -}} {{- $dest = (relURL (strings.TrimPrefix "/" $dest)) -}}

View File

@ -1,27 +1,40 @@
{{ define "main" }} {{ define "main" }}
<div class='mx-auto flex {{ partial "utils/page-width" . }}'> <div class="mx-auto flex {{ partial `utils/page-width` . }}">
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }} {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }}
{{ partial "toc.html" . }} {{ partial "toc.html" . }}
<article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]"> <article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12"> <main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
<h1 class="mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100">{{ .Title }}</h1> <h1 class="mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100">{{ .Title }}</h1>
{{ with $date := .Date }} <div class="mt-4 mb-16 text-gray-500 text-sm flex items-center flex-wrap gap-y-2">
<div class="mt-4 mb-16 text-gray-500 text-sm"> {{- with $date := .Date }}<span class="mr-1">{{ partial "utils/format-date" $date }}</span>{{ end -}}
{{ partial "utils/format-date" $date }} {{- $lazyLoading := site.Params.enableImageLazyLoading | default true -}}
{{- if $.Params.authors }}&nbsp;by&nbsp;{{ end -}} {{ if and .Date .Params.authors }}<span class="mx-1">·</span>{{ end -}}
{{- with $.Params.authors -}} {{- with $.Params.authors -}}
{{- range $i, $author := . -}} {{- range $i, $author := . -}}
{{- if $i }},{{ end -}} {{- if reflect.IsMap $author -}}
{{- if $author.link -}} {{- if and $i (not $author.image) }}<span class="mr-1">,</span>{{ end -}}
<a href="{{ $author.link }}" target="_blank" class="mx-1 text-current underline [text-underline-position:from-font] decoration-from-font">{{ $author.name }}</a> <a
{{- else -}} {{ with $author.link }}href="{{ . }}" target="_blank"{{ end }}
<span>{{ $author.name }}</span> class="group inline-flex items-center text-current gap-x-1.5 mx-1"
{{- end -}} {{ with $author.name }}title="{{ . }}"{{ end }}
>
{{- with $image := $author.image }}
{{- $isLocal := not (urls.Parse $image).Scheme -}}
{{- $startsWithSlash := hasPrefix $image "/" -}}
{{- if and $isLocal $startsWithSlash }}
{{- $image = (relURL (strings.TrimPrefix "/" $image)) -}}
{{ end -}}
<img src="{{ $image | safeURL }}" alt="{{ $author.name }}" class="inline-block h-4 w-4 rounded-full" {{ if $lazyLoading }}loading="lazy"{{ end }} />
{{ end -}}
<div class="group-hover:underline">{{ $author.name }}</div>
</a>
{{- else -}}
{{- if $i }}<span class="mr-1">,</span>{{ end -}}<span class="mx-1">{{ $author }}</span>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
</div> {{- end -}}
{{ end }} </div>
<div class="content"> <div class="content">
{{ .Content }} {{ .Content }}
</div> </div>

View File

@ -36,9 +36,11 @@
{{- define "theme-credit" -}} {{- define "theme-credit" -}}
<a class="flex text-sm items-center gap-1 text-current" target="_blank" rel="noopener noreferrer" title="Hextra GitHub Homepage" href="https://github.com/imfing/hextra"> <a class="flex text-sm items-center gap-1 text-current" target="_blank" rel="noopener noreferrer" title="Hextra GitHub Homepage" href="https://github.com/imfing/hextra">
<span <span>
>{{ . | safeHTML }} {{- . | markdownify -}}
{{- partial "utils/icon.html" (dict "name" "hextra" "attributes" "height=1em class=\"inline-block ml-1 align-text-bottom\"") -}} {{- if strings.Contains . "Hextra" -}}
{{- partial "utils/icon.html" (dict "name" "hextra" "attributes" `height=1em class="inline-block ml-1 align-[-2.5px]"`) -}}
{{- end -}}
</span> </span>
</a> </a>
{{- end -}} {{- end -}}

View File

@ -1,4 +1,10 @@
{{ with .Site.GoogleAnalytics }} {{/* site.GoogleAnalytics is deprecated in Hugo v0.120.0 */}}
{{/* it will be removed in a future version */}}
{{- $gtagID := "" -}}
{{- with site.GoogleAnalytics -}}{{ $gtagID = . }}{{- end -}}
{{- with site.Config.Services.GoogleAnalytics.ID -}}{{ $gtagID = . }}{{- end -}}
{{- with $gtagID }}
<!-- Global site tag (gtag.js) - Google Analytics --> <!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script> <script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script> <script>
@ -10,4 +16,4 @@
gtag("config", "{{ . }}"); gtag("config", "{{ . }}");
</script> </script>
{{ end }} {{ end -}}

View File

@ -16,6 +16,12 @@
{{ end -}} {{ end -}}
</title> </title>
<meta name="description" content="{{ partial "utils/page-description.html" . }}" /> <meta name="description" content="{{ partial "utils/page-description.html" . }}" />
{{ with .Params.canonical }}
<link rel="canonical" href="{{ . }}" itemprop="url" />
{{ else }}
<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
{{ end }}
{{ partial "opengraph.html" . }} {{ partial "opengraph.html" . }}
{{ template "_internal/schema.html" . -}} {{ template "_internal/schema.html" . -}}
@ -25,7 +31,7 @@
<!-- Google Analytics --> <!-- Google Analytics -->
{{- if and .Site.GoogleAnalytics (eq hugo.Environment "production") }} {{- if and (eq hugo.Environment "production") (or .Site.GoogleAnalytics .Site.Config.Services.GoogleAnalytics.ID) }}
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin /> <link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
{{ partial "google-analytics.html" . }} {{ partial "google-analytics.html" . }}
{{- end }} {{- end }}

View File

@ -32,10 +32,18 @@
{{- if eq .Params.type "search" -}} {{- if eq .Params.type "search" -}}
{{- partial "search.html" (dict "params" .Params) -}} {{- partial "search.html" (dict "params" .Params) -}}
{{- else -}} {{- else -}}
{{- $external := strings.HasPrefix .URL "http" -}} {{- $link := .URL -}}
{{- $external := strings.HasPrefix $link "http" -}}
{{- with .PageRef -}}
{{- if hasPrefix . "/" -}}
{{- $link = relLangURL (strings.TrimPrefix "/" .) -}}
{{- end -}}
{{- end -}}
{{/* Display icon menu item */}} {{/* Display icon menu item */}}
{{- if .Params.icon -}} {{- if .Params.icon -}}
<a class="p-2 text-current" {{ if $external }}target="_blank" rel="noreferer"{{ end }} href="{{ .URL | relLangURL }}" title="{{ or (T .Identifier) .Name | safeHTML }}"> {{- $rel := cond (eq .Params.icon "mastodon") "noreferer me" "noreferer" }}
<a class="p-2 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") -}} {{- partial "utils/icon.html" (dict "name" .Params.icon "attributes" "height=24") -}}
<span class="sr-only">{{ or (T .Identifier) .Name | safeHTML }}</span> <span class="sr-only">{{ or (T .Identifier) .Name | safeHTML }}</span>
</a> </a>
@ -44,7 +52,7 @@
{{- $activeClass := cond $active "font-medium" "text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200" -}} {{- $activeClass := cond $active "font-medium" "text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200" -}}
<a <a
title="{{ or (T .Identifier) .Name | safeHTML }}" title="{{ or (T .Identifier) .Name | safeHTML }}"
href="{{ .URL | relLangURL }}" href="{{ $link }}"
{{ if $external }}target="_blank" rel="noreferer"{{ end }} {{ if $external }}target="_blank" rel="noreferer"{{ end }}
class="text-sm contrast-more:text-gray-700 contrast-more:dark:text-gray-100 relative -ml-2 hidden whitespace-nowrap p-2 md:inline-block {{ $activeClass }}" class="text-sm contrast-more:text-gray-700 contrast-more:dark:text-gray-100 relative -ml-2 hidden whitespace-nowrap p-2 md:inline-block {{ $activeClass }}"
> >

View File

@ -6,10 +6,16 @@
{{- $sidebarClass := cond $disableSidebar (cond $displayPlaceholder "md:hidden xl:block" "md:hidden") "md:sticky" -}} {{- $sidebarClass := cond $disableSidebar (cond $displayPlaceholder "md:hidden xl:block" "md:hidden") "md:sticky" -}}
{{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}} {{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}}
{{- $navPages := union $navRoot.RegularPages $navRoot.Sections -}}
{{- $pageURL := $context.RelPermalink -}} {{- $pageURL := $context.RelPermalink -}}
{{/* EXPERIMENTAL */}}
{{- if .context.Params.sidebar.hide -}}
{{- $disableSidebar = true -}}
{{- $displayPlaceholder = true -}}
{{- end -}}
<div class="mobile-menu-overlay [transition:background-color_1.5s_ease] fixed inset-0 z-10 bg-black/80 dark:bg-black/60 hidden"></div>
<aside class="sidebar-container flex flex-col print:hidden md:top-16 md:shrink-0 md:w-64 md:self-start max-md:[transform:translate3d(0,-100%,0)] {{ $sidebarClass }}"> <aside class="sidebar-container flex flex-col print:hidden md:top-16 md:shrink-0 md:w-64 md:self-start max-md:[transform:translate3d(0,-100%,0)] {{ $sidebarClass }}">
<!-- Search bar on small screen --> <!-- Search bar on small screen -->
<div class="px-4 pt-4 md:hidden"> <div class="px-4 pt-4 md:hidden">
@ -67,17 +73,24 @@
{{- $toc := .toc | default false -}} {{- $toc := .toc | default false -}}
{{- with $items := union .context.RegularPages .context.Sections -}} {{- with $items := union .context.RegularPages .context.Sections -}}
{{- $items = where $items "Params.sidebar.exclude" "!=" true -}}
{{- if eq $level 0 -}} {{- if eq $level 0 -}}
{{- range $items.ByWeight }} {{- range $items.ByWeight }}
{{- $active := eq $pageURL .RelPermalink -}} {{- if .Params.sidebar.separator -}}
{{- $shouldOpen := or (.Params.sidebar.open) (.IsAncestor $page) $active | default true }} <li class="[word-break:break-word] mt-5 mb-2 px-2 py-1.5 text-sm font-semibold text-gray-900 first:mt-0 dark:text-gray-100">
<li class="{{ if $shouldOpen }}open{{ end }}"> <span class="cursor-default">{{ .LinkTitle }}</span>
{{- template "sidebar-item-link" dict "context" . "active" $active "title" .LinkTitle "link" .RelPermalink -}} </li>
{{- if and $toc $active -}} {{- else -}}
{{- template "sidebar-toc" dict "page" . -}} {{- $active := eq $pageURL .RelPermalink -}}
{{- end -}} {{- $shouldOpen := or (.Params.sidebar.open) (.IsAncestor $page) $active | default true }}
{{- template "sidebar-tree" dict "context" . "page" $page "pageURL" $pageURL "level" (add $level 1) "toc" $toc -}} <li class="{{ if $shouldOpen }}open{{ end }}">
</li> {{- template "sidebar-item-link" dict "context" . "active" $active "title" .LinkTitle "link" .RelPermalink -}}
{{- if and $toc $active -}}
{{- template "sidebar-toc" dict "page" . -}}
{{- end -}}
{{- template "sidebar-tree" dict "context" . "page" $page "pageURL" $pageURL "level" (add $level 1) "toc" $toc -}}
</li>
{{- end -}}
{{- end -}} {{- end -}}
{{- else -}} {{- else -}}
<div class="ltr:pr-0 overflow-hidden"> <div class="ltr:pr-0 overflow-hidden">
@ -110,7 +123,7 @@
<li> <li>
<a <a
href="#{{ anchorize .ID }}" href="#{{ anchorize .ID }}"
class="flex rounded px-2 py-1.5 text-sm transition-colors [word-break:break-word] cursor-pointer [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] contrast-more:border flex gap-2 before:opacity-25 before:content-['#'] text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-neutral-400 dark:hover:bg-primary-100/5 dark:hover:text-gray-50 contrast-more:text-gray-900 contrast-more:dark:text-gray-50 contrast-more:border-transparent contrast-more:hover:border-gray-900 contrast-more:dark:hover:border-gray-50" class="flex rounded px-2 py-1.5 text-sm transition-colors [word-break:break-word] cursor-pointer [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] contrast-more:border gap-2 before:opacity-25 before:content-['#'] text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-neutral-400 dark:hover:bg-primary-100/5 dark:hover:text-gray-50 contrast-more:text-gray-900 contrast-more:dark:text-gray-50 contrast-more:border-transparent contrast-more:hover:border-gray-900 contrast-more:dark:hover:border-gray-50"
> >
{{- .Title -}} {{- .Title -}}
</a> </a>
@ -152,17 +165,13 @@
{{- with .context }} {{- with .context }}
{{- if or .RegularPages .Sections }} {{- if or .RegularPages .Sections }}
<span class="hextra-sidebar-collapsible-button"> <span class="hextra-sidebar-collapsible-button">
{{- template "sidebear-collapsible-button" -}} {{- template "sidebar-collapsible-button" -}}
</span> </span>
{{- end }} {{- end }}
{{ end -}} {{ end -}}
</a> </a>
{{- end -}} {{- end -}}
{{- define "sidebar-separator" -}} {{- define "sidebar-collapsible-button" -}}
<div class="mt-4 border-t py-4 dark:border-neutral-800 contrast-more:border-neutral-400 dark:contrast-more:border-neutral-400" />
{{- end -}}
{{- define "sidebear-collapsible-button" -}}
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="h-[18px] min-w-[18px] rounded-sm p-0.5 hover:bg-gray-800/5 dark:hover:bg-gray-100/5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" class="origin-center transition-transform rtl:-rotate-180"></path></svg> <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="h-[18px] min-w-[18px] rounded-sm p-0.5 hover:bg-gray-800/5 dark:hover:bg-gray-100/5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" class="origin-center transition-transform rtl:-rotate-180"></path></svg>
{{- end -}} {{- end -}}

View File

@ -26,8 +26,18 @@
<div class="{{ $borderClass }} sticky bottom-0 flex flex-col items-start gap-2 pb-8 dark:border-neutral-800 contrast-more:border-t contrast-more:border-neutral-400 contrast-more:shadow-none contrast-more:dark:border-neutral-400"> <div class="{{ $borderClass }} sticky bottom-0 flex flex-col items-start gap-2 pb-8 dark:border-neutral-800 contrast-more:border-t contrast-more:border-neutral-400 contrast-more:shadow-none contrast-more:dark:border-neutral-400">
{{- if site.Params.editURL.enable -}} {{- if site.Params.editURL.enable -}}
{{- $editURL := site.Params.editURL.base | default "" -}} {{- $editURL := site.Params.editURL.base | default "" -}}
{{- with .File -}}{{ $editURL = urls.JoinPath $editURL (replace .Path "\\" "/") }}{{- end -}} {{- with .Params.editURL -}}
{{- with .Params.editURL -}}{{ $editURL = .Params.editURL }}{{- end -}} {{/* if `editURL` is set in the front matter */}}
{{- $editURL = . -}}
{{- else -}}
{{- with .File -}}
{{/* `.FileInfo.Meta.SourceRoot` is a Hugo internal field, e.g. `/path/to/repo/content/en/` */}}
{{- $sourceDir := replace (strings.TrimPrefix .FileInfo.Meta.BaseDir .FileInfo.Meta.SourceRoot) "\\" "/" -}}
{{- $sourceDir = strings.TrimPrefix "/content" $sourceDir -}}
{{- $path := replace .Path "\\" "/" -}}
{{- $editURL = urls.JoinPath $editURL $sourceDir $path -}}
{{- end -}}
{{- end -}}
<a class="text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 contrast-more:text-gray-800 contrast-more:dark:text-gray-50" href="{{ $editURL }}" target="_blank" rel="noreferer">{{ $editThisPage }}</a> <a class="text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 contrast-more:text-gray-800 contrast-more:dark:text-gray-50" href="{{ $editURL }}" target="_blank" rel="noreferer">{{ $editThisPage }}</a>
{{- end -}} {{- end -}}
{{/* Scroll To Top */}} {{/* Scroll To Top */}}
@ -59,7 +69,7 @@
{{- if .Title }} {{- if .Title }}
<li class="my-2 scroll-my-6 scroll-py-6"> <li class="my-2 scroll-my-6 scroll-py-6">
<a class="{{ $class }} inline-block text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300 contrast-more:text-gray-900 contrast-more:underline contrast-more:dark:text-gray-50 w-full break-words" href="#{{ anchorize .ID }}"> <a class="{{ $class }} inline-block text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300 contrast-more:text-gray-900 contrast-more:underline contrast-more:dark:text-gray-50 w-full break-words" href="#{{ anchorize .ID }}">
{{- .Title | safeHTML }} {{- .Title | safeHTML | plainify | htmlUnescape }}
</a> </a>
</li> </li>
{{- end -}} {{- end -}}

View File

@ -35,12 +35,12 @@
{{ $headingTitle := index $headingTitles $i }} {{ $headingTitle := index $headingTitles $i }}
{{ if eq $i 0 }} {{ if eq $i 0 }}
{{ $data = $data | merge (dict $headingKey ($content | markdownify | plainify | htmlUnescape | chomp)) }} {{ $data = $data | merge (dict $headingKey ($content | $page.RenderString | plainify | htmlUnescape | chomp)) }}
{{ else }} {{ else }}
{{ $parts := split $content (printf "\n%s\n" $headingTitle) }} {{ $parts := split $content (printf "\n%s\n" $headingTitle) }}
{{ $lastPart := index $parts (sub (len $parts) 1) }} {{ $lastPart := index $parts (sub (len $parts) 1) }}
{{ $data = $data | merge (dict $headingKey ($lastPart | markdownify | plainify | htmlUnescape | chomp)) }} {{ $data = $data | merge (dict $headingKey ($lastPart | $page.RenderString | plainify | htmlUnescape | chomp)) }}
{{ $content = strings.TrimSuffix $lastPart $content }} {{ $content = strings.TrimSuffix $lastPart $content }}
{{ $content = strings.TrimSuffix (printf "\n%s\n" $headingTitle) $content }} {{ $content = strings.TrimSuffix (printf "\n%s\n" $headingTitle) $content }}
{{ end }} {{ end }}

View File

@ -5,17 +5,30 @@
{{ if eq $emoji "" }} {{ if eq $emoji "" }}
{{ $emoji = index $calloutEmojiDict $type }} {{ $emoji = index $calloutEmojiDict $type }}
{{ end }} {{ end }}
{{/* Also allow using "icon" */}}
{{ $icon := .Get "icon" }}
{{ $defaultClass := "border-orange-100 bg-orange-50 text-orange-800 dark:border-orange-400/30 dark:bg-orange-400/20 dark:text-orange-300" }} {{ $defaultClass := "border-orange-100 bg-orange-50 text-orange-800 dark:border-orange-400/30 dark:bg-orange-400/20 dark:text-orange-300" }}
{{ $infoClass := "border-blue-200 bg-blue-100 text-blue-900 dark:border-blue-200/30 dark:bg-blue-900/30 dark:text-blue-200" }} {{ $infoClass := "border-blue-200 bg-blue-100 text-blue-900 dark:border-blue-200/30 dark:bg-blue-900/30 dark:text-blue-200" }}
{{ $warningClass := "border-yellow-100 bg-yellow-50 text-yellow-900 dark:border-yellow-200/30 dark:bg-yellow-700/30 dark:text-yellow-200" }} {{ $warningClass := "border-yellow-100 bg-yellow-50 text-yellow-900 dark:border-yellow-200/30 dark:bg-yellow-700/30 dark:text-yellow-200" }}
{{ $errorClass := "border-red-200 bg-red-100 text-red-900 dark:border-red-200/30 dark:bg-red-900/30 dark:text-red-200" }} {{ $errorClass := "border-red-200 bg-red-100 text-red-900 dark:border-red-200/30 dark:bg-red-900/30 dark:text-red-200" }}
{{ $class := cond (eq $type "info") $infoClass (cond (eq $type "warning") $warningClass (cond (eq $type "error") $errorClass $defaultClass)) }} {{ $class := cond (eq $type "info") $infoClass (cond (eq $type "warning") $warningClass (cond (eq $type "error") $errorClass $defaultClass)) }}
<div class="overflow-x-auto mt-6 flex rounded-lg border py-2 ltr:pr-4 rtl:pl-4 contrast-more:border-current contrast-more:dark:border-current {{ $class }}"> <div class="overflow-x-auto mt-6 flex rounded-lg border py-2 ltr:pr-4 rtl:pl-4 contrast-more:border-current contrast-more:dark:border-current {{ $class }}">
<div class="select-none text-xl ltr:pl-3 ltr:pr-2 rtl:pr-3 rtl:pl-2" style='font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'>{{ $emoji }}</div> <div class="ltr:pl-3 ltr:pr-2 rtl:pr-3 rtl:pl-2">
{{- with $emoji -}}
<div class="select-none text-xl" style="font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';">
{{ . }}
</div>
{{- else -}}
{{- with $icon }}
{{ partial "utils/icon.html" (dict "name" . "attributes" `height=1.2em class="inline-block align-middle"`) -}}
{{- end -}}
{{- end -}}
</div>
<div class="w-full min-w-0 leading-7"> <div class="w-full min-w-0 leading-7">
<div class="mt-6 leading-7 first:mt-0"> <div class="mt-6 leading-7 first:mt-0">
{{ .Inner | markdownify }} {{ .Inner | markdownify }}

View File

@ -79,3 +79,4 @@
<div class="line-clamp-3 text-sm font-normal text-gray-500 dark:text-gray-400 px-4 mb-4 mt-2">{{- $subtitle | markdownify -}}</div> <div class="line-clamp-3 text-sm font-normal text-gray-500 dark:text-gray-400 px-4 mb-4 mt-2">{{- $subtitle | markdownify -}}</div>
{{- end -}} {{- end -}}
</a> </a>
{{- /* Strip trailing newline. */ -}}

View File

@ -1,5 +1,5 @@
{{ $rows := .Get "rows" | default "3" }} {{ $rows := .Get "rows" | default "3" }}
<div class="hextra-cards mt-4 gap-4 grid not-prose" style="--rows: {{ $rows }};"> <div class="hextra-cards mt-4 gap-4 grid not-prose" style="--rows: {{ $rows }};">
{{ .Inner }} {{- .Inner -}}
</div> </div>

View File

@ -10,10 +10,14 @@
{{- $external := hasPrefix $link "http" -}} {{- $external := hasPrefix $link "http" -}}
{{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}} {{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}}
{{- if hasPrefix $image "/" -}}
{{- $image = relURL (strings.TrimPrefix "/" $image) -}}
{{- end -}}
<a <a
{{ with $link }}href="{{ $href }}" {{ with $external }} target="_blank" rel="noreferrer"{{ end }}{{ end }} {{ with $link }}href="{{ $href }}" {{ with $external }} target="_blank" rel="noreferrer"{{ end }}{{ end }}
{{ with $style }}style="{{ . | safeCSS }}"{{ end }} {{ with $style }}style="{{ . | safeCSS }}"{{ end }}
class="{{ $class }} hextra-feature-card relative overflow-hidden rounded-3xl border border-gray-200 hover:border-gray-300 dark:border-neutral-800 dark:hover:border-neutral-700 before:pointer-events-none before:absolute before:inset-0 before:bg-glass-gradient" class="{{ $class }} hextra-feature-card not-prose block relative overflow-hidden rounded-3xl border border-gray-200 hover:border-gray-300 dark:border-neutral-800 dark:hover:border-neutral-700 before:pointer-events-none before:absolute before:inset-0 before:bg-glass-gradient"
> >
<div class="relative w-full p-6"> <div class="relative w-full p-6">
<h3 class="text-2xl font-medium leading-6 mb-2 flex items-center"> <h3 class="text-2xl font-medium leading-6 mb-2 flex items-center">

View File

@ -2,7 +2,7 @@
<div <div
class="grid sm:grid-cols-2 lg:grid-cols-3 grid-cols-1 gap-4 w-full" class="grid sm:grid-cols-2 lg:grid-cols-3 grid-cols-1 gap-4 w-full not-prose"
{{ with $style }}style="{{ . | safeCSS }}"{{ end }} {{ with $style }}style="{{ . | safeCSS }}"{{ end }}
> >
{{ .Inner }} {{ .Inner }}

View File

@ -6,8 +6,8 @@
<a <a
href="{{ $href }}" {{ if $link }}href="{{ $href }}"{{ end }}
class="{{ $class }} inline-flex items-center rounded-full gap-2 px-3 py-1 text-xs text-gray-600 dark:text-gray-400 bg-gray-100 dark:bg-neutral-800 dark:border-neutral-800 border hover:border-gray-400 dark:hover:text-gray-50 dark:hover:border-gray-600 transition-all ease-in duration-200" class="{{ $class }} not-prose inline-flex items-center rounded-full gap-2 px-3 py-1 text-xs text-gray-600 dark:text-gray-400 bg-gray-100 dark:bg-neutral-800 dark:border-neutral-800 border hover:border-gray-400 dark:hover:text-gray-50 dark:hover:border-gray-600 transition-all ease-in duration-200"
{{ with $style }}style="{{ . | safeCSS }}"{{ end }} {{ with $style }}style="{{ . | safeCSS }}"{{ end }}
{{ if $external }}target="_blank" rel="noreferrer"{{ end -}} {{ if $external }}target="_blank" rel="noreferrer"{{ end -}}
> >

View File

@ -7,7 +7,7 @@
<a <a
href="{{ $href }}" href="{{ $href }}"
class="font-medium cursor-pointer px-6 py-3 rounded-full text-center text-white inline-block bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 transition-all ease-in duration-200" class="not-prose font-medium cursor-pointer px-6 py-3 rounded-full text-center text-white inline-block bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 transition-all ease-in duration-200"
{{ with $style }}style="{{ . | safeCSS }}"{{ end }} {{ with $style }}style="{{ . | safeCSS }}"{{ end }}
{{ if $external }}target="_blank" rel="noreferrer"{{ end -}} {{ if $external }}target="_blank" rel="noreferrer"{{ end -}}
> >

View File

@ -2,7 +2,7 @@
<h1 <h1
class="text-4xl font-bold leading-none tracking-tighter md:text-5xl py-2 bg-clip-text text-transparent bg-gradient-to-r from-gray-900 to-gray-600 dark:from-gray-100 dark:to-gray-400" class="not-prose text-4xl font-bold leading-none tracking-tighter md:text-5xl py-2 bg-clip-text text-transparent bg-gradient-to-r from-gray-900 to-gray-600 dark:from-gray-100 dark:to-gray-400"
{{ with $style }}style="{{ . | safeCSS }}"{{ end }} {{ with $style }}style="{{ . | safeCSS }}"{{ end }}
> >
{{ .Inner | markdownify }} {{ .Inner | markdownify }}

View File

@ -2,7 +2,7 @@
<p <p
class="text-xl text-gray-600 dark:text-gray-400 sm:text-xl" class="not-prose text-xl text-gray-600 dark:text-gray-400 sm:text-xl"
{{ with $style }}style="{{ . | safeCSS }}"{{ end }} {{ with $style }}style="{{ . | safeCSS }}"{{ end }}
> >
{{ .Inner | markdownify }} {{ .Inner | markdownify }}

View File

@ -0,0 +1,22 @@
{{- /*
https://github.com/gohugoio/gohugoioTheme/blob/master/layouts/shortcodes/include.html
Renders the page using the RenderShortcode method on the Page object.
You must call this shortcode using the {{% %}} notation.
@param {string} (postional parameter 0) The path to the page, relative to the content directory.
@returns template.HTML
@example {{% include "functions/_common/glob-patterns" %}}
*/}}
{{- with .Get 0 }}
{{- with site.GetPage . }}
{{- .RenderShortcodes }}
{{- else }}
{{- errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position }}
{{- end }}
{{- else }}
{{- errorf "The %q shortcode requires a positional parameter indicating the path of the file to include. See %s" .Name .Position }}
{{- end }}