forked from drowl87/hextra_mirror
Compare commits
44 Commits
jupyter
...
sidebar-da
Author | SHA1 | Date | |
---|---|---|---|
9e7b13a0da | |||
66489e5274 | |||
2004648076 | |||
0da6f97e99 | |||
a4bfa2d97e | |||
3a2ce0b5c0 | |||
55af474f51 | |||
b91cc79674 | |||
68e1e25119 | |||
8c789626be | |||
ba7707d4d9 | |||
25da2baf7f | |||
234fd39254 | |||
4a7ab16695 | |||
19852552c6 | |||
80a1692ade | |||
81720c7727 | |||
f98fa8c389 | |||
3503b4c4f1 | |||
bf38320797 | |||
6a9117ae7c | |||
a1c7acd6b5 | |||
e444156bb9 | |||
33f2cf653b | |||
63f153999e | |||
c62b1fd401 | |||
be7e0d3f40 | |||
e4cdabff12 | |||
fdfdef69b5 | |||
462cc5b68d | |||
2f127a2f2f | |||
f40c7fd5d4 | |||
781e7000c4 | |||
8e98791082 | |||
74fb165358 | |||
6d4bbac085 | |||
5103da4cd5 | |||
9f2b67c08c | |||
0d6cbba9df | |||
1936b46af4 | |||
ab9e40effd | |||
5080877576 | |||
24fb13b221 | |||
a5b59b61f1 |
@ -3,7 +3,7 @@
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/hugo:1": {
|
||||
"extended": true,
|
||||
"version": "0.119.0"
|
||||
"version": "0.124.1"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/node:1": {}
|
||||
},
|
||||
|
25
.github/workflows/pages.yml
vendored
25
.github/workflows/pages.yml
vendored
@ -31,21 +31,24 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HUGO_VERSION: 0.117.0
|
||||
HUGO_VERSION: 0.124.1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
|
||||
submodules: recursive
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.20'
|
||||
go-version: '1.22'
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v4
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: ${{ env.HUGO_VERSION }}
|
||||
extended: true
|
||||
run: |
|
||||
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
|
||||
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
|
||||
- name: Build with Hugo
|
||||
env:
|
||||
# For maximum backward compatibility with Hugo modules
|
||||
@ -55,9 +58,9 @@ jobs:
|
||||
hugo \
|
||||
--minify \
|
||||
--themesDir=../.. --source=exampleSite \
|
||||
--baseURL "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"
|
||||
--baseURL "${{ steps.pages.outputs.base_url }}/"
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: ./exampleSite/public
|
||||
|
||||
@ -71,4 +74,4 @@ jobs:
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
||||
uses: actions/deploy-pages@v4
|
||||
|
@ -1,5 +1,6 @@
|
||||
<div align="center">
|
||||
<h1 align="center">هگزترا</h1>
|
||||
<sup align="center"><a href="README.md">English</a> | <a href="README.zh-cn.md">简体中文</a> | <a href="README.fa.md">فارسی</a></sup>
|
||||
<p align="center">تم هیوگو مدرن، پاسخگو و دارای امکانات کامل برای ایجاد وبسایتهای استاتیک زیبا.</p>
|
||||
|
||||
نسخهی نمایشی → [imfing.github.io/hextra](https://imfing.github.io/hextra/fa)
|
||||
|
@ -1,5 +1,6 @@
|
||||
<div align="center">
|
||||
<h1 align="center">Hextra</h1>
|
||||
<sup align="center"><a href="README.md">English</a> | <a href="README.zh-cn.md">简体中文</a> | <a href="README.fa.md">فارسی</a></sup>
|
||||
<p align="center">Modern, responsive, batteries-included Hugo theme for creating beautiful static websites.</p>
|
||||
|
||||
Demo → [imfing.github.io/hextra](https://imfing.github.io/hextra/)
|
||||
|
@ -1,5 +1,6 @@
|
||||
<div align="center">
|
||||
<h1 align="center">Hextra</h1>
|
||||
<sup align="center"><a href="README.md">English</a> | <a href="README.zh-cn.md">简体中文</a> | <a href="README.fa.md">فارسی</a></sup>
|
||||
<p align="center">用于创建美观的静态站点的现代化, 响应式, 功能强大的 Hugo 主题.</p>
|
||||
|
||||
演示 → [imfing.github.io/hextra](https://imfing.github.io/hextra/)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
.hextra-cards {
|
||||
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--rows))), 1fr));
|
||||
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--hextra-cards-grid-cols))), 1fr));
|
||||
}
|
||||
|
||||
.hextra-card img {
|
||||
|
5
assets/css/components/hextra/feature-grid.css
Normal file
5
assets/css/components/hextra/feature-grid.css
Normal file
@ -0,0 +1,5 @@
|
||||
.hextra-feature-grid {
|
||||
@media (min-width: 1024px) {
|
||||
grid-template-columns: repeat(var(--hextra-feature-grid-cols), minmax(0, 1fr));
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
@media (max-width: 767px) {
|
||||
.sidebar-container {
|
||||
.hextra-sidebar-container {
|
||||
@apply hx-fixed hx-pt-[calc(var(--navbar-height))] hx-top-0 hx-w-full hx-bottom-0 hx-z-[15] hx-overscroll-contain hx-bg-white dark:hx-bg-dark;
|
||||
transition: transform 0.8s cubic-bezier(0.52, 0.16, 0.04, 1);
|
||||
will-change: transform, opacity;
|
||||
@ -8,7 +8,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-container {
|
||||
.hextra-sidebar-container {
|
||||
li > div {
|
||||
@apply hx-h-0;
|
||||
}
|
||||
@ -18,4 +18,19 @@
|
||||
li.open > a > span > svg > path {
|
||||
@apply hx-rotate-90;
|
||||
}
|
||||
|
||||
.hextra-sidebar-item-list {
|
||||
@apply hx-relative hx-flex hx-flex-col hx-gap-1 before:hx-absolute before:hx-inset-y-1 before:hx-w-px before:hx-bg-gray-200 ltr:hx-ml-3 ltr:hx-pl-3 ltr:before:hx-left-0 rtl:hx-mr-3 rtl:hx-pr-3 rtl:before:hx-right-0 dark:before:hx-bg-neutral-800;
|
||||
}
|
||||
|
||||
.hextra-sidebar-item-link {
|
||||
@apply hx-flex hx-items-center hx-justify-between hx-gap-2 hx-cursor-pointer hx-rounded hx-px-2 hx-py-1.5 hx-text-sm hx-transition-colors;
|
||||
|
||||
&.active {
|
||||
@apply hx-bg-primary-100 hx-font-semibold hx-text-primary-800 contrast-more:hx-border contrast-more:hx-border-primary-500 dark:hx-bg-primary-400/10 dark:hx-text-primary-600 contrast-more:dark:hx-border-primary-500;
|
||||
}
|
||||
&.inactive {
|
||||
@apply hx-text-gray-500 hover:hx-bg-gray-100 hover:hx-text-gray-900 contrast-more:hx-border contrast-more:hx-border-transparent contrast-more:hx-text-gray-900 contrast-more:hover:hx-border-gray-900 dark:hx-text-neutral-400 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50 contrast-more:dark:hx-text-gray-50 contrast-more:dark:hover:hx-border-gray-50;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
@import "components/navbar.css";
|
||||
@import "components/scrollbar.css";
|
||||
@import "components/code-copy.css";
|
||||
@import "components/hextra/feature-grid.css";
|
||||
|
||||
html {
|
||||
@apply hx-text-base hx-antialiased;
|
||||
|
@ -77,6 +77,15 @@
|
||||
@apply hx-text-sm hx-text-gray-500 dark:hx-text-gray-400 hx-mt-2 hx-block hx-text-center;
|
||||
}
|
||||
}
|
||||
/* Definition list */
|
||||
:where(dl):not(:where([class~=not-prose],[class~=not-prose] *)) {
|
||||
dt {
|
||||
@apply hx-mt-6 hx-font-semibold;
|
||||
}
|
||||
dd {
|
||||
@apply hx-my-2 hx-ps-6;
|
||||
}
|
||||
}
|
||||
.footnotes {
|
||||
@apply hx-mt-12 hx-text-sm;
|
||||
}
|
||||
|
@ -27,6 +27,20 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
el.addEventListener('focus', init);
|
||||
el.addEventListener('keyup', search);
|
||||
el.addEventListener('keydown', handleKeyDown);
|
||||
el.addEventListener('input', handleInputChange);
|
||||
}
|
||||
|
||||
const shortcutElements = document.querySelectorAll('.search-wrapper kbd');
|
||||
|
||||
function setShortcutElementsOpacity(opacity) {
|
||||
shortcutElements.forEach(el => {
|
||||
el.style.opacity = opacity;
|
||||
});
|
||||
}
|
||||
|
||||
function handleInputChange(e) {
|
||||
const opacity = e.target.value.length > 0 ? 0 : 100;
|
||||
setShortcutElementsOpacity(opacity);
|
||||
}
|
||||
|
||||
// Get the search wrapper, input, and results elements.
|
||||
@ -79,6 +93,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
e.target !== resultsElement &&
|
||||
!resultsElement.contains(e.target)
|
||||
) {
|
||||
setShortcutElementsOpacity(100);
|
||||
hideSearchResults();
|
||||
}
|
||||
});
|
||||
@ -157,6 +172,10 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
case 'Escape':
|
||||
e.preventDefault();
|
||||
hideSearchResults();
|
||||
// Clear the input when pressing escape
|
||||
inputElement.value = '';
|
||||
inputElement.dispatchEvent(new Event('input'));
|
||||
// Remove focus from the input
|
||||
inputElement.blur();
|
||||
break;
|
||||
}
|
||||
@ -170,7 +189,10 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
}
|
||||
}
|
||||
|
||||
// Preload the search index.
|
||||
/**
|
||||
* Preloads the search index by fetching data and adding it to the FlexSearch index.
|
||||
* @returns {Promise<void>} A promise that resolves when the index is preloaded.
|
||||
*/
|
||||
async function preloadIndex() {
|
||||
const tokenize = '{{- site.Params.search.flexsearch.tokenize | default "forward" -}}';
|
||||
window.pageIndex = new FlexSearch.Document({
|
||||
@ -240,6 +262,10 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a search based on the provided query and displays the results.
|
||||
* @param {Event} e - The event object.
|
||||
*/
|
||||
function search(e) {
|
||||
const query = e.target.value;
|
||||
if (!e.target.value) {
|
||||
@ -308,6 +334,12 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
displayResults(sortedResults, query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the search results on the page.
|
||||
*
|
||||
* @param {Array} results - The array of search results.
|
||||
* @param {string} query - The search query.
|
||||
*/
|
||||
function displayResults(results, query) {
|
||||
const { resultsElement } = getActiveSearchElement();
|
||||
if (!resultsElement) return;
|
||||
|
@ -3,7 +3,7 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const menu = document.querySelector('.hamburger-menu');
|
||||
const overlay = document.querySelector('.mobile-menu-overlay');
|
||||
const sidebarContainer = document.querySelector('.sidebar-container');
|
||||
const sidebarContainer = document.querySelector('.hextra-sidebar-container');
|
||||
|
||||
// Initialize the overlay
|
||||
const overlayClasses = ['hx-fixed', 'hx-inset-0', 'hx-z-10', 'hx-bg-black/80', 'dark:hx-bg-black/60'];
|
||||
|
@ -1,3 +1,12 @@
|
||||
/**
|
||||
* Check if the element is visible.
|
||||
* @param {Element} element Dom element
|
||||
* @returns boolean
|
||||
*/
|
||||
function isVisible(element) {
|
||||
return element.offsetWidth > 0 || element.offsetHeight > 0;
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const buttons = document.querySelectorAll(".hextra-sidebar-collapsible-button");
|
||||
buttons.forEach(function (button) {
|
||||
@ -5,8 +14,41 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
e.preventDefault();
|
||||
const list = button.parentElement.parentElement;
|
||||
if (list) {
|
||||
list.classList.toggle("open")
|
||||
list.classList.toggle("open");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const isCached = "{{- site.Params.page.sidebar.cache | default false -}}" === "true";
|
||||
const currentPagePath = window.location.href;
|
||||
|
||||
if (isCached) {
|
||||
// find the current page in the sidebar and open the parent lists
|
||||
const sidebar = document.querySelector(".hextra-sidebar-container");
|
||||
if (sidebar) {
|
||||
// find a tags and compare href with current page path
|
||||
const links = sidebar.querySelectorAll("a");
|
||||
links.forEach(function (link) {
|
||||
const linkPath = link.href;
|
||||
|
||||
if (currentPagePath === linkPath) {
|
||||
// add active class to the link
|
||||
link.classList.add("active");
|
||||
link.classList.remove("inactive");
|
||||
|
||||
if (!isVisible(link)) {
|
||||
return;
|
||||
}
|
||||
// recursively open parent lists
|
||||
let parent = link.parentElement;
|
||||
while (parent && !parent.classList.contains("hextra-sidebar-container")) {
|
||||
if (parent.tagName === "LI" && parent.classList.contains("hextra-sidebar-item")) {
|
||||
parent.classList.add("open");
|
||||
}
|
||||
parent = parent.parentElement;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
2
assets/lib/katex/auto-render.min.js
vendored
2
assets/lib/katex/auto-render.min.js
vendored
@ -1 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n<t.length;){var o=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;"\\"===o?n++:"{"===o?i++:"}"===o&&i--,n++}return-1},a=/^\\begin{/,o=function(e,t){for(var n,i=[],o=new RegExp("("+t.map((function(e){return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")})).join("|")+")");-1!==(n=e.search(o));){n>0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a<n.length;a++)if("text"===n[a].type)i.appendChild(document.createTextNode(n[a].data));else{var l=document.createElement("span"),d=n[a].data;r.displayMode=n[a].display;try{r.preProcess&&(d=r.preProcess(d)),t().render(d,l,r)}catch(e){if(!(e instanceof t().ParseError))throw e;r.errorCallback("KaTeX auto-render: Failed to parse `"+n[a].data+"` with ",e),i.appendChild(document.createTextNode(n[a].rawData));continue}i.appendChild(l)}return i},d=function e(t,r){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];if(3===i.nodeType){for(var a=i.textContent,o=i.nextSibling,d=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,d++;var s=l(a,r);if(s){for(var f=0;f<d;f++)i.nextSibling.remove();n+=s.childNodes.length-1,t.replaceChild(s,i)}else n+=d}else 1===i.nodeType&&function(){var t=" "+i.className+" ";-1===r.ignoredTags.indexOf(i.nodeName.toLowerCase())&&r.ignoredClasses.every((function(e){return-1===t.indexOf(" "+e+" ")}))&&e(i,r)}()}},s=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},d(e,r)}}(),i=i.default}()}));
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){r.d(o,{default:function(){return d}});var e=r(771),t=r.n(e);const n=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},i=/^\\begin{/;var a=function(e,t){let r;const o=[],a=new RegExp("("+t.map((e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;r=e.search(a),-1!==r;){r>0&&(o.push({type:"text",data:e.slice(0,r)}),e=e.slice(r));const a=t.findIndex((t=>e.startsWith(t.left)));if(r=n(t[a].right,e,t[a].left.length),-1===r)break;const l=e.slice(0,r+t[a].right.length),s=i.test(l)?l:e.slice(t[a].left.length,r);o.push({type:"math",data:s,rawData:l,display:t[a].display}),e=e.slice(r+t[a].right.length)}return""!==e&&o.push({type:"text",data:e}),o};const l=function(e,n){const r=a(e,n.delimiters);if(1===r.length&&"text"===r[0].type)return null;const o=document.createDocumentFragment();for(let e=0;e<r.length;e++)if("text"===r[e].type)o.appendChild(document.createTextNode(r[e].data));else{const i=document.createElement("span");let a=r[e].data;n.displayMode=r[e].display;try{n.preProcess&&(a=n.preProcess(a)),t().render(a,i,n)}catch(i){if(!(i instanceof t().ParseError))throw i;n.errorCallback("KaTeX auto-render: Failed to parse `"+r[e].data+"` with ",i),o.appendChild(document.createTextNode(r[e].rawData));continue}o.appendChild(i)}return o},s=function(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(3===r.nodeType){let o=r.textContent,i=r.nextSibling,a=0;for(;i&&i.nodeType===Node.TEXT_NODE;)o+=i.textContent,i=i.nextSibling,a++;const s=l(o,t);if(s){for(let e=0;e<a;e++)r.nextSibling.remove();n+=s.childNodes.length-1,e.replaceChild(s,r)}else n+=a}else if(1===r.nodeType){const e=" "+r.className+" ";-1===t.ignoredTags.indexOf(r.nodeName.toLowerCase())&&t.ignoredClasses.every((t=>-1===e.indexOf(" "+t+" ")))&&s(r,t)}}};var d=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},s(e,n)}}(),o=o.default}()}));
|
2
assets/lib/katex/katex.min.css
vendored
2
assets/lib/katex/katex.min.css
vendored
File diff suppressed because one or more lines are too long
2
assets/lib/katex/katex.min.js
vendored
2
assets/lib/katex/katex.min.js
vendored
File diff suppressed because one or more lines are too long
1018
assets/lib/mermaid/mermaid.min.js
vendored
1018
assets/lib/mermaid/mermaid.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,3 +1,10 @@
|
||||
---
|
||||
title: "博客"
|
||||
---
|
||||
---
|
||||
|
||||
<div style="text-align: center; margin-top: 1em;">
|
||||
{{< hextra/hero-badge link="index.xml" >}}
|
||||
<span>RSS 订阅</span>
|
||||
{{< icon name="rss" attributes="height=14" >}}
|
||||
{{< /hextra/hero-badge >}}
|
||||
</div>
|
||||
|
@ -161,7 +161,7 @@ To modify the copyright text displayed in your website's footer, you'll need to
|
||||
In this file, specify your new copyright text as shown below:
|
||||
|
||||
```yaml {filename="i18n/en.yaml"}
|
||||
copyright: "© 2023 YOUR TEXT HERE"
|
||||
copyright: "© 2024 YOUR TEXT HERE"
|
||||
```
|
||||
|
||||
For your reference, an example [`i18n/en.yaml`](https://github.com/imfing/hextra/blob/main/i18n/en.yaml) file can be found in the GitHub repository. Additionally, you could use Markdown format in the copyright text.
|
||||
|
@ -130,7 +130,7 @@ editURL: "https://example.com/edit/this/page"
|
||||
在此文件中,填写新的版权文本,像这样:
|
||||
|
||||
```yaml {filename="i18n/en.yaml"}
|
||||
copyright: "© 2023 YOUR TEXT HERE"
|
||||
copyright: "© 2024 YOUR TEXT HERE"
|
||||
```
|
||||
你可以在 GitHub 存储库中找到示例 [`i18n/en.yaml`](https://github.com/imfing/hextra/blob/main/i18n/en.yaml) 文件。另外,你可以在版权文本中使用 Markdown 格式。
|
||||
|
||||
|
164
exampleSite/content/docs/guide/deploy-site.zh-cn.md
Normal file
164
exampleSite/content/docs/guide/deploy-site.zh-cn.md
Normal file
@ -0,0 +1,164 @@
|
||||
---
|
||||
title: 部署站点
|
||||
prev: /docs/guide/shortcodes
|
||||
next: /docs/advanced
|
||||
---
|
||||
|
||||
Hugo 生成静态站点,允许多种托管方式,你可以自由选择
|
||||
本页将给出部署你的 Hextra 站点的方法
|
||||
|
||||
<!--more-->
|
||||
|
||||
|
||||
## GitHub Pages
|
||||
|
||||
[GitHub Pages](https://docs.github.com/pages) 是免费部署和托管网站的推荐方法
|
||||
|
||||
如果您使用以下方式引导该网站 [hextra-starter-template](https://github.com/imfing/hextra-starter-template), 它提供了开箱即用的 GitHub Actions 工作流程,有助于自动部署到 GitHub Pages
|
||||
|
||||
{{% details title="GitHub Actions Configuration" closed="true" %}}
|
||||
|
||||
以下是配置来自 [hextra-starter-template](https://github.com/imfing/hextra-starter-template) 的 Workflow 的示例:
|
||||
|
||||
```yaml {filename=".github/workflows/pages.yaml"}
|
||||
# 用于构建 Hugo 站点并将其部署到 GitHub Pages 的示例工作流程
|
||||
name: Deploy Hugo site to Pages
|
||||
|
||||
on:
|
||||
# 由默认分支触发
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
# 允许手动运行
|
||||
workflow_dispatch:
|
||||
|
||||
# 设置 GITHUB_TOKEN 的权限以允许部署到 GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# 仅允许一项并发部署,跳过正在进行的运行和最新排队的运行之间排队的运行
|
||||
# 但是,不要取消正在进行的运行,因为我们希望完成这些生产部署
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
# 默认为 bash
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
# 开始构建
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HUGO_VERSION: 0.121.2
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # 获取 .GitInfo 和 .Lastmod 的所有历史记录
|
||||
submodules: recursive
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v4
|
||||
- name: Setup Hugo
|
||||
run: |
|
||||
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
|
||||
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
|
||||
- name: Build with Hugo
|
||||
env:
|
||||
# 最大程度地向后兼容 Hugo 模块
|
||||
HUGO_ENVIRONMENT: production
|
||||
HUGO_ENV: production
|
||||
run: |
|
||||
hugo \
|
||||
--gc --minify \
|
||||
--baseURL "${{ steps.pages.outputs.base_url }}/"
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: ./public
|
||||
|
||||
# 开始部署
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
```
|
||||
|
||||
{{% /details %}}
|
||||
|
||||
|
||||
{{< callout >}}
|
||||
在仓库设置中将 **Pages** > **Build and deployment** > **Source** 调整为 **GitHub Actions**:
|
||||

|
||||
{{< /callout >}}
|
||||
|
||||
默认情况下,上述 GitHub Actions 工作流程 `.github/workflows/pages.yaml` 假定站点部署到 `https://<USERNAME>.github.io/<REPO>/`
|
||||
|
||||
如需部署到 `https://<USERNAME>.github.io/` 修改参数 `--baseURL`:
|
||||
|
||||
```yaml {filename=".github/workflows/pages.yaml",linenos=table,linenostart=54,hl_lines=[4]}
|
||||
run: |
|
||||
hugo \
|
||||
--gc --minify \
|
||||
--baseURL "https://${{ github.repository_owner }}.github.io/"
|
||||
```
|
||||
|
||||
如需部署到自己的域,请对应修改 `--baseURL`
|
||||
|
||||
|
||||
## Cloudflare Pages
|
||||
|
||||
1. 将您的网站托管在 Git 存储库(例如 GitHub)
|
||||
2. 登录到 [Cloudflare dashboard](https://dash.cloudflare.com/) 并选择你的账户
|
||||
3. 转至在账户主页面中 **Workers & Pages** > **Create application** > **Pages** > **Connect to Git**
|
||||
4. 选择你的仓库 **Set up builds and deployments** 提供以下信息:
|
||||
|
||||
| Configuration | Value |
|
||||
| ----------------- | -------------------- |
|
||||
| Production branch | `main` |
|
||||
| Build command | `hugo --gc --minify` |
|
||||
| Build directory | `public` |
|
||||
|
||||
如需了解更多内容,见:
|
||||
- [Deploy a Hugo site](https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/#deploy-with-cloudflare-pages).
|
||||
- [Language support and tools](https://developers.cloudflare.com/pages/platform/language-support-and-tools/).
|
||||
|
||||
|
||||
## Netlify
|
||||
|
||||
1. 将代码推送到 Git 存储库 (如 GitHub, GitLab)
|
||||
2. [导入项目](https://app.netlify.com/start)
|
||||
3. 如果您不使用[hextra-starter-template][hextra-starter-template], 手动配置以下内容:
|
||||
- C 将构建命令配置为 `hugo --gc --minify`
|
||||
- 指定发布目录为 `public`
|
||||
- 添加环境变量 `HUGO_VERSION` 并设定为 `0.119.0`
|
||||
4. 部署
|
||||
|
||||
转至 [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) 获得更多信息
|
||||
|
||||
|
||||
## Vercel
|
||||
|
||||
1. 将代码推送到 Git 存储库(GitHub、GitLab 等)
|
||||
2. 转至 [Vercel Dashboard](https://vercel.com/dashboard) 并导入你的 Hugo 项目
|
||||
3. 配置项目,选择 Hugo 作为 Framework Preset
|
||||
4. 覆盖构建命令和安装命令:
|
||||
1. 设置构建命令为 `hugo --gc --minify`
|
||||
2. 将安装命令设置为 `yum install golang`
|
||||
|
||||

|
78
exampleSite/content/docs/guide/shortcodes/callout.zh-cn.md
Normal file
78
exampleSite/content/docs/guide/shortcodes/callout.zh-cn.md
Normal file
@ -0,0 +1,78 @@
|
||||
---
|
||||
title: 标注
|
||||
aliases:
|
||||
- callouts
|
||||
prev: /docs/guide/shortcodes
|
||||
---
|
||||
|
||||
向读者显示重要信息的内置组件。
|
||||
|
||||
<!--more-->
|
||||
|
||||
## Example
|
||||
|
||||
{{< callout emoji="👾">}}
|
||||
**标注**是一段旨在吸引注意力的短文本
|
||||
{{< /callout >}}
|
||||
|
||||
{{< callout type="info" >}}
|
||||
**标注**是一段旨在吸引注意力的短文本。
|
||||
{{< /callout >}}
|
||||
|
||||
{{< callout type="warning" >}}
|
||||
**标注**是一段旨在吸引注意力的短文本。
|
||||
{{< /callout >}}
|
||||
|
||||
{{< callout type="error" >}}
|
||||
**标注**是一段旨在吸引注意力的短文本。
|
||||
{{< /callout >}}
|
||||
|
||||
## Usage
|
||||
|
||||
### Default
|
||||
|
||||
{{< callout emoji="🌐">}}
|
||||
Hugo 可用于创建各种网站,包括博客、作品集、文档网站等
|
||||
{{< /callout >}}
|
||||
|
||||
```markdown
|
||||
{{</* callout emoji="🌐" */>}}
|
||||
Hugo 可用于创建各种网站,包括博客、作品集、文档网站等
|
||||
{{</* /callout */>}}
|
||||
```
|
||||
|
||||
### Info
|
||||
|
||||
{{< callout type="info" >}}
|
||||
请访问 GitHub 查看最新版本
|
||||
{{< /callout >}}
|
||||
|
||||
```markdown
|
||||
{{</* callout type="info" */>}}
|
||||
请访问 GitHub 查看最新版本
|
||||
{{</* /callout */>}}
|
||||
```
|
||||
|
||||
### Warning
|
||||
|
||||
{{< callout type="warning" >}}
|
||||
该 API 将在下一版本中弃用
|
||||
{{< /callout >}}
|
||||
|
||||
```markdown
|
||||
{{</* callout type="warning" */>}}
|
||||
**标注**是一段旨在吸引注意力的简短文字
|
||||
{{</* /callout */>}}
|
||||
```
|
||||
|
||||
### Error
|
||||
|
||||
{{< callout type="error" >}}
|
||||
出问题了,要爆炸了
|
||||
{{< /callout >}}
|
||||
|
||||
```markdown
|
||||
{{</* callout type="error" */>}}
|
||||
出问题了,要爆炸了
|
||||
{{</* /callout */>}}
|
||||
```
|
65
exampleSite/content/docs/guide/shortcodes/cards.zh-cn.md
Normal file
65
exampleSite/content/docs/guide/shortcodes/cards.zh-cn.md
Normal file
@ -0,0 +1,65 @@
|
||||
---
|
||||
title: 卡片
|
||||
linkTitle: Cards
|
||||
---
|
||||
|
||||
## 示例
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="../callout" title="Callout" icon="warning" >}}
|
||||
{{< card link="/" title="No Icon" >}}
|
||||
{{< /cards >}}
|
||||
|
||||
{{< cards >}}
|
||||
{{< 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 >}}
|
||||
|
||||
## 使用
|
||||
|
||||
```
|
||||
{{</* cards */>}}
|
||||
{{</* card link="../callout" title="Callout" icon="warning" */>}}
|
||||
{{</* card link="/" title="No Icon" */>}}
|
||||
{{</* /cards */>}}
|
||||
```
|
||||
|
||||
```
|
||||
{{</* cards */>}}
|
||||
{{</* 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 */>}}
|
||||
```
|
||||
|
||||
## 卡片参数
|
||||
|
||||
| Parameter | Description |
|
||||
|----------- |---------------------------------------|
|
||||
| `link` | URL(内部或外部) |
|
||||
| `title` | 卡片的标题 |
|
||||
| `subtitle` | 字幕标题(支持 Markdown) |
|
||||
| `icon` | 图标的名称 |
|
||||
|
||||
## Image Card
|
||||
|
||||
此外,该卡还支持通过以下参数添加图像和处理:
|
||||
|
||||
| Parameter | Description |
|
||||
|----------- |---------------------------------------------|
|
||||
| `image` | 指定卡片的图像 URL. |
|
||||
| `method` | 设置 Hugo 的图像处理方法。 |
|
||||
| `options` | 配置 Hugo 的图像处理选项。|
|
||||
|
||||
卡片支持三种图像:
|
||||
|
||||
1. 远程图片:完整网址应放置在 image 参数中
|
||||
2. 静态图片:使用 Hugo 的 static/ 目录中的相对路径
|
||||
3. 处理过的图片:使用 Hugo 的 assets/ 目录中的相对路径
|
||||
|
||||
Hextra 在构建过程中会自动检测图片是否需要处理,并根据需要应用 options 参数或默认设置(缩放,800x,质量 80,WebP 格式)。
|
||||
|
||||
它目前支持以下处理方法:Resize(缩放)、Fit(适应)、Fill(填充)和 Crop(裁剪)。
|
||||
|
||||
有关 Hugo 内置图像处理命令、方法和选项的更多信息,请参阅他们的 [Image Processing Documentation](https://gohugo.io/content-management/image-processing/).
|
43
exampleSite/content/docs/guide/shortcodes/details.zh-cn.md
Normal file
43
exampleSite/content/docs/guide/shortcodes/details.zh-cn.md
Normal file
@ -0,0 +1,43 @@
|
||||
---
|
||||
title: 详情
|
||||
---
|
||||
|
||||
用于显示可折叠内容的内置组件。
|
||||
|
||||
<!--more-->
|
||||
|
||||
## 示例
|
||||
|
||||
{{% details title="Details" %}}
|
||||
|
||||
这是细节的内容
|
||||
|
||||
Markdown is **supported**.
|
||||
|
||||
{{% /details %}}
|
||||
|
||||
{{% details title="Click me to reveal" closed="true" %}}
|
||||
|
||||
默认情况下这将被隐藏
|
||||
|
||||
{{% /details %}}
|
||||
|
||||
## Usage
|
||||
|
||||
````markdown
|
||||
{{%/* details title="Details" */%}}
|
||||
|
||||
这是细节的内容
|
||||
|
||||
**支持** Markdown
|
||||
|
||||
{{%/* /details */%}}
|
||||
````
|
||||
|
||||
````markdown
|
||||
{{%/* details title="Click me to reveal" closed="true" */%}}
|
||||
|
||||
默认情况下这将被隐藏
|
||||
|
||||
{{%/* /details */%}}
|
||||
````
|
33
exampleSite/content/docs/guide/shortcodes/filetree.zh-cn.md
Normal file
33
exampleSite/content/docs/guide/shortcodes/filetree.zh-cn.md
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
title: 文件树
|
||||
---
|
||||
|
||||
## 示例
|
||||
|
||||
{{< filetree/container >}}
|
||||
{{< filetree/folder name="content" >}}
|
||||
{{< filetree/file name="_index.md" >}}
|
||||
{{< filetree/folder name="docs" state="closed" >}}
|
||||
{{< filetree/file name="_index.md" >}}
|
||||
{{< filetree/file name="introduction.md" >}}
|
||||
{{< filetree/file name="introduction.fr.md" >}}
|
||||
{{< /filetree/folder >}}
|
||||
{{< /filetree/folder >}}
|
||||
{{< filetree/file name="hugo.toml" >}}
|
||||
{{< /filetree/container >}}
|
||||
|
||||
## 用法
|
||||
|
||||
```text {filename="Markdown"}
|
||||
{{</* filetree/container */>}}
|
||||
{{</* filetree/folder name="content" */>}}
|
||||
{{</* filetree/file name="_index.md" */>}}
|
||||
{{</* filetree/folder name="docs" state="closed" */>}}
|
||||
{{</* filetree/file name="_index.md" */>}}
|
||||
{{</* filetree/file name="introduction.md" */>}}
|
||||
{{</* filetree/file name="introduction.fr.md" */>}}
|
||||
{{</* /filetree/folder */>}}
|
||||
{{</* /filetree/folder */>}}
|
||||
{{</* filetree/file name="hugo.toml" */>}}
|
||||
{{</* /filetree/container */>}}
|
||||
```
|
46
exampleSite/content/docs/guide/shortcodes/icon.zh-cn.md
Normal file
46
exampleSite/content/docs/guide/shortcodes/icon.zh-cn.md
Normal file
@ -0,0 +1,46 @@
|
||||
---
|
||||
title: 图标
|
||||
---
|
||||
|
||||
要内联使用此短代码,需要在配置中启用内联短代码:
|
||||
|
||||
```yaml {filename="hugo.yaml"}
|
||||
enableInlineShortcodes: true
|
||||
```
|
||||
|
||||
可用图标列表可以在以下位置找到 [`data/icons.yaml`](https://github.com/imfing/hextra/blob/main/data/icons.yaml).
|
||||
|
||||
<!--more-->
|
||||
|
||||
## 示例
|
||||
|
||||
{{< icon "academic-cap" >}}
|
||||
{{< icon "cake" >}}
|
||||
{{< icon "gift" >}}
|
||||
{{< icon "sparkles" >}}
|
||||
|
||||
## 用法
|
||||
|
||||
```
|
||||
{{</* icon "github" */>}}
|
||||
```
|
||||
|
||||
[Heroicons](https://v1.heroicons.com/) v1 轮廓图标开箱即用
|
||||
|
||||
### 如何添加自己的图标
|
||||
|
||||
创建 `data/icons.yaml` 文件,然后按以下格式添加您自己的 SVG 图标:
|
||||
|
||||
```yaml {filename="data/icons.yaml"}
|
||||
your-icon: <svg>your icon svg content</svg>
|
||||
```
|
||||
|
||||
然后可以在短代码中使用它,如下所示:
|
||||
|
||||
```
|
||||
{{</* icon "your-icon" */>}}
|
||||
|
||||
{{</* card icon="your-icon" */>}}
|
||||
```
|
||||
|
||||
提示:[Iconify Design](https://iconify.design/) 是为您的网站查找 SVG 图标的好地方
|
42
exampleSite/content/docs/guide/shortcodes/steps.zh-cn.md
Normal file
42
exampleSite/content/docs/guide/shortcodes/steps.zh-cn.md
Normal file
@ -0,0 +1,42 @@
|
||||
---
|
||||
title: 步骤
|
||||
---
|
||||
|
||||
A built-in component to display a series of steps.
|
||||
|
||||
## 示例
|
||||
|
||||
{{% steps %}}
|
||||
|
||||
### 第一步
|
||||
|
||||
这是第一步。
|
||||
|
||||
### 第二步
|
||||
|
||||
这是第二步。
|
||||
|
||||
### 第三步
|
||||
|
||||
这是第三步。
|
||||
|
||||
{{% /steps %}}
|
||||
|
||||
|
||||
## 使用
|
||||
|
||||
将 Markdown h3 标题放入 `steps` 短代码中。
|
||||
|
||||
```
|
||||
{{%/* steps */%}}
|
||||
|
||||
### Step 1
|
||||
|
||||
This is the first step.
|
||||
|
||||
### Step 2
|
||||
|
||||
This is the second step.
|
||||
|
||||
{{%/* /steps */%}}
|
||||
```
|
93
exampleSite/content/docs/guide/shortcodes/tabs.zh-cn.md
Normal file
93
exampleSite/content/docs/guide/shortcodes/tabs.zh-cn.md
Normal file
@ -0,0 +1,93 @@
|
||||
---
|
||||
title: 标签页
|
||||
next: /docs/guide/deploy-site
|
||||
---
|
||||
|
||||
## 示例
|
||||
|
||||
{{< tabs items="JSON,YAML,TOML" >}}
|
||||
|
||||
{{< tab >}}**JSON**: JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax.{{< /tab >}}
|
||||
{{< tab >}}**YAML**: YAML is a human-readable data serialization language.{{< /tab >}}
|
||||
{{< tab >}}**TOML**: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.{{< /tab >}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
## 使用
|
||||
|
||||
### 默认情况下
|
||||
|
||||
```
|
||||
{{</* tabs items="JSON,YAML,TOML" */>}}
|
||||
|
||||
{{</* tab */>}}**JSON**: JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax.{{</* /tab */>}}
|
||||
{{</* tab */>}}**YAML**: YAML is a human-readable data serialization language.{{</* /tab */>}}
|
||||
{{</* tab */>}}**TOML**: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.{{</* /tab */>}}
|
||||
|
||||
{{</* /tabs */>}}
|
||||
```
|
||||
|
||||
### 指定索引
|
||||
|
||||
使用 `defaultIndex` 属性指定选定的选项卡。索引从 0 开始。
|
||||
|
||||
```
|
||||
{{</* tabs items="JSON,YAML,TOML" defaultIndex="1" */>}}
|
||||
|
||||
{{</* tab */>}}**JSON**: JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax.{{</* /tab */>}}
|
||||
{{</* tab */>}}**YAML**: YAML is a human-readable data serialization language.{{</* /tab */>}}
|
||||
{{</* tab */>}}**TOML**: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.{{</* /tab */>}}
|
||||
|
||||
{{</* /tabs */>}}
|
||||
```
|
||||
|
||||
默认为 `YAML`
|
||||
|
||||
{{< tabs items="JSON,YAML,TOML" defaultIndex="1" >}}
|
||||
|
||||
{{< tab >}}**JSON**: JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax.{{< /tab >}}
|
||||
{{< tab >}}**YAML**: YAML is a human-readable data serialization language.{{< /tab >}}
|
||||
{{< tab >}}**TOML**: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.{{< /tab >}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
### 使用 Markdown
|
||||
|
||||
还支持包括代码块的 Markdown 语法:
|
||||
|
||||
````
|
||||
{{</* tabs items="JSON,YAML,TOML" */>}}
|
||||
|
||||
{{</* tab */>}}
|
||||
```json
|
||||
{ "hello": "world" }
|
||||
```
|
||||
{{</* /tab */>}}
|
||||
|
||||
... add other tabs similarly
|
||||
|
||||
{{</* /tabs */>}}
|
||||
````
|
||||
|
||||
{{< tabs items="JSON,YAML,TOML" >}}
|
||||
|
||||
{{< tab >}}
|
||||
```json
|
||||
{ "hello": "world" }
|
||||
```
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab >}}
|
||||
```yaml
|
||||
hello: world
|
||||
```
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab >}}
|
||||
```toml
|
||||
hello = "world"
|
||||
```
|
||||
{{< /tab >}}
|
||||
|
||||
{{< /tabs >}}
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Showcase
|
||||
description: "Open source projects powered by Hextra."
|
||||
description: "Open source projects powered by Hextra"
|
||||
toc: false
|
||||
layout: wide
|
||||
---
|
||||
@ -8,13 +8,70 @@ layout: wide
|
||||
<div class="hx-mt-4"></div>
|
||||
|
||||
<p class="hx-mb-12 hx-text-center hx-text-lg hx-text-gray-500 dark:hx-text-gray-400">
|
||||
Open source projects powered by Hextra.
|
||||
Open source projects powered by Hextra
|
||||
</p>
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="https://developers.osuny.org" title="Osuny" image="https://raw.githubusercontent.com/noesya/osuny-developers/main/static/images/showcase-hextra/screenshot.png" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
{{< card link="https://porter.sh/" title="Porter" image="https://repository-images.githubusercontent.com/155893691/aa249c80-fcf3-11ea-93b0-30079e8d7de4" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
{{< card link="https://lutheranconfessions.org/" title="LutheranConfessions" image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
{{< card link="https://github.com/imfing/hextra-starter-template/" title="Hextra Starter Template" image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
{{< card link="https://developers.clever-cloud.com/" title="Clever Cloud Documentation" image="https://cellar-c2.services.clever-cloud.com/documentation/doc-screenshot.png" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/infracourse/web"
|
||||
title="Stanford CS 40"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/8c29470b-3994-41c8-be9a-5b41476e6f3c"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/helixml/docs"
|
||||
title="Helix Docs"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/78045af0-4922-4358-ae73-624770909db6"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://developers.clever-cloud.com/"
|
||||
title="Clever Cloud Documentation"
|
||||
image="https://cellar-c2.services.clever-cloud.com/documentation/doc-screenshot.png" imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://owaspai.org/"
|
||||
title="OWASP AI Security and Privacy Guide"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/fbb1d3a5-a0e8-4cfc-88cf-3523b0176c89"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://developers.osuny.org"
|
||||
title="Osuny"
|
||||
image="https://raw.githubusercontent.com/noesya/osuny-developers/main/static/images/showcase-hextra/screenshot.png"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card link="https://porter.sh/"
|
||||
title="Porter"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/401abc3a-b4c3-4336-b95a-a6dd9afbc1de"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://hoa.moe/"
|
||||
title="HITSZ OpenAuto"
|
||||
image="https://raw.githubusercontent.com/HITSZ-OpenAuto/hoa.moe/main/static/images/showcase-new.png"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://lutheranconfessions.org/"
|
||||
title="LutheranConfessions"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/imfing/hextra-starter-template/"
|
||||
title="Hextra Starter Template"
|
||||
image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< /cards >}}
|
||||
|
@ -12,8 +12,66 @@ layout: wide
|
||||
</p>
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="https://developers.osuny.org" title="Osuny" image="https://raw.githubusercontent.com/noesya/osuny-developers/main/static/images/showcase-hextra/screenshot.png" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
{{< card link="https://porter.sh/" title="Porter" image="https://repository-images.githubusercontent.com/155893691/aa249c80-fcf3-11ea-93b0-30079e8d7de4" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
{{< card link="https://lutheranconfessions.org/" title="LutheranConfessions" image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
{{< card link="https://github.com/imfing/hextra-starter-template" title="Hextra Starter Template" image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/infracourse/web"
|
||||
title="Stanford CS 40"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/8c29470b-3994-41c8-be9a-5b41476e6f3c"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/helixml/docs"
|
||||
title="Helix Docs"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/78045af0-4922-4358-ae73-624770909db6"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://developers.clever-cloud.com/"
|
||||
title="Clever Cloud Documentation"
|
||||
image="https://cellar-c2.services.clever-cloud.com/documentation/doc-screenshot.png" imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://owaspai.org/"
|
||||
title="OWASP AI Security and Privacy Guide"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/fbb1d3a5-a0e8-4cfc-88cf-3523b0176c89"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://developers.osuny.org"
|
||||
title="Osuny"
|
||||
image="https://raw.githubusercontent.com/noesya/osuny-developers/main/static/images/showcase-hextra/screenshot.png"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card link="https://porter.sh/"
|
||||
title="Porter"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/401abc3a-b4c3-4336-b95a-a6dd9afbc1de"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://hoa.moe/"
|
||||
title="HITSZ OpenAuto"
|
||||
image="https://raw.githubusercontent.com/HITSZ-OpenAuto/hoa.moe/main/static/images/showcase-new.png"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://lutheranconfessions.org/"
|
||||
title="LutheranConfessions"
|
||||
image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< card
|
||||
link="https://github.com/imfing/hextra-starter-template/"
|
||||
title="Hextra Starter Template"
|
||||
image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg"
|
||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||
>}}
|
||||
|
||||
{{< /cards >}}
|
||||
|
@ -136,7 +136,7 @@ params:
|
||||
flexsearch:
|
||||
# index page by: content | summary | heading | title
|
||||
index: content
|
||||
# full | forward | reverse | strict
|
||||
# full | forward | reverse | strict
|
||||
# https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search
|
||||
tokenize: forward
|
||||
|
||||
@ -147,6 +147,9 @@ params:
|
||||
blog:
|
||||
list:
|
||||
displayTags: true
|
||||
# date | lastmod | publishDate | title | weight
|
||||
sortBy: date
|
||||
sortOrder: desc # or "asc"
|
||||
|
||||
comments:
|
||||
enable: false
|
||||
|
@ -208,11 +208,15 @@
|
||||
"group-open:before:hx-rotate-90",
|
||||
"hamburger-menu",
|
||||
"hextra-card",
|
||||
"hextra-card-icon",
|
||||
"hextra-card-image",
|
||||
"hextra-card-subtitle",
|
||||
"hextra-cards",
|
||||
"hextra-code-block",
|
||||
"hextra-code-copy-btn",
|
||||
"hextra-code-copy-btn-container",
|
||||
"hextra-feature-card",
|
||||
"hextra-feature-grid",
|
||||
"hextra-filetree",
|
||||
"hextra-filetree-folder",
|
||||
"hextra-footer",
|
||||
@ -300,7 +304,6 @@
|
||||
"hx-gap-x-1.5",
|
||||
"hx-gap-y-2",
|
||||
"hx-grid",
|
||||
"hx-grid-cols-1",
|
||||
"hx-group",
|
||||
"hx-group/code",
|
||||
"hx-group/copybtn",
|
||||
@ -506,7 +509,6 @@
|
||||
"language-options",
|
||||
"language-switcher",
|
||||
"last-of-type:hx-mb-0",
|
||||
"lg:hx-grid-cols-3",
|
||||
"lntable",
|
||||
"lntd",
|
||||
"ltr:before:hx-left-0",
|
||||
@ -536,6 +538,7 @@
|
||||
"max-md:[transform:translate3d(0,-100%,0)]",
|
||||
"max-md:hx-hidden",
|
||||
"max-md:hx-min-h-[340px]",
|
||||
"max-sm:hx-grid-cols-1",
|
||||
"max-xl:hx-hidden",
|
||||
"md:hx-aspect-[1.1/1]",
|
||||
"md:hx-h-[calc(100vh-var(--navbar-height)-var(--menu-height))]",
|
||||
@ -593,10 +596,10 @@
|
||||
"sidebar-container",
|
||||
"sm:hx-block",
|
||||
"sm:hx-flex",
|
||||
"sm:hx-grid-cols-2",
|
||||
"sm:hx-items-start",
|
||||
"sm:hx-text-xl",
|
||||
"sm:hx-w-[110%]",
|
||||
"sm:max-lg:hx-grid-cols-2",
|
||||
"steps",
|
||||
"subheading-anchor",
|
||||
"success-icon",
|
||||
|
6
exampleSite/layouts/partials/custom/head-end.html
Normal file
6
exampleSite/layouts/partials/custom/head-end.html
Normal file
@ -0,0 +1,6 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/quicklink/2.3.0/quicklink.umd.js"></script>
|
||||
<script>
|
||||
window.addEventListener("load", () => {
|
||||
quicklink.listen();
|
||||
});
|
||||
</script>
|
@ -2,7 +2,7 @@ backToTop: "Zpět nahoru"
|
||||
changeLanguage: "Změnit jazyk"
|
||||
changeTheme: "Změnit vzhled"
|
||||
copyCode: "Zkopírovat kód"
|
||||
copyright: "© 2023 Hextra Project."
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "Tmavý"
|
||||
editThisPage: "Upravit tuto stránku na GitHubu →"
|
||||
lastUpdated: "Naposledy změněno"
|
||||
|
@ -2,7 +2,7 @@ backToTop: "Scroll to top"
|
||||
changeLanguage: "Change language"
|
||||
changeTheme: "Change theme"
|
||||
copyCode: "Copy code"
|
||||
copyright: "© 2023 Hextra Project."
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "Dark"
|
||||
editThisPage: "Edit this page on GitHub →"
|
||||
lastUpdated: "Last updated on"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "Subir al inicio"
|
||||
changeLanguage: "Cambiar idioma"
|
||||
changeTheme: "Cambiar tema"
|
||||
copyright: "© 2023 Proyecto Hextra."
|
||||
copyright: "© 2024 Proyecto Hextra."
|
||||
dark: "Oscuro"
|
||||
editThisPage: "Edita esta página en GitHub →"
|
||||
lastUpdated: "Última actualización"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "Revenir en haut"
|
||||
changeLanguage: "Changer la langue"
|
||||
changeTheme: "Thème d'affichage"
|
||||
copyright: "© 2023 Hextra Project."
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "Sombre"
|
||||
editThisPage: "Modifier cette page sur GitHub →"
|
||||
lastUpdated: "Dernière modification"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "トップにスクロール"
|
||||
changeLanguage: "言語を変更"
|
||||
changeTheme: "テーマを変更"
|
||||
copyright: "© 2023 Hextra プロジェクト。"
|
||||
copyright: "© 2024 Hextra プロジェクト。"
|
||||
dark: "ダーク"
|
||||
editThisPage: "このページをGitHubで編集 →"
|
||||
lastUpdated: "最終更新日"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "맨위로 스크롤"
|
||||
changeLanguage: "언어변경"
|
||||
changeTheme: "테마변경"
|
||||
copyright: "© 2023 Hextra Project."
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "어두운 테마"
|
||||
editThisPage: "Github에서 편집하기 →"
|
||||
lastUpdated: "마지막 수정일자"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "Gå til toppen"
|
||||
changeLanguage: "Endre språk"
|
||||
changeTheme: "Endre tema"
|
||||
copyright: "© 2023 Hextra-prosjektet."
|
||||
copyright: "© 2024 Hextra-prosjektet."
|
||||
dark: "Mørk"
|
||||
editThisPage: "Rediger denne siden på GitHub →"
|
||||
lastUpdated: "Sist oppdatert"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "Gå til toppen"
|
||||
changeLanguage: "Endre språk"
|
||||
changeTheme: "Endre tema"
|
||||
copyright: "© 2023 Hextra-prosjektet."
|
||||
copyright: "© 2024 Hextra-prosjektet."
|
||||
dark: "Mørk"
|
||||
editThisPage: "Rediger denne sida på GitHub →"
|
||||
lastUpdated: "Sist oppdatert"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "Voltar ao topo"
|
||||
changeLanguage: "Mudar a língua"
|
||||
changeTheme: "Mudar tema"
|
||||
copyright: "© 2023 Projecto Hextra."
|
||||
copyright: "© 2024 Projecto Hextra."
|
||||
dark: "Escuro"
|
||||
editThisPage: "Edita esta página no GitHub →"
|
||||
lastUpdated: "Última modificação"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "Tembeza hadi juu"
|
||||
changeLanguage: "Badilisha lugha"
|
||||
changeTheme: "Badilisha mandhari"
|
||||
copyright: "© 2023 Hextra Project."
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "Meusi"
|
||||
editThisPage: "Hariri ukurasa huu kwenye GitHub →"
|
||||
lastUpdated: "Ilisasishwa mwisho"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "Lướt lên đầu trang"
|
||||
changeLanguage: "Đổi ngôn ngữ"
|
||||
changeTheme: "Đổi chủ đề"
|
||||
copyright: "© 2023 Hextra Project."
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "Tối"
|
||||
editThisPage: "Sửa trang này trên GitHub →"
|
||||
lastUpdated: "Lần cuối cập nhật lúc"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "返回顶部"
|
||||
changeLanguage: "切换语言"
|
||||
changeTheme: "切换主题"
|
||||
copyright: "© 2023 Hextra Project."
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "深色"
|
||||
editThisPage: "在 GitHub 上编辑此页 →"
|
||||
lastUpdated: "最后更新于"
|
||||
|
@ -1,7 +1,7 @@
|
||||
backToTop: "返回頂部"
|
||||
changeLanguage: "切換語言"
|
||||
changeTheme: "切換主題"
|
||||
copyright: "© 2023 Hextra Project."
|
||||
copyright: "© 2024 Hextra Project."
|
||||
dark: "深色"
|
||||
editThisPage: "在 GitHub 上編輯此頁 →"
|
||||
lastUpdated: "最後更新於"
|
||||
|
@ -7,6 +7,6 @@
|
||||
{{- if or (eq .Site.Params.footer.enable nil) (.Site.Params.footer.enable) }}
|
||||
{{ partial "footer.html" . }}
|
||||
{{ end }}
|
||||
{{ partial "scripts.html" . }}
|
||||
</body>
|
||||
{{ partial "scripts.html" . }}
|
||||
</html>
|
||||
|
@ -7,7 +7,8 @@
|
||||
<br class="hx-mt-1.5 hx-text-sm" />
|
||||
<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>
|
||||
{{ range .Pages.ByDate.Reverse }}
|
||||
{{- $pages := partial "utils/sort-pages" (dict "page" . "by" site.Params.blog.list.sortBy "order" site.Params.blog.list.sortOrder) -}}
|
||||
{{- range $pages }}
|
||||
<div class="hx-mb-10">
|
||||
<h3><a style="color: inherit; text-decoration: none;" class="hx-block hx-font-semibold hx-mt-8 hx-text-2xl " href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
||||
{{- if site.Params.blog.list.displayTags -}}
|
||||
@ -25,9 +26,9 @@
|
||||
</p>
|
||||
<p class="hx-opacity-50 hx-text-sm hx-mt-4 hx-leading-7">{{ partial "utils/format-date" .Date }}</p>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
</main>
|
||||
</article>
|
||||
<div class="max-xl:hx-hidden hx-h-0 hx-w-64 hx-shrink-0"></div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
12
layouts/partials/components/sidebar/bottom.html
Normal file
12
layouts/partials/components/sidebar/bottom.html
Normal file
@ -0,0 +1,12 @@
|
||||
{{- range site.Menus.sidebar }}
|
||||
{{- $name := or (T .Identifier) .Name }}
|
||||
{{- if eq .Params.type "separator" }}
|
||||
<li class="[word-break:break-word] hx-mt-5 hx-mb-2 hx-px-2 hx-py-1.5 hx-text-sm hx-font-semibold hx-text-gray-900 first:hx-mt-0 dark:hx-text-gray-100">
|
||||
<span class="hx-cursor-default">{{ $name }}</span>
|
||||
</li>
|
||||
{{- else }}
|
||||
<li>
|
||||
{{- partial "components/sidebar/item-link" (dict "active" false "title" $name "link" (.URL | relLangURL)) -}}
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end -}}
|
@ -0,0 +1,5 @@
|
||||
<span class="hextra-sidebar-collapsible-button">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="hx-h-[18px] hx-min-w-[18px] hx-rounded-sm hx-p-0.5 hover:hx-bg-gray-800/5 dark:hover:hx-bg-gray-100/5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" class="hx-origin-center hx-transition-transform rtl:-hx-rotate-180"></path>
|
||||
</svg>
|
||||
</span>
|
@ -0,0 +1,51 @@
|
||||
{{- $context := . -}}
|
||||
|
||||
{{- $pages := union .RegularPages .Sections -}}
|
||||
{{- $pages = where $pages "Params.sidebar.exclude" "!=" true -}}
|
||||
|
||||
{{- $data := slice -}}
|
||||
|
||||
{{- range $pages.ByWeight -}}
|
||||
{{ $structure := (partial "sidebar/section-walk" .) | unmarshal -}}
|
||||
{{ $data = $data | append $structure -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- define "partials/sidebar/section-walk" -}}
|
||||
{{- with . -}}
|
||||
{
|
||||
"title": "{{ partial "utils/title" . }}",
|
||||
"link": "{{ .RelPermalink }}",
|
||||
"toc": {{ partial "sidebar/section-page-toc" . }},
|
||||
"open": {{ .Params.sidebar.open | default false }}
|
||||
{{- if .IsSection }},
|
||||
"items": [
|
||||
{{ $pages := union .RegularPages .Sections -}}
|
||||
{{ $pages = where $pages "Params.sidebar.exclude" "!=" true -}}
|
||||
{{ range $index, $page := $pages.ByWeight -}}
|
||||
{{ partial "sidebar/section-walk" . }}{{ if not (ge $index (sub (len $pages) 1)) }},{{ end -}}
|
||||
{{ end -}}
|
||||
]
|
||||
{{ end -}}
|
||||
}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "partials/sidebar/section-page-toc" -}}
|
||||
{{/* Get level 2 headings list used mainly for mobile navigation */}}
|
||||
[
|
||||
{{- with .Fragments.Headings -}}
|
||||
{{/* Loop over level 1 headings */}}
|
||||
{{- range . }}
|
||||
{{- with .Headings }}
|
||||
{{ $headings := . }}
|
||||
{{- range $index, $heading := $headings }}
|
||||
{{ $heading.Title | jsonify (dict "noHTMLEscape" true) }}
|
||||
{{- if not (ge $index (sub (len $headings) 1)) }},{{ end -}}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
]
|
||||
{{- end -}}
|
||||
|
||||
{{ return ($data | jsonify (dict "noHTMLEscape" true)) }}
|
20
layouts/partials/components/sidebar/get-section-data.html
Normal file
20
layouts/partials/components/sidebar/get-section-data.html
Normal file
@ -0,0 +1,20 @@
|
||||
{{/* Get section sidebar config from Hugo `data` directory
|
||||
|
||||
If the site is multilingual, the sidebar data is stored in a language-specific
|
||||
directory. For example, the English sidebar data is stored in `data/en/sidebar.yaml`.
|
||||
*/}}
|
||||
{{ $data := "" }}
|
||||
{{ $section := .Section | default "index" }}
|
||||
{{ $filename := "sidebar" }}
|
||||
|
||||
{{ if hugo.IsMultilingual }}
|
||||
{{ with (index site.Data site.Language.Lang $filename $section) }}
|
||||
{{ $data = . }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ with (index site.Data $filename $section) }}
|
||||
{{ $data = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $data }}
|
18
layouts/partials/components/sidebar/item-link.html
Normal file
18
layouts/partials/components/sidebar/item-link.html
Normal file
@ -0,0 +1,18 @@
|
||||
{{- $external := strings.HasPrefix .link "http" -}}
|
||||
|
||||
{{- $activeClass := cond (.active) "active" "inactive" -}}
|
||||
|
||||
|
||||
<a
|
||||
class="hextra-sidebar-item-link {{ $activeClass }} [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] [word-break:break-word]"
|
||||
href="{{ .link }}"
|
||||
{{ if $external }}target="_blank" rel="noreferer"{{ end }}
|
||||
>
|
||||
{{- .title -}}
|
||||
{{- with .context }}
|
||||
{{- if or .RegularPages .Sections }}
|
||||
{{- partialCached "components/sidebar/collapsible-button" . }}
|
||||
{{- end }}
|
||||
{{ end -}}
|
||||
{{- with .items }}{{- partialCached "components/sidebar/collapsible-button" site.Home }}{{ end -}}
|
||||
</a>
|
16
layouts/partials/components/sidebar/render-data.html
Normal file
16
layouts/partials/components/sidebar/render-data.html
Normal file
@ -0,0 +1,16 @@
|
||||
{{- $page := .page -}}
|
||||
{{- $pageLink := $page.RelPermalink -}}
|
||||
{{- $cached := .cached | default false }}
|
||||
|
||||
{{- range .data -}}
|
||||
{{- $active := and (not $cached) (or (eq $pageLink .link) (eq (strings.TrimSuffix "/" $pageLink) .link)) -}}
|
||||
{{- $containsPage := hasPrefix $pageLink .link -}}
|
||||
{{- $shouldOpen := or (.open) $containsPage $active | default false -}}
|
||||
|
||||
<li class="hextra-sidebar-item {{ if $shouldOpen }}open{{ end }}">
|
||||
{{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
|
||||
{{- if .items -}}
|
||||
{{- partial "components/sidebar/render-items" (dict "items" .items "link" $pageLink "cached" $cached) -}}
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{ end }}
|
21
layouts/partials/components/sidebar/render-items.html
Normal file
21
layouts/partials/components/sidebar/render-items.html
Normal file
@ -0,0 +1,21 @@
|
||||
{{- $items := .items -}}
|
||||
{{- $pageLink := .link -}}
|
||||
{{- $cached := .cached | default false }}
|
||||
|
||||
|
||||
<div class="ltr:hx-pr-0 hx-overflow-hidden">
|
||||
<ul class="hextra-sidebar-item-list">
|
||||
{{- range $items }}
|
||||
{{- $active := and (not $cached) (or (eq $pageLink .link) (eq (strings.TrimSuffix "/" $pageLink) .link)) -}}
|
||||
{{- $containsPage := hasPrefix $pageLink .link -}}
|
||||
{{- $shouldOpen := or (.open) $containsPage $active | default false -}}
|
||||
|
||||
<li class="hextra-sidebar-item hx-flex hx-flex-col {{ if $shouldOpen }}open{{ end }}">
|
||||
{{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
|
||||
{{- if .items -}}
|
||||
{{- partial "components/sidebar/render-items" (dict "items" .items "link" $pageLink "cached" $cached) -}}
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
</div>
|
@ -1,7 +1,7 @@
|
||||
{{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}}
|
||||
{{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}}
|
||||
|
||||
{{- $copyright := (T "copyright") | default "© 2023 Hextra." -}}
|
||||
{{- $copyright := (T "copyright") | default "© 2024 Hextra." -}}
|
||||
{{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}}
|
||||
|
||||
{{- $footerWidth := "hx-max-w-screen-xl" -}}
|
||||
|
@ -4,7 +4,7 @@
|
||||
{{- $jsLang := resources.Get "js/lang.js" -}}
|
||||
{{- $jsCodeCopy := resources.Get "js/code-copy.js" -}}
|
||||
{{- $jsFileTree := resources.Get "js/filetree.js" -}}
|
||||
{{- $jsSidebar := resources.Get "js/sidebar.js" -}}
|
||||
{{- $jsSidebar := resources.Get "js/sidebar.js" | resources.ExecuteAsTemplate "sidebar.js" . -}}
|
||||
{{- $jsBackToTop := resources.Get "js/back-to-top.js" -}}
|
||||
|
||||
{{- $scripts := slice $jsTheme $jsMenu $jsCodeCopy $jsTabs $jsLang $jsFileTree $jsSidebar $jsBackToTop | resources.Concat "js/main.js" -}}
|
||||
|
54
layouts/partials/shortcodes/card.html
Normal file
54
layouts/partials/shortcodes/card.html
Normal file
@ -0,0 +1,54 @@
|
||||
{{- $page := .page -}}
|
||||
{{- $link := .link -}}
|
||||
{{- $title := .title -}}
|
||||
{{- $icon := .icon -}}
|
||||
{{- $subtitle := .subtitle -}}
|
||||
{{- $image := .image -}}
|
||||
{{- $width := .width -}}
|
||||
{{- $height := .height -}}
|
||||
{{- $imageStyle := .imageStyle -}}
|
||||
|
||||
{{ $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 -}}
|
||||
{{ $linkClass = "hover:hx-border-gray-300 hx-bg-gray-100 hx-shadow dark:hx-border-neutral-700 dark:hx-bg-neutral-800 dark:hx-text-gray-50 hover:hx-shadow-lg dark:hover:hx-border-neutral-500 dark:hover:hx-bg-neutral-700" }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $external := strings.HasPrefix $link "http" -}}
|
||||
{{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}}
|
||||
|
||||
|
||||
<a
|
||||
class="hextra-card hx-group hx-flex hx-flex-col hx-justify-start hx-overflow-hidden hx-rounded-lg hx-border hx-border-gray-200 hx-text-current hx-no-underline dark:hx-shadow-none hover:hx-shadow-gray-100 dark:hover:hx-shadow-none hx-shadow-gray-100 active:hx-shadow-sm active:hx-shadow-gray-200 hx-transition-all hx-duration-200 {{ $linkClass }}"
|
||||
{{- if $link -}}
|
||||
href="{{ $href }}"
|
||||
{{ with $external }}target="_blank" rel="noreferrer"{{ end -}}
|
||||
{{- end -}}
|
||||
>
|
||||
{{- with $image -}}
|
||||
<img
|
||||
alt="{{ $title }}"
|
||||
class="hextra-card-image"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
src="{{ $image | safeURL }}"
|
||||
{{ with $width }}width="{{ . }}"{{ end }}
|
||||
{{ with $height }}height="{{ . }}"{{ end }}
|
||||
{{ with $imageStyle }}style="{{ . | safeCSS }}"{{ end }}
|
||||
/>
|
||||
{{- end -}}
|
||||
|
||||
{{- $padding := "hx-p-4" -}}
|
||||
{{- with $subtitle -}}
|
||||
{{- $padding = "hx-pt-4 hx-px-4" -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<span class="hextra-card-icon hx-flex hx-font-semibold hx-items-start hx-gap-2 {{ $padding }} hx-text-gray-700 hover:hx-text-gray-900 dark:hx-text-neutral-200 dark:hover:hx-text-neutral-50">
|
||||
{{- with $icon }}{{ partial "utils/icon.html" (dict "name" $icon) -}}{{- end -}}
|
||||
{{- $title -}}
|
||||
</span>
|
||||
{{- 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 -}}
|
||||
</a>
|
||||
{{- /* Strip trailing newline. */ -}}
|
95
layouts/partials/sidebar-ng.html
Normal file
95
layouts/partials/sidebar-ng.html
Normal file
@ -0,0 +1,95 @@
|
||||
{{- $context := .context -}}
|
||||
|
||||
{{- $disableSidebar := .disableSidebar | default false -}}
|
||||
{{- $displayPlaceholder := .displayPlaceholder | default false -}}
|
||||
|
||||
{{- $sidebarClass := cond $disableSidebar (cond $displayPlaceholder "md:hx-hidden xl:hx-block" "md:hx-hidden") "md:hx-sticky" -}}
|
||||
|
||||
{{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}}
|
||||
{{- $pageURL := $context.RelPermalink -}}
|
||||
|
||||
{{- $data := slice -}}
|
||||
{{- $dataMobile := slice -}}
|
||||
|
||||
{{- if (eq site.Params.page.sidebar.source "data") -}}
|
||||
{{ $data = partialCached "components/sidebar/get-section-data" $context $context.Section }}
|
||||
{{- $dataMobile = $data -}}
|
||||
{{- else -}}
|
||||
{{- $data = (partialCached "components/sidebar/generate-section-data" $navRoot $navRoot) | unmarshal -}}
|
||||
{{- $dataMobile = (partialCached "components/sidebar/generate-section-data" site.Home site.Home) | unmarshal -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $shouldCache := site.Params.page.sidebar.cache | default false -}}
|
||||
|
||||
{{/* EXPERIMENTAL */}}
|
||||
{{- if .context.Params.sidebar.hide -}}
|
||||
{{- $disableSidebar = true -}}
|
||||
{{- $displayPlaceholder = true -}}
|
||||
{{- end -}}
|
||||
|
||||
<div class="mobile-menu-overlay [transition:background-color_1.5s_ease] hx-fixed hx-inset-0 hx-z-10 hx-bg-black/80 dark:hx-bg-black/60 hx-hidden"></div>
|
||||
|
||||
<aside class="hextra-sidebar-container hx-flex hx-flex-col print:hx-hidden md:hx-top-16 md:hx-shrink-0 md:hx-w-64 md:hx-self-start max-md:[transform:translate3d(0,-100%,0)] {{ $sidebarClass }}">
|
||||
{{/* Search bar on small screen */}}
|
||||
{{- partialCached "components/sidebar/mobile-search" . -}}
|
||||
|
||||
|
||||
<div class="hextra-scrollbar hx-overflow-y-auto hx-overflow-x-hidden hx-p-4 hx-grow md:hx-h-[calc(100vh-var(--navbar-height)-var(--menu-height))]">
|
||||
{{/* Mobile Navigation */}}
|
||||
<ul class="hx-flex hx-flex-col hx-gap-1 md:hx-hidden">
|
||||
{{- with $dataMobile -}}
|
||||
{{- partial "components/sidebar/render-data" (dict "data" . "page" $context) -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
|
||||
{{/* Sidebar on large screen */}}
|
||||
{{- if $disableSidebar -}}
|
||||
{{- if $displayPlaceholder }}<div class="max-xl:hx-hidden hx-h-0 hx-w-64 hx-shrink-0"></div>{{ end -}}
|
||||
{{ .context.Scratch.Set "enableFooterSwitches" true }}
|
||||
{{- else -}}
|
||||
<ul class="hx-flex hx-flex-col hx-gap-1 max-md:hx-hidden">
|
||||
{{- with $data -}}
|
||||
{{- if $shouldCache -}}
|
||||
{{- partialCached "components/sidebar/render-data" (dict "data" . "page" $context "cached" $shouldCache) $navRoot -}}
|
||||
{{- else -}}
|
||||
{{- partial "components/sidebar/render-data" (dict "data" . "page" $context "cached" $shouldCache) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- partialCached "components/sidebar/bottom" $context site.Home -}}
|
||||
</ul>
|
||||
{{ end -}}
|
||||
</div>
|
||||
{{- partial "components/sidebar/switches" (dict "context" $context "disableSidebar" $disableSidebar) -}}
|
||||
</aside>
|
||||
|
||||
{{- define "partials/components/sidebar/mobile-search" -}}
|
||||
<div class="hx-px-4 hx-pt-4 md:hx-hidden">
|
||||
{{- partialCached "search.html" . -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- define "partials/components/sidebar/switches" -}}
|
||||
{{- $context := .context -}}
|
||||
{{- $disableSidebar := .disableSidebar -}}
|
||||
{{/* Hide theme switch when sidebar is disabled */}}
|
||||
{{ $switchesClass := cond $disableSidebar "md:hx-hidden" "" -}}
|
||||
{{ $displayThemeToggle := (site.Params.theme.displayToggle | default true) -}}
|
||||
|
||||
{{ if or site.IsMultiLingual $displayThemeToggle }}
|
||||
<div
|
||||
class="{{ $switchesClass }} {{ with site.IsMultiLingual }}
|
||||
hx-justify-end
|
||||
{{ end }} hx-sticky hx-bottom-0 hx-bg-white dark:hx-bg-dark hx-mx-4 hx-py-4 hx-shadow-[0_-12px_16px_#fff] hx-flex hx-items-center hx-gap-2 dark:hx-border-neutral-800 dark:hx-shadow-[0_-12px_16px_#111] contrast-more:hx-border-neutral-400 contrast-more:hx-shadow-none contrast-more:dark:hx-shadow-none hx-border-t"
|
||||
data-toggle-animation="show"
|
||||
>
|
||||
{{- with site.IsMultiLingual -}}
|
||||
{{- partial "language-switch" (dict "context" $context "grow" true) -}}
|
||||
{{- with $displayThemeToggle }}{{ partial "theme-toggle" (dict "hideLabel" true) }}{{ end -}}
|
||||
{{- else -}}
|
||||
{{- with $displayThemeToggle -}}
|
||||
<div class="hx-flex hx-grow hx-flex-col">{{ partial "theme-toggle" }}</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
21
layouts/partials/utils/file-path.html
Normal file
21
layouts/partials/utils/file-path.html
Normal file
@ -0,0 +1,21 @@
|
||||
{{/* This utility is used to get the file path from absolute, relative path or URL. */}}
|
||||
|
||||
{{- $path := .path -}}
|
||||
{{- $page := .page -}}
|
||||
|
||||
{{- $isLocal := not (urls.Parse $path).Scheme -}}
|
||||
{{- $isPage := and (eq $page.Kind "page") (not $page.BundleType) -}}
|
||||
{{- $startsWithSlash := hasPrefix $path "/" -}}
|
||||
{{- $startsWithRelative := hasPrefix $path "../" -}}
|
||||
|
||||
{{- if and $path $isLocal -}}
|
||||
{{- if $startsWithSlash -}}
|
||||
{{/* File under static directory */}}
|
||||
{{- $path = (relURL (strings.TrimPrefix "/" $path)) -}}
|
||||
{{- else if and $isPage (not $startsWithRelative) -}}
|
||||
{{/* File is a sibling to the individual page file */}}
|
||||
{{ $path = (printf "../%s" $path) }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $path -}}
|
32
layouts/partials/utils/sort-pages.html
Normal file
32
layouts/partials/utils/sort-pages.html
Normal file
@ -0,0 +1,32 @@
|
||||
{{- $page := .page -}}
|
||||
{{- $by := .by | default "weight" -}}
|
||||
{{- $order := .order | default "asc" -}}
|
||||
|
||||
{{- $pages := slice }}
|
||||
|
||||
{{- if eq $by "weight" }}
|
||||
{{- $pages = $page.Pages.ByWeight }}
|
||||
{{- else if eq $by "date" }}
|
||||
{{- $pages = $page.Pages.ByDate }}
|
||||
{{- else if eq $by "title" }}
|
||||
{{- $pages = $page.Pages.ByTitle }}
|
||||
{{- else if eq $by "expiryDate" }}
|
||||
{{- $pages = $page.Pages.ByExpiryDate }}
|
||||
{{- else if eq $by "publishDate" }}
|
||||
{{- $pages = $page.Pages.ByPublishDate }}
|
||||
{{- else if eq $by "lastmod" }}
|
||||
{{- $pages = $page.Pages.ByLastmod }}
|
||||
{{- else if eq $by "linkTitle" }}
|
||||
{{- $pages = $page.Pages.ByLinkTitle }}
|
||||
{{- else if eq $by "length" }}
|
||||
{{- $pages = $page.Pages.ByLength }}
|
||||
{{- else }}
|
||||
{{- warnf "sort-pages: unknown sort field %q" $by -}}
|
||||
{{- $pages = $page.Pages }}
|
||||
{{ end -}}
|
||||
|
||||
{{- if eq $order "desc" }}
|
||||
{{- $pages = $pages.Reverse }}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $pages -}}
|
@ -31,7 +31,7 @@
|
||||
|
||||
<div class="hx-w-full hx-min-w-0 hx-leading-7">
|
||||
<div class="hx-mt-6 hx-leading-7 first:hx-mt-0">
|
||||
{{ .Inner | markdownify }}
|
||||
{{ .InnerDeindent | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -38,45 +38,15 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $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 -}}
|
||||
{{ $linkClass = "hover:hx-border-gray-300 hx-bg-gray-100 hx-shadow dark:hx-border-neutral-700 dark:hx-bg-neutral-800 dark:hx-text-gray-50 hover:hx-shadow-lg dark:hover:hx-border-neutral-500 dark:hover:hx-bg-neutral-700" }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $external := strings.HasPrefix $link "http" -}}
|
||||
{{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}}
|
||||
|
||||
|
||||
<a
|
||||
class="hextra-card hx-group hx-flex hx-flex-col hx-justify-start hx-overflow-hidden hx-rounded-lg hx-border hx-border-gray-200 hx-text-current hx-no-underline dark:hx-shadow-none hover:hx-shadow-gray-100 dark:hover:hx-shadow-none hx-shadow-gray-100 active:hx-shadow-sm active:hx-shadow-gray-200 hx-transition-all hx-duration-200 {{ $linkClass }}"
|
||||
{{- if $link -}}
|
||||
href="{{ $href }}" {{ with $external }}target="_blank" rel="noreferrer"{{ end -}}
|
||||
{{- end -}}
|
||||
>
|
||||
{{- with $image -}}
|
||||
<img
|
||||
alt="{{ $title }}"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
src="{{ $image | safeURL }}"
|
||||
{{ with $width }}width="{{ . }}"{{ end }}
|
||||
{{ with $height }}height="{{ . }}"{{ end }}
|
||||
{{ with $imageStyle }}style="{{ . | safeCSS }}"{{ end }}
|
||||
/>
|
||||
{{- end -}}
|
||||
|
||||
{{- $padding := "hx-p-4" -}}
|
||||
{{- with $subtitle -}}
|
||||
{{- $padding = "hx-pt-4 hx-px-4" -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<span class="hx-flex hx-font-semibold hx-items-start hx-gap-2 {{ $padding }} hx-text-gray-700 hover:hx-text-gray-900 dark:hx-text-neutral-200 dark:hover:hx-text-neutral-50">
|
||||
{{- with $icon }}{{ partial "utils/icon.html" (dict "name" $icon) -}}{{- end -}}
|
||||
{{- $title -}}
|
||||
</span>
|
||||
{{- with $subtitle -}}
|
||||
<div class="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 -}}
|
||||
</a>
|
||||
{{- /* Strip trailing newline. */ -}}
|
||||
{{- partial "shortcodes/card" (dict
|
||||
"page" .Page
|
||||
"link" $link
|
||||
"title" $title
|
||||
"icon" $icon
|
||||
"subtitle" $subtitle
|
||||
"image" $image
|
||||
"width" $width
|
||||
"height" $height
|
||||
"imageStyle" $imageStyle
|
||||
)
|
||||
-}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{ $rows := .Get "rows" | default "3" }}
|
||||
{{- $cols := .Get "cols" | default 3 -}}
|
||||
|
||||
<div class="hextra-cards hx-mt-4 hx-gap-4 hx-grid not-prose" style="--rows: {{ $rows }};">
|
||||
<div class="hextra-cards hx-mt-4 hx-gap-4 hx-grid not-prose" style="--hextra-cards-grid-cols: {{ $cols }};">
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
|
@ -1,9 +1,12 @@
|
||||
{{- $style := .Get "style" -}}
|
||||
{{- $cols := .Get "cols" | default 3 -}}
|
||||
{{- $style := .Get "style" | default "" -}}
|
||||
|
||||
{{- $css := printf "--hextra-feature-grid-cols: %v; %s" $cols $style -}}
|
||||
|
||||
|
||||
<div
|
||||
class="hx-grid sm:hx-grid-cols-2 lg:hx-grid-cols-3 hx-grid-cols-1 hx-gap-4 hx-w-full not-prose"
|
||||
{{ with $style }}style="{{ . | safeCSS }}"{{ end }}
|
||||
class="hextra-feature-grid hx-grid sm:max-lg:hx-grid-cols-2 max-sm:hx-grid-cols-1 hx-gap-4 hx-w-full not-prose"
|
||||
{{ with $css }}style="{{ . | safeCSS }}"{{ end }}
|
||||
>
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
|
9
layouts/shortcodes/pdf.html
Normal file
9
layouts/shortcodes/pdf.html
Normal file
@ -0,0 +1,9 @@
|
||||
{{/* Shortcode to include a PDF file in a page. */}}
|
||||
|
||||
{{- $path := .Get 0 -}}
|
||||
{{- $url := partial "utils/file-path" (dict "page" .Page "path" $path) -}}
|
||||
|
||||
|
||||
<div class="hextra-pdf">
|
||||
<iframe src="{{ $url | safeURL }}" width="100%" style="min-height: 32rem;" frameborder="0"></iframe>
|
||||
</div>
|
313
package-lock.json
generated
313
package-lock.json
generated
@ -6,13 +6,13 @@
|
||||
"": {
|
||||
"devDependencies": {
|
||||
"@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-cli": "^10.1.0",
|
||||
"postcss-import": "^15.1.0",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-go-template": "^0.0.13",
|
||||
"tailwindcss": "^3.3.2"
|
||||
"autoprefixer": "^10.4.19",
|
||||
"postcss": "^8.4.38",
|
||||
"postcss-cli": "^11.0.0",
|
||||
"postcss-import": "^16.1.0",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-plugin-go-template": "^0.0.15",
|
||||
"tailwindcss": "^3.4.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@alloc/quick-lru": {
|
||||
@ -116,6 +116,18 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@sindresorhus/merge-streams": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz",
|
||||
"integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@tailwindcss/nesting": {
|
||||
"version": "0.0.0-insiders.565cd3e",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/nesting/-/nesting-0.0.0-insiders.565cd3e.tgz",
|
||||
@ -197,9 +209,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/autoprefixer": {
|
||||
"version": "10.4.14",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz",
|
||||
"integrity": "sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==",
|
||||
"version": "10.4.19",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz",
|
||||
"integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -209,12 +221,16 @@
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/autoprefixer"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"browserslist": "^4.21.5",
|
||||
"caniuse-lite": "^1.0.30001464",
|
||||
"fraction.js": "^4.2.0",
|
||||
"browserslist": "^4.23.0",
|
||||
"caniuse-lite": "^1.0.30001599",
|
||||
"fraction.js": "^4.3.7",
|
||||
"normalize-range": "^0.1.2",
|
||||
"picocolors": "^1.0.0",
|
||||
"postcss-value-parser": "^4.2.0"
|
||||
@ -267,9 +283,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.21.9",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz",
|
||||
"integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==",
|
||||
"version": "4.23.0",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",
|
||||
"integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -286,10 +302,10 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30001503",
|
||||
"electron-to-chromium": "^1.4.431",
|
||||
"node-releases": "^2.0.12",
|
||||
"update-browserslist-db": "^1.0.11"
|
||||
"caniuse-lite": "^1.0.30001587",
|
||||
"electron-to-chromium": "^1.4.668",
|
||||
"node-releases": "^2.0.14",
|
||||
"update-browserslist-db": "^1.0.13"
|
||||
},
|
||||
"bin": {
|
||||
"browserslist": "cli.js"
|
||||
@ -308,9 +324,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001587",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001587.tgz",
|
||||
"integrity": "sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==",
|
||||
"version": "1.0.30001610",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001610.tgz",
|
||||
"integrity": "sha512-QFutAY4NgaelojVMjY63o6XlZyORPaLfyMnsl3HgnWdJUcX6K0oaJymHjH8PT5Gk7sTm8rvC/c5COUQKXqmOMA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -428,18 +444,6 @@
|
||||
"integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/dir-glob": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||
"integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"path-type": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/dlv": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz",
|
||||
@ -447,9 +451,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.4.474",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.474.tgz",
|
||||
"integrity": "sha512-GsFT9gtxkFMkpHf13UeN/RFbWdLQVs4DMxA1aQv4xdUAT2qyXEoAQ0hodl2sUvWmztOlicM1UYnNPcoMdzQB5A==",
|
||||
"version": "1.4.738",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.738.tgz",
|
||||
"integrity": "sha512-lwKft2CLFztD+vEIpesrOtCrko/TFnEJlHFdRhazU7Y/jx5qc4cqsocfVrBg4So4gGe9lvxnbLIoev47WMpg+A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
@ -468,9 +472,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz",
|
||||
"integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==",
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
|
||||
"integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "^2.0.2",
|
||||
@ -505,16 +509,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/fraction.js": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz",
|
||||
"integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==",
|
||||
"version": "4.3.7",
|
||||
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz",
|
||||
"integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/infusion"
|
||||
"url": "https://github.com/sponsors/rawify"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
@ -611,31 +615,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/globby": {
|
||||
"version": "13.2.2",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz",
|
||||
"integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==",
|
||||
"version": "14.0.1",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz",
|
||||
"integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"dir-glob": "^3.0.1",
|
||||
"fast-glob": "^3.3.0",
|
||||
"@sindresorhus/merge-streams": "^2.1.0",
|
||||
"fast-glob": "^3.3.2",
|
||||
"ignore": "^5.2.4",
|
||||
"merge2": "^1.4.1",
|
||||
"slash": "^4.0.0"
|
||||
"path-type": "^5.0.0",
|
||||
"slash": "^5.1.0",
|
||||
"unicorn-magic": "^0.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/globby/node_modules/slash": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz",
|
||||
"integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
@ -660,9 +653,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "5.2.4",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
|
||||
"integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==",
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
|
||||
"integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
@ -748,9 +741,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jiti": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.19.1.tgz",
|
||||
"integrity": "sha512-oVhqoRDaBXf7sjkll95LHVS6Myyyb1zaunVwk4Z0+WPSW4gjS0pl01zYKHScTuyEhQsFxV5L4DR5r+YqSyqyyg==",
|
||||
"version": "1.21.0",
|
||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz",
|
||||
"integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"jiti": "bin/jiti.js"
|
||||
@ -829,9 +822,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
|
||||
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -847,9 +840,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-releases": {
|
||||
"version": "2.0.13",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
||||
"integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==",
|
||||
"version": "2.0.14",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz",
|
||||
"integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/normalize-path": {
|
||||
@ -913,12 +906,15 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz",
|
||||
"integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
@ -958,9 +954,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.31",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
||||
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
|
||||
"version": "8.4.38",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz",
|
||||
"integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -977,27 +973,27 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.6",
|
||||
"nanoid": "^3.3.7",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^1.0.2"
|
||||
"source-map-js": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-cli": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-10.1.0.tgz",
|
||||
"integrity": "sha512-Zu7PLORkE9YwNdvOeOVKPmWghprOtjFQU3srMUGbdz3pHJiFh7yZ4geiZFMkjMfB0mtTFR3h8RemR62rPkbOPA==",
|
||||
"version": "11.0.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-11.0.0.tgz",
|
||||
"integrity": "sha512-xMITAI7M0u1yolVcXJ9XTZiO9aO49mcoKQy6pCDFdMh9kGqhzLVpWxeD/32M/QBmkhcGypZFFOLNLmIW4Pg4RA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chokidar": "^3.3.0",
|
||||
"dependency-graph": "^0.11.0",
|
||||
"fs-extra": "^11.0.0",
|
||||
"get-stdin": "^9.0.0",
|
||||
"globby": "^13.0.0",
|
||||
"globby": "^14.0.0",
|
||||
"picocolors": "^1.0.0",
|
||||
"postcss-load-config": "^4.0.0",
|
||||
"postcss-load-config": "^5.0.0",
|
||||
"postcss-reporter": "^7.0.0",
|
||||
"pretty-hrtime": "^1.0.3",
|
||||
"read-cache": "^1.0.0",
|
||||
@ -1008,16 +1004,63 @@
|
||||
"postcss": "index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
"node": ">=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-cli/node_modules/lilconfig": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz",
|
||||
"integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antonk52"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-cli/node_modules/postcss-load-config": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-5.0.3.tgz",
|
||||
"integrity": "sha512-90pBBI5apUVruIEdCxZic93Wm+i9fTrp7TXbgdUCH+/L+2WnfpITSpq5dFU/IPvbv7aNiMlQISpUkAm3fEcvgQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/postcss/"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"lilconfig": "^3.0.0",
|
||||
"yaml": "^2.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"jiti": ">=1.21.0",
|
||||
"postcss": ">=8.0.9"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"jiti": {
|
||||
"optional": true
|
||||
},
|
||||
"postcss": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-import": {
|
||||
"version": "15.1.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz",
|
||||
"integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==",
|
||||
"version": "16.1.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-16.1.0.tgz",
|
||||
"integrity": "sha512-7hsAZ4xGXl4MW+OKEWCnF6T5jqBw80/EE9aXg1r2yyn1RsVEU8EtKXbijEODa+rg7iih4bKf7vlvTGYR4CnPNg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"postcss-value-parser": "^4.0.0",
|
||||
@ -1025,7 +1068,7 @@
|
||||
"resolve": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.0.0"
|
||||
@ -1151,24 +1194,24 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
|
||||
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
|
||||
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"prettier": "bin-prettier.js"
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier-plugin-go-template": {
|
||||
"version": "0.0.13",
|
||||
"resolved": "https://registry.npmjs.org/prettier-plugin-go-template/-/prettier-plugin-go-template-0.0.13.tgz",
|
||||
"integrity": "sha512-gG/xT5kd+kCzoMaTchXvdfBdsunyRCV6G8cgdPGPd2V5JGGKXUG7SjzBKU7jaGh2RTeblcAdBb/E+S/duOAMsA==",
|
||||
"version": "0.0.15",
|
||||
"resolved": "https://registry.npmjs.org/prettier-plugin-go-template/-/prettier-plugin-go-template-0.0.15.tgz",
|
||||
"integrity": "sha512-WqU92E1NokWYNZ9mLE6ijoRg6LtIGdLMePt2C7UBDjXeDH9okcRI3zRqtnWR4s5AloiqyvZ66jNBAa9tmRY5EQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ulid": "^2.3.0"
|
||||
@ -1177,7 +1220,7 @@
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"prettier": "^2.0.0"
|
||||
"prettier": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pretty-hrtime": {
|
||||
@ -1302,9 +1345,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
|
||||
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
@ -1371,9 +1414,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tailwindcss": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz",
|
||||
"integrity": "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==",
|
||||
"version": "3.4.3",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz",
|
||||
"integrity": "sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@alloc/quick-lru": "^5.2.0",
|
||||
@ -1381,10 +1424,10 @@
|
||||
"chokidar": "^3.5.3",
|
||||
"didyoumean": "^1.2.2",
|
||||
"dlv": "^1.1.3",
|
||||
"fast-glob": "^3.2.12",
|
||||
"fast-glob": "^3.3.0",
|
||||
"glob-parent": "^6.0.2",
|
||||
"is-glob": "^4.0.3",
|
||||
"jiti": "^1.18.2",
|
||||
"jiti": "^1.21.0",
|
||||
"lilconfig": "^2.1.0",
|
||||
"micromatch": "^4.0.5",
|
||||
"normalize-path": "^3.0.0",
|
||||
@ -1419,6 +1462,23 @@
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tailwindcss/node_modules/postcss-import": {
|
||||
"version": "15.1.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz",
|
||||
"integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"postcss-value-parser": "^4.0.0",
|
||||
"read-cache": "^1.0.0",
|
||||
"resolve": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tailwindcss/node_modules/postcss-selector-parser": {
|
||||
"version": "6.0.13",
|
||||
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz",
|
||||
@ -1486,6 +1546,18 @@
|
||||
"ulid": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/unicorn-magic": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz",
|
||||
"integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||
@ -1496,9 +1568,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/update-browserslist-db": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz",
|
||||
"integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==",
|
||||
"version": "1.0.13",
|
||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
|
||||
"integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -1564,10 +1636,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz",
|
||||
"integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==",
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz",
|
||||
"integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"yaml": "bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
|
14
package.json
14
package.json
@ -7,12 +7,12 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-cli": "^10.1.0",
|
||||
"postcss-import": "^15.1.0",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-go-template": "^0.0.13",
|
||||
"tailwindcss": "^3.3.2"
|
||||
"autoprefixer": "^10.4.19",
|
||||
"postcss": "^8.4.38",
|
||||
"postcss-cli": "^11.0.0",
|
||||
"postcss-import": "^16.1.0",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-plugin-go-template": "^0.0.15",
|
||||
"tailwindcss": "^3.4.3"
|
||||
}
|
||||
}
|
||||
|
28
taskfile.yaml
Normal file
28
taskfile.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
build:
|
||||
desc: Build Hextra documentation site under `exampleSite`
|
||||
cmds:
|
||||
- hugo --gc --minify --themesDir=../.. --source=exampleSite
|
||||
|
||||
css:
|
||||
depends: [build]
|
||||
desc: Compile production CSS using PostCSS to `assets/css/compiled/main.css`
|
||||
cmds:
|
||||
- npx postcss --config postcss.config.js --env production assets/css/styles.css -o assets/css/compiled/main.css
|
||||
|
||||
dev:
|
||||
desc: Start development server for Hextra theme
|
||||
cmds:
|
||||
- npm run dev:theme
|
||||
|
||||
libs:
|
||||
desc: Download libs from CDN
|
||||
cmds:
|
||||
- curl -o assets/lib/flexsearch/flexsearch.bundle.min.js https://cdn.jsdelivr.net/npm/flexsearch@0.7.31/dist/flexsearch.bundle.min.js
|
||||
- curl -o assets/lib/katex/katex.min.js https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.js
|
||||
- curl -o assets/lib/katex/katex.min.css https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
|
||||
- curl -o assets/lib/katex/auto-render.min.js https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js
|
||||
- curl -o assets/lib/katex/mhchem.min.js https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/mhchem.min.js
|
||||
- curl -o assets/lib/mermaid/mermaid.min.js https://cdn.jsdelivr.net/npm/mermaid@10.9.0/dist/mermaid.min.js
|
Reference in New Issue
Block a user