Compare commits

..

2 Commits

Author SHA1 Message Date
ea69f0bf59 Merge 2fb6f63b41 into 56f6f19978 2024-07-07 13:33:22 +01:00
2fb6f63b41 fix: add missing Markdown syntax examples 2024-06-21 19:01:08 +02:00
44 changed files with 487 additions and 1671 deletions

View File

@ -3,7 +3,7 @@
"features": {
"ghcr.io/devcontainers/features/hugo:1": {
"extended": true,
"version": "0.131.0"
"version": "0.124.1"
},
"ghcr.io/devcontainers/features/node:1": {}
},

View File

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

View File

@ -1,5 +1,5 @@
/*
! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com
! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
@ -596,6 +596,10 @@ video {
margin-left: auto;
margin-right: auto;
}
.hx-my-1 {
margin-top: 0.25rem;
margin-bottom: 0.25rem;
}
.hx-my-1\.5 {
margin-top: 0.375rem;
margin-bottom: 0.375rem;
@ -604,6 +608,9 @@ video {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
.-hx-mb-0 {
margin-bottom: -0px;
}
.-hx-mb-0\.5 {
margin-bottom: -0.125rem;
}
@ -712,6 +719,9 @@ video {
.hx-h-2 {
height: 0.5rem;
}
.hx-h-3 {
height: 0.75rem;
}
.hx-h-3\.5 {
height: 0.875rem;
}
@ -748,6 +758,9 @@ video {
.hx-w-2 {
width: 0.5rem;
}
.hx-w-3 {
width: 0.75rem;
}
.hx-w-3\.5 {
width: 0.875rem;
}
@ -875,6 +888,10 @@ video {
.hx-gap-4 {
gap: 1rem;
}
.hx-gap-x-1 {
-moz-column-gap: 0.25rem;
column-gap: 0.25rem;
}
.hx-gap-x-1\.5 {
-moz-column-gap: 0.375rem;
column-gap: 0.375rem;
@ -897,15 +914,9 @@ video {
.hx-overflow-x-hidden {
overflow-x: hidden;
}
.hx-overflow-y-hidden {
overflow-y: hidden;
}
.hx-overscroll-contain {
overscroll-behavior: contain;
}
.hx-overscroll-x-contain {
overscroll-behavior-x: contain;
}
.hx-text-ellipsis {
text-overflow: ellipsis;
}
@ -1049,6 +1060,9 @@ video {
-webkit-background-clip: text;
background-clip: text;
}
.hx-p-0 {
padding: 0px;
}
.hx-p-0\.5 {
padding: 0.125rem;
}
@ -1067,6 +1081,10 @@ video {
.hx-p-6 {
padding: 1.5rem;
}
.hx-px-1 {
padding-left: 0.25rem;
padding-right: 0.25rem;
}
.hx-px-1\.5 {
padding-left: 0.375rem;
padding-right: 0.375rem;
@ -1075,10 +1093,6 @@ video {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.hx-px-2\.5 {
padding-left: 0.625rem;
padding-right: 0.625rem;
}
.hx-px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
@ -1176,9 +1190,6 @@ video {
.hx-text-4xl {
font-size: 2.25rem;
}
.hx-text-\[\.65rem\] {
font-size: .65rem;
}
.hx-text-\[10px\] {
font-size: 10px;
}
@ -2108,7 +2119,7 @@ article details > summary::before {
/* GenericDeleted */
.dark .highlight .chroma .gd { color: #ffa198; background-color: #490202 }
/* GenericEmph */
.dark .highlight .chroma .ge { color: inherit; font-style: italic }
.dark .highlight .chroma .ge { font-style: italic }
/* GenericError */
.dark .highlight .chroma .gr { color: #ffa198 }
/* GenericHeading */
@ -2241,9 +2252,6 @@ article details > summary::before {
.hextra-cards {
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--hextra-cards-grid-cols))), 1fr));
}
.hextra-card {
position: relative;
}
.hextra-card img {
-webkit-user-select: none;
-moz-user-select: none;
@ -2259,7 +2267,6 @@ article details > summary::before {
}
.hextra-card p {
margin-top: 0.5rem;
position: relative;
}
.dark .hextra-card svg {
color: #ffffff66;
@ -2267,12 +2274,6 @@ article details > summary::before {
.dark .hextra-card:hover svg {
color: currentColor;
}
.hextra-card-tag {
position: absolute;
top: 5px;
right: 5px;
z-index: 10;
}
.steps h3 {
counter-increment: step;
}
@ -2493,7 +2494,7 @@ nav .search-wrapper {
background-color: rgb(255 255 255 / .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);
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);
}
.nav-container-blur:is(html[class~="dark"] *) {
background-color: rgb(17 17 17 / 0.8) !important;
@ -2534,30 +2535,30 @@ nav .search-wrapper {
.hamburger-menu svg.open > g:nth-of-type(2) path {
transform: translate3d(0, -4px, 0);
}
.hextra-scrollbar, .hextra-scrollbar * {
.hextra-scrollbar {
scrollbar-width: thin; /* Firefox */
scrollbar-color: oklch(55.55% 0 0 / 40%) transparent; /* Firefox */
scrollbar-gutter: stable;
}
.hextra-scrollbar::-webkit-scrollbar, .hextra-scrollbar *::-webkit-scrollbar {
.hextra-scrollbar::-webkit-scrollbar {
height: 0.75rem;
width: 0.75rem;
}
.hextra-scrollbar::-webkit-scrollbar-track, .hextra-scrollbar *::-webkit-scrollbar-track {
.hextra-scrollbar::-webkit-scrollbar-track {
background-color: transparent;
}
.hextra-scrollbar::-webkit-scrollbar-thumb, .hextra-scrollbar *::-webkit-scrollbar-thumb {
.hextra-scrollbar::-webkit-scrollbar-thumb {
border-radius: 10px;
}
.hextra-scrollbar:hover::-webkit-scrollbar-thumb, .hextra-scrollbar *:hover::-webkit-scrollbar-thumb {
.hextra-scrollbar:hover::-webkit-scrollbar-thumb {
border: 3px solid transparent;
background-color: var(--tw-shadow-color);
background-clip: content-box;
--tw-shadow-color: rgb(115 115 115 / 0.2);
--tw-shadow: var(--tw-shadow-colored);
}
.hextra-scrollbar:hover::-webkit-scrollbar-thumb:hover, .hextra-scrollbar *:hover::-webkit-scrollbar-thumb:hover {
.hextra-scrollbar:hover::-webkit-scrollbar-thumb:hover {
--tw-shadow-color: rgb(115 115 115 / 0.4);
--tw-shadow: var(--tw-shadow-colored);
}
@ -2568,7 +2569,7 @@ nav .search-wrapper {
--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);
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);
}
.hextra-code-copy-btn:is(html[class~="dark"] *) {
--tw-bg-opacity: 0.8;
@ -2579,27 +2580,6 @@ nav .search-wrapper {
grid-template-columns: repeat(var(--hextra-feature-grid-cols), minmax(0, 1fr))
}
}
.hextra-jupyter-code-cell {
scrollbar-gutter: auto;
margin-top: 1.5rem;
}
.hextra-jupyter-code-cell .hextra-jupyter-code-cell-outputs-container {
overflow: hidden;
font-size: .75rem;
}
.hextra-jupyter-code-cell .hextra-jupyter-code-cell-outputs-container .hextra-jupyter-code-cell-outputs {
max-height: 50vh;
overflow: auto;
}
.hextra-jupyter-code-cell .hextra-jupyter-code-cell-outputs-container .hextra-jupyter-code-cell-outputs pre {
max-width: 100%;
overflow: auto;
font-size: .75rem;
}
.hextra-badge {
display: inline-flex;
align-items: center;
}
html {
font-size: 1rem;
-webkit-font-smoothing: antialiased;
@ -2818,27 +2798,27 @@ body:is(html[class~="dark"] *) {
.hx-group\/copybtn.copied .group-\[\.copied\]\/copybtn\:hx-hidden {
display: none;
}
.data-\[state\=selected\]\:hx-block[data-state="selected"] {
.data-\[state\=selected\]\:hx-block[data-state=selected] {
display: block;
}
.data-\[state\=closed\]\:hx-hidden[data-state="closed"] {
.data-\[state\=closed\]\:hx-hidden[data-state=closed] {
display: none;
}
.data-\[state\=open\]\:hx-hidden[data-state="open"] {
.data-\[state\=open\]\:hx-hidden[data-state=open] {
display: none;
}
.data-\[state\=selected\]\:hx-border-primary-500[data-state="selected"] {
.data-\[state\=selected\]\:hx-border-primary-500[data-state=selected] {
--tw-border-opacity: 1;
border-color: hsl(var(--primary-hue) var(--primary-saturation) 50% / var(--tw-border-opacity));
}
.data-\[state\=selected\]\:hx-text-primary-600[data-state="selected"] {
.data-\[state\=selected\]\:hx-text-primary-600[data-state=selected] {
--tw-text-opacity: 1;
color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-text-opacity));
}
.hx-group[data-theme="dark"] .group-data-\[theme\=dark\]\:hx-hidden {
.hx-group[data-theme=dark] .group-data-\[theme\=dark\]\:hx-hidden {
display: none;
}
.hx-group[data-theme="light"] .group-data-\[theme\=light\]\:hx-hidden {
.hx-group[data-theme=light] .group-data-\[theme\=light\]\:hx-hidden {
display: none;
}
@media (prefers-contrast: more) {
@ -3383,6 +3363,9 @@ body:is(html[class~="dark"] *) {
display: block;
}
}
.ltr\:hx-right-1:where([dir="ltr"], [dir="ltr"] *) {
right: 0.25rem;
}
.ltr\:hx-right-1\.5:where([dir="ltr"], [dir="ltr"] *) {
right: 0.375rem;
}
@ -3457,6 +3440,9 @@ body:is(html[class~="dark"] *) {
left: auto;
}
}
.rtl\:hx-left-1:where([dir="rtl"], [dir="rtl"] *) {
left: 0.25rem;
}
.rtl\:hx-left-1\.5:where([dir="rtl"], [dir="rtl"] *) {
left: 0.375rem;
}

View File

@ -1,3 +0,0 @@
.hextra-badge {
@apply hx-inline-flex hx-items-center;
}

View File

@ -2,10 +2,6 @@
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--hextra-cards-grid-cols))), 1fr));
}
.hextra-card {
position: relative;
}
.hextra-card img {
user-select: none;
}
@ -22,7 +18,6 @@
.hextra-card p {
margin-top: 0.5rem;
position: relative;
}
.dark .hextra-card svg {
@ -32,10 +27,3 @@
.dark .hextra-card:hover svg {
color: currentColor;
}
.hextra-card-tag {
position: absolute;
top: 5px;
right: 5px;
z-index: 10;
}

View File

@ -1,17 +0,0 @@
.hextra-jupyter-code-cell {
scrollbar-gutter: auto;
@apply hx-mt-6;
.hextra-jupyter-code-cell-outputs-container {
@apply hx-text-xs hx-overflow-hidden;
.hextra-jupyter-code-cell-outputs {
@apply hx-overflow-auto hx-max-h-[50vh];
pre {
@apply hx-text-xs hx-overflow-auto hx-max-w-full;
}
}
}
}

View File

@ -1,4 +1,4 @@
.hextra-scrollbar, .hextra-scrollbar * {
.hextra-scrollbar {
scrollbar-width: thin; /* Firefox */
scrollbar-color: oklch(55.55% 0 0 / 40%) transparent; /* Firefox */

View File

@ -10,8 +10,6 @@
@import "components/scrollbar.css";
@import "components/code-copy.css";
@import "components/hextra/feature-grid.css";
@import "components/jupyter.css";
@import "components/badge.css";
html {
@apply hx-text-base hx-antialiased;

View File

@ -1,14 +1,14 @@
document.querySelectorAll('.hextra-tabs-toggle').forEach(function (button) {
document.querySelectorAll('.tabs-toggle').forEach(function (button) {
button.addEventListener('click', function (e) {
// set parent tabs to unselected
const tabs = Array.from(e.target.parentElement.querySelectorAll('.hextra-tabs-toggle'));
const tabs = Array.from(e.target.parentElement.querySelectorAll('.tabs-toggle'));
tabs.map(tab => tab.dataset.state = '');
// set current tab to selected
e.target.dataset.state = 'selected';
// set all panels to unselected
const panelsContainer = e.target.parentElement.parentElement.nextElementSibling;
const panelsContainer = e.target.parentElement.nextElementSibling;
Array.from(panelsContainer.children).forEach(function (panel) {
panel.dataset.state = '';
});

View File

@ -36,8 +36,6 @@ hugo-full: >
<path fill="#fff" d="M1320.72 89.15c58.79 0 106.52 47.73 106.52 106.51 0 58.8-47.73 106.52-106.52 106.52-58.78 0-106.52-47.73-106.52-106.52 0-58.78 47.74-106.51 106.52-106.51zm0 39.57c36.95 0 66.94 30 66.94 66.94a66.97 66.97 0 0 1-66.94 66.94c-36.95 0-66.94-29.99-66.94-66.94a66.97 66.97 0 0 1 66.93-66.94h.01zm-283.8 65.31c0 47.18-8.94 60.93-26.81 80.58-17.87 19.65-41.57 27.57-71.1 27.57-27 0-48.75-9.58-67.61-26.23-20.88-18.45-36.08-47.04-36.08-78.95 0-31.37 11.72-58.48 32.49-78.67 18.22-17.67 45.34-29.18 73.3-29.18 33.77 0 68.83 15.98 90.44 47.53l-31.73 26.82c-13.45-25.03-32.94-33.46-60.82-34.26-30.83-.88-64.77 28.53-62.25 67.75 1.4 21.94 11.65 59.65 60.96 66.57 25.9 3.63 55.36-24.02 55.36-39.04H944.4v-37.5h92.5V194l.02.03zm-562.6-94.65h42.29v112.17c0 17.8.49 29.33 1.47 34.61 1.69 8.48 4.81 14.37 11.17 19.5 6.37 5.13 13.8 6.59 24.84 6.59 11.2 0 14.96-1.74 20.66-6.6 5.69-4.85 9.12-9.46 10.28-16.53 1.15-7.07 3.07-18.8 3.07-35.18V99.38h42.28v108.78c0 24.86-1.07 42.43-3.21 52.69-2.14 10.27-6.08 18.93-11.82 26-5.74 7.06-13.42 12.69-23.03 16.88-9.62 4.19-22.16 6.28-37.65 6.28-18.7 0-32.87-2.28-42.52-6.85-9.66-4.57-17.3-10.5-22.9-17.8-5.61-7.3-9.3-14.95-11.08-22.96-2.58-11.86-3.88-29.38-3.88-52.55V99.38h.03zM93.91 299.92V92.7h43.35v75.48h71.92V92.7h43.48v207.22h-43.48v-90.61h-71.92v90.61z"/>
</svg>
jupyter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M7.157 22.201A1.784 1.799 0 0 1 5.374 24a1.784 1.799 0 0 1-1.784-1.799a1.784 1.799 0 0 1 1.784-1.799a1.784 1.799 0 0 1 1.783 1.799M20.582 1.427a1.415 1.427 0 0 1-1.415 1.428a1.415 1.427 0 0 1-1.416-1.428A1.415 1.427 0 0 1 19.167 0a1.415 1.427 0 0 1 1.415 1.427M4.992 3.336A1.047 1.056 0 0 1 3.946 4.39a1.047 1.056 0 0 1-1.047-1.055A1.047 1.056 0 0 1 3.946 2.28a1.047 1.056 0 0 1 1.046 1.056m7.336 1.517c3.769 0 7.06 1.38 8.768 3.424a9.36 9.36 0 0 0-3.393-4.547a9.24 9.24 0 0 0-5.377-1.728A9.24 9.24 0 0 0 6.95 3.73a9.36 9.36 0 0 0-3.394 4.547c1.713-2.04 5.004-3.424 8.772-3.424m.001 13.295c-3.768 0-7.06-1.381-8.768-3.425a9.36 9.36 0 0 0 3.394 4.547A9.24 9.24 0 0 0 12.33 21a9.24 9.24 0 0 0 5.377-1.729a9.36 9.36 0 0 0 3.393-4.547c-1.712 2.044-5.003 3.425-8.772 3.425Z" /></svg>
warning: <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"></path></svg>
one: <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="-1 0 19 19"><path d="M16.417 9.6A7.917 7.917 0 1 1 8.5 1.683 7.917 7.917 0 0 1 16.417 9.6zM9.666 6.508H8.248L6.09 8.09l.806 1.103 1.222-.945v4.816h1.547z"></path></svg>
cards: <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.246 2.246 0 0 0-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122"></path></svg>

File diff suppressed because one or more lines are too long

View File

@ -186,10 +186,10 @@ To customize the [favicon](https://en.wikipedia.org/wiki/Favicon) for your site,
{{< /filetree/folder >}}
{{< /filetree/container >}}
Include `favicon.ico`, `favicon.svg` and `favicon-dark.svg` files in your project to ensure your site's favicons display correctly.
Include both `favicon.ico` and `favicon.svg` files in your project to ensure your site's favicons display correctly.
While `favicon.ico` is generally for older browsers, `favicon.svg` and `favicon-dark.svg` are supported by modern browsers.
Use tools like [favicon.io](https://favicon.io/) or [favycon](https://github.com/ruisaraiva19/favycon) to generate such icons.
While `favicon.ico` is generally for older browsers, `favicon.svg` is supported by modern ones. The optional `favicon-dark.svg` can be included for a tailored experience in dark mode.
Feel free to use tools like [favicon.io](https://favicon.io/) or [favycon](https://github.com/ruisaraiva19/favycon) to generate these icons.
### Theme Configuration

View File

@ -54,7 +54,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.131.0
HUGO_VERSION: 0.121.2
steps:
- name: Checkout
uses: actions/checkout@v4
@ -64,7 +64,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.21'
- name: Setup Pages
id: pages
uses: actions/configure-pages@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:
- Configure the Build command to `hugo --gc --minify`
- 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.119.0`
4. Deploy!
Check [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) for more details.

View File

@ -117,18 +117,18 @@ Hugo از سینتکس [مارک‌داون](https://en.wikipedia.org/wiki/Markd
### عکس‌ها
![landscape](https://picsum.photos/800/600)
![landscape](https://source.unsplash.com/featured/800x600?landscape)
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600)
![landscape](https://source.unsplash.com/featured/800x600?landscape)
```
با توضیحات:
![landscape](https://picsum.photos/800/600 "یک چشم‌انداز Unsplash")
![landscape](https://source.unsplash.com/featured/800x600?landscape "یک چشم‌انداز Unsplash")
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600 "یک چشم‌انداز Unsplash")
![landscape](https://source.unsplash.com/featured/800x600?landscape "یک چشم‌انداز Unsplash")
```
## پیکربندی

View File

@ -117,18 +117,18 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-
### Images
![landscape](https://picsum.photos/800/600)
![landscape](https://source.unsplash.com/featured/800x600?landscape)
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600)
![landscape](https://source.unsplash.com/featured/800x600?landscape)
```
With caption:
![landscape](https://picsum.photos/800/600 "Unsplash Landscape")
![landscape](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape")
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600 "Unsplash Landscape")
![landscape](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape")
```
## Configuration

View File

@ -117,18 +117,18 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
### 图片
![landscape](https://picsum.photos/800/600)
![landscape](https://source.unsplash.com/featured/800x600?landscape)
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600)
![landscape](https://source.unsplash.com/featured/800x600?landscape)
```
带有标题:
![landscape](https://picsum.photos/800/600 "Unsplash Landscape")
![landscape](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape")
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600 "Unsplash Landscape")
![landscape](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape")
```
## 配置

View File

@ -6,7 +6,7 @@ prev: /docs/guide
## 目录结构
默认情况下Hugo 在 `content` 目录中搜索 Markdown 文件,目录的结构决定了网站的最终输出结构。
默认情况下Hugo 在 `context` 目录中搜索 Markdown 文件,目录的结构决定了网站的最终输出结构。
以示例网站为例:
<!--more-->

View File

@ -9,6 +9,7 @@ next: /docs/guide/shortcodes/callout
Hextra provides a collection of beautiful shortcodes to enhance your content.
{{< cards >}}
{{< card link="callout" title="Callout" icon="warning" >}}
{{< card link="cards" title="Cards" icon="card" >}}
@ -18,12 +19,3 @@ Hextra provides a collection of beautiful shortcodes to enhance your content.
{{< card link="steps" title="Steps" icon="one" >}}
{{< card link="tabs" title="Tabs" icon="collection" >}}
{{< /cards >}}
<div style="padding-top:4rem"></div>
Additional shortcodes provided by Hugo and Hextra:
{{< cards >}}
{{< card link="jupyter" title="Jupyter Notebook" icon="jupyter" tag="alpha" >}}
{{< card link="others" title="Others" icon="view-grid" >}}
{{< /cards >}}

View File

@ -7,12 +7,11 @@ linkTitle: Cards
{{< cards >}}
{{< card link="../callout" title="Callout" icon="warning" >}}
{{< card link="../callout" title="Card with tag" icon="tag" tag="custom tag">}}
{{< card link="/" title="No Icon" >}}
{{< /cards >}}
{{< cards >}}
{{< card link="/" title="Image Card" image="https://github.com/user-attachments/assets/71b7e3ec-1a8d-4582-b600-5425c6cc0407" subtitle="Internet Image" >}}
{{< card link="/" title="Image Card" image="https://source.unsplash.com/featured/800x600?landscape" subtitle="Unsplash Landscape" >}}
{{< card link="/" title="Local Image" image="/images/card-image-unprocessed.jpg" subtitle="Raw image under static directory." >}}
{{< card link="/" title="Local Image" image="images/space.jpg" subtitle="Image under assets directory, processed by Hugo." method="Resize" options="600x q80 webp" >}}
{{< /cards >}}
@ -22,7 +21,6 @@ linkTitle: Cards
```
{{</* cards */>}}
{{</* card link="../callout" title="Callout" icon="warning" */>}}
{{</* card link="../callout" title="Card with tag" icon="tag" tag= "A custom tag" */>}}
{{</* card link="/" title="No Icon" */>}}
{{</* /cards */>}}
```
@ -37,15 +35,13 @@ linkTitle: Cards
## Card Parameters
| Parameter | Description |
|----------- |-----------------------------------------------------------------|
| `link` | URL (internal or external). |
| `title` | Title heading for the card. |
| `subtitle` | Subtitle heading (supports Markdown). |
| `icon` | Name of the icon. |
| `tag` | Text in tag. |
| `tagColor` | Color of the tag: `gray` (default), `yellow`, `red` and `blue`. |
| Parameter | Description |
|----------- |---------------------------------------|
| `link` | URL (internal or external). |
| `title` | Title heading for the card. |
| `subtitle` | Subtitle heading (supports Markdown). |
| `icon` | Name of the icon. |
## Image Card
Additionally, the card supports adding image and processing through these parameters:
@ -66,24 +62,3 @@ Hextra auto-detects if image processing is needed during build and applies the `
It currently supports these `method`: `Resize`, `Fit`, `Fill` and `Crop`.
For more on Hugo's built in image processing commands, methods, and options see their [Image Processing Documentation](https://gohugo.io/content-management/image-processing/).
## Tags
Card supports adding tags which could be useful to show extra status information.
{{< cards >}}
{{< card link="../callout" title="Card with default tag" tag="tag text" >}}
{{< card link="../callout" title="Card with error tag" tag="tag text" tagType="error" >}}
{{< card link="../callout" title="Card with info tag" tag="tag text" tagType="info" >}}
{{< card link="../callout" title="Card with warning tag" tag="tag text" tagType="warning" >}}
{{< card link="/" title="Image Card" image="https://github.com/user-attachments/assets/71b7e3ec-1a8d-4582-b600-5425c6cc0407" subtitle="Internet Image" tag="tag text" tagType="error" >}}
{{< /cards >}}
```
{{</* cards */>}}
{{</* card link="../callout" title="Card with default tag color" tag="tag text" */>}}
{{</* card link="../callout" title="Card with default red tag" tag="tag text" tagType="error" */>}}
{{</* card link="../callout" title="Card with blue tag" tag="tag text" tagType="info" */>}}
{{</* card link="../callout" title="Card with yellow tag" tag="tag text" tagType="warning" */>}}
{{</* /cards */>}}
```

View File

@ -1,79 +0,0 @@
---
title: "Jupyter Notebook Component"
linktitle: "Jupyter Notebook"
math: true
sidebar:
exclude: true
---
{{< callout >}}Experimental feature to include Jupyter Notebooks via a shortcode. Note that not all cell types are supported.{{< /callout >}}
[Jupyter Notebook](https://jupyter.org/) is a language-agnostic HTML notebook application for [Project Jupyter](https://jupyter.org/). It allows you to create and share documents that contain live code, equations, visualizations, and narrative text.
<!--more-->
## How to use
### Using a local notebook
To use the Jupyter Notebook shortcode, you need to have a Jupyter Notebook file in your project. Similar to how you would [add images](../../organize-files#add-images) to the project, you can add Jupyter Notebooks to the `assets` folder.
{{< filetree/container >}}
{{< filetree/folder name="assets" >}}
{{< filetree/file name="notebook.ipynb" >}}
{{< /filetree/folder >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/file name="my-page.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
Include the Jupyter Notebook in the page using the `jupyter` shortcode:
```markdown {filename="content/docs/my-page.md"}
---
title: My Page
math: true
---
{{%/* jupyter "notebook.ipynb" */%}}
```
Alternatively, you can utilize the [page bundles][page-bundles] feature of Hugo to organize the Jupyter Notebooks together with the Markdown file.
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/folder name="my-page" >}}
{{< filetree/file name="index.md" >}}
{{< filetree/file name="notebook.ipynb" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
```markdown {filename="content/docs/my-page/index.md"}
---
title: My Page
math: true
---
{{%/* jupyter "notebook.ipynb" */%}}
```
### Using a remote notebook
You can also use a remote notebook by providing the URL to the notebook file. For example, to include [What is the Jupyter Notebook](https://github.com/jupyter/notebook/blob/main/docs/source/examples/Notebook/What%20is%20the%20Jupyter%20Notebook.ipynb) notebook in the page, you can use the following shortcode:
```
{{%/* jupyter "https://raw.githubusercontent.com/jupyter/notebook/main/docs/source/examples/Notebook/What%20is%20the%20Jupyter%20Notebook.ipynb" */%}}
```
## Example Notebook
{{< callout type="info" >}}The following is an example of a notebook file that is included in the project assets folder.{{< /callout >}}
{{% jupyter "example.ipynb" %}}
[page-bundles]: https://gohugo.io/content-management/page-bundles/#leaf-bundles

View File

@ -1,78 +0,0 @@
---
title: Other Shortcodes
linkTitle: Others
sidebar:
exclude: true
---
{{< callout emoji="" >}}
Some of these are Hugo built-in shortcodes.
These shortcodes are considered less stable and may be changed anytime.
{{< /callout >}}
## Badge
```
{{</* badge "Badge" */>}}
```
Result:
{{< badge "Badge" >}}
Variants:
```
{{</* badge content="info" type="info" */>}}
{{</* badge content="warning" type="warning" */>}}
{{</* badge content="error" type="error" */>}}
```
Result:
{{< badge content="info" type="info" >}} &nbsp;
{{< badge content="warning" type="warning" >}} &nbsp;
{{< badge content="error" type="error" >}}
With link:
```
{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" */>}}
```
Result:
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" >}}
## YouTube
Embed a YouTube video.
```
{{</* youtube VIDEO_ID */>}}
```
Result:
{{< youtube id=dQw4w9WgXcQ loading=lazy >}}
For more information, see [Hugo's YouTube Shortcode](https://gohugo.io/content-management/shortcodes/#youtube).
## PDF
With PDF shortcode, you can embed a PDF file in your content.
```
{{</* pdf "https://example.com/sample.pdf" */>}}
```
You can also place the PDF file in your project directory and use the relative path.
```
{{</* pdf "path/to/file.pdf" */>}}
```
Example:
{{< pdf "https://upload.wikimedia.org/wikipedia/commons/1/13/Example.pdf" >}}

View File

@ -25,11 +25,6 @@ This is the third step.
## Usage
{{< callout emoji="" >}}
Please note that this shortcode is intended **only for Markdown content**.
If you put HTML content or other shortcodes as step content, it may not render as expected.
{{< /callout >}}
Put Markdown h3 header within `steps` shortcode.
```

View File

@ -27,7 +27,6 @@
"head",
"hr",
"html",
"iframe",
"img",
"input",
"kbd",
@ -191,7 +190,6 @@
"data-[state=selected]:hx-block",
"data-[state=selected]:hx-border-primary-500",
"data-[state=selected]:hx-text-primary-600",
"dataframe",
"filename",
"first:hx-mt-0",
"focus:hx-bg-white",
@ -209,12 +207,10 @@
"group-hover:hx-underline",
"group-open:before:hx-rotate-90",
"hamburger-menu",
"hextra-badge",
"hextra-card",
"hextra-card-icon",
"hextra-card-image",
"hextra-card-subtitle",
"hextra-card-tag",
"hextra-cards",
"hextra-code-block",
"hextra-code-copy-btn",
@ -224,14 +220,8 @@
"hextra-filetree",
"hextra-filetree-folder",
"hextra-footer",
"hextra-jupyter-code-cell",
"hextra-jupyter-code-cell-outputs",
"hextra-jupyter-code-cell-outputs-container",
"hextra-pdf",
"hextra-scrollbar",
"hextra-sidebar-collapsible-button",
"hextra-tabs-panel",
"hextra-tabs-toggle",
"hextra-toc",
"highlight",
"hover:dark:hx-bg-primary-500/10",
@ -402,9 +392,7 @@
"hx-overflow-x-auto",
"hx-overflow-x-hidden",
"hx-overflow-y-auto",
"hx-overflow-y-hidden",
"hx-overscroll-contain",
"hx-overscroll-x-contain",
"hx-p-0.5",
"hx-p-1",
"hx-p-1.5",
@ -426,7 +414,6 @@
"hx-pt-8",
"hx-px-1.5",
"hx-px-2",
"hx-px-2.5",
"hx-px-3",
"hx-px-4",
"hx-px-6",
@ -465,7 +452,6 @@
"hx-sticky",
"hx-text-2xl",
"hx-text-4xl",
"hx-text-[.65rem]",
"hx-text-[10px]",
"hx-text-[color:hsl(var(--primary-hue),100%,50%)]",
"hx-text-base",
@ -617,6 +603,8 @@
"steps",
"subheading-anchor",
"success-icon",
"tabs-panel",
"tabs-toggle",
"theme-toggle",
"xl:hx-block"
],

View File

@ -5,7 +5,7 @@
<article class="hx-w-full hx-break-words hx-flex hx-min-h-[calc(100vh-var(--navbar-height))] hx-min-w-0 hx-justify-center hx-pb-8 hx-pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="hx-w-full hx-min-w-0 hx-max-w-6xl hx-px-6 hx-pt-4 md:hx-px-12">
<div class="content">
{{ if .Title }}<h1>{{ .Title }}</h1>{{ end }}
<h1>{{ .Title }}</h1>
{{ .Content }}
</div>
<div class="hx-mt-16"></div>
@ -14,4 +14,4 @@
</main>
</article>
</div>
{{ end }}
{{ end }}

View File

@ -5,7 +5,7 @@
<article class="hx-w-full hx-break-words hx-flex hx-min-h-[calc(100vh-var(--navbar-height))] hx-min-w-0 hx-justify-center hx-pb-8 hx-pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="hx-w-full hx-min-w-0 hx-max-w-6xl hx-px-6 hx-pt-4 md:hx-px-12">
<br class="hx-mt-1.5 hx-text-sm" />
{{ if .Title }}<h1 class="hx-text-center hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>{{ end }}
<h1 class="hx-text-center hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>
<div class="hx-mb-16"></div>
<div class="content">
{{ .Content }}
@ -15,4 +15,4 @@
</main>
</article>
</div>
{{ end }}
{{ end }}

View File

@ -3,10 +3,10 @@
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" false) }}
<article class="hx-w-full hx-break-words hx-min-h-[calc(100vh-var(--navbar-height))] hx-min-w-0 hx-pt-4 hx-pb-8 hx-pl-[max(env(safe-area-inset-left),1.5rem)] hx-pr-[max(env(safe-area-inset-left),1.5rem)]">
<br class="hx-mt-1.5 hx-text-sm" />
{{ if .Title }}<h1 class="hx-text-center hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>{{ end }}
<h1 class="hx-text-center hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>
<div class="content">
{{ .Content }}
</div>
</article>
</div>
{{ end }}
{{ end }}

View File

@ -5,7 +5,7 @@
<article class="hx-w-full hx-break-words hx-flex hx-min-h-[calc(100vh-var(--navbar-height))] hx-min-w-0 hx-justify-center hx-pb-8 hx-pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="hx-w-full hx-min-w-0 hx-max-w-6xl hx-px-6 hx-pt-4 md:hx-px-12">
<br class="hx-mt-1.5 hx-text-sm" />
{{ if .Title }}<h1 class="hx-text-center hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>{{ end }}
<h1 class="hx-text-center hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>
<div class="content">{{ .Content }}</div>
{{- $pages := partial "utils/sort-pages" (dict "page" . "by" site.Params.blog.list.sortBy "order" site.Params.blog.list.sortOrder) -}}
{{- range $pages }}
@ -31,4 +31,4 @@
</article>
<div class="max-xl:hx-hidden hx-h-0 hx-w-64 hx-shrink-0"></div>
</div>
{{- end -}}
{{- end -}}

View File

@ -5,7 +5,7 @@
<article class="hx-w-full hx-break-words hx-flex hx-min-h-[calc(100vh-var(--navbar-height))] hx-min-w-0 hx-justify-center hx-pb-8 hx-pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="hx-w-full hx-min-w-0 hx-max-w-6xl hx-px-6 hx-pt-4 md:hx-px-12">
{{ partial "breadcrumb.html" . }}
{{ if .Title }}<h1 class="hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>{{ end }}
<h1 class="hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>
<div class="hx-mt-4 hx-mb-16 hx-text-gray-500 hx-text-sm hx-flex hx-items-center hx-flex-wrap hx-gap-y-2">
{{- with $date := .Date }}<span class="hx-mr-1">{{ partial "utils/format-date" $date }}</span>{{ end -}}
{{- $lazyLoading := site.Params.enableImageLazyLoading | default true -}}
@ -45,4 +45,4 @@
</main>
</article>
</div>
{{ end }}
{{ end }}

View File

@ -6,7 +6,7 @@
<main class="hx-w-full hx-min-w-0 hx-max-w-6xl hx-px-6 hx-pt-4 md:hx-px-12">
{{ partial "breadcrumb.html" . }}
<div class="content">
{{ if .Title }}<h1>{{ .Title }}</h1>{{ end }}
<h1>{{ .Title }}</h1>
{{ .Content }}
</div>
{{ partial "components/last-updated.html" . }}
@ -15,4 +15,4 @@
</main>
</article>
</div>
{{ end }}
{{ end }}

View File

@ -6,7 +6,7 @@
<main class="hx-w-full hx-min-w-0 hx-max-w-6xl hx-px-6 hx-pt-4 md:hx-px-12">
{{ partial "breadcrumb.html" . }}
<div class="content">
{{ if .Title }}<h1>{{ .Title }}</h1>{{ end }}
<h1>{{ .Title }}</h1>
{{ .Content }}
</div>
{{ partial "components/last-updated.html" . }}
@ -15,4 +15,4 @@
</main>
</article>
</div>
{{ end }}
{{ end }}

View File

@ -4,11 +4,11 @@
{{ partial "toc.html" . }}
<article class="hx-w-full hx-break-words hx-flex hx-min-h-[calc(100vh-var(--navbar-height))] hx-min-w-0 hx-justify-center hx-pb-8 hx-pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="hx-w-full hx-min-w-0 hx-max-w-6xl hx-px-6 hx-pt-4 md:hx-px-12">
{{ if .Title }}<h1 class="hx-text-center hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>{{ end }}
<h1 class="hx-text-center hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100">{{ .Title }}</h1>
<div class="content">
{{ .Content }}
</div>
</main>
</article>
</div>
{{ end }}
{{ end }}

View File

@ -1,4 +1,10 @@
{{- with site.Config.Services.GoogleAnalytics.ID }}
{{/* 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 -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>

View File

@ -1,6 +1,6 @@
{{- if and (not hugo.IsProduction) (eq hugo.Environment "theme") }}
{{- $styles := resources.Get "css/styles.css" }}
{{- $styles = $styles | postCSS (dict "inlineImports" true) }}
{{- $styles = $styles | resources.PostCSS (dict "inlineImports" true) }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
{{- else }}
{{- $styles := resources.Get "css/compiled/main.css" -}}

View File

@ -30,11 +30,12 @@
{{ partialCached "head-css.html" . }}
<!-- Google Analytics -->
{{- if and (eq hugo.Environment "production") .Site.Config.Services.GoogleAnalytics.ID }}
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
{{ partial "google-analytics.html" . }}
{{- end }}
<!-- Google Analytics -->
{{- if and (eq hugo.Environment "production") (or .Site.GoogleAnalytics .Site.Config.Services.GoogleAnalytics.ID) }}
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
{{ partial "google-analytics.html" . }}
{{- end }}
<script>
/* Initialize light/dark mode */

View File

@ -60,18 +60,12 @@
{{- end -}}
<script>
// TODO: make render options configurable
// Reference: https://katex.org/docs/autorender#api
document.addEventListener("DOMContentLoaded", function () {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\begin{equation}", right: "\\end{equation}", display: true },
{left: "\\begin{align}", right: "\\end{align}", display: true},
{left: "\\begin{alignat}", right: "\\end{alignat}", display: true},
{left: "\\begin{gather}", right: "\\end{gather}", display: true},
{left: "\\begin{CD}", right: "\\end{CD}", display: true},
{ left: "\\[", right: "\\]", display: true },
],
throwOnError: false,

View File

@ -1,16 +0,0 @@
{{- $content := .content -}}
{{- $type := .type -}}
{{- $class := .class | default "" -}}
{{- $border := .border | default false -}}
{{- $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" -}}
{{- $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" -}}
{{- $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" -}}
{{- $borderClass := cond (eq $border true) "hx-border" "" -}}
{{- $badgeClass := cond (eq $type "info") $infoClass (cond (eq $type "warning") $warningClass (cond (eq $type "error") $errorClass $defaultClass)) -}}
<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>
{{- /* Strip trailing newline. */ -}}

View File

@ -7,8 +7,6 @@
{{- $width := .width -}}
{{- $height := .height -}}
{{- $imageStyle := .imageStyle -}}
{{- $tag := .tag -}}
{{- $tagType := .tagType -}}
{{ $linkClass := "hover:hx-border-gray-300 hx-bg-transparent hx-shadow-sm dark:hx-border-neutral-800 hover:hx-bg-slate-50 hover:hx-shadow-md dark:hover:hx-border-neutral-700 dark:hover:hx-bg-neutral-900" }}
{{- with $image -}}
@ -52,15 +50,5 @@
{{- with $subtitle -}}
<div class="hextra-card-subtitle hx-line-clamp-3 hx-text-sm hx-font-normal hx-text-gray-500 dark:hx-text-gray-400 hx-px-4 hx-mb-4 hx-mt-2">{{- $subtitle | markdownify -}}</div>
{{- end -}}
{{- if $tag }}
{{- partial "shortcodes/badge.html" (dict
"content" $tag
"type" $tagType
"class" "hextra-card-tag"
"border" true
)
-}}
{{- end -}}
</a>
{{- /* Strip trailing newline. */ -}}

View File

@ -1,33 +0,0 @@
{{- if .IsNamedParams -}}
{{- $content := .Get "content" -}}
{{- $type := .Get "type" | default "" -}}
{{- $class := .Get "class" | default "" -}}
{{- $link := .Get "link" | default "" -}}
{{- if $link -}}
<a href="{{ $link }}" title="{{ $content | plainify }}" target="_blank">
{{- partial "shortcodes/badge.html" (dict
"content" $content
"type" $type
"class" $class
"border" true
)
-}}
</a>
{{- else -}}
{{- partial "shortcodes/badge.html" (dict
"content" $content
"type" $type
"class" $class
"border" true
)
-}}
{{- end -}}
{{- else -}}
{{- $content := .Get 0 -}}
{{- partial "shortcodes/badge.html" (dict
"content" $content
"border" true
)
-}}
{{- end -}}

View File

@ -7,8 +7,6 @@
{{- $width := 0 -}}
{{- $height := 0 -}}
{{- $imageStyle := .Get "imageStyle" -}}
{{- $tag := .Get "tag" -}}
{{- $tagType := .Get "tagType" -}}
{{/* Image processing options */}}
{{- $method := .Get "method" | default "Resize" | humanize -}}
@ -50,7 +48,5 @@
"width" $width
"height" $height
"imageStyle" $imageStyle
"tag" $tag
"tagType" $tagType
)
-}}

View File

@ -1,81 +0,0 @@
{{/* Render Jupyter Notebook */}}
{{- $path := .Get 0 -}}
{{- $data := "" -}}
{{- $page := .Page -}}
{{- $isLocal := not (urls.Parse $path).Scheme -}}
{{- $isPage := and (eq .Page.Kind "page") (not .Page.BundleType) -}}
{{/* https://gohugo.io/functions/transform/unmarshal/ */}}
{{- if (not $isLocal) -}}
{{- with resources.GetRemote $path -}}
{{- with unmarshal .Content -}}{{- $data = . -}}{{- end -}}
{{- else -}}
{{- errorf "Remote resource not found: %s" $path -}}
{{- end -}}
{{- else if (not $isPage) -}}
{{- with .Page.Resources.Get $path -}}
{{- with unmarshal .Content -}}{{- $data = . -}}{{- end -}}
{{- else -}}
{{- errorf "Local resource not found: %s" $path -}}
{{- end -}}
{{- else -}}
{{- with resources.Get $path -}}
{{- with unmarshal .Content -}}{{- $data = . -}}{{- end -}}
{{- else -}}
{{- errorf "Local resource not found: %s" $path -}}
{{- end -}}
{{- end -}}
{{- $language := index $data "metadata" "language_info" "name" | default "python" -}}
{{- with index $data "cells" -}}
{{- range $cell := . -}}
{{- if eq (index $cell "cell_type") "code" -}}
{{- $source := index $cell "source" -}}
{{- $sourceContent := (cond (reflect.IsSlice $source) (delimit $source "") $source) -}}
{{- with ($sourceContent | strings.Chomp) -}}
{{ (printf "\n\n```%s\n%s\n```\n" $language .) | safeHTML -}}
{{- end -}}
<div class="hextra-jupyter-code-cell hextra-scrollbar">
{{- $outputs := index $cell "outputs" -}}
{{- with $outputs -}}
<div class="hextra-jupyter-code-cell-outputs-container">
<div class="hextra-jupyter-code-cell-outputs">
{{- range $output := . -}}
{{- if eq (index $output "output_type") "display_data" -}}
{{- $data := index $output "data" -}}
{{- $image := index $data "image/png" -}}
{{- if $image -}}
<img src="data:image/png;base64,{{- $image -}}" alt="image" />
{{- end -}}
{{- else if eq (index $output "output_type") "stream" -}}
{{- $text := index $output "text" -}}
{{- $textContent := (cond (reflect.IsSlice $text) (delimit $text "") $text) -}}
<pre class="not-prose">{{- $textContent -}}</pre>
{{- else if eq (index $output "output_type") "execute_result" -}}
{{- $data := index $output "data" -}}
{{- $text := index $data "text/plain" -}}
{{- $textContent := (cond (reflect.IsSlice $text) (delimit $text "") $text) -}}
<pre class="not-prose">{{- $textContent -}}</pre>
{{- $html := index $data "text/html" -}}
{{- if $html -}}
{{- $htmlText := delimit $html "" -}}
<div>
{{- $htmlText | safeHTML -}}
</div>
{{- end -}}
{{- end -}}
{{- end -}}
</div>
</div>
{{- end -}}
</div>
{{- else if eq (index $cell "cell_type") "markdown" -}}
{{- $source := index $cell "source" }}
{{- $sourceContent := (cond (reflect.IsSlice $source) (delimit $source "") $source) }}
{{ (printf "\n%s\n" $sourceContent) | safeHTML }}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -1,12 +1,11 @@
{{- $defaultIndex := int ((.Parent.Get "defaultIndex") | default "0") -}}
<div
class="hextra-tabs-panel hx-rounded hx-pt-6 hx-hidden data-[state=selected]:hx-block"
class="tabs-panel hx-rounded hx-pt-6 hx-hidden data-[state=selected]:hx-block"
id="tabs-panel-{{ .Ordinal }}"
role="tabpanel"
{{- if eq .Ordinal $defaultIndex }} tabindex="0" {{ end -}}
{{- if eq .Ordinal $defaultIndex }} data-state="selected" {{ end -}}
{{ if eq .Ordinal $defaultIndex }}tabindex="0"{{ end }}
{{ if eq .Ordinal $defaultIndex }}data-state="selected"{{ end }}
>
{{- .InnerDeindent | markdownify -}}
{{ .InnerDeindent | markdownify }}
</div>
{{- /* Drop trailing newlines */ -}}

View File

@ -5,24 +5,22 @@
{{ errorf "no items provided" }}
{{- end -}}
<div class="hextra-scrollbar hx-overflow-x-auto hx-overflow-y-hidden hx-overscroll-x-contain">
<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 -}}
<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"
role="tab"
type="button"
aria-controls="tabs-panel-{{ $i }}"
{{- if eq $i $defaultIndex }} aria-selected="true" {{ end -}}
{{- if eq $i $defaultIndex }} tabindex="0" {{ end -}}
{{- if eq $i $defaultIndex }} data-state="selected"{{ end -}}
>
{{- $item -}}
</button>
{{- end -}}
</div>
<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 -}}
<button
class="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"
role="tab"
type="button"
aria-controls="tabs-panel-{{ $i }}"
{{ if eq $i $defaultIndex }}aria-selected="true"{{ end }}
{{ if eq $i $defaultIndex }}tabindex="0"{{ end }}
{{ if eq $i $defaultIndex }}data-state="selected"{{ end }}
>
{{- $item -}}
</button>
{{- end -}}
</div>
<div>
{{- .Inner -}}
{{ .Inner }}
</div>
{{- /* Drop trailing newlines */ -}}

View File

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

1261
package-lock.json generated

File diff suppressed because it is too large Load Diff