Merge remote-tracking branch 'origin/main' into sidebar-data-source

This commit is contained in:
Xin
2024-12-28 16:43:20 +00:00
33 changed files with 550 additions and 68 deletions

15
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,15 @@
# These are supported funding model platforms
github: imfing
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@ -31,7 +31,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: 0.136.5 HUGO_VERSION: 0.138.0
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

View File

@ -1,4 +1,7 @@
{ {
"plugins": [
"prettier-plugin-go-template"
],
"goTemplateBracketSpacing": true, "goTemplateBracketSpacing": true,
"htmlWhitespaceSensitivity": "css", "htmlWhitespaceSensitivity": "css",
"printWidth": 200, "printWidth": 200,

View File

@ -952,6 +952,10 @@ video {
.hx-border-t { .hx-border-t {
border-top-width: 1px; border-top-width: 1px;
} }
.hx-border-amber-200 {
--tw-border-opacity: 1;
border-color: rgb(253 230 138 / var(--tw-border-opacity));
}
.hx-border-black\/5 { .hx-border-black\/5 {
border-color: rgb(0 0 0 / 0.05); border-color: rgb(0 0 0 / 0.05);
} }
@ -967,6 +971,14 @@ video {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(107 114 128 / var(--tw-border-opacity)); border-color: rgb(107 114 128 / var(--tw-border-opacity));
} }
.hx-border-green-200 {
--tw-border-opacity: 1;
border-color: rgb(187 247 208 / var(--tw-border-opacity));
}
.hx-border-indigo-200 {
--tw-border-opacity: 1;
border-color: rgb(199 210 254 / var(--tw-border-opacity));
}
.hx-border-orange-100 { .hx-border-orange-100 {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(255 237 213 / var(--tw-border-opacity)); border-color: rgb(255 237 213 / var(--tw-border-opacity));
@ -982,6 +994,10 @@ 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));
} }
.hx-bg-amber-100 {
--tw-bg-opacity: 1;
background-color: rgb(254 243 199 / var(--tw-bg-opacity));
}
.hx-bg-black\/80 { .hx-bg-black\/80 {
background-color: rgb(0 0 0 / 0.8); background-color: rgb(0 0 0 / 0.8);
} }
@ -996,6 +1012,14 @@ video {
--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));
} }
.hx-bg-green-100 {
--tw-bg-opacity: 1;
background-color: rgb(220 252 231 / var(--tw-bg-opacity));
}
.hx-bg-indigo-100 {
--tw-bg-opacity: 1;
background-color: rgb(224 231 255 / var(--tw-bg-opacity));
}
.hx-bg-neutral-50 { .hx-bg-neutral-50 {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(250 250 250 / var(--tw-bg-opacity)); background-color: rgb(250 250 250 / var(--tw-bg-opacity));
@ -1161,6 +1185,9 @@ video {
.hx-text-center { .hx-text-center {
text-align: center; text-align: center;
} }
.hx-align-middle {
vertical-align: middle;
}
.hx-align-text-bottom { .hx-align-text-bottom {
vertical-align: text-bottom; vertical-align: text-bottom;
} }
@ -1237,6 +1264,10 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: hsl(var(--primary-hue) 100% 50% / var(--tw-text-opacity)); color: hsl(var(--primary-hue) 100% 50% / var(--tw-text-opacity));
} }
.hx-text-amber-900 {
--tw-text-opacity: 1;
color: rgb(120 53 15 / var(--tw-text-opacity));
}
.hx-text-blue-900 { .hx-text-blue-900 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(30 58 138 / var(--tw-text-opacity)); color: rgb(30 58 138 / var(--tw-text-opacity));
@ -1268,6 +1299,14 @@ video {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity)); color: rgb(17 24 39 / var(--tw-text-opacity));
} }
.hx-text-green-900 {
--tw-text-opacity: 1;
color: rgb(20 83 45 / var(--tw-text-opacity));
}
.hx-text-indigo-900 {
--tw-text-opacity: 1;
color: rgb(49 46 129 / var(--tw-text-opacity));
}
.hx-text-orange-800 { .hx-text-orange-800 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(154 52 18 / var(--tw-text-opacity)); color: rgb(154 52 18 / var(--tw-text-opacity));
@ -2931,6 +2970,9 @@ body:is(html[class~="dark"] *) {
.dark\:hx-hidden:is(html[class~="dark"] *) { .dark\:hx-hidden:is(html[class~="dark"] *) {
display: none; display: none;
} }
.dark\:hx-border-amber-200\/30:is(html[class~="dark"] *) {
border-color: rgb(253 230 138 / 0.3);
}
.dark\:hx-border-blue-200\/30:is(html[class~="dark"] *) { .dark\:hx-border-blue-200\/30:is(html[class~="dark"] *) {
border-color: rgb(191 219 254 / 0.3); border-color: rgb(191 219 254 / 0.3);
} }
@ -2941,6 +2983,12 @@ body:is(html[class~="dark"] *) {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(156 163 175 / var(--tw-border-opacity)); border-color: rgb(156 163 175 / var(--tw-border-opacity));
} }
.dark\:hx-border-green-200\/30:is(html[class~="dark"] *) {
border-color: rgb(187 247 208 / 0.3);
}
.dark\:hx-border-indigo-200\/30:is(html[class~="dark"] *) {
border-color: rgb(199 210 254 / 0.3);
}
.dark\:hx-border-neutral-700:is(html[class~="dark"] *) { .dark\:hx-border-neutral-700:is(html[class~="dark"] *) {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(64 64 64 / var(--tw-border-opacity)); border-color: rgb(64 64 64 / var(--tw-border-opacity));
@ -2961,6 +3009,9 @@ body:is(html[class~="dark"] *) {
.dark\:hx-border-yellow-200\/30:is(html[class~="dark"] *) { .dark\:hx-border-yellow-200\/30:is(html[class~="dark"] *) {
border-color: rgb(254 240 138 / 0.3); border-color: rgb(254 240 138 / 0.3);
} }
.dark\:hx-bg-amber-900\/30:is(html[class~="dark"] *) {
background-color: rgb(120 53 15 / 0.3);
}
.dark\:hx-bg-black\/60:is(html[class~="dark"] *) { .dark\:hx-bg-black\/60:is(html[class~="dark"] *) {
background-color: rgb(0 0 0 / 0.6); background-color: rgb(0 0 0 / 0.6);
} }
@ -2977,6 +3028,12 @@ body:is(html[class~="dark"] *) {
.dark\:hx-bg-gray-50\/10:is(html[class~="dark"] *) { .dark\:hx-bg-gray-50\/10:is(html[class~="dark"] *) {
background-color: rgb(249 250 251 / 0.1); background-color: rgb(249 250 251 / 0.1);
} }
.dark\:hx-bg-green-900\/30:is(html[class~="dark"] *) {
background-color: rgb(20 83 45 / 0.3);
}
.dark\:hx-bg-indigo-900\/30:is(html[class~="dark"] *) {
background-color: rgb(49 46 129 / 0.3);
}
.dark\:hx-bg-neutral-800:is(html[class~="dark"] *) { .dark\:hx-bg-neutral-800:is(html[class~="dark"] *) {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(38 38 38 / var(--tw-bg-opacity)); background-color: rgb(38 38 38 / var(--tw-bg-opacity));
@ -3012,6 +3069,10 @@ body:is(html[class~="dark"] *) {
.dark\:hx-to-gray-400:is(html[class~="dark"] *) { .dark\:hx-to-gray-400:is(html[class~="dark"] *) {
--tw-gradient-to: #9ca3af var(--tw-gradient-to-position); --tw-gradient-to: #9ca3af var(--tw-gradient-to-position);
} }
.dark\:hx-text-amber-200:is(html[class~="dark"] *) {
--tw-text-opacity: 1;
color: rgb(253 230 138 / var(--tw-text-opacity));
}
.dark\:hx-text-blue-200:is(html[class~="dark"] *) { .dark\:hx-text-blue-200:is(html[class~="dark"] *) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(191 219 254 / var(--tw-text-opacity)); color: rgb(191 219 254 / var(--tw-text-opacity));
@ -3036,6 +3097,14 @@ body:is(html[class~="dark"] *) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(249 250 251 / var(--tw-text-opacity)); color: rgb(249 250 251 / var(--tw-text-opacity));
} }
.dark\:hx-text-green-200:is(html[class~="dark"] *) {
--tw-text-opacity: 1;
color: rgb(187 247 208 / var(--tw-text-opacity));
}
.dark\:hx-text-indigo-200:is(html[class~="dark"] *) {
--tw-text-opacity: 1;
color: rgb(199 210 254 / var(--tw-text-opacity));
}
.dark\:hx-text-neutral-200:is(html[class~="dark"] *) { .dark\:hx-text-neutral-200:is(html[class~="dark"] *) {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(229 229 229 / var(--tw-text-opacity)); color: rgb(229 229 229 / var(--tw-text-opacity));
@ -3189,6 +3258,14 @@ body:is(html[class~="dark"] *) {
--tw-ring-opacity: 1; --tw-ring-opacity: 1;
--tw-ring-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 32) / var(--tw-ring-opacity)); --tw-ring-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 32) / var(--tw-ring-opacity));
} }
.data-\[state\=selected\]\:dark\:hx-border-primary-500:is(html[class~="dark"] *)[data-state="selected"] {
--tw-border-opacity: 1;
border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 50) / var(--tw-border-opacity));
}
.data-\[state\=selected\]\:dark\:hx-text-primary-600:is(html[class~="dark"] *)[data-state="selected"] {
--tw-text-opacity: 1;
color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-text-opacity));
}
@media (prefers-contrast: more) { @media (prefers-contrast: more) {
.contrast-more\:dark\:hx-border-current:is(html[class~="dark"] *) { .contrast-more\:dark\:hx-border-current:is(html[class~="dark"] *) {

View File

@ -289,3 +289,4 @@ youtube: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill=
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> 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>
slack: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52a2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52zm0 1.271a2.528 2.528 0 0 1 2.521 2.521a2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521a2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522zm0-1.268a2.527 2.527 0 0 1-2.52-2.523a2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523z" /></svg> slack: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52a2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52zm0 1.271a2.528 2.528 0 0 1 2.521 2.521a2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521a2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522zm0-1.268a2.527 2.527 0 0 1-2.52-2.523a2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523z" /></svg>
bluesky: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 530"><path fill="currentColor" d="M136 44c66 50 138 151 164 205 26-54 98-155 164-205 48-36 126-64 126 25 0 18-10 149-16 170-21 74-96 93-163 81 117 20 147 86 82 153-122 125-176-32-189-72-3-8-4-11-4-8 0-3-1 0-4 8-13 40-67 197-189 72-65-67-35-133 82-153-67 12-142-7-163-81-6-21-16-152-16-170 0-89 78-61 126-25z"/></svg>

View File

@ -44,6 +44,128 @@ The primary color of the theme can be customized by setting the `--primary-hue`,
} }
``` ```
### Further Theme Customization
The theme can be further customized by overriding the default styles via the exposed css classes. An example for customizing the footer element:
```css {filename="assets/css/custom.css"}
.hextra-footer {
/* Styles will be applied to the footer element */
}
.hextra-footer:is(html[class~="dark"] *) {
/* Styles will be applied to the footer element in dark mode */
}
```
The following classes can be used to customize various parts of the theme.
#### General
- `hextra-scrollbar` - The scrollbar element
- `content` - Page content container
#### Shortcodes
##### Badge
- `hextra-badge` - The badge element
##### Card
- `hextra-card` - The card element
- `hextra-card-image` - The card image element
- `hextra-card-icon` - The card icon element
- `hextra-card-subtitle` - The card subtitle element
##### Cards
- `hextra-cards` - The cards grid container
##### Jupyter Notebook
- `hextra-jupyter-code-cell` - The Jupyter code cell container
- `hextra-jupyter-code-cell-outputs-container` - The Jupyter code cell outputs container
- `hextra-jupyter-code-cell-outputs` - The Jupyter code cell output div element
##### PDF
- `hextra-pdf` - The PDF container element
##### Steps
- `steps` - The steps container
##### Tabs
- `hextra-tabs-panel` - The tabs panel container
- `hextra-tabs-toggle` - The tabs toggle button
##### Filetree
- `hextra-filetree` - The filetree container
##### Folder
- `hextra-filetree-folder` - The filetree folder container
#### Navbar
- `nav-container` - The navbar container
- `nav-container-blur` - The navbar container in blur element
- `hamburger-menu` - The hamburger menu button
#### Footer
- `hextra-footer` - The footer element
- `hextra-custom-footer` - The custom footer section container
#### Search
- `search-wrapper` - The search wrapper container
- `search-input` - The search input element
- `search-results` - The search results list container
#### Table of Contents
- `hextra-toc` - The table of contents container
#### Sidebar
- `mobile-menu-overlay` - The overlay element for the mobile menu
- `sidebar-container` - The sidebar container
- `sidebar-active-item` - The active item in the sidebar
#### Language Switcher
- `language-switcher` - The language switcher button
- `language-options` - The language options container
#### Theme Toggle
- `theme-toggle` - The theme toggle button
#### Cody Copy Button
- `hextra-code-copy-btn-container` - The code copy button container
- `hextra-code-copy-btn` - The code copy button
#### Code Block
- `hextra-code-block` - The code block container
#### Feature Card
- `hextra-feature-card` - The feature card link element
#### Feature Grid
- `hextra-feature-grid` - The feature grid container
#### Breadcrumbs
No specific class is available for breadcrumbs.
### Syntax Highlighting ### Syntax Highlighting
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:
@ -62,13 +184,28 @@ You may add custom scripts to the end of the head for every page by adding the f
layouts/partials/custom/head-end.html layouts/partials/custom/head-end.html
``` ```
## Custom Extra Section in Footer
You can add extra section in the footer by creating a file `layouts/partials/custom/footer.html` in your site.
```html {filename="layouts/partials/custom/footer.html"}
<!-- Your footer element here -->
```
The added section will be added before the copyright section in the footer.
You can use [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) and [Hugo template syntax](https://gohugo.io/templates/) to add your own content.
Hugo variables available in the footer section are: `.switchesVisible` and `.copyrightVisible`.
## Custom Layouts ## Custom Layouts
The layouts of the theme can be overridden by creating a file with the same name in the `layouts` directory of your site. The layouts of the theme can be overridden by creating a file with the same name in the `layouts` directory of your site.
For example, to override the `single.html` layout for docs, create a file `layouts/docs/single.html` in your site. For example, to override the `single.html` layout for docs, create a file `layouts/docs/single.html` in your site.
For further information, refer to the [Hugo Templates](https://gohugo.io/templates/). For further information, refer to the [Hugo Templates][hugo-template-docs].
## Further Customization ## Further Customization
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! 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!
[hugo-template-docs]: https://gohugo.io/templates/

View File

@ -54,7 +54,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: 0.131.0 HUGO_VERSION: 0.138.0
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -146,7 +146,7 @@ For more details, check out:
3. If you are not using [hextra-starter-template][hextra-starter-template], configure the following manually: 3. If you are not using [hextra-starter-template][hextra-starter-template], configure the following manually:
- Configure the Build command to `hugo --gc --minify` - Configure the Build command to `hugo --gc --minify`
- Specify the Publish directory to `public` - Specify the Publish directory to `public`
- Add Environment variable `HUGO_VERSION` and set to `0.132.2` - Add Environment variable `HUGO_VERSION` and set to `0.138.0`, or alternatively, set it in `netlify.toml` file
4. Deploy! 4. Deploy!
Check [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) for more details. Check [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) for more details.

View File

@ -35,6 +35,46 @@ Blockquote with attribution
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
``` ```
### Alerts
{{< new-feature version="v0.9.0" >}}
Alerts are a Markdown extension based on the blockquote syntax that you can use to emphasize critical information.
[GitHub-style alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) are supported.
Please make sure you are using the latest version of Hextra and [Hugo v0.134.0](https://github.com/gohugoio/hugo/releases/tag/v0.134.0) or later.
> [!NOTE]
> Useful information that users should know, even when skimming content.
> [!TIP]
> Helpful advice for doing things better or more easily.
> [!IMPORTANT]
> Key information users need to know to achieve their goal.
> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.
> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.
```markdown {filename=Markdown}
> [!NOTE]
> Useful information that users should know, even when skimming content.
> [!TIP]
> Helpful advice for doing things better or more easily.
> [!IMPORTANT]
> Key information users need to know to achieve their goal.
> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.
> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.
```
### Tables ### Tables
Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box. Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box.

View File

@ -10,6 +10,10 @@ A built-in component to show important information to the reader.
<!--more--> <!--more-->
> [!NOTE]
> [GitHub-style alerts](../../markdown#alerts) are supported since [v0.9.0](https://github.com/imfing/hextra/releases/tag/v0.9.0).
> It leverages Markdown syntax to render the callout which ensures better portability and readability of the content.
## Example ## Example
{{< callout emoji="👾">}} {{< callout emoji="👾">}}

View File

@ -34,16 +34,15 @@ Result:
{{< badge content="warning" type="warning" >}} &nbsp; {{< badge content="warning" type="warning" >}} &nbsp;
{{< badge content="error" type="error" >}} {{< badge content="error" type="error" >}}
With link: With link and icon:
``` ```
{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" */>}} {{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" */>}}
``` ```
Result: Result:
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" >}} {{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}
## YouTube ## YouTube

View File

@ -40,6 +40,24 @@ def say_hello():
print("Hello!") print("Hello!")
``` ```
### Link to File
{{< new-feature version="v0.9.2" >}}
You can use the `base_url` attribute to provide a base URL that will be combined with the file name to generate a link.
The file name can include a relative path if it specifies the file's location within the base path.
````markdown {filename="Markdown"}
```go {base_url="https://github.com/imfing/hextra/blob/main/",filename="exampleSite/hugo.work"}
go 1.20
```
````
```go {base_url="https://github.com/imfing/hextra/blob/main/",filename="exampleSite/hugo.work"}
go 1.20
```
### Line Numbers ### Line Numbers
To set line numbers, set attribute `linenos` to `table` and optionally set `linenostart` to the starting line number: To set line numbers, set attribute `linenos` to `table` and optionally set `linenostart` to the starting line number:

View File

@ -12,6 +12,20 @@ Open source projects powered by Hextra
</p> </p>
{{< cards >}} {{< cards >}}
{{< card
link="https://github.com/modelcontextprotocol/specification"
title="Model Context Protocol Specification"
image="https://github.com/user-attachments/assets/1bb4f952-b8fc-43b5-9cbd-cd7213c2ba90"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}}
{{< card
link="https://github.com/jonaspleyer/cellular_raza"
title="cellular_raza"
image="https://github.com/user-attachments/assets/f24c6455-b70a-419b-b025-e3d60101b673"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}}
{{< card {{< card
link="https://github.com/mightymoud/sidekick" link="https://github.com/mightymoud/sidekick"
title="Sidekick" title="Sidekick"
@ -77,11 +91,11 @@ Open source projects powered by Hextra
link="https://hoa.moe/" link="https://hoa.moe/"
title="HITSZ OpenAuto" title="HITSZ OpenAuto"
image="https://raw.githubusercontent.com/HITSZ-OpenAuto/hoa.moe/main/static/images/showcase-new.png" image="https://raw.githubusercontent.com/HITSZ-OpenAuto/hoa.moe/main/static/images/showcase-new.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;" imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}} >}}
{{< card {{< card
link="https://lutheranconfessions.org/" link="https://github.com/remysheppard/lutheran-confessions"
title="LutheranConfessions" title="LutheranConfessions"
image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359" image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359"
imageStyle="object-fit:cover; aspect-ratio:16/9;" imageStyle="object-fit:cover; aspect-ratio:16/9;"

View File

@ -173,3 +173,4 @@ params:
# emitMetadata: 0 # emitMetadata: 0
# inputPosition: top # inputPosition: top
# lang: en # lang: en
# theme: noborder_dark

View File

@ -141,11 +141,14 @@
"dark:hover:hx-text-gray-50", "dark:hover:hx-text-gray-50",
"dark:hover:hx-text-neutral-50", "dark:hover:hx-text-neutral-50",
"dark:hover:hx-text-white", "dark:hover:hx-text-white",
"dark:hx-bg-amber-900/30",
"dark:hx-bg-black/60", "dark:hx-bg-black/60",
"dark:hx-bg-blue-900/30", "dark:hx-bg-blue-900/30",
"dark:hx-bg-dark", "dark:hx-bg-dark",
"dark:hx-bg-dark/50", "dark:hx-bg-dark/50",
"dark:hx-bg-gray-50/10", "dark:hx-bg-gray-50/10",
"dark:hx-bg-green-900/30",
"dark:hx-bg-indigo-900/30",
"dark:hx-bg-neutral-800", "dark:hx-bg-neutral-800",
"dark:hx-bg-neutral-900", "dark:hx-bg-neutral-900",
"dark:hx-bg-orange-400/20", "dark:hx-bg-orange-400/20",
@ -155,9 +158,12 @@
"dark:hx-bg-red-900/30", "dark:hx-bg-red-900/30",
"dark:hx-bg-yellow-700/30", "dark:hx-bg-yellow-700/30",
"dark:hx-block", "dark:hx-block",
"dark:hx-border-amber-200/30",
"dark:hx-border-blue-200/30", "dark:hx-border-blue-200/30",
"dark:hx-border-gray-100/20", "dark:hx-border-gray-100/20",
"dark:hx-border-gray-400", "dark:hx-border-gray-400",
"dark:hx-border-green-200/30",
"dark:hx-border-indigo-200/30",
"dark:hx-border-neutral-700", "dark:hx-border-neutral-700",
"dark:hx-border-neutral-800", "dark:hx-border-neutral-800",
"dark:hx-border-orange-400/30", "dark:hx-border-orange-400/30",
@ -171,12 +177,15 @@
"dark:hx-shadow-[0_-12px_16px_#111]", "dark:hx-shadow-[0_-12px_16px_#111]",
"dark:hx-shadow-[0_-1px_0_rgba(255,255,255,.1)_inset]", "dark:hx-shadow-[0_-1px_0_rgba(255,255,255,.1)_inset]",
"dark:hx-shadow-none", "dark:hx-shadow-none",
"dark:hx-text-amber-200",
"dark:hx-text-blue-200", "dark:hx-text-blue-200",
"dark:hx-text-gray-100", "dark:hx-text-gray-100",
"dark:hx-text-gray-200", "dark:hx-text-gray-200",
"dark:hx-text-gray-300", "dark:hx-text-gray-300",
"dark:hx-text-gray-400", "dark:hx-text-gray-400",
"dark:hx-text-gray-50", "dark:hx-text-gray-50",
"dark:hx-text-green-200",
"dark:hx-text-indigo-200",
"dark:hx-text-neutral-200", "dark:hx-text-neutral-200",
"dark:hx-text-neutral-400", "dark:hx-text-neutral-400",
"dark:hx-text-orange-300", "dark:hx-text-orange-300",
@ -188,6 +197,8 @@
"dark:placeholder:hx-text-gray-400", "dark:placeholder:hx-text-gray-400",
"data-[state=closed]:hx-hidden", "data-[state=closed]:hx-hidden",
"data-[state=open]:hx-hidden", "data-[state=open]:hx-hidden",
"data-[state=selected]:dark:hx-border-primary-500",
"data-[state=selected]:dark:hx-text-primary-600",
"data-[state=selected]:hx-block", "data-[state=selected]:hx-block",
"data-[state=selected]:hx-border-primary-500", "data-[state=selected]:hx-border-primary-500",
"data-[state=selected]:hx-text-primary-600", "data-[state=selected]:hx-text-primary-600",
@ -219,6 +230,7 @@
"hextra-code-block", "hextra-code-block",
"hextra-code-copy-btn", "hextra-code-copy-btn",
"hextra-code-copy-btn-container", "hextra-code-copy-btn-container",
"hextra-custom-footer",
"hextra-feature-card", "hextra-feature-card",
"hextra-feature-grid", "hextra-feature-grid",
"hextra-filetree", "hextra-filetree",
@ -256,15 +268,19 @@
"hover:hx-text-primary-600", "hover:hx-text-primary-600",
"hx-absolute", "hx-absolute",
"hx-align-[-2.5px]", "hx-align-[-2.5px]",
"hx-align-middle",
"hx-align-text-bottom", "hx-align-text-bottom",
"hx-appearance-none", "hx-appearance-none",
"hx-aspect-auto", "hx-aspect-auto",
"hx-bg-amber-100",
"hx-bg-black/80", "hx-bg-black/80",
"hx-bg-black/[.05]", "hx-bg-black/[.05]",
"hx-bg-blue-100", "hx-bg-blue-100",
"hx-bg-clip-text", "hx-bg-clip-text",
"hx-bg-gradient-to-r", "hx-bg-gradient-to-r",
"hx-bg-gray-100", "hx-bg-gray-100",
"hx-bg-green-100",
"hx-bg-indigo-100",
"hx-bg-neutral-50", "hx-bg-neutral-50",
"hx-bg-orange-50", "hx-bg-orange-50",
"hx-bg-primary-100", "hx-bg-primary-100",
@ -277,12 +293,15 @@
"hx-bg-yellow-50", "hx-bg-yellow-50",
"hx-block", "hx-block",
"hx-border", "hx-border",
"hx-border-amber-200",
"hx-border-b", "hx-border-b",
"hx-border-b-2", "hx-border-b-2",
"hx-border-black/5", "hx-border-black/5",
"hx-border-blue-200", "hx-border-blue-200",
"hx-border-gray-200", "hx-border-gray-200",
"hx-border-gray-500", "hx-border-gray-500",
"hx-border-green-200",
"hx-border-indigo-200",
"hx-border-orange-100", "hx-border-orange-100",
"hx-border-red-200", "hx-border-red-200",
"hx-border-t", "hx-border-t",
@ -468,6 +487,7 @@
"hx-text-[.65rem]", "hx-text-[.65rem]",
"hx-text-[10px]", "hx-text-[10px]",
"hx-text-[color:hsl(var(--primary-hue),100%,50%)]", "hx-text-[color:hsl(var(--primary-hue),100%,50%)]",
"hx-text-amber-900",
"hx-text-base", "hx-text-base",
"hx-text-blue-900", "hx-text-blue-900",
"hx-text-center", "hx-text-center",
@ -479,6 +499,8 @@
"hx-text-gray-700", "hx-text-gray-700",
"hx-text-gray-800", "hx-text-gray-800",
"hx-text-gray-900", "hx-text-gray-900",
"hx-text-green-900",
"hx-text-indigo-900",
"hx-text-left", "hx-text-left",
"hx-text-lg", "hx-text-lg",
"hx-text-orange-800", "hx-text-orange-800",

View File

@ -0,0 +1,11 @@
{{- $version := .Get "version" | default "" -}}
{{- $icon := .Get "icon" | default "" -}}
{{- $defaultLink := cond (eq $version "") "https://github.com/imfing/hextra/tree/main" (printf "https://github.com/imfing/hextra/releases/tag/%s" $version) -}}
{{- $link := .Get "link" | default $defaultLink -}}
{{- $content := cond (eq $version "") "New in main branch" (printf "New in %s" $version) -}}
<div style="margin-top: 1rem; display: inline-flex;">
<a href="{{ $link }}" title="{{ $link | plainify }}" target="_blank">
{{- partial "shortcodes/badge" (dict "content" $content "border" true "icon" $icon) -}}
</a>
</div>

View File

@ -0,0 +1,9 @@
{{- if not (in (slice "note" "tip" "important" "warning" "caution") .AlertType) -}}
{{- warnf "Alert type %s is not supported" .AlertType -}}
{{- end -}}
{{- $content := .Text -}}
{{- $alertType := .AlertType -}}
{{- $alertTitle := .AlertTitle -}}
{{- partial "components/github-style-alert.html" (dict "content" $content "alertType" $alertType "alertTitle" $alertTitle) -}}

View File

@ -0,0 +1,3 @@
<blockquote>
{{ .Text }}
</blockquote>

View File

@ -1,12 +1,13 @@
{{- $class := .Attributes.class | default "" -}} {{- $class := .Attributes.class | default "" -}}
{{- $filename := .Attributes.filename | default "" -}} {{- $filename := .Attributes.filename | default "" -}}
{{- $base_url := .Attributes.base_url | default "" -}}
{{- $lang := .Attributes.lang | default .Type -}} {{- $lang := .Attributes.lang | default .Type -}}
<div class="hextra-code-block hx-relative hx-mt-6 first:hx-mt-0 hx-group/code"> <div class="hextra-code-block hx-relative hx-mt-6 first:hx-mt-0 hx-group/code">
{{ partial "components/codeblock" (dict "filename" $filename "lang" $lang "content" .Inner "options" .Options) }} {{- partial "components/codeblock" (dict "filename" $filename "lang" $lang "base_url" $base_url "content" .Inner "options" .Options) -}}
{{- if or (eq site.Params.highlight.copy.enable nil) (site.Params.highlight.copy.enable) }} {{- if or (eq site.Params.highlight.copy.enable nil) (site.Params.highlight.copy.enable) -}}
{{- partialCached "components/codeblock-copy-button" (dict "filename" $filename) $filename }} {{- partialCached "components/codeblock-copy-button" (dict "filename" $filename) $filename -}}
{{ end }} {{- end -}}
</div> </div>

View File

@ -1,11 +1,27 @@
{{ $filename := .filename | default "" -}} {{ $filename := .filename | default "" -}}
{{ $base_url := .base_url | default "" -}}
{{ $lang := .lang | default "" }} {{ $lang := .lang | default "" }}
{{ $content := .content }} {{ $content := .content }}
{{ $options := .options | default (dict) }} {{ $options := .options | default (dict) }}
{{- if $filename -}} {{- if $filename -}}
<div class="filename" dir="auto">{{ $filename }}</div> <div class="filename not-prose" dir="auto">
{{- if $base_url -}}
{{- $base_url = strings.TrimSuffix "/" $base_url -}}
{{- $filename = strings.TrimPrefix "/" $filename -}}
{{- $file_url := urls.JoinPath $base_url $filename -}}
<a class="hx-no-underline hx-inline-flex hx-items-center hx-gap-1" href="{{ $file_url }}" target="_blank" rel="noopener noreferrer">
<span>{{- $filename -}}</span>
{{- partial "utils/icon" (dict "name" "external-link" "attributes" "height=1em") -}}
</a>
{{- else -}}
{{- $filename -}}
{{- end -}}
</div>
{{- end -}} {{- end -}}
{{- if transform.CanHighlight $lang -}} {{- if transform.CanHighlight $lang -}}
<div>{{- highlight $content $lang $options -}}</div> <div>{{- highlight $content $lang $options -}}</div>
{{- else -}} {{- else -}}

View File

@ -8,9 +8,18 @@
* This solution was created with reference to: * This solution was created with reference to:
* https://github.com/giscus/giscus/issues/336#issuecomment-1214366281 * https://github.com/giscus/giscus/issues/336#issuecomment-1214366281
*/ */
function getGiscusTheme() { function getHugoTheme() {
return localStorage.getItem("color-theme"); return localStorage.getItem("color-theme");
} }
function getGiscusTheme() {
let giscusTheme = "{{ (string .theme) | default `light` }}";
if(getHugoTheme() == 'light') {
return giscusTheme.replace('dark', 'light');
} else {
return giscusTheme.replace('light', 'dark');
}
}
function setGiscusTheme() { function setGiscusTheme() {
function sendMessage(message) { function sendMessage(message) {

View File

@ -0,0 +1,42 @@
{{- $content := .content -}}
{{- $alertType := .alertType -}}
{{- $alertTitle := .alertTitle -}}
{{- $icons := dict
"note" "information-circle"
"tip" "light-bulb"
"important" "information-circle"
"warning" "exclamation"
"caution" "exclamation-circle"
-}}
{{- $icon := index $icons $alertType -}}
{{- $title := or $alertTitle (or (i18n $alertType) (title $alertType)) -}}
{{- $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" }}
{{- $alertClasses := dict
"note" "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200"
"tip" "hx-border-green-200 hx-bg-green-100 hx-text-green-900 dark:hx-border-green-200/30 dark:hx-bg-green-900/30 dark:hx-text-green-200"
"important" "hx-border-indigo-200 hx-bg-indigo-100 hx-text-indigo-900 dark:hx-border-indigo-200/30 dark:hx-bg-indigo-900/30 dark:hx-text-indigo-200"
"warning" "hx-border-amber-200 hx-bg-amber-100 hx-text-amber-900 dark:hx-border-amber-200/30 dark:hx-bg-amber-900/30 dark:hx-text-amber-200"
"caution" "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200"
-}}
{{- $class := index $alertClasses $alertType | default $defaultClass -}}
<div class="hx-overflow-x-auto hx-mt-6 hx-flex hx-flex-col hx-rounded-lg hx-border hx-py-4 hx-px-4 contrast-more:hx-border-current contrast-more:dark:hx-border-current {{ $class }}">
<p class="hx-flex hx-items-center hx-font-medium">
{{- with $icon -}}
{{- partial "utils/icon.html" (dict "name" . "attributes" `height=16px class="hx-inline-block hx-align-middle hx-mr-2"`) -}}
{{- end -}}
{{- $title -}}
</p>
<div class="hx-w-full hx-min-w-0 hx-leading-7">
<div class="hx-mt-6 hx-leading-7 first:hx-mt-0">
{{- $content -}}
</div>
</div>
</div>

View File

View File

@ -1,5 +1,7 @@
{{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}} {{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}}
{{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}} {{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}}
{{- $footerSwitchesVisible := and $enableFooterSwitches (or hugo.IsMultilingual $displayThemeToggle) -}}
{{- $copyrightSectionVisible := or (.Site.Params.footer.displayPoweredBy | default true) .Site.Params.footer.displayCopyright -}}
{{- $copyright := (T "copyright") | default "© 2024 Hextra." -}} {{- $copyright := (T "copyright") | default "© 2024 Hextra." -}}
{{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}} {{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}}
@ -15,7 +17,7 @@
<footer class="hextra-footer hx-bg-gray-100 hx-pb-[env(safe-area-inset-bottom)] dark:hx-bg-neutral-900 print:hx-bg-transparent"> <footer class="hextra-footer hx-bg-gray-100 hx-pb-[env(safe-area-inset-bottom)] dark:hx-bg-neutral-900 print:hx-bg-transparent">
{{- if $enableFooterSwitches -}} {{- if $footerSwitchesVisible -}}
<div class="hx-mx-auto hx-flex hx-gap-2 hx-py-2 hx-px-4 {{ $footerWidth }}"> <div class="hx-mx-auto hx-flex hx-gap-2 hx-py-2 hx-px-4 {{ $footerWidth }}">
{{- partial "language-switch.html" (dict "context" .) -}} {{- partial "language-switch.html" (dict "context" .) -}}
{{- with $displayThemeToggle }}{{ partial "theme-toggle.html" }}{{ end -}} {{- with $displayThemeToggle }}{{ partial "theme-toggle.html" }}{{ end -}}
@ -24,14 +26,21 @@
<hr class="dark:hx-border-neutral-800" /> <hr class="dark:hx-border-neutral-800" />
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
<div <div
class="{{ $footerWidth }} hx-mx-auto hx-flex hx-justify-center hx-py-12 hx-pl-[max(env(safe-area-inset-left),1.5rem)] hx-pr-[max(env(safe-area-inset-right),1.5rem)] hx-text-gray-600 dark:hx-text-gray-400 md:hx-justify-start" class="hextra-custom-footer {{ $footerWidth }} hx-pl-[max(env(safe-area-inset-left),1.5rem)] hx-pr-[max(env(safe-area-inset-right),1.5rem)] hx-text-gray-600 dark:hx-text-gray-400"
> >
<div class="hx-flex hx-w-full hx-flex-col hx-items-center sm:hx-items-start"> {{- partial "custom/footer.html" (dict "context" . "switchesVisible" $footerSwitchesVisible "copyrightVisible" $copyrightSectionVisible) -}}
{{- if (.Site.Params.footer.displayPoweredBy | default true) }}<div class="hx-font-semibold">{{ template "theme-credit" $poweredBy }}</div>{{ end }}
{{- if .Site.Params.footer.displayCopyright }}<div class="hx-mt-6 hx-text-xs">{{ $copyright | markdownify }}</div>{{ end }}
</div> </div>
</div> {{- if $copyrightSectionVisible -}}
<div
class="{{ $footerWidth }} hx-mx-auto hx-flex hx-justify-center hx-py-12 hx-pl-[max(env(safe-area-inset-left),1.5rem)] hx-pr-[max(env(safe-area-inset-right),1.5rem)] hx-text-gray-600 dark:hx-text-gray-400 md:hx-justify-start"
>
<div class="hx-flex hx-w-full hx-flex-col hx-items-center sm:hx-items-start">
{{- if (.Site.Params.footer.displayPoweredBy | default true) }}<div class="hx-font-semibold">{{ template "theme-credit" $poweredBy }}</div>{{- end -}}
{{- if .Site.Params.footer.displayCopyright }}<div class="hx-mt-6 hx-text-xs">{{ $copyright | markdownify }}</div>{{- end -}}
</div>
</div>
{{- end -}}
</footer> </footer>
{{- define "theme-credit" -}} {{- define "theme-credit" -}}

View File

@ -37,9 +37,32 @@
{{- $mermaidJS := resources.Get "lib/mermaid/mermaid.min.js" | fingerprint -}} {{- $mermaidJS := resources.Get "lib/mermaid/mermaid.min.js" | fingerprint -}}
<script defer src="{{ $mermaidJS.RelPermalink }}" integrity="{{ $mermaidJS.Data.Integrity }}"></script> <script defer src="{{ $mermaidJS.RelPermalink }}" integrity="{{ $mermaidJS.Data.Integrity }}"></script>
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", () => {
// Store original mermaid code for each diagram
document.querySelectorAll(".mermaid").forEach(el => {
el.dataset.original = el.innerHTML;
});
const theme = document.documentElement.classList.contains("dark") ? "dark" : "default"; const theme = document.documentElement.classList.contains("dark") ? "dark" : "default";
mermaid.initialize({ startOnLoad: true, theme: theme }); mermaid.initialize({ startOnLoad: true, theme: theme });
let timeout;
new MutationObserver(() => {
clearTimeout(timeout);
timeout = setTimeout(() => {
const theme = document.documentElement.classList.contains("dark") ? "dark" : "default";
document.querySelectorAll(".mermaid").forEach(el => {
// Reset to original content, preserving HTML
el.innerHTML = el.dataset.original;
el.removeAttribute("data-processed");
});
mermaid.initialize({ startOnLoad: true, theme: theme });
mermaid.init();
}, 150);
}).observe(document.documentElement, {
attributes: true,
attributeFilter: ["class"]
});
}); });
</script> </script>
{{- end -}} {{- end -}}

View File

@ -2,6 +2,7 @@
{{- $type := .type -}} {{- $type := .type -}}
{{- $class := .class | default "" -}} {{- $class := .class | default "" -}}
{{- $border := .border | default false -}} {{- $border := .border | default false -}}
{{- $icon := .icon | default "" -}}
{{- $defaultClass := "hx-text-gray-600 hx-bg-gray-100 dark:hx-bg-neutral-800 dark:hx-text-neutral-200 hx-border-gray-200 dark:hx-border-neutral-700" -}} {{- $defaultClass := "hx-text-gray-600 hx-bg-gray-100 dark:hx-bg-neutral-800 dark:hx-text-neutral-200 hx-border-gray-200 dark:hx-border-neutral-700" -}}
{{- $warningClass := "hx-border-yellow-100 hx-bg-yellow-50 hx-text-yellow-900 dark:hx-border-yellow-200/30 dark:hx-bg-yellow-700/30 dark:hx-text-yellow-200" -}} {{- $warningClass := "hx-border-yellow-100 hx-bg-yellow-50 hx-text-yellow-900 dark:hx-border-yellow-200/30 dark:hx-bg-yellow-700/30 dark:hx-text-yellow-200" -}}
@ -11,6 +12,9 @@
{{- $borderClass := cond (eq $border true) "hx-border" "" -}} {{- $borderClass := cond (eq $border true) "hx-border" "" -}}
{{- $badgeClass := cond (eq $type "info") $infoClass (cond (eq $type "warning") $warningClass (cond (eq $type "error") $errorClass $defaultClass)) -}} {{- $badgeClass := cond (eq $type "info") $infoClass (cond (eq $type "warning") $warningClass (cond (eq $type "error") $errorClass $defaultClass)) -}}
<div class="hextra-badge {{ $class }}"> <div class="hextra-badge {{ $class }}">
<div class="hx-inline-flex hx-items-center hx-rounded-full hx-px-2.5 hx-leading-6 hx-text-[.65rem] {{ $borderClass }} {{ $badgeClass }}">{{- $content -}}</div> <div class="hx-inline-flex hx-gap-1 hx-items-center hx-rounded-full hx-px-2.5 hx-leading-6 hx-text-[.65rem] {{ $borderClass }} {{ $badgeClass }}">
{{- with $icon -}}{{- partial "utils/icon" (dict "name" . "attributes" "height=12") -}}{{- end -}}
{{- $content -}}
</div>
</div> </div>
{{- /* Strip trailing newline. */ -}} {{- /* Strip trailing newline. */ -}}

View File

@ -0,0 +1,28 @@
{{- $content := .content -}}
{{- $emoji := .emoji -}}
{{- $icon := .icon -}}
{{- $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" -}}
{{- $class := .class | default $defaultClass -}}
<div class="hx-overflow-x-auto hx-mt-6 hx-flex hx-rounded-lg hx-border hx-py-2 ltr:hx-pr-4 rtl:hx-pl-4 contrast-more:hx-border-current contrast-more:dark:hx-border-current {{ $class }}">
<div class="ltr:hx-pl-3 ltr:hx-pr-2 rtl:hx-pr-3 rtl:hx-pl-2">
{{- with $emoji -}}
<div class="hx-select-none hx-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="hx-inline-block hx-align-middle"`) -}}
{{- end -}}
{{- end -}}
</div>
<div class="hx-w-full hx-min-w-0 hx-leading-7">
<div class="hx-mt-6 hx-leading-7 first:hx-mt-0">
{{- $content -}}
</div>
</div>
</div>

View File

@ -3,6 +3,7 @@
{{- $type := .Get "type" | default "" -}} {{- $type := .Get "type" | default "" -}}
{{- $class := .Get "class" | default "" -}} {{- $class := .Get "class" | default "" -}}
{{- $link := .Get "link" | default "" -}} {{- $link := .Get "link" | default "" -}}
{{- $icon := .Get "icon" | default "" -}}
{{- if $link -}} {{- if $link -}}
<a href="{{ $link }}" title="{{ $content | plainify }}" target="_blank"> <a href="{{ $link }}" title="{{ $content | plainify }}" target="_blank">
@ -11,6 +12,7 @@
"type" $type "type" $type
"class" $class "class" $class
"border" true "border" true
"icon" $icon
) )
-}} -}}
</a> </a>
@ -20,6 +22,7 @@
"type" $type "type" $type
"class" $class "class" $class
"border" true "border" true
"icon" $icon
) )
-}} -}}
{{- end -}} {{- end -}}

View File

@ -1,37 +1,19 @@
{{ $calloutEmojiDict := dict "info" "" "warning" "⚠️" "error" "🚫" }} {{- $calloutEmojiDict := dict "info" "" "warning" "⚠️" "error" "🚫" -}}
{{ $type := .Get "type" | default "default" }} {{- $type := .Get "type" | default "default" -}}
{{/* If emoji is not set, use the emoji from dict */}} {{/* If emoji is not set, use the emoji from dict */}}
{{ $emoji := .Get "emoji" }} {{- $emoji := .Get "emoji" -}}
{{ if eq $emoji "" }} {{- if eq $emoji "" -}}
{{ $emoji = index $calloutEmojiDict $type }} {{- $emoji = index $calloutEmojiDict $type -}}
{{ end }} {{- end -}}
{{/* Also allow using "icon" */}} {{/* Also allow using "icon" */}}
{{ $icon := .Get "icon" }} {{- $icon := .Get "icon" -}}
{{- $content := .InnerDeindent | markdownify -}}
{{ $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" }} {{- $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" -}}
{{ $infoClass := "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200" }} {{- $infoClass := "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200" -}}
{{ $warningClass := "hx-border-yellow-100 hx-bg-yellow-50 hx-text-yellow-900 dark:hx-border-yellow-200/30 dark:hx-bg-yellow-700/30 dark:hx-text-yellow-200" }} {{- $warningClass := "hx-border-yellow-100 hx-bg-yellow-50 hx-text-yellow-900 dark:hx-border-yellow-200/30 dark:hx-bg-yellow-700/30 dark:hx-text-yellow-200" -}}
{{ $errorClass := "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200" }} {{- $errorClass := "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-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)) -}}
{{- partial "shortcodes/callout.html" (dict "content" $content "emoji" $emoji "icon" $icon "class" $class) -}}
<div class="hx-overflow-x-auto hx-mt-6 hx-flex hx-rounded-lg hx-border hx-py-2 ltr:hx-pr-4 rtl:hx-pl-4 contrast-more:hx-border-current contrast-more:dark:hx-border-current {{ $class }}">
<div class="ltr:hx-pl-3 ltr:hx-pr-2 rtl:hx-pr-3 rtl:hx-pl-2">
{{- with $emoji -}}
<div class="hx-select-none hx-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="hx-inline-block hx-align-middle"`) -}}
{{- end -}}
{{- end -}}
</div>
<div class="hx-w-full hx-min-w-0 hx-leading-7">
<div class="hx-mt-6 hx-leading-7 first:hx-mt-0">
{{ .InnerDeindent | markdownify }}
</div>
</div>
</div>

View File

@ -0,0 +1,10 @@
{{- $style := .Get "style" -}}
{{- $heading := int (strings.TrimPrefix "h" (.Get "heading" | default "h2")) -}}
{{- $size := cond (ge $heading 4) "xl" (cond (eq $heading 3) "2xl" "4xl") -}}
<h{{ $heading }}
class="not-prose hx-text-{{ $size }} hx-font-bold hx-leading-none hx-tracking-tighter md:hx-text-3xl hx-py-2 hx-bg-clip-text hx-text-transparent hx-bg-gradient-to-r hx-from-gray-900 hx-to-gray-600 dark:hx-from-gray-100 dark:hx-to-gray-400"
{{ with $style }}style="{{ . | safeCSS }}"{{ end }}
>
{{ .Inner | markdownify }}
</h{{ $heading }}>

View File

@ -9,7 +9,7 @@
<div class="hx-mt-4 hx-flex hx-w-max hx-min-w-full hx-border-b hx-border-gray-200 hx-pb-px dark:hx-border-neutral-800"> <div class="hx-mt-4 hx-flex hx-w-max hx-min-w-full hx-border-b hx-border-gray-200 hx-pb-px dark:hx-border-neutral-800">
{{- range $i, $item := $items -}} {{- range $i, $item := $items -}}
<button <button
class="hextra-tabs-toggle data-[state=selected]:hx-border-primary-500 data-[state=selected]:hx-text-primary-600 hx-mr-2 hx-rounded-t hx-p-2 hx-font-medium hx-leading-5 hx-transition-colors -hx-mb-0.5 hx-select-none hx-border-b-2 hx-border-transparent hx-text-gray-600 hover:hx-border-gray-200 hover:hx-text-black dark:hx-text-gray-200 dark:hover:hx-border-neutral-800 dark:hover:hx-text-white" class="hextra-tabs-toggle data-[state=selected]:hx-border-primary-500 data-[state=selected]:hx-text-primary-600 data-[state=selected]:dark:hx-border-primary-500 data-[state=selected]:dark:hx-text-primary-600 hx-mr-2 hx-rounded-t hx-p-2 hx-font-medium hx-leading-5 hx-transition-colors -hx-mb-0.5 hx-select-none hx-border-b-2 hx-border-transparent hx-text-gray-600 hover:hx-border-gray-200 hover:hx-text-black dark:hx-text-gray-200 dark:hover:hx-border-neutral-800 dark:hover:hx-text-white"
role="tab" role="tab"
type="button" type="button"
aria-controls="tabs-panel-{{ $i }}" aria-controls="tabs-panel-{{ $i }}"

View File

@ -7,6 +7,6 @@ command = "cd exampleSite && hugo --gc --minify --themesDir ../.. -b ${DEPLOY_PR
ignore = "false" ignore = "false"
[build.environment] [build.environment]
HUGO_VERSION = "0.132.2" HUGO_VERSION = "0.138.0"
GO_VERSION = "1.22.3" GO_VERSION = "1.22.3"
NODE_VERSION = "22.2.0" NODE_VERSION = "22.2.0"

14
package-lock.json generated
View File

@ -523,11 +523,10 @@
} }
}, },
"node_modules/cross-spawn": { "node_modules/cross-spawn": {
"version": "7.0.3", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"license": "MIT",
"dependencies": { "dependencies": {
"path-key": "^3.1.0", "path-key": "^3.1.0",
"shebang-command": "^2.0.0", "shebang-command": "^2.0.0",
@ -1031,9 +1030,9 @@
} }
}, },
"node_modules/nanoid": { "node_modules/nanoid": {
"version": "3.3.7", "version": "3.3.8",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -1041,7 +1040,6 @@
"url": "https://github.com/sponsors/ai" "url": "https://github.com/sponsors/ai"
} }
], ],
"license": "MIT",
"bin": { "bin": {
"nanoid": "bin/nanoid.cjs" "nanoid": "bin/nanoid.cjs"
}, },

View File

@ -61,8 +61,11 @@ module.exports = {
neutral: colors.neutral, neutral: colors.neutral,
red: colors.red, red: colors.red,
orange: colors.orange, orange: colors.orange,
green: colors.green,
indigo: colors.indigo,
blue: colors.blue, blue: colors.blue,
yellow: colors.yellow, yellow: colors.yellow,
amber: colors.amber,
primary: { primary: {
50: makePrimaryColor(97), 50: makePrimaryColor(97),
100: makePrimaryColor(94), 100: makePrimaryColor(94),