mirror of
https://github.com/imfing/hextra.git
synced 2025-07-06 11:37:16 -04:00
Compare commits
21 Commits
v0.9.1
...
ac2d10952f
Author | SHA1 | Date | |
---|---|---|---|
ac2d10952f | |||
168ecf91f4 | |||
9e7b13a0da | |||
66489e5274 | |||
2004648076 | |||
0da6f97e99 | |||
a4bfa2d97e | |||
3a2ce0b5c0 | |||
55af474f51 | |||
b91cc79674 | |||
68e1e25119 | |||
8c789626be | |||
a1c7acd6b5 | |||
e444156bb9 | |||
33f2cf653b | |||
63f153999e | |||
c62b1fd401 | |||
fdfdef69b5 | |||
462cc5b68d | |||
f40c7fd5d4 | |||
74fb165358 |
15
.github/FUNDING.yml
vendored
15
.github/FUNDING.yml
vendored
@ -1,15 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: imfing
|
|
||||||
patreon: # Replace with a single Patreon username
|
|
||||||
open_collective: # Replace with a single Open Collective username
|
|
||||||
ko_fi: # Replace with a single Ko-fi username
|
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
||||||
liberapay: # Replace with a single Liberapay username
|
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
|
||||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
||||||
polar: # Replace with a single Polar username
|
|
||||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
|
||||||
thanks_dev: # Replace with a single thanks.dev username
|
|
||||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
2
.github/workflows/pages.yml
vendored
2
.github/workflows/pages.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
HUGO_VERSION: 0.138.0
|
HUGO_VERSION: 0.136.5
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
|
||||||
"prettier-plugin-go-template"
|
|
||||||
],
|
|
||||||
"goTemplateBracketSpacing": true,
|
"goTemplateBracketSpacing": true,
|
||||||
"htmlWhitespaceSensitivity": "css",
|
"htmlWhitespaceSensitivity": "css",
|
||||||
"printWidth": 200,
|
"printWidth": 200,
|
||||||
|
@ -952,10 +952,6 @@ video {
|
|||||||
.hx-border-t {
|
.hx-border-t {
|
||||||
border-top-width: 1px;
|
border-top-width: 1px;
|
||||||
}
|
}
|
||||||
.hx-border-amber-200 {
|
|
||||||
--tw-border-opacity: 1;
|
|
||||||
border-color: rgb(253 230 138 / var(--tw-border-opacity));
|
|
||||||
}
|
|
||||||
.hx-border-black\/5 {
|
.hx-border-black\/5 {
|
||||||
border-color: rgb(0 0 0 / 0.05);
|
border-color: rgb(0 0 0 / 0.05);
|
||||||
}
|
}
|
||||||
@ -971,14 +967,6 @@ video {
|
|||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(107 114 128 / var(--tw-border-opacity));
|
border-color: rgb(107 114 128 / var(--tw-border-opacity));
|
||||||
}
|
}
|
||||||
.hx-border-green-200 {
|
|
||||||
--tw-border-opacity: 1;
|
|
||||||
border-color: rgb(187 247 208 / var(--tw-border-opacity));
|
|
||||||
}
|
|
||||||
.hx-border-indigo-200 {
|
|
||||||
--tw-border-opacity: 1;
|
|
||||||
border-color: rgb(199 210 254 / var(--tw-border-opacity));
|
|
||||||
}
|
|
||||||
.hx-border-orange-100 {
|
.hx-border-orange-100 {
|
||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(255 237 213 / var(--tw-border-opacity));
|
border-color: rgb(255 237 213 / var(--tw-border-opacity));
|
||||||
@ -994,10 +982,6 @@ video {
|
|||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(254 249 195 / var(--tw-border-opacity));
|
border-color: rgb(254 249 195 / var(--tw-border-opacity));
|
||||||
}
|
}
|
||||||
.hx-bg-amber-100 {
|
|
||||||
--tw-bg-opacity: 1;
|
|
||||||
background-color: rgb(254 243 199 / var(--tw-bg-opacity));
|
|
||||||
}
|
|
||||||
.hx-bg-black\/80 {
|
.hx-bg-black\/80 {
|
||||||
background-color: rgb(0 0 0 / 0.8);
|
background-color: rgb(0 0 0 / 0.8);
|
||||||
}
|
}
|
||||||
@ -1012,14 +996,6 @@ video {
|
|||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
.hx-bg-green-100 {
|
|
||||||
--tw-bg-opacity: 1;
|
|
||||||
background-color: rgb(220 252 231 / var(--tw-bg-opacity));
|
|
||||||
}
|
|
||||||
.hx-bg-indigo-100 {
|
|
||||||
--tw-bg-opacity: 1;
|
|
||||||
background-color: rgb(224 231 255 / var(--tw-bg-opacity));
|
|
||||||
}
|
|
||||||
.hx-bg-neutral-50 {
|
.hx-bg-neutral-50 {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(250 250 250 / var(--tw-bg-opacity));
|
background-color: rgb(250 250 250 / var(--tw-bg-opacity));
|
||||||
@ -1185,9 +1161,6 @@ video {
|
|||||||
.hx-text-center {
|
.hx-text-center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.hx-align-middle {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.hx-align-text-bottom {
|
.hx-align-text-bottom {
|
||||||
vertical-align: text-bottom;
|
vertical-align: text-bottom;
|
||||||
}
|
}
|
||||||
@ -1264,10 +1237,6 @@ video {
|
|||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: hsl(var(--primary-hue) 100% 50% / var(--tw-text-opacity));
|
color: hsl(var(--primary-hue) 100% 50% / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
.hx-text-amber-900 {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(120 53 15 / var(--tw-text-opacity));
|
|
||||||
}
|
|
||||||
.hx-text-blue-900 {
|
.hx-text-blue-900 {
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(30 58 138 / var(--tw-text-opacity));
|
color: rgb(30 58 138 / var(--tw-text-opacity));
|
||||||
@ -1299,14 +1268,6 @@ video {
|
|||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(17 24 39 / var(--tw-text-opacity));
|
color: rgb(17 24 39 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
.hx-text-green-900 {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(20 83 45 / var(--tw-text-opacity));
|
|
||||||
}
|
|
||||||
.hx-text-indigo-900 {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(49 46 129 / var(--tw-text-opacity));
|
|
||||||
}
|
|
||||||
.hx-text-orange-800 {
|
.hx-text-orange-800 {
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(154 52 18 / var(--tw-text-opacity));
|
color: rgb(154 52 18 / var(--tw-text-opacity));
|
||||||
@ -2970,9 +2931,6 @@ body:is(html[class~="dark"] *) {
|
|||||||
.dark\:hx-hidden:is(html[class~="dark"] *) {
|
.dark\:hx-hidden:is(html[class~="dark"] *) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.dark\:hx-border-amber-200\/30:is(html[class~="dark"] *) {
|
|
||||||
border-color: rgb(253 230 138 / 0.3);
|
|
||||||
}
|
|
||||||
.dark\:hx-border-blue-200\/30:is(html[class~="dark"] *) {
|
.dark\:hx-border-blue-200\/30:is(html[class~="dark"] *) {
|
||||||
border-color: rgb(191 219 254 / 0.3);
|
border-color: rgb(191 219 254 / 0.3);
|
||||||
}
|
}
|
||||||
@ -2983,12 +2941,6 @@ body:is(html[class~="dark"] *) {
|
|||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(156 163 175 / var(--tw-border-opacity));
|
border-color: rgb(156 163 175 / var(--tw-border-opacity));
|
||||||
}
|
}
|
||||||
.dark\:hx-border-green-200\/30:is(html[class~="dark"] *) {
|
|
||||||
border-color: rgb(187 247 208 / 0.3);
|
|
||||||
}
|
|
||||||
.dark\:hx-border-indigo-200\/30:is(html[class~="dark"] *) {
|
|
||||||
border-color: rgb(199 210 254 / 0.3);
|
|
||||||
}
|
|
||||||
.dark\:hx-border-neutral-700:is(html[class~="dark"] *) {
|
.dark\:hx-border-neutral-700:is(html[class~="dark"] *) {
|
||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(64 64 64 / var(--tw-border-opacity));
|
border-color: rgb(64 64 64 / var(--tw-border-opacity));
|
||||||
@ -3009,9 +2961,6 @@ body:is(html[class~="dark"] *) {
|
|||||||
.dark\:hx-border-yellow-200\/30:is(html[class~="dark"] *) {
|
.dark\:hx-border-yellow-200\/30:is(html[class~="dark"] *) {
|
||||||
border-color: rgb(254 240 138 / 0.3);
|
border-color: rgb(254 240 138 / 0.3);
|
||||||
}
|
}
|
||||||
.dark\:hx-bg-amber-900\/30:is(html[class~="dark"] *) {
|
|
||||||
background-color: rgb(120 53 15 / 0.3);
|
|
||||||
}
|
|
||||||
.dark\:hx-bg-black\/60:is(html[class~="dark"] *) {
|
.dark\:hx-bg-black\/60:is(html[class~="dark"] *) {
|
||||||
background-color: rgb(0 0 0 / 0.6);
|
background-color: rgb(0 0 0 / 0.6);
|
||||||
}
|
}
|
||||||
@ -3028,12 +2977,6 @@ body:is(html[class~="dark"] *) {
|
|||||||
.dark\:hx-bg-gray-50\/10:is(html[class~="dark"] *) {
|
.dark\:hx-bg-gray-50\/10:is(html[class~="dark"] *) {
|
||||||
background-color: rgb(249 250 251 / 0.1);
|
background-color: rgb(249 250 251 / 0.1);
|
||||||
}
|
}
|
||||||
.dark\:hx-bg-green-900\/30:is(html[class~="dark"] *) {
|
|
||||||
background-color: rgb(20 83 45 / 0.3);
|
|
||||||
}
|
|
||||||
.dark\:hx-bg-indigo-900\/30:is(html[class~="dark"] *) {
|
|
||||||
background-color: rgb(49 46 129 / 0.3);
|
|
||||||
}
|
|
||||||
.dark\:hx-bg-neutral-800:is(html[class~="dark"] *) {
|
.dark\:hx-bg-neutral-800:is(html[class~="dark"] *) {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
|
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
|
||||||
@ -3069,10 +3012,6 @@ body:is(html[class~="dark"] *) {
|
|||||||
.dark\:hx-to-gray-400:is(html[class~="dark"] *) {
|
.dark\:hx-to-gray-400:is(html[class~="dark"] *) {
|
||||||
--tw-gradient-to: #9ca3af var(--tw-gradient-to-position);
|
--tw-gradient-to: #9ca3af var(--tw-gradient-to-position);
|
||||||
}
|
}
|
||||||
.dark\:hx-text-amber-200:is(html[class~="dark"] *) {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(253 230 138 / var(--tw-text-opacity));
|
|
||||||
}
|
|
||||||
.dark\:hx-text-blue-200:is(html[class~="dark"] *) {
|
.dark\:hx-text-blue-200:is(html[class~="dark"] *) {
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(191 219 254 / var(--tw-text-opacity));
|
color: rgb(191 219 254 / var(--tw-text-opacity));
|
||||||
@ -3097,14 +3036,6 @@ body:is(html[class~="dark"] *) {
|
|||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(249 250 251 / var(--tw-text-opacity));
|
color: rgb(249 250 251 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
.dark\:hx-text-green-200:is(html[class~="dark"] *) {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(187 247 208 / var(--tw-text-opacity));
|
|
||||||
}
|
|
||||||
.dark\:hx-text-indigo-200:is(html[class~="dark"] *) {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(199 210 254 / var(--tw-text-opacity));
|
|
||||||
}
|
|
||||||
.dark\:hx-text-neutral-200:is(html[class~="dark"] *) {
|
.dark\:hx-text-neutral-200:is(html[class~="dark"] *) {
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(229 229 229 / var(--tw-text-opacity));
|
color: rgb(229 229 229 / var(--tw-text-opacity));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@media (max-width: 767px) {
|
@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;
|
@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);
|
transition: transform 0.8s cubic-bezier(0.52, 0.16, 0.04, 1);
|
||||||
will-change: transform, opacity;
|
will-change: transform, opacity;
|
||||||
@ -8,7 +8,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-container {
|
.hextra-sidebar-container {
|
||||||
li > div {
|
li > div {
|
||||||
@apply hx-h-0;
|
@apply hx-h-0;
|
||||||
}
|
}
|
||||||
@ -18,4 +18,19 @@
|
|||||||
li.open > a > span > svg > path {
|
li.open > a > span > svg > path {
|
||||||
@apply hx-rotate-90;
|
@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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
const menu = document.querySelector('.hamburger-menu');
|
const menu = document.querySelector('.hamburger-menu');
|
||||||
const overlay = document.querySelector('.mobile-menu-overlay');
|
const overlay = document.querySelector('.mobile-menu-overlay');
|
||||||
const sidebarContainer = document.querySelector('.sidebar-container');
|
const sidebarContainer = document.querySelector('.hextra-sidebar-container');
|
||||||
|
|
||||||
// Initialize the overlay
|
// Initialize the overlay
|
||||||
const overlayClasses = ['hx-fixed', 'hx-inset-0', 'hx-z-10', 'hx-bg-black/80', 'dark:hx-bg-black/60'];
|
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 () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
scrollToActiveItem();
|
scrollToActiveItem();
|
||||||
enableCollapsibles();
|
enableCollapsibles();
|
||||||
@ -10,10 +19,43 @@ function enableCollapsibles() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const list = button.parentElement.parentElement;
|
const list = button.parentElement.parentElement;
|
||||||
if (list) {
|
if (list) {
|
||||||
list.classList.toggle("open")
|
list.classList.toggle("open");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isCached = "{{- site.Params.page.sidebar.cache | default false -}}" === "true";
|
||||||
|
const currentPagePath = window.location.href;
|
||||||
|
|
||||||
|
if (isCached) {
|
||||||
|
// find the current page in the sidebar and open the parent lists
|
||||||
|
const sidebar = document.querySelector(".hextra-sidebar-container");
|
||||||
|
if (sidebar) {
|
||||||
|
// find a tags and compare href with current page path
|
||||||
|
const links = sidebar.querySelectorAll("a");
|
||||||
|
links.forEach(function (link) {
|
||||||
|
const linkPath = link.href;
|
||||||
|
|
||||||
|
if (currentPagePath === linkPath) {
|
||||||
|
// add active class to the link
|
||||||
|
link.classList.add("active");
|
||||||
|
link.classList.remove("inactive");
|
||||||
|
|
||||||
|
if (!isVisible(link)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// recursively open parent lists
|
||||||
|
let parent = link.parentElement;
|
||||||
|
while (parent && !parent.classList.contains("hextra-sidebar-container")) {
|
||||||
|
if (parent.tagName === "LI" && parent.classList.contains("hextra-sidebar-item")) {
|
||||||
|
parent.classList.add("open");
|
||||||
|
}
|
||||||
|
parent = parent.parentElement;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollToActiveItem() {
|
function scrollToActiveItem() {
|
||||||
@ -31,6 +73,6 @@ function scrollToActiveItem() {
|
|||||||
const yDistance = visibleActiveItem.getBoundingClientRect().top - sidebarScrollbar.getBoundingClientRect().top;
|
const yDistance = visibleActiveItem.getBoundingClientRect().top - sidebarScrollbar.getBoundingClientRect().top;
|
||||||
sidebarScrollbar.scrollTo({
|
sidebarScrollbar.scrollTo({
|
||||||
behavior: "instant",
|
behavior: "instant",
|
||||||
top: yDistance - yOffset
|
top: yDistance - yOffset,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -44,129 +44,6 @@ The primary color of the theme can be customized by setting the `--primary-hue`,
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Further Theme Customization
|
|
||||||
|
|
||||||
The theme can be further customized by overriding the default styles via the exposed css classes. An example for customizing the footer element:
|
|
||||||
|
|
||||||
```css {filename="assets/css/custom.css"}
|
|
||||||
.hextra-footer {
|
|
||||||
/* Styles will be applied to the footer element */
|
|
||||||
}
|
|
||||||
|
|
||||||
.hextra-footer:is(html[class~="dark"] *) {
|
|
||||||
/* Styles will be applied to the footer element in dark mode */
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
The following classes can be used to customize various parts of the theme.
|
|
||||||
|
|
||||||
#### General
|
|
||||||
|
|
||||||
- `hextra-scrollbar` - The scrollbar element
|
|
||||||
- `content` - Page content container
|
|
||||||
|
|
||||||
#### Shortcodes
|
|
||||||
|
|
||||||
##### Badge
|
|
||||||
|
|
||||||
- `hextra-badge` - The badge element
|
|
||||||
|
|
||||||
##### Card
|
|
||||||
|
|
||||||
- `hextra-card` - The card element
|
|
||||||
- `hextra-card-image` - The card image element
|
|
||||||
- `hextra-card-icon` - The card icon element
|
|
||||||
- `hextra-card-subtitle` - The card subtitle element
|
|
||||||
|
|
||||||
##### Cards
|
|
||||||
|
|
||||||
- `hextra-cards` - The cards grid container
|
|
||||||
|
|
||||||
##### Jupyter Notebook
|
|
||||||
|
|
||||||
- `hextra-jupyter-code-cell` - The Jupyter code cell container
|
|
||||||
- `hextra-jupyter-code-cell-outputs-container` - The Jupyter code cell outputs container
|
|
||||||
- `hextra-jupyter-code-cell-outputs` - The Jupyter code cell output div element
|
|
||||||
|
|
||||||
##### PDF
|
|
||||||
|
|
||||||
- `hextra-pdf` - The PDF container element
|
|
||||||
|
|
||||||
##### Steps
|
|
||||||
|
|
||||||
- `steps` - The steps container
|
|
||||||
|
|
||||||
##### Tabs
|
|
||||||
|
|
||||||
- `hextra-tabs-panel` - The tabs panel container
|
|
||||||
- `hextra-tabs-toggle` - The tabs toggle button
|
|
||||||
|
|
||||||
##### Filetree
|
|
||||||
|
|
||||||
- `hextra-filetree` - The filetree container
|
|
||||||
|
|
||||||
##### Folder
|
|
||||||
|
|
||||||
- `hextra-filetree-folder` - The filetree folder container
|
|
||||||
|
|
||||||
#### Navbar
|
|
||||||
|
|
||||||
- `nav-container` - The navbar container
|
|
||||||
- `nav-container-blur` - The navbar container in blur element
|
|
||||||
- `hamburger-menu` - The hamburger menu button
|
|
||||||
|
|
||||||
#### Footer
|
|
||||||
|
|
||||||
- `hextra-footer` - The footer element
|
|
||||||
- `hextra-custom-footer` - The custom footer section container
|
|
||||||
|
|
||||||
#### Search
|
|
||||||
|
|
||||||
- `search-wrapper` - The search wrapper container
|
|
||||||
- `search-input` - The search input element
|
|
||||||
- `search-results` - The search results list container
|
|
||||||
|
|
||||||
#### Table of Contents
|
|
||||||
|
|
||||||
- `hextra-toc` - The table of contents container
|
|
||||||
|
|
||||||
#### Sidebar
|
|
||||||
|
|
||||||
- `mobile-menu-overlay` - The overlay element for the mobile menu
|
|
||||||
- `sidebar-container` - The sidebar container
|
|
||||||
- `sidebar-active-item` - The active item in the sidebar
|
|
||||||
|
|
||||||
#### Language Switcher
|
|
||||||
|
|
||||||
- `language-switcher` - The language switcher button
|
|
||||||
- `language-options` - The language options container
|
|
||||||
|
|
||||||
#### Theme Toggle
|
|
||||||
|
|
||||||
- `theme-toggle` - The theme toggle button
|
|
||||||
|
|
||||||
#### Cody Copy Button
|
|
||||||
|
|
||||||
- `hextra-code-copy-btn-container` - The code copy button container
|
|
||||||
- `hextra-code-copy-btn` - The code copy button
|
|
||||||
|
|
||||||
#### Code Block
|
|
||||||
|
|
||||||
- `hextra-code-block` - The code block container
|
|
||||||
|
|
||||||
#### Feature Card
|
|
||||||
|
|
||||||
- `hextra-feature-card` - The feature card link element
|
|
||||||
|
|
||||||
#### Feature Grid
|
|
||||||
|
|
||||||
- `hextra-feature-grid` - The feature grid container
|
|
||||||
|
|
||||||
#### Breadcrumbs
|
|
||||||
|
|
||||||
No specific class is available for breadcrumbs.
|
|
||||||
|
|
||||||
### Syntax Highlighting
|
### Syntax Highlighting
|
||||||
|
|
||||||
List of available syntax highlighting themes are available at [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html). The stylesheet can be generated using the command:
|
List of available syntax highlighting themes are available at [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html). The stylesheet can be generated using the command:
|
||||||
@ -185,21 +62,6 @@ You may add custom scripts to the end of the head for every page by adding the f
|
|||||||
layouts/partials/custom/head-end.html
|
layouts/partials/custom/head-end.html
|
||||||
```
|
```
|
||||||
|
|
||||||
## Custom Footer Section
|
|
||||||
|
|
||||||
You can add a custom section the footer between the language/theme buttons and the "Copyright"/"Powered By" section by creating a file `layouts/partials/custom/footer.html` in your site.
|
|
||||||
|
|
||||||
```html {filename="layouts/partials/custom/footer.html"}
|
|
||||||
<!-- Your footer element here -->
|
|
||||||
```
|
|
||||||
|
|
||||||
Available variables in the footer section are:
|
|
||||||
|
|
||||||
- `.switchesVisible`: `true` if the language/theme button(s) are visible above the footer along with a horizontal separator.
|
|
||||||
- `.copyrightVisible`: `true` if the "Copyright" and "Powered By" text are visible at the bottom of the footer.
|
|
||||||
|
|
||||||
_Note: The custom footer inherits the default footer background color text color and the `width` setting in `hugo.yaml#footer` section._
|
|
||||||
|
|
||||||
## Custom Layouts
|
## Custom Layouts
|
||||||
|
|
||||||
The layouts of the theme can be overridden by creating a file with the same name in the `layouts` directory of your site.
|
The layouts of the theme can be overridden by creating a file with the same name in the `layouts` directory of your site.
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
HUGO_VERSION: 0.138.0
|
HUGO_VERSION: 0.131.0
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -146,7 +146,7 @@ For more details, check out:
|
|||||||
3. If you are not using [hextra-starter-template][hextra-starter-template], configure the following manually:
|
3. If you are not using [hextra-starter-template][hextra-starter-template], configure the following manually:
|
||||||
- Configure the Build command to `hugo --gc --minify`
|
- Configure the Build command to `hugo --gc --minify`
|
||||||
- Specify the Publish directory to `public`
|
- Specify the Publish directory to `public`
|
||||||
- Add Environment variable `HUGO_VERSION` and set to `0.138.0`, or alternatively, set it in `netlify.toml` file
|
- Add Environment variable `HUGO_VERSION` and set to `0.132.2`
|
||||||
4. Deploy!
|
4. Deploy!
|
||||||
|
|
||||||
Check [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) for more details.
|
Check [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) for more details.
|
||||||
|
@ -35,44 +35,6 @@ Blockquote with attribution
|
|||||||
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Alerts
|
|
||||||
|
|
||||||
Alerts are a Markdown extension based on the blockquote syntax that you can use to emphasize critical information.
|
|
||||||
[GitHub-style alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) are supported.
|
|
||||||
Please make sure you are using the latest version of Hextra and [Hugo v0.134.0](https://github.com/gohugoio/hugo/releases/tag/v0.134.0) or later.
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> Useful information that users should know, even when skimming content.
|
|
||||||
|
|
||||||
> [!TIP]
|
|
||||||
> Helpful advice for doing things better or more easily.
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> Key information users need to know to achieve their goal.
|
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> Urgent info that needs immediate user attention to avoid problems.
|
|
||||||
|
|
||||||
> [!CAUTION]
|
|
||||||
> Advises about risks or negative outcomes of certain actions.
|
|
||||||
|
|
||||||
```markdown {filename=Markdown}
|
|
||||||
> [!NOTE]
|
|
||||||
> Useful information that users should know, even when skimming content.
|
|
||||||
|
|
||||||
> [!TIP]
|
|
||||||
> Helpful advice for doing things better or more easily.
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> Key information users need to know to achieve their goal.
|
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> Urgent info that needs immediate user attention to avoid problems.
|
|
||||||
|
|
||||||
> [!CAUTION]
|
|
||||||
> Advises about risks or negative outcomes of certain actions.
|
|
||||||
```
|
|
||||||
|
|
||||||
### Tables
|
### Tables
|
||||||
|
|
||||||
Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box.
|
Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box.
|
||||||
|
@ -95,7 +95,7 @@ Open source projects powered by Hextra
|
|||||||
>}}
|
>}}
|
||||||
|
|
||||||
{{< card
|
{{< card
|
||||||
link="https://github.com/remysheppard/lutheran-confessions"
|
link="https://lutheranconfessions.org/"
|
||||||
title="LutheranConfessions"
|
title="LutheranConfessions"
|
||||||
image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359"
|
image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359"
|
||||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||||
|
@ -173,4 +173,3 @@ params:
|
|||||||
# emitMetadata: 0
|
# emitMetadata: 0
|
||||||
# inputPosition: top
|
# inputPosition: top
|
||||||
# lang: en
|
# lang: en
|
||||||
# theme: noborder_dark
|
|
||||||
|
@ -141,14 +141,11 @@
|
|||||||
"dark:hover:hx-text-gray-50",
|
"dark:hover:hx-text-gray-50",
|
||||||
"dark:hover:hx-text-neutral-50",
|
"dark:hover:hx-text-neutral-50",
|
||||||
"dark:hover:hx-text-white",
|
"dark:hover:hx-text-white",
|
||||||
"dark:hx-bg-amber-900/30",
|
|
||||||
"dark:hx-bg-black/60",
|
"dark:hx-bg-black/60",
|
||||||
"dark:hx-bg-blue-900/30",
|
"dark:hx-bg-blue-900/30",
|
||||||
"dark:hx-bg-dark",
|
"dark:hx-bg-dark",
|
||||||
"dark:hx-bg-dark/50",
|
"dark:hx-bg-dark/50",
|
||||||
"dark:hx-bg-gray-50/10",
|
"dark:hx-bg-gray-50/10",
|
||||||
"dark:hx-bg-green-900/30",
|
|
||||||
"dark:hx-bg-indigo-900/30",
|
|
||||||
"dark:hx-bg-neutral-800",
|
"dark:hx-bg-neutral-800",
|
||||||
"dark:hx-bg-neutral-900",
|
"dark:hx-bg-neutral-900",
|
||||||
"dark:hx-bg-orange-400/20",
|
"dark:hx-bg-orange-400/20",
|
||||||
@ -158,12 +155,9 @@
|
|||||||
"dark:hx-bg-red-900/30",
|
"dark:hx-bg-red-900/30",
|
||||||
"dark:hx-bg-yellow-700/30",
|
"dark:hx-bg-yellow-700/30",
|
||||||
"dark:hx-block",
|
"dark:hx-block",
|
||||||
"dark:hx-border-amber-200/30",
|
|
||||||
"dark:hx-border-blue-200/30",
|
"dark:hx-border-blue-200/30",
|
||||||
"dark:hx-border-gray-100/20",
|
"dark:hx-border-gray-100/20",
|
||||||
"dark:hx-border-gray-400",
|
"dark:hx-border-gray-400",
|
||||||
"dark:hx-border-green-200/30",
|
|
||||||
"dark:hx-border-indigo-200/30",
|
|
||||||
"dark:hx-border-neutral-700",
|
"dark:hx-border-neutral-700",
|
||||||
"dark:hx-border-neutral-800",
|
"dark:hx-border-neutral-800",
|
||||||
"dark:hx-border-orange-400/30",
|
"dark:hx-border-orange-400/30",
|
||||||
@ -177,15 +171,12 @@
|
|||||||
"dark:hx-shadow-[0_-12px_16px_#111]",
|
"dark:hx-shadow-[0_-12px_16px_#111]",
|
||||||
"dark:hx-shadow-[0_-1px_0_rgba(255,255,255,.1)_inset]",
|
"dark:hx-shadow-[0_-1px_0_rgba(255,255,255,.1)_inset]",
|
||||||
"dark:hx-shadow-none",
|
"dark:hx-shadow-none",
|
||||||
"dark:hx-text-amber-200",
|
|
||||||
"dark:hx-text-blue-200",
|
"dark:hx-text-blue-200",
|
||||||
"dark:hx-text-gray-100",
|
"dark:hx-text-gray-100",
|
||||||
"dark:hx-text-gray-200",
|
"dark:hx-text-gray-200",
|
||||||
"dark:hx-text-gray-300",
|
"dark:hx-text-gray-300",
|
||||||
"dark:hx-text-gray-400",
|
"dark:hx-text-gray-400",
|
||||||
"dark:hx-text-gray-50",
|
"dark:hx-text-gray-50",
|
||||||
"dark:hx-text-green-200",
|
|
||||||
"dark:hx-text-indigo-200",
|
|
||||||
"dark:hx-text-neutral-200",
|
"dark:hx-text-neutral-200",
|
||||||
"dark:hx-text-neutral-400",
|
"dark:hx-text-neutral-400",
|
||||||
"dark:hx-text-orange-300",
|
"dark:hx-text-orange-300",
|
||||||
@ -228,7 +219,6 @@
|
|||||||
"hextra-code-block",
|
"hextra-code-block",
|
||||||
"hextra-code-copy-btn",
|
"hextra-code-copy-btn",
|
||||||
"hextra-code-copy-btn-container",
|
"hextra-code-copy-btn-container",
|
||||||
"hextra-custom-footer",
|
|
||||||
"hextra-feature-card",
|
"hextra-feature-card",
|
||||||
"hextra-feature-grid",
|
"hextra-feature-grid",
|
||||||
"hextra-filetree",
|
"hextra-filetree",
|
||||||
@ -266,19 +256,15 @@
|
|||||||
"hover:hx-text-primary-600",
|
"hover:hx-text-primary-600",
|
||||||
"hx-absolute",
|
"hx-absolute",
|
||||||
"hx-align-[-2.5px]",
|
"hx-align-[-2.5px]",
|
||||||
"hx-align-middle",
|
|
||||||
"hx-align-text-bottom",
|
"hx-align-text-bottom",
|
||||||
"hx-appearance-none",
|
"hx-appearance-none",
|
||||||
"hx-aspect-auto",
|
"hx-aspect-auto",
|
||||||
"hx-bg-amber-100",
|
|
||||||
"hx-bg-black/80",
|
"hx-bg-black/80",
|
||||||
"hx-bg-black/[.05]",
|
"hx-bg-black/[.05]",
|
||||||
"hx-bg-blue-100",
|
"hx-bg-blue-100",
|
||||||
"hx-bg-clip-text",
|
"hx-bg-clip-text",
|
||||||
"hx-bg-gradient-to-r",
|
"hx-bg-gradient-to-r",
|
||||||
"hx-bg-gray-100",
|
"hx-bg-gray-100",
|
||||||
"hx-bg-green-100",
|
|
||||||
"hx-bg-indigo-100",
|
|
||||||
"hx-bg-neutral-50",
|
"hx-bg-neutral-50",
|
||||||
"hx-bg-orange-50",
|
"hx-bg-orange-50",
|
||||||
"hx-bg-primary-100",
|
"hx-bg-primary-100",
|
||||||
@ -291,15 +277,12 @@
|
|||||||
"hx-bg-yellow-50",
|
"hx-bg-yellow-50",
|
||||||
"hx-block",
|
"hx-block",
|
||||||
"hx-border",
|
"hx-border",
|
||||||
"hx-border-amber-200",
|
|
||||||
"hx-border-b",
|
"hx-border-b",
|
||||||
"hx-border-b-2",
|
"hx-border-b-2",
|
||||||
"hx-border-black/5",
|
"hx-border-black/5",
|
||||||
"hx-border-blue-200",
|
"hx-border-blue-200",
|
||||||
"hx-border-gray-200",
|
"hx-border-gray-200",
|
||||||
"hx-border-gray-500",
|
"hx-border-gray-500",
|
||||||
"hx-border-green-200",
|
|
||||||
"hx-border-indigo-200",
|
|
||||||
"hx-border-orange-100",
|
"hx-border-orange-100",
|
||||||
"hx-border-red-200",
|
"hx-border-red-200",
|
||||||
"hx-border-t",
|
"hx-border-t",
|
||||||
@ -485,7 +468,6 @@
|
|||||||
"hx-text-[.65rem]",
|
"hx-text-[.65rem]",
|
||||||
"hx-text-[10px]",
|
"hx-text-[10px]",
|
||||||
"hx-text-[color:hsl(var(--primary-hue),100%,50%)]",
|
"hx-text-[color:hsl(var(--primary-hue),100%,50%)]",
|
||||||
"hx-text-amber-900",
|
|
||||||
"hx-text-base",
|
"hx-text-base",
|
||||||
"hx-text-blue-900",
|
"hx-text-blue-900",
|
||||||
"hx-text-center",
|
"hx-text-center",
|
||||||
@ -497,8 +479,6 @@
|
|||||||
"hx-text-gray-700",
|
"hx-text-gray-700",
|
||||||
"hx-text-gray-800",
|
"hx-text-gray-800",
|
||||||
"hx-text-gray-900",
|
"hx-text-gray-900",
|
||||||
"hx-text-green-900",
|
|
||||||
"hx-text-indigo-900",
|
|
||||||
"hx-text-left",
|
"hx-text-left",
|
||||||
"hx-text-lg",
|
"hx-text-lg",
|
||||||
"hx-text-orange-800",
|
"hx-text-orange-800",
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
{{- if not (in (slice "note" "tip" "important" "warning" "caution") .AlertType) -}}
|
|
||||||
{{- warnf "Alert type %s is not supported" .AlertType -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- $content := .Text -}}
|
|
||||||
{{- $alertType := .AlertType -}}
|
|
||||||
{{- $alertTitle := .AlertTitle -}}
|
|
||||||
|
|
||||||
{{- partial "components/github-style-alert.html" (dict "content" $content "alertType" $alertType "alertTitle" $alertTitle) -}}
|
|
@ -1,3 +0,0 @@
|
|||||||
<blockquote>
|
|
||||||
{{ .Text }}
|
|
||||||
</blockquote>
|
|
@ -8,17 +8,8 @@
|
|||||||
* This solution was created with reference to:
|
* This solution was created with reference to:
|
||||||
* https://github.com/giscus/giscus/issues/336#issuecomment-1214366281
|
* https://github.com/giscus/giscus/issues/336#issuecomment-1214366281
|
||||||
*/
|
*/
|
||||||
function getHugoTheme() {
|
|
||||||
return localStorage.getItem("color-theme");
|
|
||||||
}
|
|
||||||
|
|
||||||
function getGiscusTheme() {
|
function getGiscusTheme() {
|
||||||
let giscusTheme = "{{ (string .theme) | default `light` }}";
|
return localStorage.getItem("color-theme");
|
||||||
if(getHugoTheme() == 'light') {
|
|
||||||
return giscusTheme.replace('dark', 'light');
|
|
||||||
} else {
|
|
||||||
return giscusTheme.replace('light', 'dark');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setGiscusTheme() {
|
function setGiscusTheme() {
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
{{- $content := .content -}}
|
|
||||||
{{- $alertType := .alertType -}}
|
|
||||||
{{- $alertTitle := .alertTitle -}}
|
|
||||||
|
|
||||||
{{- $icons := dict
|
|
||||||
"note" "information-circle"
|
|
||||||
"tip" "light-bulb"
|
|
||||||
"important" "information-circle"
|
|
||||||
"warning" "exclamation"
|
|
||||||
"caution" "exclamation-circle"
|
|
||||||
-}}
|
|
||||||
|
|
||||||
{{- $icon := index $icons $alertType -}}
|
|
||||||
{{- $title := or $alertTitle (or (i18n $alertType) (title $alertType)) -}}
|
|
||||||
|
|
||||||
{{- $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" }}
|
|
||||||
|
|
||||||
{{- $alertClasses := dict
|
|
||||||
"note" "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200"
|
|
||||||
"tip" "hx-border-green-200 hx-bg-green-100 hx-text-green-900 dark:hx-border-green-200/30 dark:hx-bg-green-900/30 dark:hx-text-green-200"
|
|
||||||
"important" "hx-border-indigo-200 hx-bg-indigo-100 hx-text-indigo-900 dark:hx-border-indigo-200/30 dark:hx-bg-indigo-900/30 dark:hx-text-indigo-200"
|
|
||||||
"warning" "hx-border-amber-200 hx-bg-amber-100 hx-text-amber-900 dark:hx-border-amber-200/30 dark:hx-bg-amber-900/30 dark:hx-text-amber-200"
|
|
||||||
"caution" "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200"
|
|
||||||
-}}
|
|
||||||
|
|
||||||
{{- $class := index $alertClasses $alertType | default $defaultClass -}}
|
|
||||||
|
|
||||||
|
|
||||||
<div class="hx-overflow-x-auto hx-mt-6 hx-flex hx-flex-col hx-rounded-lg hx-border hx-py-4 hx-px-4 contrast-more:hx-border-current contrast-more:dark:hx-border-current {{ $class }}">
|
|
||||||
<p class="hx-flex hx-items-center hx-font-medium">
|
|
||||||
{{- with $icon -}}
|
|
||||||
{{- partial "utils/icon.html" (dict "name" . "attributes" `height=16px class="hx-inline-block hx-align-middle hx-mr-2"`) -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $title -}}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="hx-w-full hx-min-w-0 hx-leading-7">
|
|
||||||
<div class="hx-mt-6 hx-leading-7 first:hx-mt-0">
|
|
||||||
{{- $content -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
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,5 @@
|
|||||||
{{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}}
|
{{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}}
|
||||||
{{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}}
|
{{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}}
|
||||||
{{- $footerSwitchesVisible := and $enableFooterSwitches (or hugo.IsMultilingual $displayThemeToggle) -}}
|
|
||||||
{{- $copyrightSectionVisible := or (.Site.Params.footer.displayPoweredBy | default true) .Site.Params.footer.displayCopyright -}}
|
|
||||||
|
|
||||||
{{- $copyright := (T "copyright") | default "© 2024 Hextra." -}}
|
{{- $copyright := (T "copyright") | default "© 2024 Hextra." -}}
|
||||||
{{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}}
|
{{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}}
|
||||||
@ -17,7 +15,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<footer class="hextra-footer hx-bg-gray-100 hx-pb-[env(safe-area-inset-bottom)] dark:hx-bg-neutral-900 print:hx-bg-transparent">
|
<footer class="hextra-footer hx-bg-gray-100 hx-pb-[env(safe-area-inset-bottom)] dark:hx-bg-neutral-900 print:hx-bg-transparent">
|
||||||
{{- if $footerSwitchesVisible -}}
|
{{- if $enableFooterSwitches -}}
|
||||||
<div class="hx-mx-auto hx-flex hx-gap-2 hx-py-2 hx-px-4 {{ $footerWidth }}">
|
<div class="hx-mx-auto hx-flex hx-gap-2 hx-py-2 hx-px-4 {{ $footerWidth }}">
|
||||||
{{- partial "language-switch.html" (dict "context" .) -}}
|
{{- partial "language-switch.html" (dict "context" .) -}}
|
||||||
{{- with $displayThemeToggle }}{{ partial "theme-toggle.html" }}{{ end -}}
|
{{- with $displayThemeToggle }}{{ partial "theme-toggle.html" }}{{ end -}}
|
||||||
@ -26,21 +24,14 @@
|
|||||||
<hr class="dark:hx-border-neutral-800" />
|
<hr class="dark:hx-border-neutral-800" />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<div
|
|
||||||
class="hextra-custom-footer {{ $footerWidth }} hx-pl-[max(env(safe-area-inset-left),1.5rem)] hx-pr-[max(env(safe-area-inset-right),1.5rem)] hx-text-gray-600 dark:hx-text-gray-400"
|
|
||||||
>
|
|
||||||
{{- partial "custom/footer.html" (dict "context" . "switchesVisible" $footerSwitchesVisible "copyrightVisible" $copyrightSectionVisible) -}}
|
|
||||||
</div>
|
|
||||||
{{- if $copyrightSectionVisible -}}
|
|
||||||
<div
|
<div
|
||||||
class="{{ $footerWidth }} hx-mx-auto hx-flex hx-justify-center hx-py-12 hx-pl-[max(env(safe-area-inset-left),1.5rem)] hx-pr-[max(env(safe-area-inset-right),1.5rem)] hx-text-gray-600 dark:hx-text-gray-400 md:hx-justify-start"
|
class="{{ $footerWidth }} hx-mx-auto hx-flex hx-justify-center hx-py-12 hx-pl-[max(env(safe-area-inset-left),1.5rem)] hx-pr-[max(env(safe-area-inset-right),1.5rem)] hx-text-gray-600 dark:hx-text-gray-400 md:hx-justify-start"
|
||||||
>
|
>
|
||||||
<div class="hx-flex hx-w-full hx-flex-col hx-items-center sm:hx-items-start">
|
<div class="hx-flex hx-w-full hx-flex-col hx-items-center sm:hx-items-start">
|
||||||
{{- if (.Site.Params.footer.displayPoweredBy | default true) }}<div class="hx-font-semibold">{{ template "theme-credit" $poweredBy }}</div>{{- end -}}
|
{{- if (.Site.Params.footer.displayPoweredBy | default true) }}<div class="hx-font-semibold">{{ template "theme-credit" $poweredBy }}</div>{{ end }}
|
||||||
{{- if .Site.Params.footer.displayCopyright }}<div class="hx-mt-6 hx-text-xs">{{ $copyright | markdownify }}</div>{{- end -}}
|
{{- if .Site.Params.footer.displayCopyright }}<div class="hx-mt-6 hx-text-xs">{{ $copyright | markdownify }}</div>{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
{{- define "theme-credit" -}}
|
{{- define "theme-credit" -}}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
{{- $jsLang := resources.Get "js/lang.js" -}}
|
{{- $jsLang := resources.Get "js/lang.js" -}}
|
||||||
{{- $jsCodeCopy := resources.Get "js/code-copy.js" -}}
|
{{- $jsCodeCopy := resources.Get "js/code-copy.js" -}}
|
||||||
{{- $jsFileTree := resources.Get "js/filetree.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" -}}
|
{{- $jsBackToTop := resources.Get "js/back-to-top.js" -}}
|
||||||
|
|
||||||
{{- $scripts := slice $jsTheme $jsMenu $jsCodeCopy $jsTabs $jsLang $jsFileTree $jsSidebar $jsBackToTop | resources.Concat "js/main.js" -}}
|
{{- $scripts := slice $jsTheme $jsMenu $jsCodeCopy $jsTabs $jsLang $jsFileTree $jsSidebar $jsBackToTop | resources.Concat "js/main.js" -}}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
{{- $content := .content -}}
|
|
||||||
{{- $emoji := .emoji -}}
|
|
||||||
{{- $icon := .icon -}}
|
|
||||||
|
|
||||||
{{- $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" -}}
|
|
||||||
|
|
||||||
{{- $class := .class | default $defaultClass -}}
|
|
||||||
|
|
||||||
|
|
||||||
<div class="hx-overflow-x-auto hx-mt-6 hx-flex hx-rounded-lg hx-border hx-py-2 ltr:hx-pr-4 rtl:hx-pl-4 contrast-more:hx-border-current contrast-more:dark:hx-border-current {{ $class }}">
|
|
||||||
<div class="ltr:hx-pl-3 ltr:hx-pr-2 rtl:hx-pr-3 rtl:hx-pl-2">
|
|
||||||
{{- with $emoji -}}
|
|
||||||
<div class="hx-select-none hx-text-xl" style="font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';">
|
|
||||||
{{- . -}}
|
|
||||||
</div>
|
|
||||||
{{- else -}}
|
|
||||||
{{- with $icon -}}
|
|
||||||
{{ partial "utils/icon.html" (dict "name" . "attributes" `height=1.2em class="hx-inline-block hx-align-middle"`) -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hx-w-full hx-min-w-0 hx-leading-7">
|
|
||||||
<div class="hx-mt-6 hx-leading-7 first:hx-mt-0">
|
|
||||||
{{- $content -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
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 -}}
|
@ -1,19 +1,37 @@
|
|||||||
{{- $calloutEmojiDict := dict "info" "ℹ️" "warning" "⚠️" "error" "🚫" -}}
|
{{ $calloutEmojiDict := dict "info" "ℹ️" "warning" "⚠️" "error" "🚫" }}
|
||||||
{{- $type := .Get "type" | default "default" -}}
|
{{ $type := .Get "type" | default "default" }}
|
||||||
{{/* If emoji is not set, use the emoji from dict */}}
|
{{/* If emoji is not set, use the emoji from dict */}}
|
||||||
{{- $emoji := .Get "emoji" -}}
|
{{ $emoji := .Get "emoji" }}
|
||||||
{{- if eq $emoji "" -}}
|
{{ if eq $emoji "" }}
|
||||||
{{- $emoji = index $calloutEmojiDict $type -}}
|
{{ $emoji = index $calloutEmojiDict $type }}
|
||||||
{{- end -}}
|
{{ end }}
|
||||||
{{/* Also allow using "icon" */}}
|
{{/* Also allow using "icon" */}}
|
||||||
{{- $icon := .Get "icon" -}}
|
{{ $icon := .Get "icon" }}
|
||||||
{{- $content := .InnerDeindent | markdownify -}}
|
|
||||||
|
|
||||||
{{- $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" -}}
|
{{ $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" }}
|
||||||
{{- $infoClass := "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200" -}}
|
{{ $infoClass := "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200" }}
|
||||||
{{- $warningClass := "hx-border-yellow-100 hx-bg-yellow-50 hx-text-yellow-900 dark:hx-border-yellow-200/30 dark:hx-bg-yellow-700/30 dark:hx-text-yellow-200" -}}
|
{{ $warningClass := "hx-border-yellow-100 hx-bg-yellow-50 hx-text-yellow-900 dark:hx-border-yellow-200/30 dark:hx-bg-yellow-700/30 dark:hx-text-yellow-200" }}
|
||||||
{{- $errorClass := "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200" -}}
|
{{ $errorClass := "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200" }}
|
||||||
|
|
||||||
{{- $class := cond (eq $type "info") $infoClass (cond (eq $type "warning") $warningClass (cond (eq $type "error") $errorClass $defaultClass)) -}}
|
{{ $class := cond (eq $type "info") $infoClass (cond (eq $type "warning") $warningClass (cond (eq $type "error") $errorClass $defaultClass)) }}
|
||||||
|
|
||||||
{{- partial "shortcodes/callout.html" (dict "content" $content "emoji" $emoji "icon" $icon "class" $class) -}}
|
|
||||||
|
<div class="hx-overflow-x-auto hx-mt-6 hx-flex hx-rounded-lg hx-border hx-py-2 ltr:hx-pr-4 rtl:hx-pl-4 contrast-more:hx-border-current contrast-more:dark:hx-border-current {{ $class }}">
|
||||||
|
<div class="ltr:hx-pl-3 ltr:hx-pr-2 rtl:hx-pr-3 rtl:hx-pl-2">
|
||||||
|
{{- with $emoji -}}
|
||||||
|
<div class="hx-select-none hx-text-xl" style="font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';">
|
||||||
|
{{ . }}
|
||||||
|
</div>
|
||||||
|
{{- else -}}
|
||||||
|
{{- with $icon }}
|
||||||
|
{{ partial "utils/icon.html" (dict "name" . "attributes" `height=1.2em class="hx-inline-block hx-align-middle"`) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hx-w-full hx-min-w-0 hx-leading-7">
|
||||||
|
<div class="hx-mt-6 hx-leading-7 first:hx-mt-0">
|
||||||
|
{{ .InnerDeindent | markdownify }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -7,6 +7,6 @@ command = "cd exampleSite && hugo --gc --minify --themesDir ../.. -b ${DEPLOY_PR
|
|||||||
ignore = "false"
|
ignore = "false"
|
||||||
|
|
||||||
[build.environment]
|
[build.environment]
|
||||||
HUGO_VERSION = "0.138.0"
|
HUGO_VERSION = "0.132.2"
|
||||||
GO_VERSION = "1.22.3"
|
GO_VERSION = "1.22.3"
|
||||||
NODE_VERSION = "22.2.0"
|
NODE_VERSION = "22.2.0"
|
||||||
|
14
package-lock.json
generated
14
package-lock.json
generated
@ -523,10 +523,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.6",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"path-key": "^3.1.0",
|
"path-key": "^3.1.0",
|
||||||
"shebang-command": "^2.0.0",
|
"shebang-command": "^2.0.0",
|
||||||
@ -1030,9 +1031,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nanoid": {
|
"node_modules/nanoid": {
|
||||||
"version": "3.3.8",
|
"version": "3.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||||
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
|
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -1040,6 +1041,7 @@
|
|||||||
"url": "https://github.com/sponsors/ai"
|
"url": "https://github.com/sponsors/ai"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
"nanoid": "bin/nanoid.cjs"
|
"nanoid": "bin/nanoid.cjs"
|
||||||
},
|
},
|
||||||
|
@ -61,11 +61,8 @@ module.exports = {
|
|||||||
neutral: colors.neutral,
|
neutral: colors.neutral,
|
||||||
red: colors.red,
|
red: colors.red,
|
||||||
orange: colors.orange,
|
orange: colors.orange,
|
||||||
green: colors.green,
|
|
||||||
indigo: colors.indigo,
|
|
||||||
blue: colors.blue,
|
blue: colors.blue,
|
||||||
yellow: colors.yellow,
|
yellow: colors.yellow,
|
||||||
amber: colors.amber,
|
|
||||||
primary: {
|
primary: {
|
||||||
50: makePrimaryColor(97),
|
50: makePrimaryColor(97),
|
||||||
100: makePrimaryColor(94),
|
100: makePrimaryColor(94),
|
||||||
|
Reference in New Issue
Block a user