mirror of
https://github.com/imfing/hextra.git
synced 2025-05-15 18:28:26 -04:00
Compare commits
14 Commits
451adfa404
...
931ae6e6ed
Author | SHA1 | Date | |
---|---|---|---|
![]() |
931ae6e6ed | ||
![]() |
e83c11f31a | ||
![]() |
f439e6bb87 | ||
![]() |
9c0ba06db4 | ||
![]() |
5c6ed19c34 | ||
![]() |
0986b9ee84 | ||
![]() |
d2d2a62d5a | ||
![]() |
e3b582676e | ||
![]() |
56f6f19978 | ||
![]() |
712e670f9d | ||
![]() |
2df115a195 | ||
![]() |
365d78da13 | ||
![]() |
f87f19fb74 | ||
![]() |
795755bf9b |
@ -3,7 +3,7 @@
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/hugo:1": {
|
||||
"extended": true,
|
||||
"version": "0.124.1"
|
||||
"version": "0.131.0"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/node:1": {}
|
||||
},
|
||||
|
2
.github/workflows/pages.yml
vendored
2
.github/workflows/pages.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HUGO_VERSION: 0.126.1
|
||||
HUGO_VERSION: 0.131.0
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
@ -74,7 +74,7 @@
|
||||
/* CommentPreprocFile */ .chroma .cpf { color: #8b949e; font-weight: bold; font-style: italic }
|
||||
/* Generic */ .chroma .g { }
|
||||
/* GenericDeleted */ .chroma .gd { color: #ffa198; background-color: #490202 }
|
||||
/* GenericEmph */ .chroma .ge { font-style: italic }
|
||||
/* GenericEmph */ .chroma .ge { color: inherit; font-style: italic }
|
||||
/* GenericError */ .chroma .gr { color: #ffa198 }
|
||||
/* GenericHeading */ .chroma .gh { color: #79c0ff; font-weight: bold }
|
||||
/* GenericInserted */ .chroma .gi { color: #56d364; background-color: #0f5323 }
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com
|
||||
! tailwindcss v3.4.9 | MIT License | https://tailwindcss.com
|
||||
*//*
|
||||
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
||||
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
||||
@ -596,10 +596,6 @@ video {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.hx-my-1 {
|
||||
margin-top: 0.25rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.hx-my-1\.5 {
|
||||
margin-top: 0.375rem;
|
||||
margin-bottom: 0.375rem;
|
||||
@ -608,9 +604,6 @@ video {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
.-hx-mb-0 {
|
||||
margin-bottom: -0px;
|
||||
}
|
||||
.-hx-mb-0\.5 {
|
||||
margin-bottom: -0.125rem;
|
||||
}
|
||||
@ -719,9 +712,6 @@ video {
|
||||
.hx-h-2 {
|
||||
height: 0.5rem;
|
||||
}
|
||||
.hx-h-3 {
|
||||
height: 0.75rem;
|
||||
}
|
||||
.hx-h-3\.5 {
|
||||
height: 0.875rem;
|
||||
}
|
||||
@ -758,9 +748,6 @@ video {
|
||||
.hx-w-2 {
|
||||
width: 0.5rem;
|
||||
}
|
||||
.hx-w-3 {
|
||||
width: 0.75rem;
|
||||
}
|
||||
.hx-w-3\.5 {
|
||||
width: 0.875rem;
|
||||
}
|
||||
@ -888,10 +875,6 @@ video {
|
||||
.hx-gap-4 {
|
||||
gap: 1rem;
|
||||
}
|
||||
.hx-gap-x-1 {
|
||||
-moz-column-gap: 0.25rem;
|
||||
column-gap: 0.25rem;
|
||||
}
|
||||
.hx-gap-x-1\.5 {
|
||||
-moz-column-gap: 0.375rem;
|
||||
column-gap: 0.375rem;
|
||||
@ -914,9 +897,15 @@ video {
|
||||
.hx-overflow-x-hidden {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.hx-overflow-y-hidden {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.hx-overscroll-contain {
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.hx-overscroll-x-contain {
|
||||
overscroll-behavior-x: contain;
|
||||
}
|
||||
.hx-text-ellipsis {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
@ -1060,9 +1049,6 @@ video {
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
}
|
||||
.hx-p-0 {
|
||||
padding: 0px;
|
||||
}
|
||||
.hx-p-0\.5 {
|
||||
padding: 0.125rem;
|
||||
}
|
||||
@ -1081,10 +1067,6 @@ video {
|
||||
.hx-p-6 {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
.hx-px-1 {
|
||||
padding-left: 0.25rem;
|
||||
padding-right: 0.25rem;
|
||||
}
|
||||
.hx-px-1\.5 {
|
||||
padding-left: 0.375rem;
|
||||
padding-right: 0.375rem;
|
||||
@ -1093,6 +1075,10 @@ video {
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
.hx-px-2\.5 {
|
||||
padding-left: 0.625rem;
|
||||
padding-right: 0.625rem;
|
||||
}
|
||||
.hx-px-3 {
|
||||
padding-left: 0.75rem;
|
||||
padding-right: 0.75rem;
|
||||
@ -2119,7 +2105,7 @@ article details > summary::before {
|
||||
/* GenericDeleted */
|
||||
.dark .highlight .chroma .gd { color: #ffa198; background-color: #490202 }
|
||||
/* GenericEmph */
|
||||
.dark .highlight .chroma .ge { font-style: italic }
|
||||
.dark .highlight .chroma .ge { color: inherit; font-style: italic }
|
||||
/* GenericError */
|
||||
.dark .highlight .chroma .gr { color: #ffa198 }
|
||||
/* GenericHeading */
|
||||
@ -2252,6 +2238,9 @@ article details > summary::before {
|
||||
.hextra-cards {
|
||||
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--hextra-cards-grid-cols))), 1fr));
|
||||
}
|
||||
.hextra-card {
|
||||
position: relative;
|
||||
}
|
||||
.hextra-card img {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
@ -2267,6 +2256,7 @@ article details > summary::before {
|
||||
}
|
||||
.hextra-card p {
|
||||
margin-top: 0.5rem;
|
||||
position: relative;
|
||||
}
|
||||
.dark .hextra-card svg {
|
||||
color: #ffffff66;
|
||||
@ -2274,6 +2264,13 @@ article details > summary::before {
|
||||
.dark .hextra-card:hover svg {
|
||||
color: currentColor;
|
||||
}
|
||||
.hextra-card-tag {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
z-index: 10;
|
||||
font-size: .65rem;
|
||||
}
|
||||
.steps h3 {
|
||||
counter-increment: step;
|
||||
}
|
||||
@ -2798,27 +2795,27 @@ body:is(html[class~="dark"] *) {
|
||||
.hx-group\/copybtn.copied .group-\[\.copied\]\/copybtn\:hx-hidden {
|
||||
display: none;
|
||||
}
|
||||
.data-\[state\=selected\]\:hx-block[data-state=selected] {
|
||||
.data-\[state\=selected\]\:hx-block[data-state="selected"] {
|
||||
display: block;
|
||||
}
|
||||
.data-\[state\=closed\]\:hx-hidden[data-state=closed] {
|
||||
.data-\[state\=closed\]\:hx-hidden[data-state="closed"] {
|
||||
display: none;
|
||||
}
|
||||
.data-\[state\=open\]\:hx-hidden[data-state=open] {
|
||||
.data-\[state\=open\]\:hx-hidden[data-state="open"] {
|
||||
display: none;
|
||||
}
|
||||
.data-\[state\=selected\]\:hx-border-primary-500[data-state=selected] {
|
||||
.data-\[state\=selected\]\:hx-border-primary-500[data-state="selected"] {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(var(--primary-hue) var(--primary-saturation) 50% / var(--tw-border-opacity));
|
||||
}
|
||||
.data-\[state\=selected\]\:hx-text-primary-600[data-state=selected] {
|
||||
.data-\[state\=selected\]\:hx-text-primary-600[data-state="selected"] {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(var(--primary-hue) var(--primary-saturation) 45% / var(--tw-text-opacity));
|
||||
}
|
||||
.hx-group[data-theme=dark] .group-data-\[theme\=dark\]\:hx-hidden {
|
||||
.hx-group[data-theme="dark"] .group-data-\[theme\=dark\]\:hx-hidden {
|
||||
display: none;
|
||||
}
|
||||
.hx-group[data-theme=light] .group-data-\[theme\=light\]\:hx-hidden {
|
||||
.hx-group[data-theme="light"] .group-data-\[theme\=light\]\:hx-hidden {
|
||||
display: none;
|
||||
}
|
||||
@media (prefers-contrast: more) {
|
||||
@ -3363,9 +3360,6 @@ body:is(html[class~="dark"] *) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.ltr\:hx-right-1:where([dir="ltr"], [dir="ltr"] *) {
|
||||
right: 0.25rem;
|
||||
}
|
||||
.ltr\:hx-right-1\.5:where([dir="ltr"], [dir="ltr"] *) {
|
||||
right: 0.375rem;
|
||||
}
|
||||
@ -3440,9 +3434,6 @@ body:is(html[class~="dark"] *) {
|
||||
left: auto;
|
||||
}
|
||||
}
|
||||
.rtl\:hx-left-1:where([dir="rtl"], [dir="rtl"] *) {
|
||||
left: 0.25rem;
|
||||
}
|
||||
.rtl\:hx-left-1\.5:where([dir="rtl"], [dir="rtl"] *) {
|
||||
left: 0.375rem;
|
||||
}
|
||||
|
@ -2,6 +2,10 @@
|
||||
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--hextra-cards-grid-cols))), 1fr));
|
||||
}
|
||||
|
||||
.hextra-card {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hextra-card img {
|
||||
user-select: none;
|
||||
}
|
||||
@ -18,6 +22,7 @@
|
||||
|
||||
.hextra-card p {
|
||||
margin-top: 0.5rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dark .hextra-card svg {
|
||||
@ -27,3 +32,11 @@
|
||||
.dark .hextra-card:hover svg {
|
||||
color: currentColor;
|
||||
}
|
||||
|
||||
.hextra-card-tag {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
z-index: 10;
|
||||
font-size: .65rem;
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
document.querySelectorAll('.tabs-toggle').forEach(function (button) {
|
||||
document.querySelectorAll('.hextra-tabs-toggle').forEach(function (button) {
|
||||
button.addEventListener('click', function (e) {
|
||||
// set parent tabs to unselected
|
||||
const tabs = Array.from(e.target.parentElement.querySelectorAll('.tabs-toggle'));
|
||||
const tabs = Array.from(e.target.parentElement.querySelectorAll('.hextra-tabs-toggle'));
|
||||
tabs.map(tab => tab.dataset.state = '');
|
||||
|
||||
// set current tab to selected
|
||||
e.target.dataset.state = 'selected';
|
||||
|
||||
// set all panels to unselected
|
||||
const panelsContainer = e.target.parentElement.nextElementSibling;
|
||||
const panelsContainer = e.target.parentElement.parentElement.nextElementSibling;
|
||||
Array.from(panelsContainer.children).forEach(function (panel) {
|
||||
panel.dataset.state = '';
|
||||
});
|
||||
|
@ -28,14 +28,28 @@ Hugo از سینتکس [مارکداون](https://en.wikipedia.org/wiki/Markd
|
||||
|
||||
[^1]: نقلقول بالا گزیدهای از [سخنرانی](https://www.youtube.com/watch?v=PAAkCSZUG1c) راب پایک در Gopherfest، در تاریخ ۲۷ آبان ۱۳۹۴ است.
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
> با اشتراکگذاری حافظه ارتباط برقرار نکنید، حافظه را با برقراری ارتباط به اشتراک بگذارید.<br>
|
||||
> — <cite>راب پایک[^1]</cite>
|
||||
|
||||
[^1]: نقلقول بالا گزیدهای از [سخنرانی](https://www.youtube.com/watch?v=PAAkCSZUG1c) راب پایک در Gopherfest، در تاریخ ۲۷ آبان ۱۳۹۴ است.
|
||||
```
|
||||
|
||||
### جدولها
|
||||
|
||||
جدولها بخشی از مشخصات اصلی مارکداون نیستند، اما Hugo از آنها در خارج از جعبه پشتیبانی میکند.
|
||||
|
||||
نام | سن
|
||||
--------|------
|
||||
گودرز | ۳۰
|
||||
آصف | ۳۴
|
||||
| نام | سن |
|
||||
|--------|------|
|
||||
| گودرز | ۳۰|
|
||||
| آصف | ۳۴ |
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
| نام | سن |
|
||||
|--------|------|
|
||||
| گودرز | ۳۰|
|
||||
| آصف | ۳۴ |
|
||||
```
|
||||
|
||||
#### مارکداون درونخطی درون جدولها
|
||||
|
||||
@ -43,6 +57,12 @@ Hugo از سینتکس [مارکداون](https://en.wikipedia.org/wiki/Markd
|
||||
| -------- | -------- | ------ |
|
||||
| *کج* | **توپر** | `کد` |
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
| کج | توپر | کد |
|
||||
| -------- | -------- | ------ |
|
||||
| *کج* | **توپر** | `کد` |
|
||||
```
|
||||
|
||||
### بلوکهای کد
|
||||
|
||||
{{< cards >}}
|
||||
@ -57,12 +77,24 @@ Hugo از سینتکس [مارکداون](https://en.wikipedia.org/wiki/Markd
|
||||
2. دومین آیتم
|
||||
3. سومین آیتم
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
1. اولین آیتم
|
||||
2. دومین آیتم
|
||||
3. سومین آیتم
|
||||
```
|
||||
|
||||
#### فهرست مرتبنشده
|
||||
|
||||
* فهرست آیتم
|
||||
* یک آیتم دیگه
|
||||
* و یک آیتم دیگه
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
* فهرست آیتم
|
||||
* یک آیتم دیگه
|
||||
* و یک آیتم دیگه
|
||||
```
|
||||
|
||||
#### فهرست تو در تو
|
||||
|
||||
* میوه
|
||||
@ -73,13 +105,31 @@ Hugo از سینتکس [مارکداون](https://en.wikipedia.org/wiki/Markd
|
||||
* شیر
|
||||
* پنیر
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
* میوه
|
||||
* سیب
|
||||
* پرتقال
|
||||
* موز
|
||||
* لبنیات
|
||||
* شیر
|
||||
* پنیر
|
||||
```
|
||||
|
||||
### عکسها
|
||||
|
||||

|
||||

|
||||
|
||||
```markdown {filename=Markdown}
|
||||

|
||||
```
|
||||
|
||||
با توضیحات:
|
||||
|
||||

|
||||

|
||||
|
||||
```markdown {filename=Markdown}
|
||||

|
||||
```
|
||||
|
||||
## پیکربندی
|
||||
|
||||
|
@ -28,14 +28,28 @@ 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.
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
||||
```
|
||||
|
||||
### Tables
|
||||
|
||||
Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box.
|
||||
|
||||
Name | Age
|
||||
--------|------
|
||||
Bob | 27
|
||||
Alice | 23
|
||||
| Name | Age |
|
||||
|--------|------|
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
| Name | Age |
|
||||
|--------|------|
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
```
|
||||
|
||||
#### Inline Markdown within tables
|
||||
|
||||
@ -43,6 +57,12 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-
|
||||
| -------- | -------- | ------ |
|
||||
| *italics* | **bold** | `code` |
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
| Italics | Bold | Code |
|
||||
| -------- | -------- | ------ |
|
||||
| *italics* | **bold** | `code` |
|
||||
```
|
||||
|
||||
### Code Blocks
|
||||
|
||||
{{< cards >}}
|
||||
@ -57,12 +77,24 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-
|
||||
2. Second item
|
||||
3. Third item
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
```
|
||||
|
||||
#### Unordered List
|
||||
|
||||
* List item
|
||||
* Another item
|
||||
* And another item
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
* List item
|
||||
* Another item
|
||||
* And another item
|
||||
```
|
||||
|
||||
#### Nested list
|
||||
|
||||
* Fruit
|
||||
@ -73,13 +105,31 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-
|
||||
* Milk
|
||||
* Cheese
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
* Fruit
|
||||
* Apple
|
||||
* Orange
|
||||
* Banana
|
||||
* Dairy
|
||||
* Milk
|
||||
* Cheese
|
||||
```
|
||||
|
||||
### Images
|
||||
|
||||

|
||||

|
||||
|
||||
```markdown {filename=Markdown}
|
||||

|
||||
```
|
||||
|
||||
With caption:
|
||||
|
||||

|
||||

|
||||
|
||||
```markdown {filename=Markdown}
|
||||

|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
|
@ -28,14 +28,28 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
|
||||
|
||||
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
||||
```
|
||||
|
||||
### 表格
|
||||
|
||||
表格并非核心 Markdown 规范,但 Hugo 支持开箱即用的表格:
|
||||
|
||||
Name | Age
|
||||
--------|------
|
||||
Bob | 27
|
||||
Alice | 23
|
||||
| Name | Age |
|
||||
|--------|------|
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
| Name | Age |
|
||||
|--------|------|
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
```
|
||||
|
||||
#### Markdown 表格中的内联
|
||||
|
||||
@ -43,6 +57,12 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
|
||||
| -------- | -------- | ------ |
|
||||
| *italics* | **bold** | `code` |
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
| Italics | Bold | Code |
|
||||
| -------- | -------- | ------ |
|
||||
| *italics* | **bold** | `code` |
|
||||
```
|
||||
|
||||
### 代码块
|
||||
|
||||
{{< cards >}}
|
||||
@ -57,12 +77,24 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
|
||||
2. Second item
|
||||
3. Third item
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
```
|
||||
|
||||
#### 无序列表
|
||||
|
||||
* List item
|
||||
* Another item
|
||||
* And another item
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
* List item
|
||||
* Another item
|
||||
* And another item
|
||||
```
|
||||
|
||||
#### 嵌套列表
|
||||
|
||||
* Fruit
|
||||
@ -73,13 +105,31 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
|
||||
* Milk
|
||||
* Cheese
|
||||
|
||||
```markdown {filename=Markdown}
|
||||
* Fruit
|
||||
* Apple
|
||||
* Orange
|
||||
* Banana
|
||||
* Dairy
|
||||
* Milk
|
||||
* Cheese
|
||||
```
|
||||
|
||||
### 图片
|
||||
|
||||

|
||||

|
||||
|
||||
```markdown {filename=Markdown}
|
||||

|
||||
```
|
||||
|
||||
带有标题:
|
||||
|
||||

|
||||

|
||||
|
||||
```markdown {filename=Markdown}
|
||||

|
||||
```
|
||||
|
||||
## 配置
|
||||
|
||||
|
@ -6,7 +6,7 @@ prev: /docs/guide
|
||||
|
||||
## 目录结构
|
||||
|
||||
默认情况下,Hugo 在 `context` 目录中搜索 Markdown 文件,目录的结构决定了网站的最终输出结构。
|
||||
默认情况下,Hugo 在 `content` 目录中搜索 Markdown 文件,目录的结构决定了网站的最终输出结构。
|
||||
以示例网站为例:
|
||||
|
||||
<!--more-->
|
||||
|
@ -7,11 +7,12 @@ linkTitle: Cards
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="../callout" title="Callout" icon="warning" >}}
|
||||
{{< card link="../callout" title="Card with tag" icon="tag" tag="custom tag">}}
|
||||
{{< card link="/" title="No Icon" >}}
|
||||
{{< /cards >}}
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="/" title="Image Card" image="https://source.unsplash.com/featured/800x600?landscape" subtitle="Unsplash Landscape" >}}
|
||||
{{< card link="/" title="Image Card" image="https://github.com/user-attachments/assets/71b7e3ec-1a8d-4582-b600-5425c6cc0407" subtitle="Internet Image" >}}
|
||||
{{< 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 >}}
|
||||
@ -21,6 +22,7 @@ linkTitle: Cards
|
||||
```
|
||||
{{</* cards */>}}
|
||||
{{</* card link="../callout" title="Callout" icon="warning" */>}}
|
||||
{{</* card link="../callout" title="Card with tag" icon="warning" tag= "A custom tag" */>}}
|
||||
{{</* card link="/" title="No Icon" */>}}
|
||||
{{</* /cards */>}}
|
||||
```
|
||||
@ -36,11 +38,13 @@ linkTitle: Cards
|
||||
## Card Parameters
|
||||
|
||||
| Parameter | Description |
|
||||
|----------- |---------------------------------------|
|
||||
|----------- |-----------------------------------------------------------------|
|
||||
| `link` | URL (internal or external). |
|
||||
| `title` | Title heading for the card. |
|
||||
| `subtitle` | Subtitle heading (supports Markdown). |
|
||||
| `icon` | Name of the icon. |
|
||||
| `tag` | Text in tag. |
|
||||
| `tagColor` | Color of the tag: `gray` (default), `yellow`, `red` and `blue`. |
|
||||
|
||||
## Image Card
|
||||
|
||||
@ -62,3 +66,24 @@ Hextra auto-detects if image processing is needed during build and applies the `
|
||||
It currently supports these `method`: `Resize`, `Fit`, `Fill` and `Crop`.
|
||||
|
||||
For more on Hugo's built in image processing commands, methods, and options see their [Image Processing Documentation](https://gohugo.io/content-management/image-processing/).
|
||||
|
||||
## Tags
|
||||
|
||||
Card supports adding tags which could be useful to show extra status information.
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="../callout" title="Card with default tag" tag="tag text" >}}
|
||||
{{< card link="../callout" title="Card with error tag" tag="tag text" tagType="error" >}}
|
||||
{{< card link="../callout" title="Card with info tag" tag="tag text" tagType="info" >}}
|
||||
{{< card link="../callout" title="Card with warning tag" tag="tag text" tagType="warning" >}}
|
||||
{{< card link="/" title="Image Card" image="https://github.com/user-attachments/assets/71b7e3ec-1a8d-4582-b600-5425c6cc0407" subtitle="Internet Image" tag="tag text" tagType="error" >}}
|
||||
{{< /cards >}}
|
||||
|
||||
```
|
||||
{{</* cards */>}}
|
||||
{{</* card link="../callout" title="Card with default tag color" tag="tag text" */>}}
|
||||
{{</* card link="../callout" title="Card with default red tag" tag="tag text" tagType="error" */>}}
|
||||
{{</* card link="../callout" title="Card with blue tag" tag="tag text" tagType="info" */>}}
|
||||
{{</* card link="../callout" title="Card with yellow tag" tag="tag text" tagType="warning" */>}}
|
||||
{{</* /cards */>}}
|
||||
```
|
||||
|
@ -78,11 +78,18 @@ def main():
|
||||
say_hello()
|
||||
```
|
||||
|
||||
|
||||
### Copy Button
|
||||
|
||||
By default, copy button is enabled for code blocks.
|
||||
By default, copy button is enabled for code blocks. Its behavior can changed by modifying the site configuration file:
|
||||
|
||||
```yaml {linenos=table,linenostart=42,filename="hugo.yaml"}
|
||||
params:
|
||||
highlight:
|
||||
copy:
|
||||
enable: true
|
||||
# hover | always
|
||||
display: hover
|
||||
```
|
||||
|
||||
## Supported Languages
|
||||
|
||||
|
@ -142,6 +142,7 @@ params:
|
||||
|
||||
editURL:
|
||||
enable: true
|
||||
location: "toc" # single | toc
|
||||
base: "https://github.com/imfing/hextra/edit/main/exampleSite/content"
|
||||
|
||||
blog:
|
||||
@ -151,6 +152,12 @@ params:
|
||||
sortBy: date
|
||||
sortOrder: desc # or "asc"
|
||||
|
||||
highlight:
|
||||
copy:
|
||||
enable: true
|
||||
# hover | always
|
||||
display: hover
|
||||
|
||||
comments:
|
||||
enable: false
|
||||
type: giscus
|
||||
|
@ -211,6 +211,7 @@
|
||||
"hextra-card-icon",
|
||||
"hextra-card-image",
|
||||
"hextra-card-subtitle",
|
||||
"hextra-card-tag",
|
||||
"hextra-cards",
|
||||
"hextra-code-block",
|
||||
"hextra-code-copy-btn",
|
||||
@ -222,6 +223,8 @@
|
||||
"hextra-footer",
|
||||
"hextra-scrollbar",
|
||||
"hextra-sidebar-collapsible-button",
|
||||
"hextra-tabs-panel",
|
||||
"hextra-tabs-toggle",
|
||||
"hextra-toc",
|
||||
"highlight",
|
||||
"hover:dark:hx-bg-primary-500/10",
|
||||
@ -392,7 +395,9 @@
|
||||
"hx-overflow-x-auto",
|
||||
"hx-overflow-x-hidden",
|
||||
"hx-overflow-y-auto",
|
||||
"hx-overflow-y-hidden",
|
||||
"hx-overscroll-contain",
|
||||
"hx-overscroll-x-contain",
|
||||
"hx-p-0.5",
|
||||
"hx-p-1",
|
||||
"hx-p-1.5",
|
||||
@ -414,6 +419,7 @@
|
||||
"hx-pt-8",
|
||||
"hx-px-1.5",
|
||||
"hx-px-2",
|
||||
"hx-px-2.5",
|
||||
"hx-px-3",
|
||||
"hx-px-4",
|
||||
"hx-px-6",
|
||||
@ -476,6 +482,7 @@
|
||||
"hx-text-white",
|
||||
"hx-text-xl",
|
||||
"hx-text-xs",
|
||||
"hx-text-xxs",
|
||||
"hx-text-yellow-900",
|
||||
"hx-to-gray-600",
|
||||
"hx-top-0",
|
||||
@ -603,8 +610,6 @@
|
||||
"steps",
|
||||
"subheading-anchor",
|
||||
"success-icon",
|
||||
"tabs-panel",
|
||||
"tabs-toggle",
|
||||
"theme-toggle",
|
||||
"xl:hx-block"
|
||||
],
|
||||
|
28
layouts/partials/components/edit-url.html
Normal file
28
layouts/partials/components/edit-url.html
Normal file
@ -0,0 +1,28 @@
|
||||
{{- $editThisPage := (T "editThisPage") | default "Edit this page"}}
|
||||
|
||||
{{- $context := .context -}}
|
||||
|
||||
{{- $linkClass := "hx-mb-4 hx-block hx-text-xs hx-text-gray-500 ltr:hx-text-right rtl:hx-text-left dark:hx-text-gray-400" -}}
|
||||
|
||||
{{- if and (site.Params.editURL.enable) (eq site.Params.editURL.location .source) -}}
|
||||
{{- $editURL := site.Params.editURL.base | default "" -}}
|
||||
|
||||
{{- with $context.Params.editURL -}}
|
||||
{{/* if `editURL` is set in the front matter */}}
|
||||
{{- $editURL = . -}}
|
||||
{{- else -}}
|
||||
{{- with $context.File -}}
|
||||
{{/* `.FileInfo.Meta.SourceRoot` is a Hugo internal field, e.g. `/path/to/repo/content/en/` */}}
|
||||
{{- $sourceDir := replace (strings.TrimPrefix .FileInfo.Meta.BaseDir .FileInfo.Meta.SourceRoot) "\\" "/" -}}
|
||||
{{- $sourceDir = strings.TrimPrefix "/content" $sourceDir -}}
|
||||
{{- $path := replace .Path "\\" "/" -}}
|
||||
{{- $editURL = urls.JoinPath $editURL $sourceDir $path -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if eq site.Params.editURL.location "toc" -}}
|
||||
{{- $linkClass = "hx-text-xs hx-font-medium hx-text-gray-500 hover:hx-text-gray-900 dark:hx-text-gray-400 dark:hover:hx-text-gray-100 contrast-more:hx-text-gray-800 contrast-more:dark:hx-text-gray-50" -}}
|
||||
{{- end -}}
|
||||
|
||||
<a class="{{ $linkClass }}" href="{{ $editURL }}" target="_blank" rel="noreferer">{{ $editThisPage }}</a>
|
||||
{{- end -}}
|
@ -1,9 +1,12 @@
|
||||
{{- $lastUpdated := (T "lastUpdated") | default "Last updated on" -}}
|
||||
|
||||
{{- if site.Params.displayUpdatedDate -}}
|
||||
<div class="hx-mt-12 hx-mb-8 hx-block hx-text-xs hx-text-gray-500 ltr:hx-text-right rtl:hx-text-left dark:hx-text-gray-400">
|
||||
{{ partial "components/edit-url.html" (dict "source" "single" "context" .) }}
|
||||
{{- with .Lastmod -}}
|
||||
{{ $datetime := (time.Format "2006-01-02T15:04:05.000Z" .) }}
|
||||
<div class="hx-mt-12 hx-mb-8 hx-block hx-text-xs hx-text-gray-500 ltr:hx-text-right rtl:hx-text-left dark:hx-text-gray-400">{{ $lastUpdated }} <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time></div>
|
||||
<div class="hx-mt-4">{{ $lastUpdated }} <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time></div>
|
||||
</div>
|
||||
{{- else -}}
|
||||
<div class="hx-mt-16"></div>
|
||||
{{- end -}}
|
||||
|
@ -7,6 +7,8 @@
|
||||
{{- $width := .width -}}
|
||||
{{- $height := .height -}}
|
||||
{{- $imageStyle := .imageStyle -}}
|
||||
{{- $tag := .tag -}}
|
||||
{{- $tagType := .tagType -}}
|
||||
|
||||
{{ $linkClass := "hover:hx-border-gray-300 hx-bg-transparent hx-shadow-sm dark:hx-border-neutral-800 hover:hx-bg-slate-50 hover:hx-shadow-md dark:hover:hx-border-neutral-700 dark:hover:hx-bg-neutral-900" }}
|
||||
{{- with $image -}}
|
||||
@ -50,5 +52,17 @@
|
||||
{{- with $subtitle -}}
|
||||
<div class="hextra-card-subtitle hx-line-clamp-3 hx-text-sm hx-font-normal hx-text-gray-500 dark:hx-text-gray-400 hx-px-4 hx-mb-4 hx-mt-2">{{- $subtitle | markdownify -}}</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- if $tag }}
|
||||
{{ $defaultClass := "hx-text-gray-600 hx-text-xxs hx-bg-gray-100 dark:hx-bg-neutral-800 dark:hx-text-neutral-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" }}
|
||||
{{ $infoClass := "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200" }}
|
||||
{{ $errorClass := "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200" }}
|
||||
|
||||
{{ $tagClass := cond (eq $tagType "info") $infoClass (cond (eq $tagType "warning") $warningClass (cond (eq $tagType "error") $errorClass $defaultClass)) }}
|
||||
<div class="hextra-card-tag">
|
||||
<span class="hx-inline-block hx-rounded-full hx-px-2.5 hx-leading-6 {{ $tagClass }}">{{ $tag }}</span>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</a>
|
||||
{{- /* Strip trailing newline. */ -}}
|
||||
|
@ -24,22 +24,7 @@
|
||||
|
||||
{{/* TOC bottom part */}}
|
||||
<div class="{{ $borderClass }} hx-sticky hx-bottom-0 hx-flex hx-flex-col hx-items-start hx-gap-2 hx-pb-8 dark:hx-border-neutral-800 contrast-more:hx-border-t contrast-more:hx-border-neutral-400 contrast-more:hx-shadow-none contrast-more:dark:hx-border-neutral-400">
|
||||
{{- if site.Params.editURL.enable -}}
|
||||
{{- $editURL := site.Params.editURL.base | default "" -}}
|
||||
{{- with .Params.editURL -}}
|
||||
{{/* if `editURL` is set in the front matter */}}
|
||||
{{- $editURL = . -}}
|
||||
{{- else -}}
|
||||
{{- with .File -}}
|
||||
{{/* `.FileInfo.Meta.SourceRoot` is a Hugo internal field, e.g. `/path/to/repo/content/en/` */}}
|
||||
{{- $sourceDir := replace (strings.TrimPrefix .FileInfo.Meta.BaseDir .FileInfo.Meta.SourceRoot) "\\" "/" -}}
|
||||
{{- $sourceDir = strings.TrimPrefix "/content" $sourceDir -}}
|
||||
{{- $path := replace .Path "\\" "/" -}}
|
||||
{{- $editURL = urls.JoinPath $editURL $sourceDir $path -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<a class="hx-text-xs hx-font-medium hx-text-gray-500 hover:hx-text-gray-900 dark:hx-text-gray-400 dark:hover:hx-text-gray-100 contrast-more:hx-text-gray-800 contrast-more:dark:hx-text-gray-50" href="{{ $editURL }}" target="_blank" rel="noreferer">{{ $editThisPage }}</a>
|
||||
{{- end -}}
|
||||
{{ partial "components/edit-url.html" (dict "source" "toc" "context" .) }}
|
||||
{{/* Scroll To Top */}}
|
||||
<button aria-hidden="true" id="backToTop" onClick="scrollUp();" class="hx-transition-all hx-duration-75 hx-opacity-0 hx-text-xs hx-font-medium hx-text-gray-500 hover:hx-text-gray-900 dark:hx-text-gray-400 dark:hover:hx-text-gray-100 contrast-more:hx-text-gray-800 contrast-more:dark:hx-text-gray-50">
|
||||
<span>
|
||||
|
@ -7,6 +7,8 @@
|
||||
{{- $width := 0 -}}
|
||||
{{- $height := 0 -}}
|
||||
{{- $imageStyle := .Get "imageStyle" -}}
|
||||
{{- $tag := .Get "tag" -}}
|
||||
{{- $tagType := .Get "tagType" -}}
|
||||
|
||||
{{/* Image processing options */}}
|
||||
{{- $method := .Get "method" | default "Resize" | humanize -}}
|
||||
@ -48,5 +50,7 @@
|
||||
"width" $width
|
||||
"height" $height
|
||||
"imageStyle" $imageStyle
|
||||
"tag" $tag
|
||||
"tagType" $tagType
|
||||
)
|
||||
-}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{- $defaultIndex := int ((.Parent.Get "defaultIndex") | default "0") -}}
|
||||
|
||||
<div
|
||||
class="tabs-panel hx-rounded hx-pt-6 hx-hidden data-[state=selected]:hx-block"
|
||||
class="hextra-tabs-panel hx-rounded hx-pt-6 hx-hidden data-[state=selected]:hx-block"
|
||||
id="tabs-panel-{{ .Ordinal }}"
|
||||
role="tabpanel"
|
||||
{{ if eq .Ordinal $defaultIndex }}tabindex="0"{{ end }}
|
||||
|
@ -5,11 +5,11 @@
|
||||
{{ errorf "no items provided" }}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<div class="hx-mt-4 hx-flex hx-w-max hx-min-w-full hx-border-b hx-border-gray-200 hx-pb-px dark:hx-border-neutral-800">
|
||||
<div class="hextra-scrollbar hx-overflow-x-auto hx-overflow-y-hidden hx-overscroll-x-contain">
|
||||
<div class="hx-mt-4 hx-flex hx-w-max hx-min-w-full hx-border-b hx-border-gray-200 hx-pb-px dark:hx-border-neutral-800">
|
||||
{{- range $i, $item := $items -}}
|
||||
<button
|
||||
class="tabs-toggle data-[state=selected]:hx-border-primary-500 data-[state=selected]:hx-text-primary-600 hx-mr-2 hx-rounded-t hx-p-2 hx-font-medium hx-leading-5 hx-transition-colors -hx-mb-0.5 hx-select-none hx-border-b-2 hx-border-transparent hx-text-gray-600 hover:hx-border-gray-200 hover:hx-text-black dark:hx-text-gray-200 dark:hover:hx-border-neutral-800 dark:hover:hx-text-white"
|
||||
class="hextra-tabs-toggle data-[state=selected]:hx-border-primary-500 data-[state=selected]:hx-text-primary-600 hx-mr-2 hx-rounded-t hx-p-2 hx-font-medium hx-leading-5 hx-transition-colors -hx-mb-0.5 hx-select-none hx-border-b-2 hx-border-transparent hx-text-gray-600 hover:hx-border-gray-200 hover:hx-text-black dark:hx-text-gray-200 dark:hover:hx-border-neutral-800 dark:hover:hx-text-white"
|
||||
role="tab"
|
||||
type="button"
|
||||
aria-controls="tabs-panel-{{ $i }}"
|
||||
@ -20,6 +20,7 @@
|
||||
{{- $item -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{{ .Inner }}
|
||||
|
1266
package-lock.json
generated
1266
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user