mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-31 10:42:41 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a5bd268a3 | |||
| 5036111d11 | |||
| 8367c13ebd | |||
| 536e0b171e | |||
| 03f3500c35 | |||
| b4008081d7 | |||
| fdfd772100 | |||
| 0c1d074890 | |||
| b29368c3e6 | |||
| 50d27e0e5b | |||
| 8b5315a141 | |||
| c257b9b10f |
@@ -29,3 +29,4 @@ $RECYCLE.BIN/
|
||||
.directory
|
||||
|
||||
CHANGELOG.md
|
||||
.stash/
|
||||
|
||||
@@ -147,6 +147,7 @@ Click the following links to generate a new repository with template:
|
||||
- **Diagrams** code fences extended and shortcode supported by [mermaid](https://github.com/knsv/mermaid)
|
||||
- **Interactive data visualization** shortcode and code fences extended supported by [ECharts](https://echarts.apache.org/)
|
||||
- **Timeline** code fences extended and shortcode supported
|
||||
- **File tree** code fences extended and shortcode supported
|
||||
- **Mapbox** shortcode supported by [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
- **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
- **Bilibili player** and **Douyin player** shortcode
|
||||
|
||||
@@ -147,6 +147,7 @@ pnpx fixit-cli create my-blog
|
||||
- 支持基于 [mermaid](https://github.com/knsv/mermaid) 的**图表** 代码块扩展语法和 shortcode
|
||||
- 支持基于 [ECharts](https://echarts.apache.org/) 的**交互式数据可视化** 代码块扩展语法和 shortcode
|
||||
- 支持 **Timeline** 的代码块扩展语法和 shortcode
|
||||
- 支持 **文件树** 的代码块扩展语法和 shortcode
|
||||
- 支持基于 [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js) 的 **Mapbox** shortcode
|
||||
- 支持基于 [APlayer](https://github.com/MoePlayer/APlayer) 和 [MetingJS](https://github.com/metowolf/MetingJS) 的**音乐播放器** shortcode
|
||||
- 支持 **Bilibili 视频** 和 **抖音视频** shortcode
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
[
|
||||
{
|
||||
"name": "src-json",
|
||||
"type": "dir",
|
||||
"children": [
|
||||
{
|
||||
"name": "index.ts",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"name": "components",
|
||||
"type": "dir",
|
||||
"children": [
|
||||
{
|
||||
"name": "Header.tsx",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"name": "Footer.tsx",
|
||||
"type": "file"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "utils",
|
||||
"type": "dir",
|
||||
"children": [
|
||||
{
|
||||
"name": "helper.ts",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"name": "validator.ts",
|
||||
"type": "file"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "public",
|
||||
"type": "dir",
|
||||
"children": [
|
||||
{
|
||||
"name": "favicon.ico",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "dir",
|
||||
"children": [
|
||||
{
|
||||
"name": "logo.png",
|
||||
"type": "file"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "package.json",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"name": "README.md",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"name": "tsconfig.json",
|
||||
"type": "file"
|
||||
}
|
||||
]
|
||||
@@ -39,7 +39,7 @@ This article comprehensively tests the **Alerts** Markdown syntax extension and
|
||||
> [!NOTE] FixIt
|
||||
> A clean, elegant but advanced Hugo theme.
|
||||
|
||||
> [!TIP] This is a title-only alert
|
||||
> [!TIP] This is a title-only alert.
|
||||
|
||||
### Foldable Alerts
|
||||
|
||||
@@ -59,6 +59,11 @@ Alerts can be nested in multiple levels:
|
||||
> > [!todo] Yes! They can be nested.
|
||||
> > > [!example] You can even use multiple layers of nesting.
|
||||
|
||||
### Content-only Alerts
|
||||
|
||||
> [!TIP]~
|
||||
> This is a content-only alert without a title.
|
||||
|
||||
### Supported types
|
||||
|
||||
> [!note]+
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
[[filetree]]
|
||||
name = "src-toml"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "index.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "components"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children.children]]
|
||||
name = "Header.tsx"
|
||||
type = "file"
|
||||
|
||||
[[filetree.children.children]]
|
||||
name = "Footer.tsx"
|
||||
type = "file"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "utils"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children.children]]
|
||||
name = "helper.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree.children.children]]
|
||||
name = "validator.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "public"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "favicon.ico"
|
||||
type = "file"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "images"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children.children]]
|
||||
name = "logo.png"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "package.json"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "README.md"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "tsconfig.json"
|
||||
type = "file"
|
||||
@@ -0,0 +1,273 @@
|
||||
---
|
||||
title: File Tree Test
|
||||
date: 2026-01-10T03:00:48+08:00
|
||||
collections:
|
||||
- Tests
|
||||
categories:
|
||||
- Shortcodes
|
||||
tags:
|
||||
- file-tree
|
||||
---
|
||||
|
||||
This article tests the **File Tree** shortcode functionality in the FixIt theme.
|
||||
|
||||
<!--more-->
|
||||
<!-- markdownlint-disable-file MD007 MD024 MD032 -->
|
||||
|
||||
## Content Modes
|
||||
|
||||
### Shortcode body
|
||||
|
||||
#### JSON format
|
||||
|
||||
{{< file-tree >}}
|
||||
[
|
||||
{
|
||||
"name": "src",
|
||||
"type": "dir",
|
||||
"children": [
|
||||
{
|
||||
"name": "index.ts",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"name": "app.ts",
|
||||
"type": "file"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "README.md",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"name": ".gitignore",
|
||||
"type": "file"
|
||||
}
|
||||
]
|
||||
{{< /file-tree >}}
|
||||
|
||||
#### YAML format
|
||||
|
||||
{{< file-tree folderSlash=true >}}
|
||||
- name: project-root
|
||||
type: dir
|
||||
children:
|
||||
- name: src
|
||||
type: dir
|
||||
children:
|
||||
- name: index.ts
|
||||
type: file
|
||||
- name: config.ts
|
||||
type: file
|
||||
- name: tests
|
||||
type: dir
|
||||
children:
|
||||
- name: unit.test.ts
|
||||
type: file
|
||||
- name: package.json
|
||||
type: file
|
||||
- name: tsconfig.json
|
||||
type: file
|
||||
{{< /file-tree >}}
|
||||
|
||||
#### TOML format
|
||||
|
||||
{{< file-tree >}}
|
||||
[[filetree]]
|
||||
name = "src"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "index.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "app.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "README.md"
|
||||
type = "file"
|
||||
{{< /file-tree >}}
|
||||
|
||||
### File data
|
||||
|
||||
#### TOML format
|
||||
|
||||
{{< file-tree file="data/example.toml" />}}
|
||||
|
||||
TOML with folder slash and level 3:
|
||||
|
||||
{{< file-tree file="data/example.toml" level=3 folderSlash=true />}}
|
||||
|
||||
#### JSON format
|
||||
|
||||
{{< file-tree file="filetree/example.json" />}}
|
||||
|
||||
JSON with folder slash and level 2:
|
||||
|
||||
{{< file-tree file="filetree/example.json" level=2 folderSlash=true />}}
|
||||
|
||||
#### YAML format
|
||||
|
||||
Trying the file not found case (should fallback to next mode):
|
||||
|
||||
{{< file-tree file="data/nonexistent.yaml" data="example" />}}
|
||||
|
||||
### Site data
|
||||
|
||||
#### Basic usage
|
||||
|
||||
{{< file-tree data="example" />}}
|
||||
|
||||
#### Fully expanded
|
||||
|
||||
{{< file-tree data="example" level=-1 />}}
|
||||
|
||||
#### Limited expansion
|
||||
|
||||
{{< file-tree data="example" level=1 />}}
|
||||
|
||||
#### With folder slash
|
||||
|
||||
{{< file-tree data="example" folderSlash=true />}}
|
||||
|
||||
#### With level and folder slash
|
||||
|
||||
{{< file-tree data="example" level=2 folderSlash=true />}}
|
||||
|
||||
#### Collapsed with ignore
|
||||
|
||||
{{< file-tree data="example" level=0 ignoreList="README.md" />}}
|
||||
|
||||
## Filesystem Mode
|
||||
|
||||
### Basic paths
|
||||
|
||||
{{< file-tree />}}
|
||||
|
||||
{{< file-tree "." />}}
|
||||
|
||||
{{< file-tree "content" />}}
|
||||
|
||||
{{< file-tree name="{path}" />}}
|
||||
|
||||
{{< file-tree name="FixIt/apps/test" />}}
|
||||
|
||||
{{< file-tree path="posts" name="{path}" />}}
|
||||
|
||||
### Named parameters
|
||||
|
||||
{{< file-tree path="data" level=2 />}}
|
||||
|
||||
### Expansion levels
|
||||
|
||||
{{< file-tree "assets" 0 />}}
|
||||
|
||||
{{< file-tree path="assets" level=2 folderSlash=true />}}
|
||||
|
||||
{{< file-tree "assets" -1 />}}
|
||||
|
||||
### With ignore lists
|
||||
|
||||
{{< file-tree ignoreList=".hugo_build.lock, public, resources, node_modules" level=2 folderSlash=true />}}
|
||||
|
||||
### root not exist
|
||||
|
||||
path="nonexistent/path"
|
||||
|
||||
{{< file-tree "nonexistent/path" />}}
|
||||
|
||||
## Code Block Rendering
|
||||
|
||||
### Basic code block
|
||||
|
||||
YAML format:
|
||||
|
||||
```file-tree
|
||||
- name: my-project
|
||||
type: dir
|
||||
children:
|
||||
- name: src
|
||||
type: dir
|
||||
children:
|
||||
- name: main.js
|
||||
type: file
|
||||
- name: utils.js
|
||||
type: file
|
||||
- name: package.json
|
||||
type: file
|
||||
- name: README.md
|
||||
type: file
|
||||
```
|
||||
|
||||
### TOML format
|
||||
|
||||
```file-tree
|
||||
[[filetree]]
|
||||
name = "src"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "index.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "README.md"
|
||||
type = "file"
|
||||
```
|
||||
|
||||
### With parameters
|
||||
|
||||
```file-tree {level=2 folderSlash=true ignoreList="config.local.js"}
|
||||
- name: project
|
||||
type: dir
|
||||
children:
|
||||
- name: config
|
||||
type: dir
|
||||
children:
|
||||
- name: config.js
|
||||
type: file
|
||||
- name: config.local.js
|
||||
type: file
|
||||
- name: src
|
||||
type: dir
|
||||
children:
|
||||
- name: index.js
|
||||
type: file
|
||||
- name: .gitignore
|
||||
type: file
|
||||
```
|
||||
|
||||
### Fully expanded
|
||||
|
||||
```file-tree {level=-1 folderSlash=true}
|
||||
- name: backend
|
||||
type: dir
|
||||
children:
|
||||
- name: api
|
||||
type: dir
|
||||
children:
|
||||
- name: routes
|
||||
type: dir
|
||||
children:
|
||||
- name: users.js
|
||||
type: file
|
||||
- name: posts.js
|
||||
type: file
|
||||
- name: controllers
|
||||
type: dir
|
||||
children:
|
||||
- name: userController.js
|
||||
type: file
|
||||
- name: database
|
||||
type: dir
|
||||
children:
|
||||
- name: models
|
||||
type: dir
|
||||
- name: migrations
|
||||
type: dir
|
||||
- name: app.js
|
||||
type: file
|
||||
```
|
||||
@@ -18,6 +18,7 @@ Test for rendering Font Awesome icons.
|
||||
:(fa-solid fa-camera fa-xs):
|
||||
:(fa-solid fa-camera fa-sm):
|
||||
:(fa-solid fa-camera fa-lg):
|
||||
:(fa-solid fa-camera fa-1x):
|
||||
:(fa-solid fa-camera fa-2x):
|
||||
:(fa-solid fa-camera fa-3x):
|
||||
:(fa-solid fa-camera fa-5x):
|
||||
@@ -26,9 +27,9 @@ Test for rendering Font Awesome icons.
|
||||
|
||||
## Fixed width
|
||||
|
||||
:(fa-solid fa-skating fa-fw fa-2x): Skating\
|
||||
:(fa-solid fa-skiing fa-fw fa-2x): Skiing\
|
||||
:(fa-solid fa-skiing-nordic fa-fw fa-2x): Nordic Skiing
|
||||
:(fa-solid fa-skating fa-2x): Skating\
|
||||
:(fa-solid fa-skiing fa-2x): Skiing\
|
||||
:(fa-solid fa-skiing-nordic fa-2x): Nordic Skiing
|
||||
|
||||
## List icon
|
||||
|
||||
@@ -75,4 +76,4 @@ hey guys!
|
||||
|
||||
## Border
|
||||
|
||||
:(fa-brands fa-apple fa-border fa-fw fa-10x):
|
||||
:(fa-brands fa-apple fa-border fa-10x):
|
||||
|
||||
@@ -178,3 +178,42 @@ gantt
|
||||
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
### File Tree inside Tabs
|
||||
|
||||
{{< tabs >}}
|
||||
{{% tab title="File Tree Shortcode" %}}
|
||||
|
||||
{{< file-tree >}}
|
||||
[[filetree]]
|
||||
name = "src"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "index.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "README.md"
|
||||
type = "file"
|
||||
{{< /file-tree >}}
|
||||
|
||||
{{% /tab %}}
|
||||
{{% tab title="File Tree Code Block" %}}
|
||||
|
||||
```file-tree
|
||||
[[filetree]]
|
||||
name = "src"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "index.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "README.md"
|
||||
type = "file"
|
||||
```
|
||||
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
- name: my-project
|
||||
type: dir
|
||||
children:
|
||||
- name: src
|
||||
type: dir
|
||||
children:
|
||||
- name: index.ts
|
||||
type: file
|
||||
- name: components
|
||||
type: dir
|
||||
children:
|
||||
- name: Header.tsx
|
||||
type: file
|
||||
- name: Footer.tsx
|
||||
type: file
|
||||
- name: utils
|
||||
type: dir
|
||||
children:
|
||||
- name: helper.ts
|
||||
type: file
|
||||
- name: validator.ts
|
||||
type: file
|
||||
- name: public
|
||||
type: dir
|
||||
children:
|
||||
- name: favicon.ico
|
||||
type: file
|
||||
- name: images
|
||||
type: dir
|
||||
children:
|
||||
- name: logo.png
|
||||
type: file
|
||||
- name: package.json
|
||||
type: file
|
||||
- name: README.md
|
||||
type: file
|
||||
- name: tsconfig.json
|
||||
type: file
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
title = "Hugo FixIt TEST"
|
||||
baseURL = "https://demo.fixit.lruihao.cn/test/"
|
||||
ignoreLogs = [ "warning-file-tree" ]
|
||||
|
||||
[permalinks]
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
// hr / divider style
|
||||
#{$rootPrefix}hr-background-color: #{darken($global-border-color, 5%)};
|
||||
#{$rootPrefix}hr-before-color: #{lighten($single-link-hover-color, 4%)};
|
||||
#{$rootPrefix}hr-active-color: #{lighten($single-link-hover-color, 4%)};
|
||||
#{$rootPrefix}divider-edge-weak: linear-gradient(to right, transparent, var(#{$rootPrefix}divider-bg, #d0d0d5), transparent);
|
||||
|
||||
// Scrollbar related variables
|
||||
@@ -54,7 +54,7 @@
|
||||
#{$rootPrefix}global-link-hover-color: #{$global-link-hover-color-dark};
|
||||
|
||||
#{$rootPrefix}hr-background-color: #{lighten($global-border-color-dark, 5%)};
|
||||
#{$rootPrefix}hr-before-color: #{darken($global-link-hover-color-dark, 4%)};
|
||||
#{$rootPrefix}hr-active-color: #{darken($global-link-hover-color-dark, 4%)};
|
||||
|
||||
#{$rootPrefix}code-inline-background-color: rgba(99, 110, 123, 0.4);
|
||||
#{$rootPrefix}code-block-background-color: #{$code-background-color-dark};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@mixin blur {
|
||||
// TODO refactor blur with backdrop-filter
|
||||
.blur & {
|
||||
@include filter(blur(1.5px));
|
||||
}
|
||||
|
||||
@@ -105,8 +105,6 @@
|
||||
&.awesome-hr {
|
||||
&::before {
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
font-family: 'Font Awesome 6 Free';
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
position: absolute;
|
||||
@@ -114,11 +112,13 @@
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 1;
|
||||
color: var(#{$rootPrefix}hr-before-color);
|
||||
content: '\f0c4';
|
||||
color: var(#{$rootPrefix}hr-active-color);
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
transition: left 1s ease-in-out, color 0.3s ease, border-color 0.3s ease;
|
||||
font-family: var(--fa-family-classic);
|
||||
font-weight: 600;
|
||||
content: '\f0c4';
|
||||
}
|
||||
|
||||
&:hover::before {
|
||||
@@ -510,7 +510,8 @@
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO Reorganization import
|
||||
@import '../_shortcodes';
|
||||
@import '../_partials/_single/alert';
|
||||
@import '../_partials/_single/code';
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
|
||||
i.details-icon {
|
||||
color: var(#{$rootPrefix}global-font-secondary-color);
|
||||
@include transition(transform 0.2s ease);
|
||||
@include transition(all 0.2s ease);
|
||||
|
||||
&:hover {
|
||||
color: var(#{$rootPrefix}global-font-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
// Diagram copy button styles
|
||||
.diagram-copy-btn {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 0.5rem;
|
||||
@@ -40,10 +42,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.fa-clone {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
&[data-copied] {
|
||||
.fa-clone {
|
||||
--fa: "\f00c";
|
||||
font-weight: 900;
|
||||
--fa: '\f00c';
|
||||
--fa-style: 900;
|
||||
color: var(#{$rootPrefix}global-link-hover-color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
opacity: 0;
|
||||
translate: 100vw 0;
|
||||
width: MIN(calc(100% - 4rem), 460px);
|
||||
height: 100%;
|
||||
height: 100dvh;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
margin-right: 0;
|
||||
@@ -272,14 +272,15 @@
|
||||
font-size: max($toc-content-font-size, 1rem);
|
||||
|
||||
nav {
|
||||
max-height: calc(100vh - 5rem);
|
||||
max-height: calc(100dvh - 5rem);
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&::backdrop {
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
background-color: rgba(0, 0, 0, 0.25);
|
||||
backdrop-filter: blur(2px);
|
||||
transition:
|
||||
display 0.5s allow-discrete,
|
||||
overlay 0.5s allow-discrete,
|
||||
|
||||
@@ -4,13 +4,16 @@
|
||||
padding: 0 0.75rem;
|
||||
border-left: .25rem solid;
|
||||
overflow: hidden;
|
||||
background-color: var(#{$rootPrefix}admonition-bg-color);
|
||||
border-left-color: var(#{$rootPrefix}admonition-color);
|
||||
@include border-radius($global-border-radius);
|
||||
|
||||
.admonition-title {
|
||||
font-weight: var(--admonition-title-font-weight, bold);
|
||||
font-weight: var(#{$rootPrefix}admonition-title-font-weight, bold);
|
||||
margin: 0 -0.75rem;
|
||||
padding: 0.25rem 1.8rem;
|
||||
border-bottom: 1px solid;
|
||||
position: relative;
|
||||
@include border-radius(0);
|
||||
|
||||
strong {
|
||||
@@ -22,11 +25,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
&:has(+ .details-content > .admonition-content:empty) {
|
||||
--admonition-title-font-weight: normal;
|
||||
// title-only admonition without content
|
||||
&:not(:has(+ .details-content)) {
|
||||
#{$rootPrefix}admonition-title-font-weight: normal;
|
||||
padding: 0.75rem 1rem 0.75rem 2.2rem;
|
||||
border: 0;
|
||||
|
||||
i.icon {
|
||||
left: 1.1rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> .admonition-title {
|
||||
border-bottom-color: var(#{$rootPrefix}admonition-bg-color);
|
||||
background-color: var(#{$rootPrefix}admonition-bg-color-collapsed);
|
||||
@include transition(all 0.2s ease);
|
||||
|
||||
i.icon {
|
||||
color: var(#{$rootPrefix}admonition-color);
|
||||
}
|
||||
}
|
||||
|
||||
&.open > .admonition-title {
|
||||
background-color: var(#{$rootPrefix}admonition-bg-color);
|
||||
}
|
||||
|
||||
.admonition-content {
|
||||
padding: 0.5rem 0;
|
||||
|
||||
@@ -34,10 +59,6 @@
|
||||
> p {
|
||||
margin: 0;
|
||||
}
|
||||
// title-only alert
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.code-block .code-header {
|
||||
top: initial !important;
|
||||
@@ -47,30 +68,16 @@
|
||||
i.icon {
|
||||
font-size: 0.85rem;
|
||||
position: absolute;
|
||||
top: 0.6rem;
|
||||
left: 0.4rem;
|
||||
top: 50%;
|
||||
left: 0.9rem;
|
||||
translate: -50% -50%;
|
||||
}
|
||||
|
||||
i.details-icon {
|
||||
position: absolute;
|
||||
top: 0.6rem;
|
||||
right: 0.3rem;
|
||||
}
|
||||
|
||||
background-color: var(#{$rootPrefix}admonition-bg-color);
|
||||
border-left-color: var(#{$rootPrefix}admonition-color);
|
||||
|
||||
> .admonition-title {
|
||||
border-bottom-color: var(#{$rootPrefix}admonition-bg-color);
|
||||
background-color: var(#{$rootPrefix}admonition-bg-color-collapsed);
|
||||
|
||||
i.icon {
|
||||
color: var(#{$rootPrefix}admonition-color);
|
||||
}
|
||||
}
|
||||
|
||||
&.open > .admonition-title {
|
||||
background-color: var(#{$rootPrefix}admonition-bg-color);
|
||||
top: 50%;
|
||||
right: 0.9rem;
|
||||
translate: 50% -50%;
|
||||
}
|
||||
|
||||
// default admonition type is note
|
||||
@@ -92,4 +99,13 @@
|
||||
&:last-child {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
// content-only admonition without title
|
||||
&:not(:has(.admonition-title)) {
|
||||
border: 1px solid var(#{$rootPrefix}admonition-bg-color);
|
||||
|
||||
.admonition-content {
|
||||
padding: 0.75rem 0.25rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ blockquote.blockquote-center {
|
||||
border-top: 1px solid $global-border-color;
|
||||
text-align: left;
|
||||
top: -20px;
|
||||
content: '\f10d';
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-family: var(--fa-family-classic);
|
||||
font-weight: 900;
|
||||
content: '\f10d';
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-top-color: $global-border-color-dark;
|
||||
@@ -32,9 +32,9 @@ blockquote.blockquote-center {
|
||||
border-bottom: 1px solid $global-border-color;
|
||||
bottom: -20px;
|
||||
text-align: right;
|
||||
content: '\f10e';
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-family: var(--fa-family-classic);
|
||||
font-weight: 900;
|
||||
content: '\f10e';
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-bottom-color: $global-border-color-dark;
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
.file-tree-wrapper {
|
||||
border: 1px solid var(#{$rootPrefix}global-border-color);
|
||||
padding: 0.5rem;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1;
|
||||
margin-block: 0.5rem;
|
||||
@include border-radius($global-border-radius);
|
||||
@include transition(box-shadow 0.2s ease);
|
||||
|
||||
&:hover {
|
||||
@include box-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 2px 8px rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
}
|
||||
|
||||
ul.file-tree {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
.file-tree-item {
|
||||
position: relative;
|
||||
|
||||
&.file-tree-folder {
|
||||
> .file-tree-toggle {
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
i,
|
||||
span {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.file-tree-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
gap: 0.25rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
@include border-radius($global-border-radius);
|
||||
@include transition(all 0.15s ease);
|
||||
|
||||
.file-tree-icon {
|
||||
width: 1rem;
|
||||
text-align: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&.is-highlighted {
|
||||
color: var(#{$rootPrefix}global-link-hover-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:not([data-level='0']) {
|
||||
.file-tree-item {
|
||||
margin: 0.25rem 0;
|
||||
padding-left: 0.25rem;
|
||||
|
||||
.file-tree-label::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -0.5rem;
|
||||
translate: 0 -50%;
|
||||
width: 0.75rem;
|
||||
height: 1px;
|
||||
background-color: var(#{$rootPrefix}secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.file-tree .file-tree {
|
||||
padding-left: 1.25rem;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -0.25rem;
|
||||
bottom: 0.625rem;
|
||||
left: calc(1rem - 0.5px);
|
||||
width: 1px;
|
||||
background-color: var(#{$rootPrefix}secondary);
|
||||
height: var(#{$rootPrefix}file-tree-line-height);
|
||||
}
|
||||
}
|
||||
|
||||
.file-tree-item.is-collapsed {
|
||||
> .file-tree {
|
||||
display: none;
|
||||
}
|
||||
|
||||
> .file-tree-label .file-tree-icon::before {
|
||||
--fa: '\f07b';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
@import '_cardlink';
|
||||
@import '_center-quote';
|
||||
@import '_echarts';
|
||||
@import '_file-tree';
|
||||
@import '_instagram';
|
||||
@import '_mapbox';
|
||||
@import '_mermaid';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
tab-container {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
margin-block: 0.5rem;
|
||||
margin-block: 0.5rem 1rem;
|
||||
position: relative;
|
||||
|
||||
// loading before defined
|
||||
@@ -46,6 +46,9 @@ tab-container {
|
||||
&[hidden] {
|
||||
display: none;
|
||||
}
|
||||
> *:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&::part(tablist-tab-wrapper) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.#{$prefix}timeline {
|
||||
ul.#{$prefix}timeline {
|
||||
list-style: none;
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
|
||||
@@ -41,6 +41,8 @@ $global-link-hover-color-dark: #fff !default;
|
||||
|
||||
// Color of the border
|
||||
// TODO refactor border colors
|
||||
// $global-border-color: #e3e3e3 !default;
|
||||
// $global-border-color-dark: #434343 !default;
|
||||
$global-border-color: #f0f0f0 !default;
|
||||
$global-border-color-dark: #363636 !default;
|
||||
// ========== Global ========== //
|
||||
|
||||
@@ -30,8 +30,8 @@ libFiles:
|
||||
cryptoSha256JS: crypto-js@4.2.0/sha256.js
|
||||
# echarts@5.3.3 https://github.com/apache/echarts
|
||||
echartsJS: echarts@5.3.3/dist/echarts.min.js
|
||||
# fontawesome-free@6.7.1 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.7.1/css/all.min.css'
|
||||
# fontawesome-free@7.1.0 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@7.1.0/css/all.min.css'
|
||||
# fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
fuseJS: fuse.js@6.6.2/dist/fuse.min.js
|
||||
# gitalk@1.7.2 https://github.com/gitalk/gitalk
|
||||
|
||||
@@ -30,8 +30,8 @@ libFiles:
|
||||
cryptoSha256JS: crypto-js@4.2.0/sha256.js
|
||||
# echarts@5.3.3 https://github.com/apache/echarts
|
||||
echartsJS: echarts@5.3.3/dist/echarts.min.js
|
||||
# fontawesome-free@6.7.1 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.7.1/css/all.min.css'
|
||||
# fontawesome-free@7.1.0 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@7.1.0/css/all.min.css'
|
||||
# fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
fuseJS: fuse.js@6.6.2/dist/fuse.min.js
|
||||
# gitalk@1.7.2 https://github.com/gitalk/gitalk
|
||||
|
||||
+63
-63
@@ -4,7 +4,7 @@ github:
|
||||
Prefix: https://github.com/
|
||||
Title: GitHub
|
||||
Icon:
|
||||
Class: fa-brands fa-github-alt fa-fw
|
||||
Class: fa-brands fa-github-alt
|
||||
|
||||
# 002: LinkedIn
|
||||
linkedin:
|
||||
@@ -12,7 +12,7 @@ linkedin:
|
||||
Prefix: https://linkedin.com/in/
|
||||
Title: LinkedIn
|
||||
Icon:
|
||||
Class: fa-brands fa-linkedin fa-fw
|
||||
Class: fa-brands fa-linkedin
|
||||
|
||||
# 003: Twitter (X)
|
||||
twitter:
|
||||
@@ -20,7 +20,7 @@ twitter:
|
||||
Prefix: https://twitter.com/
|
||||
Title: X
|
||||
Icon:
|
||||
Class: fa-brands fa-x-twitter fa-fw
|
||||
Class: fa-brands fa-x-twitter
|
||||
|
||||
# 004: Instagram
|
||||
instagram:
|
||||
@@ -28,7 +28,7 @@ instagram:
|
||||
Prefix: https://www.instagram.com/
|
||||
Title: Instagram
|
||||
Icon:
|
||||
Class: fa-brands fa-instagram fa-fw
|
||||
Class: fa-brands fa-instagram
|
||||
|
||||
# 005: facebook
|
||||
facebook:
|
||||
@@ -36,7 +36,7 @@ facebook:
|
||||
Prefix: https://facebook.com/
|
||||
Title: facebook
|
||||
Icon:
|
||||
Class: fa-brands fa-facebook fa-fw
|
||||
Class: fa-brands fa-facebook
|
||||
|
||||
# 006: Telegram
|
||||
telegram:
|
||||
@@ -44,7 +44,7 @@ telegram:
|
||||
Prefix: https://t.me/
|
||||
Title: Telegram
|
||||
Icon:
|
||||
Class: fa-brands fa-telegram-plane fa-fw
|
||||
Class: fa-brands fa-telegram-plane
|
||||
|
||||
# 007: Medium
|
||||
medium:
|
||||
@@ -52,7 +52,7 @@ medium:
|
||||
Prefix: https://medium.com/
|
||||
Title: Medium
|
||||
Icon:
|
||||
Class: fa-brands fa-medium fa-fw
|
||||
Class: fa-brands fa-medium
|
||||
|
||||
# 008: GitLab
|
||||
gitlab:
|
||||
@@ -60,7 +60,7 @@ gitlab:
|
||||
Prefix: https://gitlab.com/
|
||||
Title: GitLab
|
||||
Icon:
|
||||
Class: fa-brands fa-gitlab fa-fw
|
||||
Class: fa-brands fa-gitlab
|
||||
|
||||
# 009: YouTube Legacy
|
||||
youtubelegacy:
|
||||
@@ -68,7 +68,7 @@ youtubelegacy:
|
||||
Prefix: https://www.youtube.com/user/
|
||||
Title: YouTube
|
||||
Icon:
|
||||
Class: fa-brands fa-youtube fa-fw
|
||||
Class: fa-brands fa-youtube
|
||||
|
||||
# 010: YouTube Custom
|
||||
youtubecustom:
|
||||
@@ -76,7 +76,7 @@ youtubecustom:
|
||||
Prefix: https://www.youtube.com/c/
|
||||
Title: YouTube
|
||||
Icon:
|
||||
Class: fa-brands fa-youtube fa-fw
|
||||
Class: fa-brands fa-youtube
|
||||
|
||||
# 011: YouTube Channel
|
||||
youtubechannel:
|
||||
@@ -84,7 +84,7 @@ youtubechannel:
|
||||
Prefix: https://www.youtube.com/channel/
|
||||
Title: YouTube
|
||||
Icon:
|
||||
Class: fa-brands fa-youtube fa-fw
|
||||
Class: fa-brands fa-youtube
|
||||
|
||||
# 012: Tumblr
|
||||
tumblr:
|
||||
@@ -92,7 +92,7 @@ tumblr:
|
||||
Template: https://%v.tumblr.com/
|
||||
Title: Tumblr
|
||||
Icon:
|
||||
Class: fa-brands fa-tumblr fa-fw
|
||||
Class: fa-brands fa-tumblr
|
||||
|
||||
# 013: Quora
|
||||
quora:
|
||||
@@ -100,7 +100,7 @@ quora:
|
||||
Prefix: https://www.quora.com/profile/
|
||||
Title: Quora
|
||||
Icon:
|
||||
Class: fa-brands fa-quora fa-fw
|
||||
Class: fa-brands fa-quora
|
||||
|
||||
# 014: Keybase
|
||||
keybase:
|
||||
@@ -108,7 +108,7 @@ keybase:
|
||||
Prefix: https://keybase.io/
|
||||
Title: Keybase
|
||||
Icon:
|
||||
Class: fa-brands fa-keybase fa-fw
|
||||
Class: fa-brands fa-keybase
|
||||
|
||||
# 015: Pinterest
|
||||
pinterest:
|
||||
@@ -116,7 +116,7 @@ pinterest:
|
||||
Prefix: https://www.pinterest.com/
|
||||
Title: Pinterest
|
||||
Icon:
|
||||
Class: fa-brands fa-pinterest fa-fw
|
||||
Class: fa-brands fa-pinterest
|
||||
|
||||
# 016: Reddit
|
||||
reddit:
|
||||
@@ -124,7 +124,7 @@ reddit:
|
||||
Prefix: https://www.reddit.com/user/
|
||||
Title: Reddit
|
||||
Icon:
|
||||
Class: fa-brands fa-reddit fa-fw
|
||||
Class: fa-brands fa-reddit
|
||||
|
||||
# 017: CodePen
|
||||
codepen:
|
||||
@@ -132,7 +132,7 @@ codepen:
|
||||
Prefix: https://codepen.io/
|
||||
Title: CodePen
|
||||
Icon:
|
||||
Class: fa-brands fa-codepen fa-fw
|
||||
Class: fa-brands fa-codepen
|
||||
|
||||
# 018: freeCodeCamp
|
||||
freecodecamp:
|
||||
@@ -140,7 +140,7 @@ freecodecamp:
|
||||
Prefix: https://freecodecamp.org/
|
||||
Title: freeCodeCamp
|
||||
Icon:
|
||||
Class: fa-brands fa-free-code-camp fa-fw
|
||||
Class: fa-brands fa-free-code-camp
|
||||
|
||||
# 019: Bitbucket
|
||||
bitbucket:
|
||||
@@ -148,7 +148,7 @@ bitbucket:
|
||||
Prefix: https://bitbucket.org/
|
||||
Title: Bitbucket
|
||||
Icon:
|
||||
Class: fa-brands fa-bitbucket fa-fw
|
||||
Class: fa-brands fa-bitbucket
|
||||
|
||||
# 020: Stack Overflow
|
||||
stackoverflow:
|
||||
@@ -156,7 +156,7 @@ stackoverflow:
|
||||
Prefix: https://stackoverflow.com/users/
|
||||
Title: Stack Overflow
|
||||
Icon:
|
||||
Class: fa-brands fa-stack-overflow fa-fw
|
||||
Class: fa-brands fa-stack-overflow
|
||||
|
||||
# 021: 微博
|
||||
weibo:
|
||||
@@ -164,7 +164,7 @@ weibo:
|
||||
Prefix: https://weibo.com/
|
||||
Title: 微博
|
||||
Icon:
|
||||
Class: fa-brands fa-weibo fa-fw
|
||||
Class: fa-brands fa-weibo
|
||||
|
||||
# 022: OK.RU
|
||||
odnoklassniki:
|
||||
@@ -172,7 +172,7 @@ odnoklassniki:
|
||||
Prefix: https://ok.ru/
|
||||
Title: OK.RU
|
||||
Icon:
|
||||
Class: fa-brands fa-odnoklassniki fa-fw
|
||||
Class: fa-brands fa-odnoklassniki
|
||||
|
||||
# 023: VK
|
||||
vk:
|
||||
@@ -180,7 +180,7 @@ vk:
|
||||
Prefix: https://vk.com/
|
||||
Title: VK
|
||||
Icon:
|
||||
Class: fa-brands fa-vk fa-fw
|
||||
Class: fa-brands fa-vk
|
||||
|
||||
# 024: Flickr
|
||||
flickr:
|
||||
@@ -188,7 +188,7 @@ flickr:
|
||||
Prefix: https://www.flickr.com/photos/
|
||||
Title: Flickr
|
||||
Icon:
|
||||
Class: fa-brands fa-flickr fa-fw
|
||||
Class: fa-brands fa-flickr
|
||||
|
||||
# 025: Xing
|
||||
xing:
|
||||
@@ -196,7 +196,7 @@ xing:
|
||||
Prefix: https://www.xing.com/profile/
|
||||
Title: Xing
|
||||
Icon:
|
||||
Class: fa-brands fa-xing fa-fw
|
||||
Class: fa-brands fa-xing
|
||||
|
||||
# 026: Snapchat
|
||||
snapchat:
|
||||
@@ -204,7 +204,7 @@ snapchat:
|
||||
Prefix: https://www.snapchat.com/add/
|
||||
Title: Snapchat
|
||||
Icon:
|
||||
Class: fa-brands fa-snapchat fa-fw
|
||||
Class: fa-brands fa-snapchat
|
||||
|
||||
# 027: SoundCloud
|
||||
soundcloud:
|
||||
@@ -212,7 +212,7 @@ soundcloud:
|
||||
Prefix: https://soundcloud.com/
|
||||
Title: SoundCloud
|
||||
Icon:
|
||||
Class: fa-brands fa-soundcloud fa-fw
|
||||
Class: fa-brands fa-soundcloud
|
||||
|
||||
# 028: Spotify
|
||||
spotify:
|
||||
@@ -220,7 +220,7 @@ spotify:
|
||||
Prefix: https://open.spotify.com/user/
|
||||
Title: Spotify
|
||||
Icon:
|
||||
Class: fa-brands fa-spotify fa-fw
|
||||
Class: fa-brands fa-spotify
|
||||
|
||||
# 029: Bandcamp
|
||||
bandcamp:
|
||||
@@ -228,7 +228,7 @@ bandcamp:
|
||||
Template: https://%v.bandcamp.com/
|
||||
Title: Bandcamp
|
||||
Icon:
|
||||
Class: fa-brands fa-bandcamp fa-fw
|
||||
Class: fa-brands fa-bandcamp
|
||||
|
||||
# 030: PayPal
|
||||
paypal:
|
||||
@@ -236,7 +236,7 @@ paypal:
|
||||
Prefix: https://paypal.me/
|
||||
Title: PayPal
|
||||
Icon:
|
||||
Class: fa-brands fa-paypal fa-fw
|
||||
Class: fa-brands fa-paypal
|
||||
|
||||
# 031: 500px
|
||||
fivehundredpx:
|
||||
@@ -244,7 +244,7 @@ fivehundredpx:
|
||||
Prefix: https://500px.com/
|
||||
Title: 500px
|
||||
Icon:
|
||||
Class: fa-brands fa-500px fa-fw
|
||||
Class: fa-brands fa-500px
|
||||
|
||||
# 032: Mix
|
||||
mix:
|
||||
@@ -252,7 +252,7 @@ mix:
|
||||
Prefix: https://mix.com/
|
||||
Title: Mix
|
||||
Icon:
|
||||
Class: fa-brands fa-mix fa-fw
|
||||
Class: fa-brands fa-mix
|
||||
|
||||
# 033: Goodreads
|
||||
goodreads:
|
||||
@@ -260,7 +260,7 @@ goodreads:
|
||||
Prefix: https://www.goodreads.com/user/show/
|
||||
Title: Goodreads
|
||||
Icon:
|
||||
Class: fa-brands fa-goodreads fa-fw
|
||||
Class: fa-brands fa-goodreads
|
||||
|
||||
# 034: Last.fm
|
||||
lastfm:
|
||||
@@ -268,7 +268,7 @@ lastfm:
|
||||
Prefix: https://www.last.fm/user/
|
||||
Title: Last.fm
|
||||
Icon:
|
||||
Class: fa-brands fa-lastfm fa-fw
|
||||
Class: fa-brands fa-lastfm
|
||||
|
||||
# 035: Foursquare
|
||||
foursquare:
|
||||
@@ -276,7 +276,7 @@ foursquare:
|
||||
Prefix: https://foursquare.com/
|
||||
Title: Foursquare
|
||||
Icon:
|
||||
Class: fa-brands fa-foursquare fa-fw
|
||||
Class: fa-brands fa-foursquare
|
||||
|
||||
# 036: Hacker News
|
||||
hackernews:
|
||||
@@ -284,7 +284,7 @@ hackernews:
|
||||
Template: https://news.ycombinator.com/user?id=%v
|
||||
Title: Hacker News
|
||||
Icon:
|
||||
Class: fa-brands fa-hacker-news fa-fw
|
||||
Class: fa-brands fa-hacker-news
|
||||
|
||||
# 037: Kickstarter
|
||||
kickstarter:
|
||||
@@ -292,7 +292,7 @@ kickstarter:
|
||||
Prefix: https://kickstarter.com/profile/
|
||||
Title: Kickstarter
|
||||
Icon:
|
||||
Class: fa-brands fa-kickstarter fa-fw
|
||||
Class: fa-brands fa-kickstarter
|
||||
|
||||
# 038: Patreon
|
||||
patreon:
|
||||
@@ -300,7 +300,7 @@ patreon:
|
||||
Prefix: https://patreon.com/
|
||||
Title: Patreon
|
||||
Icon:
|
||||
Class: fa-brands fa-patreon fa-fw
|
||||
Class: fa-brands fa-patreon
|
||||
|
||||
# 039: Steam
|
||||
steam:
|
||||
@@ -308,7 +308,7 @@ steam:
|
||||
Prefix: https://steamcommunity.com/id/
|
||||
Title: Steam
|
||||
Icon:
|
||||
Class: fa-brands fa-steam fa-fw
|
||||
Class: fa-brands fa-steam
|
||||
|
||||
# 040: Twitch
|
||||
twitch:
|
||||
@@ -316,7 +316,7 @@ twitch:
|
||||
Prefix: https://www.twitch.tv/
|
||||
Title: Twitch
|
||||
Icon:
|
||||
Class: fa-brands fa-twitch fa-fw
|
||||
Class: fa-brands fa-twitch
|
||||
|
||||
# 041: Strava
|
||||
strava:
|
||||
@@ -324,7 +324,7 @@ strava:
|
||||
Prefix: https://www.strava.com/athletes/
|
||||
Title: Strava
|
||||
Icon:
|
||||
Class: fa-brands fa-strava fa-fw
|
||||
Class: fa-brands fa-strava
|
||||
|
||||
# 042: Skype
|
||||
skype:
|
||||
@@ -332,7 +332,7 @@ skype:
|
||||
Template: 'skype:'
|
||||
Title: Skype
|
||||
Icon:
|
||||
Class: fa-brands fa-skype fa-fw
|
||||
Class: fa-brands fa-skype
|
||||
|
||||
# 043: WhatsApp
|
||||
whatsapp:
|
||||
@@ -340,7 +340,7 @@ whatsapp:
|
||||
Prefix: https://wa.me/
|
||||
Title: WhatsApp
|
||||
Icon:
|
||||
Class: fa-brands fa-whatsapp fa-fw
|
||||
Class: fa-brands fa-whatsapp
|
||||
|
||||
# 044: 知乎
|
||||
zhihu:
|
||||
@@ -348,7 +348,7 @@ zhihu:
|
||||
Prefix: https://www.zhihu.com/people/
|
||||
Title: 知乎
|
||||
Icon:
|
||||
Class: fa-brands fa-zhihu fa-fw
|
||||
Class: fa-brands fa-zhihu
|
||||
|
||||
# 045: 豆瓣
|
||||
douban:
|
||||
@@ -364,7 +364,7 @@ angellist:
|
||||
Prefix: https://angel.co/
|
||||
Title: Angellist
|
||||
Icon:
|
||||
Class: fa-brands fa-angellist fa-fw
|
||||
Class: fa-brands fa-angellist
|
||||
|
||||
# 047: SlideShare
|
||||
slideshare:
|
||||
@@ -372,7 +372,7 @@ slideshare:
|
||||
Prefix: https://slideshare.com/
|
||||
Title: SlideShare
|
||||
Icon:
|
||||
Class: fa-brands fa-slideshare fa-fw
|
||||
Class: fa-brands fa-slideshare
|
||||
|
||||
# 048: JSFiddle
|
||||
jsfiddle:
|
||||
@@ -380,7 +380,7 @@ jsfiddle:
|
||||
Prefix: https://jsfiddle.com/
|
||||
Title: JSFiddle
|
||||
Icon:
|
||||
Class: fa-brands fa-jsfiddle fa-fw
|
||||
Class: fa-brands fa-jsfiddle
|
||||
|
||||
# 049: DeviantArt
|
||||
deviantart:
|
||||
@@ -388,7 +388,7 @@ deviantart:
|
||||
Template: https://%v.deviantart.com/
|
||||
Title: DeviantArt
|
||||
Icon:
|
||||
Class: fa-brands fa-deviantart fa-fw
|
||||
Class: fa-brands fa-deviantart
|
||||
|
||||
# 050: Behance
|
||||
behance:
|
||||
@@ -396,7 +396,7 @@ behance:
|
||||
Prefix: https://behance.net/
|
||||
Title: Behance
|
||||
Icon:
|
||||
Class: fa-brands fa-behance fa-fw
|
||||
Class: fa-brands fa-behance
|
||||
|
||||
# 051: Dribbble
|
||||
dribbble:
|
||||
@@ -404,7 +404,7 @@ dribbble:
|
||||
Prefix: https://dribbble.com/
|
||||
Title: Dribbble
|
||||
Icon:
|
||||
Class: fa-brands fa-dribbble fa-fw
|
||||
Class: fa-brands fa-dribbble
|
||||
|
||||
# 052: WordPress
|
||||
wordpress:
|
||||
@@ -412,7 +412,7 @@ wordpress:
|
||||
Template: https://%v.wordpress.com/
|
||||
Title: WordPress
|
||||
Icon:
|
||||
Class: fa-brands fa-wordpress fa-fw
|
||||
Class: fa-brands fa-wordpress
|
||||
|
||||
# 053: Vine
|
||||
vine:
|
||||
@@ -420,7 +420,7 @@ vine:
|
||||
Prefix: https://vine.co/
|
||||
Title: Vine
|
||||
Icon:
|
||||
Class: fa-brands fa-vine fa-fw
|
||||
Class: fa-brands fa-vine
|
||||
|
||||
# 054: Google Scholar
|
||||
googlescholar:
|
||||
@@ -436,7 +436,7 @@ researchgate:
|
||||
Prefix: https://www.researchgate.net/profile/
|
||||
Title: ResearchGate
|
||||
Icon:
|
||||
Class: fa-brands fa-researchgate fa-fw
|
||||
Class: fa-brands fa-researchgate
|
||||
|
||||
# 056: Mastodon
|
||||
mastodon:
|
||||
@@ -444,7 +444,7 @@ mastodon:
|
||||
Prefix: https://mastodon.social/
|
||||
Title: Mastodon
|
||||
Icon:
|
||||
Class: fa-brands fa-mastodon fa-fw
|
||||
Class: fa-brands fa-mastodon
|
||||
|
||||
# 057: Thingiverse
|
||||
thingiverse:
|
||||
@@ -460,7 +460,7 @@ devto:
|
||||
Prefix: https://dev.to/
|
||||
Title: Dev.To
|
||||
Icon:
|
||||
Class: fa-brands fa-dev fa-fw
|
||||
Class: fa-brands fa-dev
|
||||
|
||||
# 059: Gitea
|
||||
gitea:
|
||||
@@ -499,7 +499,7 @@ orcid:
|
||||
Prefix: https://orcid.org/
|
||||
Title: ORCID
|
||||
Icon:
|
||||
Class: fa-brands fa-orcid fa-fw
|
||||
Class: fa-brands fa-orcid
|
||||
|
||||
# 064 Liberapay
|
||||
liberapay:
|
||||
@@ -570,7 +570,7 @@ discord:
|
||||
Prefix: https://discordapp.com/users/
|
||||
Title: Discord
|
||||
Icon:
|
||||
Class: fa-brands fa-discord fa-fw
|
||||
Class: fa-brands fa-discord
|
||||
|
||||
# 073: Discord Server Invite Link
|
||||
discordinvite:
|
||||
@@ -578,7 +578,7 @@ discordinvite:
|
||||
Prefix: https://discord.gg/
|
||||
Title: Discord
|
||||
Icon:
|
||||
Class: fa-brands fa-discord fa-fw
|
||||
Class: fa-brands fa-discord
|
||||
|
||||
# 074: Lichess user profile
|
||||
lichess:
|
||||
@@ -601,14 +601,14 @@ kaggle:
|
||||
Prefix: https://kaggle.com/
|
||||
Title: Kaggle
|
||||
Icon:
|
||||
Class: fa-brands fa-kaggle fa-fw
|
||||
Class: fa-brands fa-kaggle
|
||||
|
||||
# 077: MediaWiki
|
||||
mediawiki:
|
||||
Weight: 77
|
||||
Title: MediaWiki
|
||||
Icon:
|
||||
Class: fa-brands fa-wikipedia-w fa-fw
|
||||
Class: fa-brands fa-wikipedia-w
|
||||
|
||||
# 078: Plume
|
||||
plume:
|
||||
@@ -687,7 +687,7 @@ phone:
|
||||
Template: tel:%v
|
||||
Title: Phone
|
||||
Icon:
|
||||
Class: fa-solid fa-phone fa-fw
|
||||
Class: fa-solid fa-phone
|
||||
|
||||
# Email
|
||||
email:
|
||||
@@ -695,7 +695,7 @@ email:
|
||||
Template: mailto:%v
|
||||
Title: Email
|
||||
Icon:
|
||||
Class: fa-regular fa-envelope fa-fw
|
||||
Class: fa-regular fa-envelope
|
||||
|
||||
# RSS
|
||||
rss:
|
||||
@@ -704,4 +704,4 @@ rss:
|
||||
Title: RSS
|
||||
Newtab: true
|
||||
Icon:
|
||||
Class: fa-solid fa-rss fa-fw
|
||||
Class: fa-solid fa-rss
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* FileTree class to handle file tree interactions
|
||||
*/
|
||||
export default class FileTree {
|
||||
init(target = document) {
|
||||
target.querySelectorAll('.file-tree-toggle:not([data-init])').forEach((label) => {
|
||||
label.addEventListener('click', (e) => {
|
||||
e.stopPropagation()
|
||||
const item = label.closest('.file-tree-folder')
|
||||
const isCollapsed = item.classList.contains('is-collapsed')
|
||||
item && item.classList.toggle('is-collapsed', !isCollapsed)
|
||||
|
||||
const wrapper = label.closest('.file-tree-wrapper')
|
||||
this.updateLineHeight(wrapper)
|
||||
})
|
||||
label.dataset.init = 'true'
|
||||
})
|
||||
this.updateLineHeight(target)
|
||||
}
|
||||
|
||||
updateLineHeight(target = document) {
|
||||
const uls = target.querySelectorAll('.file-tree .file-tree')
|
||||
uls.forEach((ul) => {
|
||||
const parentItem = ul.closest('.file-tree-item.is-collapsed')
|
||||
if (parentItem) {
|
||||
ul.style.removeProperty('--fi-file-tree-line-height')
|
||||
return
|
||||
}
|
||||
const items = Array.from(ul.children).filter((el) => el.classList?.contains('file-tree-item'))
|
||||
if (!items.length) {
|
||||
ul.style.removeProperty('--fi-file-tree-line-height')
|
||||
return
|
||||
}
|
||||
|
||||
const firstLabel = items[0].querySelector('.file-tree-label')
|
||||
const lastLabel = items[items.length - 1].querySelector('.file-tree-label')
|
||||
if (!firstLabel || !lastLabel) return
|
||||
|
||||
const firstRect = firstLabel.getBoundingClientRect()
|
||||
const lastRect = lastLabel.getBoundingClientRect()
|
||||
|
||||
const firstCenterY = firstRect.top + firstRect.height / 2
|
||||
const lastCenterY = lastRect.top + lastRect.height / 2
|
||||
const offsetY = firstRect.height / 2 + 1/2 + 4
|
||||
const height = Math.max(0, lastCenterY - firstCenterY + offsetY)
|
||||
|
||||
ul.style.setProperty('--fi-file-tree-line-height', `${height}px`)
|
||||
})
|
||||
}
|
||||
}
|
||||
+9
-4
@@ -1,11 +1,14 @@
|
||||
// TODO use ESLint to check the code style
|
||||
// 按需加载主题内部库和功能模块
|
||||
import Util from './util';
|
||||
import FileTree from './lib/file-tree.js'
|
||||
|
||||
class FixIt {
|
||||
constructor() {
|
||||
this.config = window.config;
|
||||
this.isDark = document.documentElement.dataset.theme === 'dark';
|
||||
this.util = new Util();
|
||||
this.fileTree = new FileTree();
|
||||
this.newScrollTop = this.util.getScrollTop();
|
||||
this.oldScrollTop = this.newScrollTop;
|
||||
this.scrollEventSet = new Set();
|
||||
@@ -279,7 +282,7 @@ class FixIt {
|
||||
const results = {};
|
||||
window._index.search(query).forEach(({ item, refIndex, matches }) => {
|
||||
let title = item.title;
|
||||
let content = item.content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
||||
let content = item.content;
|
||||
matches.forEach(({ indices, value, key }) => {
|
||||
if (key === 'content') {
|
||||
content = this._applyHighlightToText(content, indices, highlightTag);
|
||||
@@ -340,13 +343,13 @@ class FixIt {
|
||||
templates: {
|
||||
suggestion: ({ title, uri, date, context }) =>
|
||||
`<div><a href="${uri}"><span class="suggestion-title">${title}</span></a><span class="suggestion-date">${date}</span></div><div class="suggestion-context">${context}</div>`,
|
||||
empty: ({ query }) => `<div class="search-empty">${searchConfig.noResultsFound}: <span class="search-query">"${query}"</span></div>`,
|
||||
empty: ({ query }) => `<div class="search-empty">${searchConfig.noResultsFound}: <span class="search-query">"${this.util.HTMLEscape(query)}"</span></div>`,
|
||||
footer: ({ }) => {
|
||||
let searchType, icon, href;
|
||||
switch (searchConfig.type) {
|
||||
case 'algolia':
|
||||
searchType = 'algolia';
|
||||
icon = '<i class="fa-brands fa-algolia fa-fw" aria-hidden="true"></i>';
|
||||
icon = '<i class="fa-brands fa-algolia" aria-hidden="true"></i>';
|
||||
href = 'https://www.algolia.com/';
|
||||
break;
|
||||
case 'fuse':
|
||||
@@ -357,7 +360,7 @@ class FixIt {
|
||||
case 'cse':
|
||||
if (this.config.cse.engine === 'google') {
|
||||
searchType = 'Google CSE';
|
||||
icon = '<i class="fa-brands fa-google fa-fw" aria-hidden="true"></i>';
|
||||
icon = '<i class="fa-brands fa-google" aria-hidden="true"></i>';
|
||||
href = 'https://programmablesearchengine.google.com/';
|
||||
}
|
||||
break;
|
||||
@@ -1122,6 +1125,7 @@ class FixIt {
|
||||
|
||||
initTabEvents(target = document) {
|
||||
target.addEventListener('tab-container-changed', () => {
|
||||
this.fileTree.updateLineHeight(target);
|
||||
window.FixItMermaid?.init?.();
|
||||
}, false);
|
||||
}
|
||||
@@ -1150,6 +1154,7 @@ class FixIt {
|
||||
this.initMathJax();
|
||||
this.initJsonViewer();
|
||||
this.initTabEvents(target);
|
||||
this.fileTree.init(target);
|
||||
window.FixItMermaid?.init?.();
|
||||
window.FixItAPlayer?.init?.();
|
||||
}
|
||||
|
||||
@@ -133,4 +133,14 @@ export default class Util {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
HTMLEscape(str) {
|
||||
return str.replace(/[&<>"']/g, char => ({
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
})[char]);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
File diff suppressed because one or more lines are too long
@@ -809,7 +809,7 @@ RSS = true
|
||||
# Title = "Twitter"
|
||||
|
||||
# [params.social.twitter.icon]
|
||||
# class = "fa-brands fa-x-twitter fa-fw"
|
||||
# class = "fa-brands fa-x-twitter"
|
||||
|
||||
# TypeIt config
|
||||
[params.typeit]
|
||||
@@ -1160,6 +1160,16 @@ copyable = true
|
||||
sort = false
|
||||
boxed = true
|
||||
|
||||
# FixIt 0.4.2 | NEW File tree config
|
||||
# See https://fixit.lruihao.cn/documentation/content-management/shortcodes/extended/file-tree/
|
||||
[params.filetree]
|
||||
# the expand level of the tree (expand all: -1, collapse all: 0)
|
||||
level = 1
|
||||
# whether to append a trailing "/" to folder names
|
||||
folderSlash = false
|
||||
# list of file or folder names to ignore
|
||||
ignoreList = []
|
||||
|
||||
# FixIt 0.3.12 | NEW Custom partials config
|
||||
# Custom partials must be stored in the /layouts/_partials/ directory.
|
||||
# Depends on open custom blocks https://fixit.lruihao.cn/references/blocks/
|
||||
@@ -1187,6 +1197,8 @@ postFooterAfter = []
|
||||
enable = false
|
||||
# Check for updates
|
||||
c4u = false
|
||||
# FixIt 0.4.0 | NEW Enable debug mode
|
||||
debug = false
|
||||
|
||||
# Page config
|
||||
# TODO migrate mapping key to `params` layer in the future
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<p class="error-text">
|
||||
{{- T "pageNotFoundText" -}}
|
||||
<a href="javascript:void(0);" title="{{ T `back` }}" onclick="window.history.back();">
|
||||
{{- dict "Class" "fa-regular fa-hand-point-left fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-regular fa-hand-point-left" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
</p>
|
||||
</article>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
{{- /*
|
||||
Render hook for file-tree code blocks
|
||||
Alternative to file-tree shortcode's inner content rendering.
|
||||
|
||||
Supported attributes:
|
||||
- level: The expand level of the tree (expand all: -1, collapse all: 0, default: 1)
|
||||
- folderSlash: Whether to append a trailing "/" to folder names (default: false)
|
||||
- ignoreList: List of file or folder names to ignore, separated by commas
|
||||
- highlightList: List of file or folder names to highlight, separated by commas
|
||||
|
||||
Content format: YAML/JSON/TOML with the following item structure:
|
||||
name: string - The name of the file or folder
|
||||
type: string - Type of item, either "dir" (directory) or "file"
|
||||
children?: array - (Optional) Array of child items, only valid for directories
|
||||
|
||||
Example usage:
|
||||
```file-tree {level=2 folderSlash=true}
|
||||
- name: my-project
|
||||
type: dir
|
||||
children:
|
||||
- name: src
|
||||
type: dir
|
||||
- name: package.json
|
||||
type: file
|
||||
```
|
||||
*/ -}}
|
||||
|
||||
{{- $pageConfig := dict | merge .Page.Params.filetree | merge .Page.Site.Params.filetree -}}
|
||||
{{- $config := .Attributes | merge $pageConfig -}}
|
||||
{{- $level := cond (isset $config "level") ($config.level | int) 1 -}}
|
||||
{{- $folderSlash := $config.folderslash | default false -}}
|
||||
{{- $ignoreList := union (apply (split (.Attributes.ignorelist | default "") ",") "trim" "." " ") $pageConfig.ignorelist -}}
|
||||
{{- $highlightList := apply (split (.Attributes.highlightlist | default "") ",") "trim" "." " " -}}
|
||||
|
||||
{{- $content := strings.TrimSpace .Inner | default "" -}}
|
||||
{{- $treeData := slice -}}
|
||||
{{- with $content -}}
|
||||
{{- $treeData = . | unmarshal -}}
|
||||
{{- if reflect.IsMap $treeData -}}
|
||||
{{- $treeData = $treeData.filetree -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $options := dict
|
||||
"items" $treeData
|
||||
"level" $level
|
||||
"folderSlash" $folderSlash
|
||||
"ignoreList" $ignoreList
|
||||
"highlightList" $highlightList
|
||||
-}}
|
||||
{{- partial "plugin/file-tree.html" $options -}}
|
||||
@@ -0,0 +1,18 @@
|
||||
{{- /*
|
||||
Render template call stack for debugging purpose.
|
||||
Call the partial from any template: {{- partial "devtools/template-call-stack.html" . -}}
|
||||
*/ -}}
|
||||
{{- $debug := (site.Store.Get "devOpts").debug -}}
|
||||
|
||||
{{- if $debug | and hugo.IsServer -}}
|
||||
{{- with templates.Current -}}
|
||||
<ul class="template-call-stack">
|
||||
{{- range .Ancestors -}}
|
||||
<li><a href="vscode://file/{{ .Filename }}"><small>{{ .Filename }}</small></a></li>
|
||||
{{- with .Base -}}
|
||||
<li><a href="vscode://file/{{ .Filename }}"><small>{{ .Filename }}</small></a></li>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="footer-line copyright{{ with $footerConfig.order.copyright }} order-{{ . }}{{ end }}" itemscope itemtype="http://schema.org/CreativeWork">
|
||||
{{- /* Copyright year */ -}}
|
||||
{{- if ne $footerConfig.copyright false -}}
|
||||
{{ dict "Class" "fa-regular fa-copyright fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-regular fa-copyright" | partial "plugin/icon.html" }}
|
||||
{{ with $footerConfig.since -}}
|
||||
<span itemprop="copyrightYear">
|
||||
{{- if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year -}}
|
||||
@@ -59,7 +59,7 @@
|
||||
{{- if $siteTime.enable | and $siteTime.value -}}
|
||||
{{- with $siteTime -}}
|
||||
<span class="site-time" title='{{ T "footer.siteRunning" }}'>
|
||||
{{- $siteTimeIcon := printf (cond .Animate "%v fa-fw animate-icon" "%v fa-fw") .Icon -}}
|
||||
{{- $siteTimeIcon := printf (cond .Animate "%v animate-icon" "%v") .Icon -}}
|
||||
{{- dict "Class" $siteTimeIcon | partial "plugin/icon.html" -}}
|
||||
{{- with .Pre -}}<span class="ms-1 d-none">{{ . }}</span>{{- end -}}
|
||||
{{- printf `<span class="run-times ms-1">%v</span>` (T "footer.siteRunning") | safeHTML -}}
|
||||
@@ -72,9 +72,9 @@
|
||||
{{- /* 不蒜子 */ -}}
|
||||
{{- $busuanzi := .Site.Params.busuanzi -}}
|
||||
{{- if eq $busuanzi.enable true -}}
|
||||
{{- $loading := dict "Class" "fa-solid fa-spinner fa-spin fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- $iconUV := dict "Class" "fa-regular fa-user fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- $iconPV := dict "Class" "fa-regular fa-eye fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- $loading := dict "Class" "fa-solid fa-spinner fa-spin" | partial "plugin/icon.html" -}}
|
||||
{{- $iconUV := dict "Class" "fa-regular fa-user me-1" | partial "plugin/icon.html" -}}
|
||||
{{- $iconPV := dict "Class" "fa-regular fa-eye me-1" | partial "plugin/icon.html" -}}
|
||||
<div class="footer-line visitor{{ with $footerConfig.order.visitor }} order-{{ . }}{{ end }}{{ if not $busuanzi.siteViews }} d-none{{ end }}">
|
||||
<span id="busuanzi_container_site_uv" title='{{ T "footer.siteUV" }}'>
|
||||
{{- $iconUV }}<span id="busuanzi_value_site_uv">{{ $loading }}</span>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{- $wrapper := .Wrapper -}}
|
||||
|
||||
{{- if $config.copyable -}}
|
||||
{{- $copyIcon := dict "Class" "fa-regular fa-clone" | partial "plugin/icon.html" -}}
|
||||
{{- $copyIcon := dict "Class" "fa-regular fa-clone fa-width-auto" | partial "plugin/icon.html" -}}
|
||||
{{- $copyBtn := printf `<div class="code-copy-btn" aria-label="%s" role="button" title="%s">%s</div>` (T "assets.copyToClipboard") (T "assets.copyToClipboard") $copyIcon -}}
|
||||
{{- $wrapper = replaceRE `(<div class="code-wrapper">[\s\S]*?<\/div>)` (printf `$1%s` $copyBtn) $wrapper -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -7,27 +7,27 @@
|
||||
{{- $lineWrapBtn := "" -}}
|
||||
{{- $editBtn := "" -}}
|
||||
{{- $copyBtn := "" -}}
|
||||
{{- $foldIcon := dict "Class" "arrow fa-solid fa-chevron-down fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- $foldIcon := dict "Class" "arrow fa-solid fa-chevron-down" | partial "plugin/icon.html" -}}
|
||||
{{- $titleEl := printf `<span class="code-title">%s</span>` $foldIcon -}}
|
||||
{{- $ellipsisBtn := printf `<span class="ellipses-btn" aria-label="Show more options" role="button">%s</span>` (dict "Class" "fa-solid fa-ellipsis-h fa-fw" | partial "plugin/icon.html") -}}
|
||||
{{- $ellipsisBtn := printf `<span class="ellipses-btn" aria-label="Show more options" role="button">%s</span>` (dict "Class" "fa-solid fa-ellipsis-h" | partial "plugin/icon.html") -}}
|
||||
|
||||
{{- if $config.title -}}
|
||||
{{- $titleEl = printf `<span class="code-title">%s<span class="title-inner">%s</span></span>` $foldIcon $config.title -}}
|
||||
{{- end -}}
|
||||
{{- if $config.linenostoggler -}}
|
||||
{{- $lineNosIcon := dict "Class" "fa-solid fa-list-ol fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- $lineNosIcon := dict "Class" "fa-solid fa-list-ol" | partial "plugin/icon.html" -}}
|
||||
{{- $lineNosBtn = printf `<span class="line-nos-btn" aria-label="%s" role="button" title="%s">%s</span>` (T "assets.toggleLineNumbers") (T "assets.toggleLineNumbers") $lineNosIcon -}}
|
||||
{{- end -}}
|
||||
{{- if $config.linewraptoggler -}}
|
||||
{{- $lineWrapIcon := dict "Class" "fa-solid fa-right-left fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- $lineWrapIcon := dict "Class" "fa-solid fa-right-left" | partial "plugin/icon.html" -}}
|
||||
{{- $lineWrapBtn = printf `<span class="line-wrap-btn" aria-label="%s" role="button" title="%s">%s</span>` (T "assets.toggleLineWrap") (T "assets.toggleLineWrap") $lineWrapIcon -}}
|
||||
{{- end -}}
|
||||
{{- if $config.editable -}}
|
||||
{{- $editIcon := dict "Class" "fa-solid fa-pen-to-square fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- $editIcon := dict "Class" "fa-solid fa-pen-to-square" | partial "plugin/icon.html" -}}
|
||||
{{- $editBtn = printf `<span class="edit-btn" aria-label="%s" role="button" title="%s">%s</span>` (T "assets.toggleCodeEditable") (T "assets.toggleCodeEditable") $editIcon -}}
|
||||
{{- end -}}
|
||||
{{- if $config.copyable -}}
|
||||
{{- $copyIcon := dict "Class" "fa-regular fa-clone fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- $copyIcon := dict "Class" "fa-regular fa-clone" | partial "plugin/icon.html" -}}
|
||||
{{- $copyBtn = printf `<span class="copy-btn" aria-label="%s" role="button" title="%s">%s</span>` (T "assets.copyToClipboard") (T "assets.copyToClipboard") $copyIcon -}}
|
||||
{{- end -}}
|
||||
{{- with $config.name -}}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
{{- /*
|
||||
Build structured tree data from filesystem with root path validation
|
||||
|
||||
It attempts to resolve the path relative to the root of your project directory.
|
||||
If a matching directory is not found, it will attempt to resolve the path relative to the contentDir.
|
||||
A leading path separator (/) is optional.
|
||||
|
||||
NOTE: For performance reasons, the recursion depth is limited to 10 levels by default.
|
||||
|
||||
@param {string} root - The root path to scan (relative to project root or contentDir)
|
||||
@param {string} [path] - The directory path for recursive calls
|
||||
@param {int} [level=10] - Descend only level directories deep
|
||||
@param {int} [deep=0] - Current depth level for recursive calls
|
||||
@param {array} [ignoreList] - List of file or folder names to ignore
|
||||
@param {boolean} [isRecursive=false] - Internal flag for recursive calls
|
||||
@param {string} [name] - Project name for the root node, if set to `{path}`, uses the full root path
|
||||
@param {string} [lang] - Page language for multilingual sites
|
||||
@param {boolean} [log=false] - Whether to log warnings
|
||||
@return {array} Array of tree items with structure: {name, type, children?}, or empty array if root doesn't exist
|
||||
*/ -}}
|
||||
|
||||
{{- $result := slice -}}
|
||||
{{- $level := .level | default 10 -}}
|
||||
{{- $deep := .deep | default 0 -}}
|
||||
{{- $isRecursive := .isRecursive | default false -}}
|
||||
{{- $_ignoreList := slice ".DS_Store" "Thumbs.db" ".directory" ".git" "node_modules" "public" -}}
|
||||
{{- $ignoreList := .ignoreList | default slice | union $_ignoreList -}}
|
||||
{{- $_debug := (site.Store.Get "devOpts").debug -}}
|
||||
|
||||
{{- if $isRecursive -}}
|
||||
{{- if le $deep $level -}}
|
||||
{{- /* Recursive mode: scan directory and build children */ -}}
|
||||
{{- /* {{- if $_debug -}}{{- warnf "Path%v: %v" $deep .path -}}{{- end -}} */ -}}
|
||||
{{- $path := .path -}}
|
||||
{{- $items := readDir $path -}}
|
||||
|
||||
{{- range $items -}}
|
||||
{{- if in $ignoreList .Name -}}
|
||||
{{- continue -}}
|
||||
{{- end -}}
|
||||
{{- $item := dict "name" .Name "type" (cond .IsDir "dir" "file") -}}
|
||||
{{- if .IsDir -}}
|
||||
{{- $fullPath := path.Clean (path.Join $path .Name) -}}
|
||||
{{- $childOptions := dict "path" $fullPath "deep" (add $deep 1) "ignoreList" $ignoreList "isRecursive" true -}}
|
||||
{{- $children := partial "function/get-file-tree.html" $childOptions -}}
|
||||
{{- $item = merge $item (dict "children" $children) -}}
|
||||
{{- end -}}
|
||||
{{- $result = $result | append $item -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- /* Initial call: validate root and build tree with root node */ -}}
|
||||
{{- $root := .root -}}
|
||||
{{- $rootIsExists := false -}}
|
||||
|
||||
{{- if (fileExists $root) -}}
|
||||
{{- with try (readDir $root) -}}
|
||||
{{- if .Err }}
|
||||
{{- /* Attempt to resolve the path relative to the contentDir */ -}}
|
||||
{{- $contentPath := path.Clean (path.Join "content" $root) -}}
|
||||
{{- /* If multilingual site, try language-specific content directory */ -}}
|
||||
{{- if hugo.IsMultilingual -}}
|
||||
{{- $contentPath = path.Clean (path.Join "content" $.lang $root) -}}
|
||||
{{- end -}}
|
||||
{{- with try (readDir $contentPath) -}}
|
||||
{{- if not .Err }}
|
||||
{{- $rootIsExists = true -}}
|
||||
{{- $root = $contentPath -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $rootIsExists = true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $rootIsExists -}}
|
||||
{{- $f := os.Stat $root -}}
|
||||
{{- /* Determine the root name for display */ -}}
|
||||
{{- $rootLabel := .name | default $f.Name -}}
|
||||
{{- $rootClean := path.Clean $root -}}
|
||||
{{- if eq .name "{path}" -}}
|
||||
{{- $rootLabel = $rootClean -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Build children recursively */ -}}
|
||||
{{- if $_debug -}}{{- warnf "> %v:" $rootLabel -}}{{- end -}}
|
||||
{{- $childOptions := dict "path" $root "deep" (add $deep 1) "level" $level "ignoreList" $ignoreList "isRecursive" true -}}
|
||||
{{- $children := partial "function/get-file-tree.html" $childOptions -}}
|
||||
|
||||
{{- /* Return root item with children */ -}}
|
||||
{{- $result = slice (dict "name" $rootLabel "type" "dir" "children" $children) -}}
|
||||
{{- else -}}
|
||||
{{- /* Root doesn't exist, emit warning if context provided */ -}}
|
||||
{{- if .log | default false -}}
|
||||
{{- warnidf "warning-file-tree" "[get-file-tree]: The root path does not exist: %s." $root -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $result -}}
|
||||
@@ -26,11 +26,11 @@
|
||||
- [ ] Unchecked
|
||||
- [x] Checked
|
||||
*/ -}}
|
||||
{{- $icon := dict "Class" (add "checkbox-icon fa-fw " (index $iconMap " ")) | partial "plugin/icon.html" -}}
|
||||
{{- $icon := dict "Class" (add "checkbox-icon " (index $iconMap " ")) | partial "plugin/icon.html" -}}
|
||||
{{- $label := T (printf "taskList.%v" " ") -}}
|
||||
{{- $content := replaceRE `<li>(\n<p>)*<input disabled="" type="checkbox"> (.+?)(</p>\n)*</li>` (printf `<li data-task=" " title=%q>$1%s$2$3</li>` $label $icon) . -}}
|
||||
{{- $label := T (printf "taskList.%v" "x") -}}
|
||||
{{- $icon := dict "Class" (add "checkbox-icon fa-fw " (index $iconMap "x")) | partial "plugin/icon.html" -}}
|
||||
{{- $icon := dict "Class" (add "checkbox-icon " (index $iconMap "x")) | partial "plugin/icon.html" -}}
|
||||
{{- $content = replaceRE `<li>(\n<p>)*<input checked="" disabled="" type="checkbox"> (.+?)(</p>\n)*</li>` (printf `<li data-task="x" title=%q>$1%s$2$3</li>` $label $icon) $content -}}
|
||||
|
||||
{{- /*
|
||||
@@ -45,7 +45,7 @@
|
||||
*/ -}}
|
||||
{{- range $extendedSigns -}}
|
||||
{{- $class := index $iconMap . | default "fa-solid fa-check-square" -}}
|
||||
{{- $icon := dict "Class" (add "checkbox-icon fa-fw " $class) | partial "plugin/icon.html" -}}
|
||||
{{- $icon := dict "Class" (add "checkbox-icon " $class) | partial "plugin/icon.html" -}}
|
||||
{{- $sign := htmlEscape . -}}
|
||||
{{- $originSign := replace . "\\" "" -}}
|
||||
{{- $label := (T (printf "taskList.%v" $originSign)) | default (T (printf "taskList.%v" " ")) -}}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
{{- if (urls.Parse $url).Host }} rel="noopener noreferrer" target="_blank"{{ end -}}
|
||||
>
|
||||
{{- with .Pre -}}{{- . | safeHTML }} {{ end }}
|
||||
{{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- .Name }}
|
||||
{{- with .Post }} {{ . | safeHTML -}}{{- end -}}
|
||||
</a>
|
||||
@@ -79,7 +79,7 @@
|
||||
{{- if (urls.Parse $url).Host }} rel="noopener noreferrer" target="_blank"{{ end -}}
|
||||
>
|
||||
{{- with $v.Pre -}}{{- . | safeHTML }} {{ end }}
|
||||
{{- with $v.Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- with $v.Params.Icon -}}{{ dict "Class" (printf "%v fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- $v.Name }}
|
||||
{{- with $v.Post }} {{ . | safeHTML -}}{{- end -}}
|
||||
</a>
|
||||
@@ -98,23 +98,23 @@
|
||||
<li class="menu-item search" id="search-desktop">
|
||||
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `assets.searchPlaceholder`) }}" id="search-input-desktop">
|
||||
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="{{ T `assets.search` }}">
|
||||
{{ dict "Class" "fa-solid fa-search fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-solid fa-search" | partial "plugin/icon.html" }}
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="search-button search-clear" id="search-clear-desktop" title="{{ T `assets.clear` }}">
|
||||
{{ dict "Class" "fa-solid fa-times-circle fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-solid fa-times-circle" | partial "plugin/icon.html" }}
|
||||
</a>
|
||||
<span class="search-button search-loading" id="search-loading-desktop">
|
||||
{{ dict "Class" "fa-solid fa-spinner fa-fw fa-spin" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-solid fa-spinner fa-spin" | partial "plugin/icon.html" }}
|
||||
</span>
|
||||
</li>
|
||||
{{- end -}}
|
||||
<li class="menu-item theme-switch" role="button" aria-label="{{ T "header.switchTheme" }}" title="{{ T "header.switchTheme" }}">
|
||||
{{- dict "Class" "fa-solid fa-adjust fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-adjust" | partial "plugin/icon.html" -}}
|
||||
</li>
|
||||
{{- if hugo.IsMultilingual -}}
|
||||
<li class="menu-item language-switch">
|
||||
<span role="button" aria-label="{{ T "header.selectLanguage" }}" title="{{ T "header.selectLanguage" }}">
|
||||
{{- dict "Class" "fa-solid fa-language fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-language" | partial "plugin/icon.html" -}}
|
||||
</span>
|
||||
<ul class="sub-menu">
|
||||
{{- if (eq .Kind "404") -}}
|
||||
@@ -188,7 +188,7 @@
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="theme-switch" role="button" aria-label="{{ T "header.switchTheme" }}">
|
||||
{{- dict "Class" "fa-solid fa-adjust fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-adjust" | partial "plugin/icon.html" -}}
|
||||
</div>
|
||||
<div class="menu-toggle" id="menu-toggle-mobile" role="button" aria-labelledby="menu-mobile">
|
||||
<span></span><span></span><span></span>
|
||||
@@ -201,13 +201,13 @@
|
||||
<div class="search mobile" id="search-mobile">
|
||||
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `assets.searchPlaceholder`) }}" id="search-input-mobile">
|
||||
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="{{ T `assets.search` }}">
|
||||
{{ dict "Class" "fa-solid fa-search fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-solid fa-search" | partial "plugin/icon.html" }}
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="search-button search-clear" id="search-clear-mobile" title="{{ T `assets.clear` }}">
|
||||
{{ dict "Class" "fa-solid fa-times-circle fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-solid fa-times-circle" | partial "plugin/icon.html" }}
|
||||
</a>
|
||||
<span class="search-button search-loading" id="search-loading-mobile">
|
||||
{{ dict "Class" "fa-solid fa-spinner fa-fw fa-spin" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-solid fa-spinner fa-spin" | partial "plugin/icon.html" }}
|
||||
</span>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="search-cancel" id="search-cancel-mobile">
|
||||
@@ -234,7 +234,7 @@
|
||||
{{- if (urls.Parse $url).Host }} rel="noopener noreferrer" target="_blank"{{ end -}}
|
||||
>
|
||||
{{- with .Pre -}}{{- . | safeHTML }} {{ end }}
|
||||
{{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- .Name }}
|
||||
{{- with .Post }} {{ . | safeHTML -}}{{- end -}}
|
||||
</a>
|
||||
@@ -260,7 +260,7 @@
|
||||
{{- if (urls.Parse $url).Host }}rel="noopener noreferrer" target="_blank"{{ end -}}
|
||||
>
|
||||
{{- with $v.Pre -}}{{- . | safeHTML }} {{ end }}
|
||||
{{- with $v.Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- with $v.Params.Icon -}}{{ dict "Class" (printf "%v fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- $v.Name }}
|
||||
{{- with $v.Post }} {{ . | safeHTML -}}{{- end -}}
|
||||
</a>
|
||||
@@ -275,7 +275,7 @@
|
||||
{{- if (urls.Parse $url).Host }} rel="noopener noreferrer" target="_blank"{{ end -}}
|
||||
>
|
||||
{{- with .Pre -}}{{- . | safeHTML }} {{ end }}
|
||||
{{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-sm" .) | partial "plugin/icon.html" }} {{ end }}
|
||||
{{- .Name }}
|
||||
{{- with .Post }} {{ . | safeHTML -}}{{- end -}}
|
||||
</a>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v0.4.1" -}}
|
||||
{{- hugo.Store.Set "version" "v0.4.2" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
@@ -46,20 +46,25 @@
|
||||
{{- $type = index $aliasMap $type | default $type | default "note" -}}
|
||||
{{- $icon := index $iconMap $type | default "fa-solid fa-pencil-alt" -}}
|
||||
{{- $title := .Title | default (T (printf "admonition.%v" $type)) | default (title $type) -}}
|
||||
{{- $titleless := eq .Title "~" -}}
|
||||
{{- $foldable := ne .Foldable false -}}
|
||||
|
||||
<div class="details admonition {{ $type }}{{ if .Open | ne false }} open{{ end }}{{ if not $foldable }} disabled{{ end }}">
|
||||
<div class="details-summary admonition-title">
|
||||
{{- dict "Class" (add "icon fa-fw " $icon) | partial "plugin/icon.html" -}}
|
||||
{{- $title | safeHTML -}}
|
||||
{{- if $foldable -}}
|
||||
{{- dict "Class" "details-icon fa-solid fa-angle-right fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="details-content">
|
||||
<div class="admonition-content">
|
||||
{{- .Text | safeHTML -}}
|
||||
{{- if not $titleless }}
|
||||
<div class="details-summary admonition-title">
|
||||
{{- dict "Class" (add "icon " $icon) | partial "plugin/icon.html" -}}
|
||||
{{- $title | safeHTML -}}
|
||||
{{- if $foldable -}}
|
||||
{{- dict "Class" "details-icon fa-solid fa-angle-right" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- with .Text -}}
|
||||
<div class="details-content">
|
||||
<div class="admonition-content">
|
||||
{{- . | safeHTML -}}
|
||||
</div>
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- /* EOF */ -}}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
{{- $label := .Label | default "Copy Diagram code" -}}
|
||||
|
||||
<div class="diagram-copy-btn" aria-label="{{ $label }}" role="button">
|
||||
{{- dict "Class" "fa-regular fa-clone" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-regular fa-clone fa-width-auto" | partial "plugin/icon.html" -}}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
{{- /*
|
||||
Recursive function to render tree from structured data
|
||||
@param {array} items - Array of tree items
|
||||
@param {int} level - The expand level of the tree (expand all: -1, collapse all: 0)
|
||||
@param {int} [depth=0] - Current depth level
|
||||
@param {bool} [folderSlash=false] - Whether to append a trailing "/" to folder names
|
||||
@param {array} [ignoreList] - List of file or folder names to ignore
|
||||
@param {array} [highlightList] - List of file or folder names to highlight
|
||||
|
||||
File tree item structure:
|
||||
name: string - The name of the file or folder
|
||||
type: string - Type of item, either "dir" (directory) or "file"
|
||||
children?: array - (Optional) Array of child items, only valid for directories
|
||||
*/ -}}
|
||||
{{- define "render-file-tree" -}}
|
||||
{{- $items := .items -}}
|
||||
{{- $level := .level -}}
|
||||
{{- $depth := .depth | default 0 -}}
|
||||
{{- $folderSlash := .folderSlash | default false -}}
|
||||
{{- $ignoreList := .ignoreList | default slice -}}
|
||||
{{- $highlightList := .highlightList | default slice -}}
|
||||
|
||||
<ul class="file-tree" data-level="{{ $depth }}">
|
||||
{{- /* Sort items: directories first, then files */ -}}
|
||||
{{- $dirItems := slice -}}
|
||||
{{- $fileItems := slice -}}
|
||||
{{- range $items -}}
|
||||
{{- if in $ignoreList .name -}}
|
||||
{{- continue -}}
|
||||
{{- end -}}
|
||||
{{- if eq .type "dir" -}}
|
||||
{{- $dirItems = $dirItems | append . -}}
|
||||
{{- else -}}
|
||||
{{- $fileItems = $fileItems | append . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range (append $fileItems $dirItems) -}}
|
||||
{{- $isDir := eq .type "dir" -}}
|
||||
{{- $isCollapsed := $isDir | and (ge $depth $level) | and (ge $level 0) -}}
|
||||
{{- $isHighlighted := in $highlightList .name -}}
|
||||
{{- $label := .name -}}
|
||||
{{- if and $isDir $folderSlash -}}
|
||||
{{- $label = printf "%s/" $label -}}
|
||||
{{- end -}}
|
||||
|
||||
<li class="file-tree-item{{ if $isDir }} file-tree-folder{{ end }}{{ if $isCollapsed }} is-collapsed{{ end }}">
|
||||
<span class="file-tree-label{{ if $isDir }} file-tree-toggle{{ end }}{{ if $isHighlighted }} is-highlighted{{ end }}">
|
||||
{{- $icon := "file-tree-icon fa-regular " -}}
|
||||
{{- if $isDir -}}
|
||||
{{- $icon = add $icon "fa-folder-open" -}}
|
||||
{{- else -}}
|
||||
{{- $icon = add $icon "fa-file-lines" -}}
|
||||
{{- end -}}
|
||||
{{- dict "Class" $icon | partial "plugin/icon.html" -}}
|
||||
<span class="file-tree-label__inner">{{ $label }}</span>
|
||||
</span>
|
||||
|
||||
{{- if and $isDir .children -}}
|
||||
{{- $options := dict
|
||||
"items" .children
|
||||
"depth" (add $depth 1)
|
||||
"level" $level
|
||||
"folderSlash" $folderSlash
|
||||
"ignoreList" $ignoreList
|
||||
"highlightList" $highlightList
|
||||
-}}
|
||||
{{- template "render-file-tree" $options -}}
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
{{- if .items -}}
|
||||
{{- $ignoreList := .ignoreList | default slice -}}
|
||||
{{- $notEmpty := false -}}
|
||||
{{- range .items -}}
|
||||
{{- if not (in $ignoreList .name) -}}
|
||||
{{- $notEmpty = true -}}
|
||||
{{- break -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $notEmpty -}}
|
||||
<div class="file-tree-wrapper">
|
||||
{{- template "render-file-tree" . -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -33,12 +33,12 @@
|
||||
| and (eq ((strings.HasSuffix .Content `</i>`) | or (strings.HasSuffix .Content `):`)) false)
|
||||
-}}
|
||||
{{- if .Download -}}
|
||||
{{- dict "Class" "fa-solid fa-cloud-download-alt fa-fw ms-1 text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-cloud-download-alt ms-1 text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "Class" "fa-solid fa-external-link-alt fa-fw fa-xs ms-1 text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
{{- else if .Download }}
|
||||
{{- dict "Class" "fa-solid fa-download fa-fw ms-1 text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-download ms-1 text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $cardIcon := .CardIcon -}}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="comment">{{ $reward.comment }}</div>
|
||||
<input type="checkbox" class="reward-input" name="reward" id="{{ $id }}" hidden />
|
||||
<label class="reward-button" for="{{ $id }}">
|
||||
{{- dict "Class" "fa-solid fa-qrcode fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-qrcode" | partial "plugin/icon.html" -}}
|
||||
{{- T "single.reward.donate" -}}
|
||||
</label>
|
||||
<div class="reward-ways"{{ with $reward.mode }} data-mode="{{ . }}"{{ end }}>
|
||||
|
||||
@@ -5,84 +5,84 @@
|
||||
{{- /* 001: Twitter */ -}}
|
||||
{{- if $share.Twitter -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} X" data-sharer="twitter" data-url="{{ .Permalink }}" data-title="{{ $title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.tags }} data-hashtags="{{ delimit . `,` }}"{{ end }}>
|
||||
{{- dict "Class" "fa-brands fa-x-twitter fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-x-twitter" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 002: Facebook */ -}}
|
||||
{{- if $share.Facebook -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Facebook" data-sharer="facebook" data-url="{{ .Permalink }}"{{ with .Params.tags }} data-hashtag="{{ index . 0 }}"{{ end }}>
|
||||
{{- dict "Class" "fa-brands fa-facebook-square fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-facebook-square" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 003: Linkedin */ -}}
|
||||
{{- if $share.Linkedin -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Linkedin" data-sharer="linkedin" data-url="{{ .Permalink }}">
|
||||
{{- dict "Class" "fa-brands fa-linkedin fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-linkedin" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 004: WhatsApp */ -}}
|
||||
{{- if $share.Whatsapp -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} WhatsApp" data-sharer="whatsapp" data-url="{{ .Permalink }}" data-title="{{ $title }}" data-web>
|
||||
{{- dict "Class" "fa-brands fa-whatsapp fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-whatsapp" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 005: Viber */ -}}
|
||||
{{- if $share.Viber -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Viber" data-sharer="viber" data-url="{{ .Permalink }}" data-title="{{ $title }}">
|
||||
{{- dict "Class" "fa-brands fa-viber fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-viber" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 006: Pinterest */ -}}
|
||||
{{- if $share.Pinterest -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pinterest" data-sharer="pinterest" data-url="{{ .Permalink }}"{{ with .Description }} data-description="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
{{- dict "Class" "fa-brands fa-pinterest fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-pinterest" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 007: Tumblr */ -}}
|
||||
{{- if $share.Tumblr -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Tumblr" data-sharer="tumblr" data-url="{{ .Permalink }}" data-title="{{ $title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.tags }} data-tags="{{ delimit . `,` }}"{{ end }}>
|
||||
{{- dict "Class" "fa-brands fa-tumblr fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-tumblr" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 008: Hacker News */ -}}
|
||||
{{- if $share.Hackernews -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Hacker News" data-sharer="hackernews" data-url="{{ .Permalink }}" data-title="{{ $title }}">
|
||||
{{- dict "Class" "fa-brands fa-hacker-news fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-hacker-news" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 009: Reddit */ -}}
|
||||
{{- if $share.Reddit -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Reddit" data-sharer="reddit" data-url="{{ .Permalink }}">
|
||||
{{- dict "Class" "fa-brands fa-reddit fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-reddit" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 010: VK */ -}}
|
||||
{{- if $share.VK -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} VK" data-sharer="vk" data-url="{{ .Permalink }}" data-title="{{ $title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
{{- dict "Class" "fa-brands fa-vk fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-vk" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 011: Buffer */ -}}
|
||||
{{- if $share.Buffer -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Buffer" data-sharer="buffer" data-url="{{ .Permalink }}" data-title="{{ $title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-picture="{{ . }}"{{ end }}>
|
||||
{{- dict "Class" "fa-brands fa-buffer fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-buffer" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 012: Xing */ -}}
|
||||
{{- if $share.Xing -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Xing" data-sharer="xing" data-url="{{ .Permalink }}" data-title="{{ $title }}">
|
||||
{{- dict "Class" "fa-brands fa-xing fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-xing" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
@@ -103,21 +103,21 @@
|
||||
{{- /* 015: Pocket */ -}}
|
||||
{{- if $share.Pocket -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pocket" data-sharer="pocket" data-url="{{ .Permalink }}">
|
||||
{{- dict "Class" "fa-brands fa-get-pocket fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-get-pocket" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 016: Flipboard */ -}}
|
||||
{{- if $share.Flipboard -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Flipboard" data-sharer="flipboard" data-url="{{ .Permalink }}" data-title="{{ $title }}">
|
||||
{{- dict "Class" "fa-brands fa-flipboard fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-flipboard" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 017: 微博 */ -}}
|
||||
{{- if $share.Weibo -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 微博" data-sharer="weibo" data-url="{{ .Permalink }}" data-title="{{ $title }}"{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}{{ with .Site.Params.Social.Weibo }} data-ralateuid="{{ . }}"{{ end }}>
|
||||
{{- dict "Class" "fa-brands fa-weibo fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-weibo" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
{{- /* 019: Blogger */ -}}
|
||||
{{- if $share.Blogger -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Blogger" data-sharer="blogger" data-url="{{ .Permalink }}" data-title="{{ $title }}" data-description="{{ .Description }}">
|
||||
{{- dict "Class" "fa-brands fa-blogger fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-blogger" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
@@ -145,35 +145,35 @@
|
||||
{{- /* 021: OK.RU */ -}}
|
||||
{{- if $share.Odnoklassniki -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} OK.RU" data-sharer="okru" data-url="{{ .Permalink }}" data-title="{{ $title }}">
|
||||
{{- dict "Class" "fa-brands fa-odnoklassniki fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-odnoklassniki" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 022: Evernote */ -}}
|
||||
{{- if $share.Evernote -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Evernote" data-sharer="evernote" data-url="{{ .Permalink }}" data-title="{{ $title }}">
|
||||
{{- dict "Class" "fa-brands fa-evernote fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-evernote" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 023: Skype */ -}}
|
||||
{{- if $share.Skype -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Skype" data-sharer="skype" data-url="{{ .Permalink }}" data-title="{{ $title }}">
|
||||
{{- dict "Class" "fa-brands fa-skype fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-skype" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 024: Trello */ -}}
|
||||
{{- if $share.Trello -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Trello" data-sharer="trello" data-url="{{ .Permalink }}" data-title="{{ $title }}" data-description="{{ .Description }}">
|
||||
{{- dict "Class" "fa-brands fa-trello fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-trello" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
{{- /* 025: Mix */ -}}
|
||||
{{- if $share.Mix -}}
|
||||
<a href="//mix.com/add?url={{ .Permalink }}&description={{ $title }}" target="_blank" title="{{ T `shareOn` }} Mix">
|
||||
{{- dict "Class" "fa-brands fa-mix fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-brands fa-mix" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{ end -}}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
{{- $postCount = add $postCount 1 -}}
|
||||
{{- if eq $hasTitle false -}}
|
||||
<h2 class="group-title">
|
||||
{{- dict "Class" "fa-regular fa-calendar-check fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-regular fa-calendar-check me-1" | partial "plugin/icon.html" -}}
|
||||
{{- T "section.recentlyUpdated" -}}
|
||||
</h2>
|
||||
{{- $hasTitle = true -}}
|
||||
@@ -37,7 +37,7 @@
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||
{{- $repost := .Params.repost | default dict -}}
|
||||
{{- if eq $repost.enable true -}}
|
||||
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-share text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
{{- if eq $scope "archives" -}}
|
||||
{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
<div class="details collection-details{{ if $open }} open{{ end }}">
|
||||
<div class="details-summary collection-summary">
|
||||
{{ dict "Class" "fa-solid fa-layer-group fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-solid fa-layer-group" | partial "plugin/icon.html" }}
|
||||
<span class="collection-name" title="{{ T "collections" }}">{{ .LinkTitle }}</span>
|
||||
<span class="collection-count">{{ $pages.Len }}</span>
|
||||
{{- dict "Class" "details-icon fa-solid fa-angle-right fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "details-icon fa-solid fa-angle-right" | partial "plugin/icon.html" -}}
|
||||
</div>
|
||||
<div class="details-content collection-content">
|
||||
<nav>
|
||||
@@ -36,19 +36,19 @@
|
||||
{{- with $pages.Next $ -}}
|
||||
{{- $capitalizeTitles := .Param "capitalizeTitles" -}}
|
||||
<a href="{{ .RelPermalink }}" class="collection-nav-item" rel="prev" title="{{ cond $capitalizeTitles (title .LinkTitle) .LinkTitle }}">
|
||||
{{- dict "Class" "fa-solid fa-angle-left fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-left" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- else -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-left fa-fw collection-nav-item text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-left collection-nav-item text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
<span class="text-secondary">{{ add $currentKey 1 }}/{{ $pages.Len }}</span>
|
||||
{{- with $pages.Prev $ -}}
|
||||
{{- $capitalizeTitles := .Param "capitalizeTitles" -}}
|
||||
<a href="{{ .RelPermalink }}" class="collection-nav-item" rel="next" title="{{ cond $capitalizeTitles (title .LinkTitle) .LinkTitle }}">
|
||||
{{- dict "Class" "fa-solid fa-angle-right fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-right" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- else -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-right fa-fw collection-nav-item text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-right collection-nav-item text-secondary" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{{- range $collectionTerms -}}
|
||||
{{- $termLink := printf `<a href="%v">%v <span>%v・%v</span></span></a>`
|
||||
(partial "function/escapeurl.html" .RelPermalink)
|
||||
(dict "Class" "fa-solid fa-layer-group fa-fw" | partial "plugin/icon.html")
|
||||
(dict "Class" "fa-solid fa-layer-group" | partial "plugin/icon.html")
|
||||
(T "collection")
|
||||
.LinkTitle
|
||||
-}}
|
||||
@@ -22,7 +22,7 @@
|
||||
{{- $title := .Params.shortTitle | default .LinkTitle -}}
|
||||
{{- $title = cond $capitalizeTitles (title $title) $title -}}
|
||||
<a href="{{ .RelPermalink }}" class="collection-nav-item" rel="prev" title="{{ $title }}">
|
||||
{{- dict "Class" "fa-solid fa-angle-left fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-left" | partial "plugin/icon.html" -}}
|
||||
<span>{{ $title }}</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
@@ -32,7 +32,7 @@
|
||||
{{- $title = cond $capitalizeTitles (title $title) $title -}}
|
||||
<a href="{{ .RelPermalink }}" class="collection-nav-item" rel="next" title="{{ $title }}">
|
||||
<span>{{ $title }}</span>
|
||||
{{- dict "Class" "fa-solid fa-angle-right fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-right" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{{- end -}}
|
||||
<div class="expiration-reminder details admonition {{ $type }} open">
|
||||
<div class="details-summary admonition-title">
|
||||
<i class="icon fa-solid {{ $icon }} fa-fw" aria-hidden="true"></i>{{ T (printf "admonition.%v" $type) }}<i class="details-icon fa-solid fa-angle-right fa-fw" aria-hidden="true"></i>
|
||||
<i class="icon fa-solid {{ $icon }}" aria-hidden="true"></i>{{ T (printf "admonition.%v" $type) }}<i class="details-icon fa-solid fa-angle-right" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details-content">
|
||||
<div class="admonition-content">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{{- $title = printf "%s
Commit Date: %v" $title (.CommitDate | dateFormat "2006-01-02 15:04:05") -}}
|
||||
{{- end -}}
|
||||
<a class="git-hash" href="{{ printf `%v/commit/%v` $gitRepo .Hash }}" rel="external nofollow noopener noreferrer" target="_blank" title="{{ $title | safeHTML }}">
|
||||
{{- dict "Class" "fa-solid fa-hashtag fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-hashtag" | partial "plugin/icon.html" -}}
|
||||
{{- .AbbreviatedHash -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
@@ -97,7 +97,7 @@
|
||||
<section class="post-tags">
|
||||
{{- $tagTerms := .GetTerms "tags" -}}
|
||||
{{- if $tagTerms -}}
|
||||
{{- dict "Class" "fa-solid fa-tags fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-tags me-1" | partial "plugin/icon.html" -}}
|
||||
{{- range $tagTerms -}}
|
||||
{{- $href := partial "function/escapeurl.html" .RelPermalink -}}
|
||||
{{- $title := printf "%v - %v" (T "tags") .LinkTitle -}}
|
||||
@@ -129,7 +129,7 @@
|
||||
{{- with $prev -}}
|
||||
{{- $capitalizeTitles := .Param "capitalizeTitles" -}}
|
||||
<a href="{{ .RelPermalink }}" class="post-nav-item" rel="prev" title="{{ cond $capitalizeTitles (title .LinkTitle) .LinkTitle }}">
|
||||
{{- dict "Class" "fa-solid fa-angle-left fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-left" | partial "plugin/icon.html" -}}
|
||||
{{- cond $capitalizeTitles (title .LinkTitle) .LinkTitle -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
@@ -137,7 +137,7 @@
|
||||
{{- $capitalizeTitles := .Param "capitalizeTitles" -}}
|
||||
<a href="{{ .RelPermalink }}" class="post-nav-item" rel="next" title="{{ cond $capitalizeTitles (title .LinkTitle) .LinkTitle }}">
|
||||
{{- cond $capitalizeTitles (title .LinkTitle) .LinkTitle -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-right fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-right" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
printf `<a href="%v" class="post-category" title="%v">%v %v</a>`
|
||||
(partial "function/escapeurl.html" .RelPermalink)
|
||||
(printf "%v - %v" (T "category") .LinkTitle)
|
||||
(dict "Class" "fa-regular fa-folder fa-fw" | partial "plugin/icon.html")
|
||||
(dict "Class" "fa-regular fa-folder" | partial "plugin/icon.html")
|
||||
.LinkTitle
|
||||
) -}}
|
||||
{{- end -}}
|
||||
@@ -16,7 +16,7 @@
|
||||
printf `<a href="%v" class="post-collection" title="%v">%v %v</a>`
|
||||
(partial "function/escapeurl.html" .RelPermalink)
|
||||
(printf "%v - %v" (T "collection") .LinkTitle)
|
||||
(dict "Class" "fa-solid fa-layer-group fa-fw" | partial "plugin/icon.html")
|
||||
(dict "Class" "fa-solid fa-layer-group" | partial "plugin/icon.html")
|
||||
.LinkTitle
|
||||
) -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
{{- with $related -}}
|
||||
<div class="details related-details open">
|
||||
<div class="details-summary related-summary">
|
||||
{{ dict "Class" "fa-solid fa-fire fa-fade text-danger fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ dict "Class" "fa-solid fa-fire fa-fade text-danger" | partial "plugin/icon.html" }}
|
||||
<span class="related-title">{{ T "single.relatedContent" }}</span>
|
||||
{{- dict "Class" "details-icon fa-solid fa-angle-right fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "details-icon fa-solid fa-angle-right" | partial "plugin/icon.html" -}}
|
||||
</div>
|
||||
<div class="details-content related-content">
|
||||
<ul class="related-list">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{{- /* back to top button */ -}}
|
||||
{{- if $backToTop.enable -}}
|
||||
<div class="fixed-button back-to-top animate__faster d-none" role="button" aria-label="{{ T `baseof.backToTop` }}">
|
||||
{{- dict "Class" "fa-solid fa-arrow-up fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-arrow-up" | partial "plugin/icon.html" -}}
|
||||
{{- if $backToTop.scrollpercent -}}
|
||||
<svg viewBox="0 0 100 100">
|
||||
<circle class="bg" cx="50" cy="50" r="50"></circle>
|
||||
@@ -19,13 +19,13 @@
|
||||
{{- /* toc dialog button */ -}}
|
||||
{{- if .Store.Get "showToc" -}}
|
||||
<div id="toc-drawer-button" class="fixed-button toc-drawer-button d-none{{ with $params.password }} encrypted-hidden{{ end }}" role="button" aria-label="{{ T `single.contents` }}">
|
||||
{{- dict "Class" "fa-solid fa-bars fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-bars" | partial "plugin/icon.html" -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- /* comment button */ -}}
|
||||
{{- if $comment.enable -}}
|
||||
<div class="fixed-button view-comments d-none" role="button" aria-label="{{ T `baseof.viewComments` }}">
|
||||
{{- dict "Class" "fa-solid fa-comment fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-comment" | partial "plugin/icon.html" -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
{{- /*
|
||||
Renders an interactive file tree structure from inline content, resources, data files, or filesystem
|
||||
See https://fixit.lruihao.cn/documentation/content-management/shortcodes/extended/file-tree/
|
||||
|
||||
@param {string} [path="/"] - The path to scan in filesystem (relative to project root or contentDir)
|
||||
@param {int} [level=1] - The expand level of the tree (expand all: -1, collapse all: 0)
|
||||
@param {boolean} [folderSlash=false] - Whether to append a trailing "/" to folder names.
|
||||
@param {string} [file] - The path of a data file in page resources or assets. (JSON/YAML/TOML)
|
||||
@param {string} [data] - The name of the data file in data/filetree/ directory. (JSON/YAML/TOML)
|
||||
@param {string} [ignoreList=""] - List of file or folder names to ignore, separated by commas
|
||||
@param {string} [highlightList=""] - List of file or folder names to highlight, separated by commas
|
||||
@param {string} [name] - Project name for the root node, if set to `{path}`, uses the full root path
|
||||
|
||||
Priority order (highest to lowest):
|
||||
1. Inline content (shortcode body) - Parse tree data from shortcode body
|
||||
2. Resources files (file parameter) - Read data file from page bundle or asset
|
||||
3. Data files (data parameter) - Load data file from data/filetree/ directory
|
||||
4. Actual Filesystem (path parameter) - Scan actual directory structure (default)
|
||||
|
||||
Fallback mechanism: If the current mode fails (e.g., file not found, invalid format),
|
||||
the shortcode will automatically fall back to the next available mode in the priority order.
|
||||
|
||||
@example
|
||||
{{< file-tree "content" 2 />}}
|
||||
{{< file-tree path="content" level=2 folderSlash=true />}}
|
||||
{{< file-tree file="data/example.yml" />}}
|
||||
{{< file-tree data="example" />}}
|
||||
{{< file-tree >}}
|
||||
- name: my-project
|
||||
type: dir
|
||||
children:
|
||||
- name: src
|
||||
type: dir
|
||||
- name: package.json
|
||||
type: file
|
||||
{{< /file-tree >}}
|
||||
|
||||
Data format note: YAML and JSON support direct array format, while TOML requires a root key 'filetree' due to format limitations.
|
||||
Example TOML structure:
|
||||
```file-tree
|
||||
[[filetree]]
|
||||
name = "src"
|
||||
type = "dir"
|
||||
|
||||
[[filetree.children]]
|
||||
name = "index.ts"
|
||||
type = "file"
|
||||
|
||||
[[filetree]]
|
||||
name = "README.md"
|
||||
type = "file"
|
||||
```
|
||||
*/ -}}
|
||||
|
||||
{{- $config := dict | merge .Page.Params.filetree | merge .Site.Params.filetree -}}
|
||||
{{- $root := cond .IsNamedParams (.Get "path") (.Get 0) | default "/" -}}
|
||||
{{- $level := cond .IsNamedParams (.Get "level") (.Get 1) -}}
|
||||
{{- $config = cond ((eq $level 0) | or $level) (dict "level" $level | merge $config) $config -}}
|
||||
{{- $level = cond (isset $config "level") ($config.level | int) 1 -}}
|
||||
{{- $folderSlash := cond .IsNamedParams (.Get "folderSlash") (.Get 2) | default $config.folderslash | default false -}}
|
||||
{{- $fileName := .Get "file" -}}
|
||||
{{- $dataName := .Get "data" -}}
|
||||
{{- $supportExts := slice ".yml" ".yaml" ".json" ".toml" -}}
|
||||
{{- $ignoreList := union (apply (split (.Get "ignoreList" | default "") ",") "trim" "." " ") $config.ignorelist -}}
|
||||
{{- $highlightList := apply (split (.Get "highlightList" | default "") ",") "trim" "." " " -}}
|
||||
|
||||
{{- /* Shortcode body */ -}}
|
||||
{{- $content := strings.TrimSpace .Inner | default "" -}}
|
||||
{{- /* File Data */ -}}
|
||||
{{- if $fileName | and (eq $content "") -}}
|
||||
{{- $ext := path.Ext $fileName | lower -}}
|
||||
{{- if in $supportExts $ext -}}
|
||||
{{- with dict "Path" $fileName "Resources" $.Page.Resources | partial "function/resource.html" }}
|
||||
{{- $content = .Content -}}
|
||||
{{- else -}}
|
||||
{{- warnidf "warning-file-tree" "[%s]: no such data file: %s. See %s" $.Name $fileName $.Position -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- warnidf "warning-file-tree" "[%s]: Unsupported file format '%s'. Use %s. See %s" $.Name $ext (delimit $supportExts ", " " or ") $.Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Parse structured data from content or file */ -}}
|
||||
{{- $treeData := slice -}}
|
||||
{{- with $content -}}
|
||||
{{- $treeData = . | unmarshal -}}
|
||||
{{- if reflect.IsMap $treeData -}}
|
||||
{{- $treeData = $treeData.filetree -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Site Data: load from data/filetree/ */ -}}
|
||||
{{- if $dataName | and (not $treeData) -}}
|
||||
{{- with index .Site.Data.filetree (printf "%v.%v" $dataName .Page.Language) | default (index .Site.Data.filetree $dataName) -}}
|
||||
{{- $treeData = . -}}
|
||||
{{- else -}}
|
||||
{{- $exts := delimit (apply $supportExts "trim" "." "\\.") "|" -}}
|
||||
{{- warnidf "warning-file-tree" "[%s]: Data file 'data/filetree/%s.{%s}' not found. See %s" $.Name $dataName $exts $.Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Filesystem mode: build structured tree data from filesystem */ -}}
|
||||
{{- if not $treeData -}}
|
||||
{{- $buildOptions := dict "root" $root "ignoreList" $ignoreList "name" (.Get "name") "lang" .Page.Language -}}
|
||||
{{- with partial "function/get-file-tree.html" $buildOptions -}}
|
||||
{{- $treeData = . -}}
|
||||
{{- else -}}
|
||||
{{- warnidf "warning-file-tree" "[%s]: The root path does not exist: %s. See %s" .Name $root .Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Render the file tree */ -}}
|
||||
{{- $options := dict
|
||||
"items" $treeData
|
||||
"level" $level
|
||||
"folderSlash" $folderSlash
|
||||
"ignoreList" $ignoreList
|
||||
"highlightList" $highlightList
|
||||
-}}
|
||||
{{- partial "plugin/file-tree.html" $options -}}
|
||||
@@ -1,3 +1,23 @@
|
||||
{{- /*
|
||||
Renders a tabbed interface with multiple tabs and their corresponding content.
|
||||
See https://fixit.lruihao.cn/documentation/content-management/shortcodes/extended/tabs/
|
||||
|
||||
@param {int} [defaultTab=0] - The index of the tab to be active by default (0-based)
|
||||
@param {string} [type="underline"] - The style type of the tabs ("underline", "pill", "card", "segment", etc.)
|
||||
@param {string} [placement="top"] - The placement of the tabs ("top", "bottom", "left", "right")
|
||||
|
||||
Usage:
|
||||
{{< tabs defaultTab="1" type="card" placement="top" >}}
|
||||
{{% tab title="Tab 1" %}}
|
||||
Content for Tab 1
|
||||
{{% /tab %}}
|
||||
{{% tab title="Tab 2" %}}
|
||||
Content for Tab 2
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
Note: Tabs must be defined using the nested "tab" shortcode within the "tabs" shortcode.
|
||||
*/ -}}
|
||||
{{- $tabs := .Store.Get "tabs" -}}
|
||||
{{- if not $tabs -}}
|
||||
{{- errorf "No tabs found. Please add at least one tab to the tabs shortcode. See %s %s" .Name .Position -}}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="header">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="single-title animate__animated animate__pulse animate__faster">
|
||||
{{- dict "Class" "fa-solid fa-box-archive fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-box-archive me-1" | partial "plugin/icon.html" -}}
|
||||
{{- .Params.Title | default (T "archives") }} <sup>{{ $pages.Len }}</sup>
|
||||
</h1>
|
||||
{{- /* Total word count */ -}}
|
||||
@@ -26,7 +26,7 @@
|
||||
{{- $humanizedNum = printf "%.2fK" (div $humanizedNum 1000.0) -}}
|
||||
{{- end -}}
|
||||
<p class="single-subtitle total-word-count" title='{{- T "section.totalWordCount" . }}'>
|
||||
{{- dict "Class" "fa-regular fa-keyboard fa-fw" | partial "plugin/icon.html" }} {{ T "section.totalWordCount" (dict "Count" $humanizedNum) -}}
|
||||
{{- dict "Class" "fa-regular fa-keyboard" | partial "plugin/icon.html" }} {{ T "section.totalWordCount" (dict "Count" $humanizedNum) -}}
|
||||
</p>
|
||||
{{- end -}}
|
||||
</div>
|
||||
@@ -42,7 +42,7 @@
|
||||
{{- partial "recently-updated.html" . -}}
|
||||
{{- range $pages.PageGroups -}}
|
||||
<h2 class="group-title">
|
||||
{{- dict "Class" "fa-regular fa-calendar fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-regular fa-calendar me-1" | partial "plugin/icon.html" -}}
|
||||
{{- .Key -}}
|
||||
</h2>
|
||||
{{- range .Pages -}}
|
||||
@@ -50,7 +50,7 @@
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||
{{- $repost := .Params.repost | default dict -}}
|
||||
{{- if eq $repost.enable true -}}
|
||||
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-share text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
{{- /* Use the original title after archiving the articles */ -}}
|
||||
{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
{{- $anchor = replace (index (split $contentm ">") 0) `"` "" -}}
|
||||
{{- $contentm = printf "<h6 id=%v" $contentm -}}
|
||||
{{- end -}}
|
||||
{{/* Plainify, unescape and remove (\n, \t) */}}
|
||||
{{- $contentj = $contentj | plainify | htmlUnescape | replaceRE `[\n\t ]+` " " -}}
|
||||
{{/* Plainify and remove (\n, \t) */}}
|
||||
{{- $contentj = $contentj | plainify | replaceRE `[\n\t ]+` " " -}}
|
||||
{{- if gt $.Site.Params.search.contentLength 0 -}}
|
||||
{{- $contentj = substr $contentj 0 $.Site.Params.search.contentLength -}}
|
||||
{{- end -}}
|
||||
@@ -80,8 +80,8 @@
|
||||
{{- if gt $j 0 -}}
|
||||
{{- $contentj = printf "<h3 id=%v" $contentj -}}
|
||||
{{- end -}}
|
||||
{{/* Plainify, unescape and remove (\n, \t) */}}
|
||||
{{- $contentj = $contentj | plainify | htmlUnescape | replaceRE `[\n\t ]+` " " -}}
|
||||
{{/* Plainify and remove (\n, \t) */}}
|
||||
{{- $contentj = $contentj | plainify | replaceRE `[\n\t ]+` " " -}}
|
||||
{{- if gt $.Site.Params.search.contentLength 0 -}}
|
||||
{{- $contentj = substr $contentj 0 $.Site.Params.search.contentLength -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{{- $repost := $params.repost | default dict -}}
|
||||
{{- with $repost -}}
|
||||
{{- if eq .Enable true -}}
|
||||
{{- $icon := dict "Class" "fa-solid fa-share fa-fw" -}}
|
||||
{{- $icon := dict "Class" "fa-solid fa-share" -}}
|
||||
{{- $iconTitle := cond (hasPrefix .Url "http") (printf "%v -> %v" (T "single.repost") .Url ) (T "single.repost") -}}
|
||||
{{- if hasPrefix .Url "http" -}}
|
||||
{{ dict "Destination" .Url "Icon" $icon "Class" "icon-repost" "Title" $iconTitle | partial "plugin/link.html" -}}
|
||||
@@ -56,27 +56,27 @@
|
||||
<div class="post-meta-line">
|
||||
{{- with .PublishDate | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
|
||||
<span title="{{ dict "Date" ("2006-01-02 15:04:05" | $.PublishDate.Format) | T "single.publishedOnDate" }}">
|
||||
{{- dict "Class" "fa-solid fa-calendar-days fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-calendar-days me-1" | partial "plugin/icon.html" -}}
|
||||
{{- printf `<time datetime="%v">%v</time>` . . | safeHTML -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- if (ne .Lastmod.Unix .PublishDate.Unix) | and $params.showLastmod -}}
|
||||
{{- with .Lastmod | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
|
||||
<span title="{{ dict "Date" ("2006-01-02 15:04:05" | $.Lastmod.Format) | T "single.updatedOnDate" }}">
|
||||
{{- dict "Class" "fa-regular fa-calendar-check fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-regular fa-calendar-check me-1" | partial "plugin/icon.html" -}}
|
||||
{{- printf `<time datetime="%v">%v</time>` . . | safeHTML -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $params.wordCount -}}
|
||||
<span title="{{ T "single.wordCount" .WordCount }}">
|
||||
{{- dict "Class" "fa-solid fa-pencil-alt fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-pencil-alt me-1" | partial "plugin/icon.html" -}}
|
||||
{{- T "single.fuzzyWordCount" .FuzzyWordCount -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- if $params.readingTime -}}
|
||||
<span>
|
||||
{{- dict "Class" "fa-regular fa-clock fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-regular fa-clock me-1" | partial "plugin/icon.html" -}}
|
||||
{{- T "single.readingTime" .ReadingTime -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
@@ -90,8 +90,8 @@
|
||||
{{- .Store.Set "commentExpired" true -}}
|
||||
{{- end -}}
|
||||
{{- $comment := .Store.Get "comment" | default dict -}}
|
||||
{{- $visitorIcon := dict "Class" "fa-regular fa-eye fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- $commentIcon := dict "Class" "fa-regular fa-comments fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- $visitorIcon := dict "Class" "fa-regular fa-eye me-1" | partial "plugin/icon.html" -}}
|
||||
{{- $commentIcon := dict "Class" "fa-regular fa-comments me-1" | partial "plugin/icon.html" -}}
|
||||
{{- /* Visitor Count */ -}}
|
||||
{{- if $comment.enable | and $comment.artalk.enable -}}
|
||||
<span class="comment-visitors" data-flag-title="{{ $title }}">
|
||||
@@ -231,7 +231,7 @@
|
||||
{{- if $showToc -}}
|
||||
<h2 class="toc-title{{ with $params.password }} encrypted-hidden{{ end }}">
|
||||
{{- T "single.contents" -}}
|
||||
{{- dict "Class" "toc-icon fa-solid fa-angle-down fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "toc-icon fa-solid fa-angle-down" | partial "plugin/icon.html" -}}
|
||||
</h2>
|
||||
<div class="toc-content{{ if eq $toc.auto false }} always-active{{ end }}{{ with $params.password }} encrypted-hidden{{ end }}" id="toc-content-auto"></div>
|
||||
{{- end -}}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
{{- with .Params.titleIcon -}}
|
||||
{{- $titleIcon = . -}}
|
||||
{{- end -}}
|
||||
{{- dict "Class" (add $titleIcon " fa-fw me-1") | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" (add $titleIcon " me-1") | partial "plugin/icon.html" -}}
|
||||
{{- title (.Params.Title | default ((T .Section) | default .Section | dict "Some" | T "allSome")) }} <sup>{{ .Pages.Len }}</sup>
|
||||
</h1>
|
||||
{{- /* Total word count */ -}}
|
||||
@@ -27,7 +27,7 @@
|
||||
{{- $humanizedNum = printf "%.2fK" (div $humanizedNum 1000.0) -}}
|
||||
{{- end -}}
|
||||
<p class="single-subtitle total-word-count" title='{{- T "section.totalWordCount" . }}'>
|
||||
{{- dict "Class" "fa-regular fa-keyboard fa-fw" | partial "plugin/icon.html" }} {{ T "section.totalWordCount" (dict "Count" $humanizedNum) -}}
|
||||
{{- dict "Class" "fa-regular fa-keyboard" | partial "plugin/icon.html" }} {{ T "section.totalWordCount" (dict "Count" $humanizedNum) -}}
|
||||
</p>
|
||||
{{- end -}}
|
||||
</div>
|
||||
@@ -43,7 +43,7 @@
|
||||
{{- partial "recently-updated.html" . -}}
|
||||
{{- range $pages.PageGroups -}}
|
||||
<h2 class="group-title">
|
||||
{{- dict "Class" "fa-regular fa-calendar fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-regular fa-calendar me-1" | partial "plugin/icon.html" -}}
|
||||
{{- .Key -}}
|
||||
</h2>
|
||||
{{- range .Pages -}}
|
||||
@@ -51,7 +51,7 @@
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||
{{- $repost := .Params.repost | default dict -}}
|
||||
{{- if eq $repost.enable true -}}
|
||||
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-share text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
{{- cond (.Param "capitalizeTitles") (title .LinkTitle) .LinkTitle -}}
|
||||
</a>
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="single-title" itemprop="name headline">
|
||||
{{- with $params.weight -}}
|
||||
{{- $icon := dict "Class" "fa-solid fa-thumbtack fa-fw" -}}
|
||||
{{- $icon := dict "Class" "fa-solid fa-thumbtack" -}}
|
||||
<span title="{{ T "single.pin" }}" class="icon-pin">{{- $icon | partial "plugin/icon.html" -}}</span>
|
||||
{{- end -}}
|
||||
{{- $repost := $params.repost | default dict -}}
|
||||
{{- with $repost -}}
|
||||
{{- if eq .Enable true -}}
|
||||
{{- $icon := dict "Class" "fa-solid fa-share fa-fw" -}}
|
||||
{{- $icon := dict "Class" "fa-solid fa-share" -}}
|
||||
{{- $title := cond (hasPrefix .Url "http") (printf "%v -> %v" (T "single.repost") .Url ) (T "single.repost") -}}
|
||||
<span title="{{ $title }}" class="icon-repost">{{- $icon | partial "plugin/icon.html" -}}</span>
|
||||
{{- end -}}
|
||||
@@ -73,7 +73,7 @@
|
||||
{{- $tagTerms := .GetTerms "tags" -}}
|
||||
{{- if $tagTerms -}}
|
||||
<div class="post-tags">
|
||||
{{- dict "Class" "fa-solid fa-tags fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-tags me-1" | partial "plugin/icon.html" -}}
|
||||
{{- range $tagTerms -}}
|
||||
<a href='{{ partial "function/escapeurl.html" .RelPermalink }}' class="post-tag">{{ .LinkTitle }}</a>
|
||||
{{- end -}}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="card-item-wrapper">
|
||||
<h2 class="card-item-title">
|
||||
<a href='{{ partial "function/escapeurl.html" .RelPermalink }}'>
|
||||
{{- dict "Class" (add $icon " fa-fw me-1") | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" (add $icon " me-1") | partial "plugin/icon.html" -}}
|
||||
{{- .Page.Title }} <sup>{{ len $pages }}</sup>
|
||||
</a>
|
||||
</h2>
|
||||
@@ -23,7 +23,7 @@
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||
{{- $repost := .Params.repost | default dict -}}
|
||||
{{- if eq $repost.enable true -}}
|
||||
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-share text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
{{- cond (.Param "capitalizeTitles") (title .LinkTitle) .LinkTitle -}}
|
||||
</a>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="single-title animate__animated animate__pulse animate__faster">
|
||||
{{- dict "Class" (add $icon " fa-fw me-1") | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" (add $icon " me-1") | partial "plugin/icon.html" -}}
|
||||
{{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" }} <sup>{{ len .Data.Terms.ByCount }}</sup>
|
||||
</h1>
|
||||
{{- /* Render different taxonomies */ -}}
|
||||
|
||||
+3
-3
@@ -21,7 +21,7 @@
|
||||
{{- end -}}
|
||||
<h1 class="single-title animate__animated animate__pulse animate__faster">
|
||||
{{- with $termIcon -}}
|
||||
{{- dict "Class" (add . " fa-fw me-1") | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" (add . " me-1") | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
{{- $termTitle }} <sup>{{ $pageCount }}</sup>
|
||||
</h1>
|
||||
@@ -37,7 +37,7 @@
|
||||
{{- partial "recently-updated.html" . -}}
|
||||
{{- range $pages.PageGroups -}}
|
||||
<h2 class="group-title">
|
||||
{{- dict "Class" "fa-regular fa-calendar fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-regular fa-calendar me-1" | partial "plugin/icon.html" -}}
|
||||
{{- .Key -}}
|
||||
</h2>
|
||||
{{- range .Pages -}}
|
||||
@@ -45,7 +45,7 @@
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||
{{- $repost := .Params.repost | default dict -}}
|
||||
{{- if eq $repost.enable true -}}
|
||||
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- dict "Class" "fa-solid fa-share text-success me-1" | partial "plugin/icon.html" -}}
|
||||
{{- end -}}
|
||||
{{- cond (.Param "capitalizeTitles") (title .LinkTitle) .LinkTitle -}}
|
||||
</a>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hugo-fixit/core",
|
||||
"type": "module",
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.2",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@10.22.0",
|
||||
"description": "Hugo FixIt core theme component source files",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user