mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-31 10:42:41 +00:00
Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de72a8c802 | |||
| f5b867d717 | |||
| 5ba4a8145b | |||
| 80e4d07294 | |||
| c2dc17e9e0 | |||
| b7edbf3e49 | |||
| adeecfb69d | |||
| 64378cb9c0 | |||
| 12c64431cb | |||
| 142e933fa2 | |||
| 1a43881170 | |||
| b0170f55f0 | |||
| 40c5dcb8c2 | |||
| ed14126001 | |||
| 22c3353dde | |||
| 2b936cb6ad | |||
| e2afa113be | |||
| 6c7145c311 | |||
| 8212d6fd02 | |||
| ad01016092 | |||
| 7d41c8af85 | |||
| 3f66669581 | |||
| e0523a15d1 | |||
| 8b4021295f | |||
| cf04ad3593 | |||
| 015610b7e8 | |||
| d6bd1ce697 | |||
| 1739d6937b | |||
| 2f564429de | |||
| 07816709b5 | |||
| b124218350 | |||
| a58d15e140 | |||
| 409d6c8894 | |||
| 53149ad6d2 | |||
| 1e59a684a6 | |||
| 30a67c4b52 | |||
| 469af95f10 | |||
| 21750077ba | |||
| 54675a61d5 | |||
| 72baedd5f5 | |||
| 03b3bfbd09 | |||
| 33a8861ec6 | |||
| d3cb08f56f | |||
| f537b808cf | |||
| 45ce8679ad | |||
| 036cbb415b | |||
| d816b1c836 | |||
| 2e96060d41 | |||
| 10b46284a1 | |||
| 3e210af76a | |||
| fcd72c9d66 | |||
| 68b028e9b6 | |||
| e2eeaf9632 | |||
| 91f3ad7471 | |||
| 041d5e2517 | |||
| 1d09297784 | |||
| 5931bf3786 | |||
| 0e7dc99319 | |||
| 9614598f07 | |||
| 637c4641cb | |||
| d2c4d7c18f | |||
| 99f51de9f9 | |||
| 9faf1ac1a8 | |||
| 393a1393c3 | |||
| 5e587a13a2 |
+3
-1
@@ -1 +1,3 @@
|
||||
assets/lib/**/* linguist-vendored
|
||||
assets/lib/**/* linguist-vendored
|
||||
*.toml linguist-detectable
|
||||
*.md linguist-detectable
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Set to true to add reviewers to PRs
|
||||
addReviewers: true
|
||||
|
||||
# Set to 'author' to add PR's author as a assignee
|
||||
addAssignees: author
|
||||
|
||||
# A list of reviewers to be added to PRs (GitHub user name)
|
||||
reviewers:
|
||||
- Lruihao
|
||||
|
||||
# A number of reviewers added to the PR
|
||||
# Set 0 to add all the reviewers (default: 0)
|
||||
numberOfReviewers: 1
|
||||
|
||||
# A list of assignees, overrides reviewers if set
|
||||
assignees:
|
||||
- Lruihao
|
||||
|
||||
# A number of assignees to add to the PRs
|
||||
# Set to 0 to add all of the assignees.
|
||||
# Uses numberOfReviewers if unset.
|
||||
numberOfAssignees: 0
|
||||
|
||||
# A list of keywords to be skipped the process if PR's title include it
|
||||
skipKeywords:
|
||||
- wip
|
||||
- deps-dev
|
||||
@@ -1,14 +0,0 @@
|
||||
name: Auto Assign
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/auto-assign@v3
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CONFIG_FILE: .github/configs/auto-assign.yml
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Hugo build check
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
Actions-Hugo-Check:
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: latest
|
||||
hugo-version: ${{ vars.HUGO_VERSION || 'latest' }}
|
||||
extended: true
|
||||
- name: Build Hugo static files
|
||||
run: hugo --source=demo --gc --minify --logLevel info
|
||||
|
||||
@@ -14,10 +14,10 @@ name: "CodeQL"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
schedule:
|
||||
- cron: "30 18 * * 5"
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
name: Generate hugo-fixit component list
|
||||
on:
|
||||
schedule: # Run workflow automatically
|
||||
- cron: '0 0 * * *' # Runs every day at 00:00 UTC
|
||||
workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the GitHub Actions Workflow page directly
|
||||
permissions:
|
||||
contents: write # To write the generated contents to the readme
|
||||
|
||||
jobs:
|
||||
generate-component-list:
|
||||
name: Update this repo's README with the list of hugo-fixit theme components
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Generate hugo-fixit component list
|
||||
uses: hugo-fixit/action-component-list@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
comment_tag_name: HUGO_FIXIT_COMPONENTS
|
||||
readme_path: 'README.md,README.zh-cn.md'
|
||||
template: "- [{$repo.name}]({$repo.html_url})\\\n {$repo.description}"
|
||||
- name: Commit changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: ':memo: Docs: update hugo-fixit component list'
|
||||
commit_author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
|
||||
@@ -4,7 +4,7 @@ name: Release for new tag
|
||||
|
||||
# Controls when the action will run.
|
||||
on:
|
||||
# Triggers the workflow on push or pull request events but only for the master branch
|
||||
# Triggers the workflow on push or pull request events but only for the main branch
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
@@ -36,6 +36,7 @@ jobs:
|
||||
run: |
|
||||
npm install
|
||||
npm run release -- --starting-version ${{ github.ref_name }}
|
||||
sed -i '1,4d' CHANGELOG.md
|
||||
|
||||
- name: GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
||||
+3
-1
@@ -10,7 +10,9 @@ jsconfig.json
|
||||
node_modules/
|
||||
|
||||
# VSCode
|
||||
.vscode
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
!.vscode/settings.json
|
||||
|
||||
# OS Files
|
||||
## Windows
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"budparr.language-hugo-vscode",
|
||||
"kaellarkin.hugo-shortcode-syntax",
|
||||
"eliostruyf.vscode-hugo-themer"
|
||||
]
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"todo-tree.tree.scanMode": "workspace only",
|
||||
"explorer.fileNesting.enabled": true,
|
||||
"explorer.fileNesting.patterns": {
|
||||
"tsconfig.json": "tsconfig.*.json, env.d.ts",
|
||||
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
|
||||
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .oxlint*, oxlint*, .prettier*, prettier*, .editorconfig"
|
||||
}
|
||||
}
|
||||
+12
-14
@@ -15,7 +15,7 @@ git clone https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
Then, install the dev dependencies.
|
||||
|
||||
```bash
|
||||
npm install
|
||||
pnpm install
|
||||
```
|
||||
|
||||
And now you are ready to go!
|
||||
@@ -24,15 +24,15 @@ Here are some useful commands.
|
||||
|
||||
```bash
|
||||
# run a local debugging server with watch
|
||||
npm run server
|
||||
pnpm server
|
||||
# run a local debugging server with watch in production environment
|
||||
npm run server:production
|
||||
pnpm server:production
|
||||
```
|
||||
|
||||
If you want to do docs-related theme changes, the simplest way is to have both `FixIt` and `fixit-docs` cloned as sibling directories, and then run:
|
||||
|
||||
```bash
|
||||
npm run server:docs
|
||||
pnpm server:docs
|
||||
```
|
||||
|
||||
Finally, create a new pull request at <https://github.com/hugo-fixit/FixIt/pulls> to submit your contribution 🎉
|
||||
@@ -41,19 +41,17 @@ Finally, create a new pull request at <https://github.com/hugo-fixit/FixIt/pulls
|
||||
|
||||
### Branches
|
||||
|
||||
| Branch | Description |
|
||||
| :-- | :-- |
|
||||
| master | _The branch open to the public and release versions_ |
|
||||
| dev | _The development branch of the next version_ |
|
||||
| single feature | _The branch to enhancements or fixes_ |
|
||||
| Branch | Description |
|
||||
| :------------- | :----------------------------------------------------- |
|
||||
| main | _The development branch, may contain unstable updates_ |
|
||||
| single feature | _The branch to enhancements or fixes_ |
|
||||
|
||||
### Merge events
|
||||
|
||||
| event | merge |
|
||||
| :-- | :-- |
|
||||
| release | **dev => master:** `--rebase` |
|
||||
| PR | **others:master => master:** `--rebase` |
|
||||
| single feature| **feature branch => dev/master:** `--merge` |
|
||||
| event | merge |
|
||||
| :------------- | :------------------------------------ |
|
||||
| PR | **others:main => main:** `--rebase` |
|
||||
| single feature | **feature branch => main:** `--merge` |
|
||||
|
||||
### Commit message
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 LIUZHICHAO.COM
|
||||
Copyright (c) 2019-2020 DILLONZQ.COM
|
||||
Copyright (c) 2021-2024 Lruihao (https://lruihao.cn)
|
||||
Copyright (c) 2021-2025 Lruihao (https://lruihao.cn)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,37 +1,68 @@
|
||||
<!-- markdownlint-disable-file MD033 MD041 -->
|
||||

|
||||
|
||||
<div align="center">English | <a href="/README.zh-cn.md">简体中文</a></div>
|
||||
<div align="center" class="ignore">
|
||||
<p>
|
||||
FixIt is a clean, elegant but advanced blog theme for <a href="https://gohugo.io/">Hugo</a>.<br>
|
||||
<em><sub>Don't forget to leave a ⭐️ if you like this theme, thanks!</sub></em>
|
||||
</p>
|
||||
English |
|
||||
<a href="/README.zh-cn.md">简体中文</a> |
|
||||
<a href="https://fixit.lruihao.cn/zh-cn/ecosystem/hugo-fixit/fixit/?lang=chinese_traditional">繁體中文</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=french">Français</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=russian">Русский язык</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=spanish">Español</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=hindi">हिन्दी</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=german">deutsch</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=korean">한국어</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=japanese">しろうと</a>
|
||||
</div>
|
||||
|
||||
<a title="FixIt website" href="https://fixit.lruihao.cn"><img align="right" alt="FixIt logo" width="70" height="70" src="https://avatars.githubusercontent.com/u/110414864?s=200&v=4"></a>
|
||||
|
||||
# FixIt
|
||||
|
||||
> It is based on the original [LoveIt](https://github.com/dillonzq/LoveIt) Theme, [KeepIt](https://github.com/Fastbyte01/KeepIt) Theme and [LeaveIt](https://github.com/liuzc/LeaveIt) Theme.
|
||||
|
||||
[](https://github.com/hugo-fixit/FixIt/releases)
|
||||
[](https://gohugo.io/)
|
||||
[](https://gohugo.io/)
|
||||
[](/LICENSE)
|
||||
[](https://github.com/hugo-fixit/FixIt)
|
||||
|
||||
> «FixIt» is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/).
|
||||
|
||||
It is based on the original [LoveIt](https://github.com/dillonzq/LoveIt) Theme, [KeepIt](https://github.com/Fastbyte01/KeepIt) Theme and [LeaveIt](https://github.com/liuzc/LeaveIt) Theme.
|
||||
|
||||
## Live Preview
|
||||
|
||||
<p align="center">
|
||||
💟 <a href="https://fixit.lruihao.cn">Production</a> | ❇️ <a href="https://pre.fixit.lruihao.cn">Preview</a> | 🚼 <a href="https://demo.fixit.lruihao.cn">Demo</a> | 🆕 <a href="https://hugo-fixit.github.io/hugo-fixit-starter/">Starter</a>
|
||||
<br>
|
||||
<br>
|
||||
More «FixIt» examples <a href="https://fixit.lruihao.cn/showcase/">here</a>.
|
||||
More FixIt examples <a href="https://fixit.lruihao.cn/showcase/">here</a>.
|
||||
</p>
|
||||
|
||||
## Documentation
|
||||
## Why choose FixIt
|
||||
|
||||
I don't know why 🤷.
|
||||
|
||||
<!-- Too lazy to write... -->
|
||||
|
||||
## Usage
|
||||
|
||||
### Documentation
|
||||
|
||||
Head to the [Quick Start](https://fixit.lruihao.cn/documentation/getting-started/quick-start/) page for a step-by-step guide on how to create a new website with FixIt.
|
||||
|
||||
Outline: [Installation](https://fixit.lruihao.cn/documentation/installation/) ➜ [Getting Started](https://fixit.lruihao.cn/documentation/getting-started/) ➜ [Content Management](https://fixit.lruihao.cn/documentation/content-management/) ➜ [Advanced Usage](https://fixit.lruihao.cn/documentation/advanced/)
|
||||
|
||||
## Template repository
|
||||
### Starter Wizard
|
||||
|
||||
We provided a CLI tool to help you create a new project with FixIt by a single command.
|
||||
|
||||
```bash
|
||||
pnpx fixit-cli create my-blog
|
||||
```
|
||||
|
||||
[](https://asciinema.org/a/697494)
|
||||
|
||||
### Templates
|
||||
|
||||
Click the following links to generate a new repository with template:
|
||||
|
||||
@@ -51,14 +82,11 @@ Click the following links to generate a new repository with template:
|
||||
[lruihao-blog]: https://github.com/Lruihao/hugo-blog
|
||||
[lruihao-blog:generate]: https://github.com/Lruihao/hugo-blog/generate
|
||||
|
||||
## Why choose FixIt
|
||||
|
||||
I don't know why 🤷
|
||||
|
||||
<!-- Too lazy to write... -->
|
||||
|
||||
## Features
|
||||
|
||||
<details>
|
||||
<summary>Click to view.</summary>
|
||||
|
||||
### Performance and SEO
|
||||
|
||||
- Optimized for **performance**: 99/100 on mobile and 100/100 on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||
@@ -103,11 +131,12 @@ I don't know why 🤷
|
||||
|
||||
### Extended Features
|
||||
|
||||
- **AI Summary**, **AI Search** and **AI Chatbot** supported by [PostChat](https://ai.tianli0.top/?InviteID=IRE1S88Z)
|
||||
- **PWA (Progressive Web App)** supported
|
||||
- **Sub Menu** supported
|
||||
- **Content Encryption** supported (Pages, Partial)
|
||||
- **Friends** page embedded template
|
||||
- **Search** supported by [algolia](https://www.algolia.com/), [Fuse.js](https://fusejs.io/) or CSE
|
||||
- **Search** supported by [algolia](https://www.algolia.com/), [Fuse.js](https://fusejs.io/), CSE or [PostChat](https://ai.tianli0.top/?InviteID=IRE1S88Z)
|
||||
- **Custom Search Engine (CSE)** supported by [Google](https://programmablesearchengine.google.com/)
|
||||
- **Twemoji** supported
|
||||
- Automatically **highlighting** code
|
||||
@@ -134,13 +163,14 @@ I don't know why 🤷
|
||||
- Options to **cache remote image** locally
|
||||
- ...
|
||||
|
||||
### Theme Components
|
||||
|
||||
The FixIt theme balances **simplicity** and **extensibility** with extra [Hugo theme components](https://fixit.lruihao.cn/components/) for customization.
|
||||
</details>
|
||||
|
||||
## Multilingual and i18n
|
||||
|
||||
FixIt supports the following languages:
|
||||
FixIt supports multilingual and i18n. For more information, see the [Content Management](https://fixit.lruihao.cn/documentation/content-management/introduction#multilingual) documentation. You are welcome to [contribute with a new language](https://github.com/hugo-fixit/FixIt/pulls).
|
||||
|
||||
<details>
|
||||
<summary>FixIt supports the following languages.</summary>
|
||||
|
||||
- English
|
||||
- Simplified Chinese
|
||||
@@ -156,9 +186,44 @@ FixIt supports the following languages:
|
||||
- Romanian
|
||||
- Vietnamese
|
||||
- Hindi
|
||||
- [Contribute with a new language](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
|
||||
[Languages Compatibility](https://fixit.lruihao.cn/documentation/basics/#language-compatibility)
|
||||
</details>
|
||||
|
||||
## Theme Components
|
||||
|
||||
The FixIt theme balances **simplicity** and **extensibility** with extra [Hugo theme components](https://fixit.lruihao.cn/ecosystem/#-components) for customization.
|
||||
|
||||
<details>
|
||||
<summary>Click to view.</summary>
|
||||
|
||||
<!-- HUGO_FIXIT_COMPONENTS:START -->
|
||||
- [fixit-bundle](https://github.com/hugo-fixit/fixit-bundle)\
|
||||
🌲 Bundles the FixIt core theme and all hugo-fixit components into a single component.
|
||||
- [cmpt-flyfish](https://github.com/hugo-fixit/cmpt-flyfish)\
|
||||
🐟 一个 canvas 实现的小鱼游动动画效果。
|
||||
- [cmpt-mdevtools](https://github.com/hugo-fixit/cmpt-mdevtools)\
|
||||
Mobile devtools component powered by vConsole and eruda.
|
||||
- [cmpt-translate](https://github.com/hugo-fixit/cmpt-translate)\
|
||||
🌐 A component for site automatic translation.
|
||||
- [component-projects](https://github.com/hugo-fixit/component-projects)\
|
||||
🐙 Display your GitHub projects in the FixIt theme and generate blog posts from readme.
|
||||
- [hugo-atom-feed](https://github.com/hugo-fixit/hugo-atom-feed)\
|
||||
Hugo theme component for ATOM feed custom Output Format.
|
||||
- [hugo-json-feed](https://github.com/hugo-fixit/hugo-json-feed)\
|
||||
Hugo theme component for JSON feed custom Output Format.
|
||||
- [shortcode-asciinema](https://github.com/hugo-fixit/shortcode-asciinema)\
|
||||
A Hugo theme component with asciinema-embed shortcode.
|
||||
- [shortcode-caniuse](https://github.com/hugo-fixit/shortcode-caniuse)\
|
||||
一个含有 caniuse shortcode 的 Hugo 主题组件。
|
||||
- [shortcode-docs-bookmark](https://github.com/hugo-fixit/shortcode-docs-bookmark)\
|
||||
🔖 Embed bookmark of FixIt Docs.
|
||||
- [shortcode-mmt-netease](https://github.com/hugo-fixit/shortcode-mmt-netease)\
|
||||
🎶 A Hugo theme component with a NetEase Cloud random comment shortcode.
|
||||
- [shortcode-rewards](https://github.com/hugo-fixit/shortcode-rewards)\
|
||||
A Hugo theme component with reward-log or sponsor-log shortcode.
|
||||
<!-- HUGO_FIXIT_COMPONENTS:END -->
|
||||
|
||||
</details>
|
||||
|
||||
## Community
|
||||
|
||||
@@ -171,8 +236,6 @@ All feedback is welcome! Head over to the [discussions][discussions], [Pull requ
|
||||
| [FixIt QQ group][qq-group] | QQ group: `814031017` |
|
||||
| [Hugo FixIt Planet][zsxq] | Paid knowledge Planet |
|
||||
|
||||
Don't forget to leave a ⭐️ if you like this theme, thanks!
|
||||
|
||||
[discussions]: https://github.com/hugo-fixit/FixIt/discussions
|
||||
[pulls]: https://github.com/hugo-fixit/FixIt/pulls
|
||||
[issues]: https://github.com/hugo-fixit/FixIt/issues
|
||||
@@ -253,6 +316,10 @@ If you enjoy the theme, please consider buying me a coffee ☕️. Thanks!
|
||||
- [Alipay](/images/alipay.jpg)
|
||||
- [PayPal](https://paypal.me/Lruihao)
|
||||
|
||||
Thanks to the following sponsors for their support:
|
||||
|
||||
- [translate.js](https://github.com/xnx3/translate) Sponsoring [Enterprise Translation Channel](https://translate.zvo.cn/4087.html).
|
||||
|
||||
## Author
|
||||
|
||||
[Lruihao](https://github.com/Lruihao "Follow me on GitHub")
|
||||
|
||||
+91
-24
@@ -1,37 +1,68 @@
|
||||
<!-- markdownlint-disable-file MD033 MD041 -->
|
||||

|
||||
|
||||
<div align="center"><a href="/README.md">English</a> | 简体中文</div>
|
||||
<div align="center" class="ignore">
|
||||
<p>
|
||||
FixIt 是一个简洁、优雅且高效的 <a href="https://gohugo.io/">Hugo</a> 博客主题。<br>
|
||||
<em><sub>如果你喜欢这个主题,别忘了留下一颗 ⭐️ 哦,谢谢!</sub></em>
|
||||
</p>
|
||||
<a href="/README.md">English</a> |
|
||||
简体中文 |
|
||||
<a href="https://fixit.lruihao.cn/zh-cn/ecosystem/hugo-fixit/fixit/?lang=chinese_traditional">繁體中文</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=french">Français</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=russian">Русский язык</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=spanish">Español</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=hindi">हिन्दी</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=german">deutsch</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=korean">한국어</a> |
|
||||
<a href="https://fixit.lruihao.cn/ecosystem/hugo-fixit/fixit/?lang=japanese">しろうと</a>
|
||||
</div>
|
||||
|
||||
<a title="FixIt 官网" href="https://fixit.lruihao.cn/zh-cn/"><img align="right" alt="FixIt logo" width="70" height="70" src="https://avatars.githubusercontent.com/u/110414864?s=200&v=4"></a>
|
||||
|
||||
# FixIt
|
||||
|
||||
> 它的原型基于 [LoveIt](https://github.com/dillonzq/LoveIt) 主题,[KeepIt](https://github.com/Fastbyte01/KeepIt) 主题和 [LeaveIt](https://github.com/liuzc/LeaveIt) 主题。
|
||||
|
||||
[](https://github.com/hugo-fixit/FixIt/releases)
|
||||
[](https://gohugo.io/)
|
||||
[](https://gohugo.io/)
|
||||
[](/LICENSE)
|
||||
[](https://github.com/hugo-fixit/FixIt)
|
||||
|
||||
> «FixIt» 是一个**简洁**、**优雅**且**高效**的 [Hugo](https://gohugo.io/) 博客主题。
|
||||
|
||||
它的原型基于 [LoveIt](https://github.com/dillonzq/LoveIt) 主题,[KeepIt](https://github.com/Fastbyte01/KeepIt) 主题和 [LeaveIt](https://github.com/liuzc/LeaveIt) 主题。
|
||||
|
||||
## 即时预览
|
||||
|
||||
<p align="center">
|
||||
💟 <a href="https://fixit.lruihao.cn/zh-cn/">Production</a> | ❇️ <a href="https://pre.fixit.lruihao.cn/zh-cn/">Preview</a> | 🚼 <a href="https://demo.fixit.lruihao.cn">Demo</a> | 🆕 <a href="https://hugo-fixit.github.io/hugo-fixit-starter/">Starter</a>
|
||||
<br>
|
||||
<br>
|
||||
更多 «FixIt» 的例子参见 <a href="https://fixit.lruihao.cn/zh-cn/showcase/">这里</a>。
|
||||
更多 FixIt 的例子参见 <a href="https://fixit.lruihao.cn/zh-cn/showcase/">这里</a>。
|
||||
</p>
|
||||
|
||||
## 主题文档
|
||||
## 为什么选择 FixIt
|
||||
|
||||
我也不知道为什么 🤷。
|
||||
|
||||
<!-- 懒的写…… -->
|
||||
|
||||
## 使用指南
|
||||
|
||||
### 主题文档
|
||||
|
||||
前往 [快速上手](https://fixit.lruihao.cn/zh-cn/documentation/getting-started/quick-start/) 页面,了解如何使用 FixIt 主题创建一个新网站的详细步骤。
|
||||
|
||||
大纲:[安装篇](https://fixit.lruihao.cn/zh-cn/documentation/installation/) ➜ [入门篇](https://fixit.lruihao.cn/zh-cn/documentation/getting-started/) ➜ [内容管理](https://fixit.lruihao.cn/zh-cn/documentation/content-management/) ➜ [进阶篇](https://fixit.lruihao.cn/zh-cn/documentation/advanced/)
|
||||
|
||||
## 模板仓库
|
||||
### 快速开始
|
||||
|
||||
我们提供了一个 CLI 工具,可以通过一个命令来创建一个新的 FixIt 项目。
|
||||
|
||||
```bash
|
||||
pnpx fixit-cli create my-blog
|
||||
```
|
||||
|
||||
[](https://asciinema.org/a/697494)
|
||||
|
||||
### 模板
|
||||
|
||||
点击以下链接使用模板生成一个新的仓库:
|
||||
|
||||
@@ -51,13 +82,14 @@
|
||||
[lruihao-blog]: https://github.com/Lruihao/hugo-blog
|
||||
[lruihao-blog:generate]: https://github.com/Lruihao/hugo-blog/generate
|
||||
|
||||
## 为什么选择 FixIt
|
||||
### 镜像
|
||||
|
||||
我也不知道为什么 🤷
|
||||
Gitee 镜像仓库:<https://gitee.com/lruihao/FixIt>
|
||||
|
||||
<!-- 懒的写…… -->
|
||||
## 特色
|
||||
|
||||
## 特性
|
||||
<details>
|
||||
<summary>点击展开</summary>
|
||||
|
||||
### 性能和 SEO
|
||||
|
||||
@@ -103,11 +135,12 @@
|
||||
|
||||
### 扩展功能
|
||||
|
||||
- 支持基于 [PostChat](https://ai.tianli0.top/?InviteID=IRE1S88Z) 的 **AI 摘要**、**AI 搜索** 和 **AI 智能客服**
|
||||
- 支持**渐进式网页应用**
|
||||
- 支持**二级菜单**
|
||||
- 支持**内容加密**(页面、局部)
|
||||
- 支持**友情链接**的页面模板
|
||||
- 支持基于 [algolia](https://www.algolia.com/)、[Fuse.js](https://fusejs.io/) 或 **CSE** 的**搜索**
|
||||
- 支持基于 [algolia](https://www.algolia.com/)、[Fuse.js](https://fusejs.io/)、 **CSE** 或 [PostChat](https://ai.tianli0.top/?InviteID=IRE1S88Z) 的**搜索**
|
||||
- 支持基于 [Google](https://programmablesearchengine.google.com/) 的**自定义搜索引擎 (CSE)**
|
||||
- 支持 **Twemoji**
|
||||
- 支持**代码高亮**
|
||||
@@ -134,13 +167,14 @@
|
||||
- 支持本地**缓存远程图床图片**
|
||||
- ……
|
||||
|
||||
### 主题组件
|
||||
|
||||
FixIt 主题旨在在**简洁性**和**可扩展性**之间取得平衡。为此,我们开发了一系列额外的 [Hugo 主题组件](https://fixit.lruihao.cn/zh-cn/components/) 供用户选择。
|
||||
</details>
|
||||
|
||||
## 多语言和国际化
|
||||
|
||||
FixIt 支持下列语言:
|
||||
FixIt 主题多语言基本配置及自动翻译等详见 [内容管理](https://fixit.lruihao.cn/zh-cn/documentation/content-management/introduction#multilingual) 文档,欢迎 [贡献一种新的语言](https://github.com/hugo-fixit/FixIt/pulls)。
|
||||
|
||||
<details>
|
||||
<summary>FixIt 支持下列语言。</summary>
|
||||
|
||||
- 英语
|
||||
- 简体中文
|
||||
@@ -156,13 +190,44 @@ FixIt 支持下列语言:
|
||||
- 罗马尼亚语
|
||||
- 越南语
|
||||
- 印地语
|
||||
- [贡献一种新的语言](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
|
||||
[语言兼容性](https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/#language-compatibility)
|
||||
</details>
|
||||
|
||||
## 镜像
|
||||
## 主题组件
|
||||
|
||||
Gitee 镜像仓库:<https://gitee.com/lruihao/FixIt>
|
||||
FixIt 主题旨在在**简洁性**和**可扩展性**之间取得平衡。为此,我们开发了一系列额外的 [Hugo 主题组件](https://fixit.lruihao.cn/zh-cn/ecosystem/#-组件) 供用户选择。
|
||||
|
||||
<details>
|
||||
<summary>点击展开</summary>
|
||||
|
||||
<!-- HUGO_FIXIT_COMPONENTS:START -->
|
||||
- [fixit-bundle](https://github.com/hugo-fixit/fixit-bundle)\
|
||||
🌲 Bundles the FixIt core theme and all hugo-fixit components into a single component.
|
||||
- [cmpt-flyfish](https://github.com/hugo-fixit/cmpt-flyfish)\
|
||||
🐟 一个 canvas 实现的小鱼游动动画效果。
|
||||
- [cmpt-mdevtools](https://github.com/hugo-fixit/cmpt-mdevtools)\
|
||||
Mobile devtools component powered by vConsole and eruda.
|
||||
- [cmpt-translate](https://github.com/hugo-fixit/cmpt-translate)\
|
||||
🌐 A component for site automatic translation.
|
||||
- [component-projects](https://github.com/hugo-fixit/component-projects)\
|
||||
🐙 Display your GitHub projects in the FixIt theme and generate blog posts from readme.
|
||||
- [hugo-atom-feed](https://github.com/hugo-fixit/hugo-atom-feed)\
|
||||
Hugo theme component for ATOM feed custom Output Format.
|
||||
- [hugo-json-feed](https://github.com/hugo-fixit/hugo-json-feed)\
|
||||
Hugo theme component for JSON feed custom Output Format.
|
||||
- [shortcode-asciinema](https://github.com/hugo-fixit/shortcode-asciinema)\
|
||||
A Hugo theme component with asciinema-embed shortcode.
|
||||
- [shortcode-caniuse](https://github.com/hugo-fixit/shortcode-caniuse)\
|
||||
一个含有 caniuse shortcode 的 Hugo 主题组件。
|
||||
- [shortcode-docs-bookmark](https://github.com/hugo-fixit/shortcode-docs-bookmark)\
|
||||
🔖 Embed bookmark of FixIt Docs.
|
||||
- [shortcode-mmt-netease](https://github.com/hugo-fixit/shortcode-mmt-netease)\
|
||||
🎶 A Hugo theme component with a NetEase Cloud random comment shortcode.
|
||||
- [shortcode-rewards](https://github.com/hugo-fixit/shortcode-rewards)\
|
||||
A Hugo theme component with reward-log or sponsor-log shortcode.
|
||||
<!-- HUGO_FIXIT_COMPONENTS:END -->
|
||||
|
||||
</details>
|
||||
|
||||
## 社区支持
|
||||
|
||||
@@ -175,8 +240,6 @@ Gitee 镜像仓库:<https://gitee.com/lruihao/FixIt>
|
||||
| [FixIt 主题交流群(QQ)][qq-group] | QQ 群:`814031017` |
|
||||
| [Hugo FixIt 星球][zsxq] | 付费知识星球 |
|
||||
|
||||
如果你喜欢这个主题,别忘了留下一颗 ⭐️ 哦,谢谢!
|
||||
|
||||
[discussions]: https://github.com/hugo-fixit/FixIt/discussions
|
||||
[pulls]: https://github.com/hugo-fixit/FixIt/pulls
|
||||
[issues]: https://github.com/hugo-fixit/FixIt/issues
|
||||
@@ -257,6 +320,10 @@ FixIt 根据 **MIT** 许可协议授权。更多信息请查看 [LICENSE 文件]
|
||||
- [支付宝](/images/alipay.jpg)
|
||||
- [PayPal](https://paypal.me/Lruihao)
|
||||
|
||||
感谢以下赞助商提供大力支持:
|
||||
|
||||
- [translate.js](https://github.com/xnx3/translate) 赞助[企业级翻译通道](https://translate.zvo.cn/4087.html)。
|
||||
|
||||
## 作者
|
||||
|
||||
[Lruihao](https://github.com/Lruihao "在 GitHub 上关注我")
|
||||
|
||||
@@ -54,6 +54,15 @@ abbr[title] {
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
img {
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
img,video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@include link(true, true);
|
||||
|
||||
@import '../_partials/scrollbar';
|
||||
|
||||
@@ -5,3 +5,11 @@
|
||||
@mixin details-transition-close {
|
||||
@include transition(max-height 0.2s cubic-bezier(0.5, 0, 1, 0) 0s);
|
||||
}
|
||||
|
||||
details {
|
||||
&.center {
|
||||
summary {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,8 +105,6 @@
|
||||
|
||||
.featured-image-preview {
|
||||
width: 100%;
|
||||
// resolve the aspect ratio issue temporarily
|
||||
max-width: 1000px;
|
||||
// use the same proportions as the cover image of https://dev.to/
|
||||
aspect-ratio: auto 1000 / 420;
|
||||
position: relative;
|
||||
|
||||
@@ -368,31 +368,6 @@
|
||||
max-width: 100%;
|
||||
min-height: 1em;
|
||||
|
||||
&:not([height]) {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
&[loading='lazy'][srcset]:not([data-lazyloaded]) {
|
||||
&:not(.suffix-invalid__small) {
|
||||
width: var(--width-small, var(--width));
|
||||
aspect-ratio: var(--aspect-ratio-small, var(--aspect-ratio));
|
||||
}
|
||||
|
||||
&:not(.suffix-invalid) {
|
||||
@media (min-resolution: 1.01dppx) and (max-resolution: 1.5dppx) {
|
||||
width: calc(var(--width) / 1.5);
|
||||
aspect-ratio: var(--aspect-ratio);
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.suffix-invalid__large) {
|
||||
@media (min-resolution: 1.51dppx) {
|
||||
width: calc(var(--width-large, var(--width)) / 2);
|
||||
aspect-ratio: var(--aspect-ratio-large, var(--aspect-ratio));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.version {
|
||||
height: 1.25em;
|
||||
vertical-align: text-bottom;
|
||||
@@ -419,6 +394,7 @@
|
||||
img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
font-size: $collection-title-font-size;
|
||||
|
||||
&::before {
|
||||
content: attr(data-collections) '・';
|
||||
content: attr(title) '・';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
// BUG of Hugo https://github.com/gohugoio/hugo/issues/12913
|
||||
&:has(> p:only-child:empty) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
i.icon {
|
||||
|
||||
+49
-7
@@ -124,6 +124,21 @@ class FixIt {
|
||||
const $searchToggle = document.getElementById(`search-toggle-${suffix}`);
|
||||
const $searchLoading = document.getElementById(`search-loading-${suffix}`);
|
||||
const $searchClear = document.getElementById(`search-clear-${suffix}`);
|
||||
const $searchCancel = document.getElementById('search-cancel-mobile');
|
||||
|
||||
// goto the PostChat panel rather than search results
|
||||
if (searchConfig.type === 'post-chat' && window.postChatUser) {
|
||||
if (isMobile) {
|
||||
$searchInput.addEventListener('focus', () => {
|
||||
window.postChatUser.setSearchInput('');
|
||||
}, false);
|
||||
} else {
|
||||
$searchToggle.addEventListener('click', () => {
|
||||
window.postChatUser.setSearchInput('');
|
||||
}, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMobile) {
|
||||
this._searchMobileOnce = true;
|
||||
@@ -132,7 +147,7 @@ class FixIt {
|
||||
document.body.classList.add('blur');
|
||||
$header.classList.add('open');
|
||||
}, false);
|
||||
document.getElementById('search-cancel-mobile').addEventListener('click', () => {
|
||||
$searchCancel.addEventListener('click', () => {
|
||||
this.disableScrollEvent = false;
|
||||
$header.classList.remove('open');
|
||||
document.body.classList.remove('blur');
|
||||
@@ -301,6 +316,8 @@ class FixIt {
|
||||
context: cseConfig.gotoResultsPage
|
||||
}]);
|
||||
}
|
||||
} else {
|
||||
finish([]);
|
||||
}
|
||||
},
|
||||
templates: {
|
||||
@@ -669,7 +686,12 @@ class FixIt {
|
||||
if ($echarts.nextElementSibling.tagName === 'TEMPLATE') {
|
||||
const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', { renderer: 'svg' });
|
||||
stagingDOM.stage($echarts.nextElementSibling.content.cloneNode(true));
|
||||
chart.setOption(stagingDOM.contentAsJson());
|
||||
// support both JSON and JS object literal
|
||||
if ($echarts.nextElementSibling.dataset.fmt === 'js') {
|
||||
eval(`chart.setOption(${stagingDOM.contentAsText()})`);
|
||||
} else {
|
||||
chart.setOption(stagingDOM.contentAsJson());
|
||||
}
|
||||
this._echartsArr.push(chart);
|
||||
}
|
||||
});
|
||||
@@ -938,13 +960,17 @@ class FixIt {
|
||||
document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, giscusConfig.origin);
|
||||
});
|
||||
this.switchThemeEventSet.add(this._giscusOnSwitchTheme);
|
||||
this.giscus2parentMsg = window.addEventListener('message', (event) => {
|
||||
// gicuss to parent message
|
||||
this._messageListener = (event) => {
|
||||
if (event.origin !== giscusConfig.origin) return;
|
||||
const $script = document.querySelector('#giscus>script');
|
||||
if ($script){
|
||||
this._giscusOnSwitchTheme();
|
||||
$script.parentElement.removeChild($script);
|
||||
}
|
||||
}, { once: true });
|
||||
this._giscusOnSwitchTheme()
|
||||
window.removeEventListener('message', this._messageListener, false);
|
||||
};
|
||||
window.addEventListener('message', this._messageListener, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1050,10 +1076,10 @@ class FixIt {
|
||||
this.initEcharts();
|
||||
this.initTypeit();
|
||||
this.initMapbox();
|
||||
this.fixTocScroll();
|
||||
this.initToc();
|
||||
this.initTocListener();
|
||||
this.initPangu();
|
||||
this.fixTocScroll();
|
||||
this.util.forEach(document.querySelectorAll('.encrypted-hidden'), ($element) => {
|
||||
$element.classList.replace('encrypted-hidden', 'decrypted-shown');
|
||||
});
|
||||
@@ -1130,6 +1156,21 @@ class FixIt {
|
||||
this.scrollEventSet.add(_closeRewardExclude);
|
||||
}
|
||||
|
||||
initPostChatUser() {
|
||||
if (!window.postChatUser || !postChatConfig || postChatConfig.userMode === 'magic') {
|
||||
return;
|
||||
}
|
||||
postChat_theme = this.isDark ? 'dark' : 'light';
|
||||
this.switchThemeEventSet.add((isDark) => {
|
||||
const targetFrame = document.getElementById("postChat_iframeContainer")
|
||||
if (targetFrame) {
|
||||
window.postChatUser.setPostChatTheme(isDark ? 'dark' : 'light');
|
||||
} else {
|
||||
postChat_theme = isDark ? 'dark' : 'light';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onScroll() {
|
||||
const $headers = [];
|
||||
const ACCURACY = 20;
|
||||
@@ -1269,13 +1310,14 @@ class FixIt {
|
||||
this.initWatermark();
|
||||
this.initAutoMark();
|
||||
this.initReward();
|
||||
this.initPostChatUser();
|
||||
|
||||
window.setTimeout(() => {
|
||||
this.initComment();
|
||||
if (!this.config.encryption?.all) {
|
||||
this.fixTocScroll();
|
||||
this.initToc();
|
||||
this.initTocListener();
|
||||
this.fixTocScroll();
|
||||
}
|
||||
this.onScroll();
|
||||
this.onResize();
|
||||
|
||||
@@ -135,7 +135,7 @@ enableEmoji = true
|
||||
[module]
|
||||
[module.hugoVersion]
|
||||
extended = true
|
||||
min = "0.134.1"
|
||||
min = "0.146.0"
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
# Markup related configuration in Hugo
|
||||
@@ -389,7 +389,7 @@ enableEmoji = true
|
||||
# Search config
|
||||
[params.search]
|
||||
enable = false
|
||||
# type of search engine ["algolia", "fuse", "cse"]
|
||||
# type of search engine ["algolia", "fuse", "cse", "post-chat"]
|
||||
type = "fuse"
|
||||
# max index length of the chunked content
|
||||
contentLength = 4000
|
||||
@@ -835,7 +835,8 @@ enableEmoji = true
|
||||
|
||||
# Compatibility config
|
||||
[params.compatibility]
|
||||
# whether to use Polyfill.io to be compatible with older browsers
|
||||
# whether to use Polyfill.io on cdnjs to be compatible with older browsers
|
||||
# https://cdnjs.cloudflare.com/polyfill
|
||||
polyfill = false
|
||||
# whether to use object-fit-images to be compatible with older browsers
|
||||
objectFit = false
|
||||
@@ -885,6 +886,53 @@ enableEmoji = true
|
||||
# "corner-indicator", "fill-left", "flash", "flat-top", "loading-bar", "mac-osx", "material", "minimal"]
|
||||
theme = "minimal"
|
||||
|
||||
# FixIt 0.3.17 | NEW PostChat AI config
|
||||
# Based on your posts to build a knowledge base, support AI summary, AI search, and AI Chatbot.
|
||||
# Get PostChat Key from my invitation link, thanks for your support!
|
||||
# https://ai.tianli0.top/?InviteID=IRE1S88Z
|
||||
[params.postChat]
|
||||
enable = false
|
||||
key = ""
|
||||
# How users initiate chats: ["iframe", "magic"]
|
||||
userMode = "iframe"
|
||||
addButton = true
|
||||
defaultInput = false
|
||||
left = ""
|
||||
bottom = ""
|
||||
width = ""
|
||||
height = ""
|
||||
fill = ""
|
||||
backgroundColor = ""
|
||||
upLoadWeb = true
|
||||
showInviteLink = true
|
||||
userTitle = ""
|
||||
userDesc = ""
|
||||
# dom container to be blacked out, e.g. [".aplayer"]
|
||||
blackDom = []
|
||||
# Only for iframe mode
|
||||
frameWidth = "" # e.g. "375px"
|
||||
frameHeight = "" # e.g. "600px"
|
||||
# only for magic mode
|
||||
userIcon = ""
|
||||
defaultChatQuestions = []
|
||||
defaultSearchQuestions = []
|
||||
|
||||
# FixIt 0.3.17 | NEW Summary AI config
|
||||
# See https://postchat.zhheo.com/summary.html
|
||||
[params.postSummary]
|
||||
enable = false
|
||||
# If you set `params.postChat.key`, you don't need to set `params.postSummary.key`
|
||||
key = ""
|
||||
title = ""
|
||||
# themes options: ["", "simple", "yanzhi"]
|
||||
theme = ""
|
||||
postURL = ""
|
||||
blacklist = ""
|
||||
wordLimit = 1000
|
||||
typingAnimate = true
|
||||
beginningText = ""
|
||||
loadingText = true
|
||||
|
||||
# FixIt 0.3.10 | NEW Global Feed config for RSS, Atom and JSON feed.
|
||||
[params.feed]
|
||||
# The number of posts to include in the feed. If set to -1, all posts.
|
||||
@@ -895,6 +943,13 @@ enableEmoji = true
|
||||
[params.feed.follow]
|
||||
feedId = ""
|
||||
userId = ""
|
||||
|
||||
# FixIt 0.3.17 | NEW Image config
|
||||
[params.image]
|
||||
# cache remote images for better optimisations
|
||||
cacheRemote = false
|
||||
# Image resizing and optimisation
|
||||
optimise = false
|
||||
|
||||
# FixIt 0.3.12 | NEW Custom partials config
|
||||
# Custom partials must be stored in the /layouts/partials/ directory.
|
||||
@@ -909,6 +964,10 @@ enableEmoji = true
|
||||
footer = []
|
||||
widgets = []
|
||||
assets = []
|
||||
postTocBefore = []
|
||||
postTocAfter = []
|
||||
postContentBefore = []
|
||||
postContentAfter = []
|
||||
postFooterBefore = []
|
||||
postFooterAfter = []
|
||||
|
||||
@@ -1055,11 +1114,6 @@ enableEmoji = true
|
||||
scale = true
|
||||
# whether to add FullscreenControl
|
||||
fullscreen = true
|
||||
# FixIt 0.3.0 | NEW [Experimental] cache remote images locally, see: https://github.com/hugo-fixit/FixIt/pull/362
|
||||
[params.page.cacheRemoteImages]
|
||||
enable = false
|
||||
# replace remote image url with local image url (place in public/images/remote/)
|
||||
replace = false
|
||||
# FixIt 0.3.0 | NEW Related content config (https://gohugo.io/content-management/related/)
|
||||
[params.page.related]
|
||||
enable = false
|
||||
@@ -1153,8 +1207,8 @@ enableEmoji = true
|
||||
appKey = ""
|
||||
placeholder = ""
|
||||
avatar = "mp"
|
||||
meta = ""
|
||||
requiredFields = ""
|
||||
meta = ['nick','mail','link']
|
||||
requiredFields = []
|
||||
pageSize = 10
|
||||
lang = ""
|
||||
visitor = true
|
||||
|
||||
@@ -2,16 +2,12 @@
|
||||
|
||||
{{- if .AlertTitle | or .AlertSign | or (.AlertType | in $basicTypes | not) -}}
|
||||
{{- /* The extended syntax is compatible with Obsidian and FixIt admonition shortcode. */ -}}
|
||||
{{- /* === Dirty hack === */ -}}
|
||||
{{- /* BUG of Hugo https://github.com/gohugoio/hugo/issues/12913 */ -}}
|
||||
{{- $title := replaceRE "</([a-zA-Z]+)$" "</$1>" .AlertTitle -}}
|
||||
{{- /* === Dirty hack === */ -}}
|
||||
{{- $openMap := dict "+" true "-" false -}}
|
||||
{{- $open := index $openMap .AlertSign | default true -}}
|
||||
{{- $foldable := ne .AlertSign "" -}}
|
||||
{{- dict
|
||||
"Type" .AlertType
|
||||
"Title" $title
|
||||
"Title" .AlertTitle
|
||||
"Open" $open
|
||||
"Text" .Text
|
||||
"Foldable" $foldable
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
{{- /* TODO refactor */ -}}
|
||||
{{- /*
|
||||
A Markdown image has three components: the image description, the image destination, and optionally the image title.
|
||||
|
||||

|
||||
------------ ------------------ ---------
|
||||
description destination title
|
||||
------------ ------------------ ---------
|
||||
.Text .Destination .Title
|
||||
*/ -}}
|
||||
{{- $params := .Page.Params | merge site.Params.page -}}
|
||||
{{- $optim := slice
|
||||
(dict "Process" "resize 800x webp q75" "descriptor" "800w")
|
||||
(dict "Process" "resize 1200x webp q75" "descriptor" "1200w")
|
||||
(dict "Process" "resize 1600x webp q75" "descriptor" "1600w")
|
||||
-}}
|
||||
{{- if .Title | and .Text -}}
|
||||
{{- $linked := ne $params.lightgallery false -}}
|
||||
<figure>
|
||||
{{- dict "Src" .Destination "Alt" .Text "Caption" .Text "Title" .Title "Linked" $linked "Responsive" true "Resources" .Page.Resources | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" .Destination "Alt" .PlainText "Title" .Title "Caption" .Text "Linked" $linked "Loading" "lazy" "Resources" .Page.Resources "OptimConfig" $optim | partial "plugin/image.html" -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- .Text | safeHTML -}}
|
||||
{{- .Title | safeHTML -}}
|
||||
</figcaption>
|
||||
</figure>
|
||||
{{- else -}}
|
||||
{{- $linked := (eq $params.lightgallery "force") | or ($params.lightgallery | and (ne .Title "")) -}}
|
||||
{{- dict "Src" .Destination "Alt" .Text "Title" .Title "Linked" $linked "Responsive" true "Resources" .Page.Resources | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" .Destination "Alt" .PlainText "Title" .Title "Linked" $linked "Loading" "lazy" "Resources" .Page.Resources "OptimConfig" $optim | partial "plugin/image.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
<article class="single summary" itemscope itemtype="http://schema.org/Article">
|
||||
{{- /* Featured image */ -}}
|
||||
{{- $image := $params.featuredimagepreview | default $params.featuredimage -}}
|
||||
{{- with dict "Path" $image "Resources" .Resources | partial "function/resource.html" }}
|
||||
{{- $image = .RelPermalink }}
|
||||
{{- end }}
|
||||
{{- with .Resources.GetMatch "featured-image" -}}
|
||||
{{- $image = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
@@ -12,7 +15,12 @@
|
||||
{{- with $image -}}
|
||||
<div class="featured-image-preview">
|
||||
<a href="{{ $.RelPermalink }}" aria-label="{{ $.Title }}">
|
||||
{{- dict "Src" . "Title" $.Description "Alt" $.Title "Resources" $.Resources "Width" "50%" "Height" "50%" | partial "plugin/image.html" -}}
|
||||
{{- $optim := slice
|
||||
(dict "Process" "fill 800x240 Center webp q75" "descriptor" "800w")
|
||||
(dict "Process" "fill 1200x360 Center webp q75" "descriptor" "1200w")
|
||||
(dict "Process" "fill 1600x480 Center webp q75" "descriptor" "1600w")
|
||||
-}}
|
||||
{{- dict "Src" . "Title" $.Title "Resources" $.Resources "Loading" "eager" "Width" "800" "Height" "240" "Sizes" "(max-width: 680px) 100vw, (max-width: 960px) 80vw, (max-width: 1440px) 56vw, 800px" "OptimConfig" $optim "Alt" (printf "Featured image for %v" $.Title) | partial "plugin/image.html" -}}
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
{{- $source := $cdn.fuseJS | default "lib/fuse/fuse.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $config = dict "isCaseSensitive" $search.fuse.isCaseSensitive "minMatchCharLength" $search.fuse.minMatchCharLength "findAllMatches" $search.fuse.findAllMatches "location" $search.fuse.location "threshold" $search.fuse.threshold "distance" $search.fuse.distance "ignoreLocation" $search.fuse.ignoreLocation "useExtendedSearch" $search.fuse.useExtendedSearch "ignoreFieldNorm" $search.fuse.ignoreFieldNorm | dict "search" | merge $config -}}
|
||||
{{- else if eq $search.type "cse" -}}
|
||||
{{- else if eq $search.type "cse" -}}
|
||||
{{- $config = dict "type" "cse" | dict "search" | merge $config -}}
|
||||
{{- $cse := .Site.Params.cse -}}
|
||||
{{- $config = dict "resultsPage" $cse.resultsPage "gotoResultsPage" (T "assets.gotoResultsPage") | dict "cse" | merge $config -}}
|
||||
@@ -32,6 +32,8 @@
|
||||
{{- if eq $cse.engine "bing" -}}
|
||||
{{- /* Unsupported */ -}}
|
||||
{{- end -}}
|
||||
{{- else if eq $search.type "post-chat" -}}
|
||||
{{- $config = dict "type" "post-chat" | dict "search" | merge $config -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -265,6 +267,9 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* PostChat */ -}}
|
||||
{{- partial "plugin/post-chat-ai.html" . -}}
|
||||
|
||||
{{- range $params.library.css -}}
|
||||
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -61,6 +61,34 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "custom-post__toc:before" -}}
|
||||
{{- $ctx := . -}}
|
||||
{{- range .Site.Params.customPartials.postTocBefore -}}
|
||||
{{- partial . $ctx -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "custom-post__toc:after" -}}
|
||||
{{- $ctx := . -}}
|
||||
{{- range .Site.Params.customPartials.postTocAfter -}}
|
||||
{{- partial . $ctx -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "custom-post__content:before" -}}
|
||||
{{- $ctx := . -}}
|
||||
{{- range .Site.Params.customPartials.postContentBefore -}}
|
||||
{{- partial . $ctx -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "custom-post__content:after" -}}
|
||||
{{- $ctx := . -}}
|
||||
{{- range .Site.Params.customPartials.postContentAfter -}}
|
||||
{{- partial . $ctx -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "custom-post__footer:before" -}}
|
||||
{{- $ctx := . -}}
|
||||
{{- range .Site.Params.customPartials.postFooterBefore -}}
|
||||
|
||||
@@ -32,13 +32,9 @@
|
||||
{{- $params := .Params | merge .Site.Params.Page }}
|
||||
{{- $fullText := ((.Params.feed | default dict) | merge $.Config ).fulltext }}
|
||||
{{- $author := partial "function/get-author-map.html" .Params.author }}
|
||||
{{- $cacheRemoteImages := $params.cacheRemoteImages }}
|
||||
{{- $image := $params.featuredimagepreview | default $params.featuredimage }}
|
||||
{{- with dict "Path" $image "Resources" .Resources "CacheRemoteImages" $cacheRemoteImages.enable | partial "function/resource.html" }}
|
||||
{{- $url := urls.Parse $image }}
|
||||
{{- if not $url.Host | or $cacheRemoteImages.replace }}
|
||||
{{- $image = .Permalink }}
|
||||
{{- end }}
|
||||
{{- with dict "Path" $image "Resources" .Resources | partial "function/resource.html" }}
|
||||
{{- $image = .Permalink }}
|
||||
{{- end }}
|
||||
{{- with .Resources.GetMatch "featured-image" }}
|
||||
{{- $image = .Permalink }}
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
{{- /* cache remote image locally */ -}}
|
||||
{{- $resource := 0 -}}
|
||||
{{- $suffixList := slice ".jpeg" ".jpg" ".png" ".gif" ".bmp" ".tif" ".tiff" ".webp" ".avif" ".svg" -}}
|
||||
{{- $suffixValid := (dict "Path" .Path "Suffixes" $suffixList | partial "function/suffix-validation.html") -}}
|
||||
{{- /* maybe could add domain validation */ -}}
|
||||
{{- $pass := $suffixValid | or .Pass -}}
|
||||
{{- $isRemote := urls.Parse .Src | partial "function/is-url-remote.html" -}}
|
||||
|
||||
{{- if $pass -}}
|
||||
{{- with $remoteResource := resources.GetRemote .Path -}}
|
||||
{{- if $isRemote -}}
|
||||
{{- with try (resources.GetRemote .Src) -}}
|
||||
{{- with .Err -}}
|
||||
{{- erroridf "error-get-remote-image" "%s" . -}}
|
||||
{{- else -}}
|
||||
{{- if eq $remoteResource.ResourceType "image" -}}
|
||||
{{- warnf "%s" . -}}
|
||||
{{- else with .Value -}}
|
||||
{{- if .ResourceType | eq "image" -}}
|
||||
{{- /* placed remote image in public/images/remote/ */ -}}
|
||||
{{- $resource = $remoteResource | resources.Copy (add "/images/remote/" $remoteResource.Name) -}}
|
||||
{{- $resource = . | resources.Copy (add "/images/remote/" .Name) -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- warnf "Unable to get remote image %q" $.Src -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- erroridf "error-get-remote-image" "Unable to get remote image %q" .Path -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- return $resource -}}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{{- $response := dict -}}
|
||||
{{- with resources.GetRemote .URL .OPTIONS -}}
|
||||
{{- with try (resources.GetRemote .URL .OPTIONS) -}}
|
||||
{{- with .Err -}}
|
||||
{{- erroridf "error-get-remote-json" "%s" . -}}
|
||||
{{- else -}}
|
||||
{{- else with .Value -}}
|
||||
{{- $response = .Content | transform.Unmarshal -}}
|
||||
{{- else -}}
|
||||
{{- erroridf "error-get-remote-json" "Unable to get remote resource %q" $.URL -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- erroridf "error-get-remote-json" "Unable to get remote resource %q" .URL -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $response -}}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{{- return and (not (eq .Scheme "")) .Host -}}
|
||||
@@ -1,22 +1,18 @@
|
||||
{{- $Resources := .Resources | default page.Resources -}}
|
||||
{{- $resource := 0 -}}
|
||||
{{- $url := urls.Parse .Path -}}
|
||||
{{- if not $url.Host | and $url.Path | and (strings.HasSuffix $url.Path "/" | not) -}}
|
||||
{{- if not (partial "function/is-url-remote.html" $url) -}}
|
||||
{{- $dest := strings.TrimPrefix "./" $url.Path -}}
|
||||
{{- if $Resources -}}
|
||||
{{- with $Resources.GetMatch $url.Path -}}
|
||||
{{- with $Resources.GetMatch $dest -}}
|
||||
{{- $resource = . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $resource -}}
|
||||
{{- with resources.Get $url.Path -}}
|
||||
{{- with resources.Get $dest -}}
|
||||
{{- $resource = . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $cacheRemoteImages := .CacheRemoteImages | default false -}}
|
||||
{{- if $cacheRemoteImages -}}
|
||||
{{- $resource = partial "function/get-remote-image.html" (dict "Path" .Path) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $resource -}}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
{{- /*
|
||||
Example:
|
||||
{{- $suffixList := slice ".jpeg" ".jpg" ".png" ".gif" ".bmp" ".tif" ".tiff" ".webp" ".avif" ".svg" -}}
|
||||
{{- $suffixValid := (dict "Path" .Path "Suffixes" $suffixList | partial "function/suffix-validation.html") -}}
|
||||
*/ -}}
|
||||
{{- $url := urls.Parse .Path -}}
|
||||
{{- $path := path.Clean ((printf "%v%v" $url.Host $url.Path) | lower) -}}
|
||||
{{- with $url.Scheme -}}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<a href="{{ $homeRelPermalink }}" title="{{ .Site.Title }}">
|
||||
{{- with .Site.Params.header.title -}}
|
||||
{{- with .logo -}}
|
||||
{{- dict "Src" . "Class" "logo" "Alt" $.Site.Title "Width" 26 "Height" 26 | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" . "Class" "logo" "Alt" $.Site.Title "Width" 32 "Height" 32 | partial "plugin/image.html" -}}
|
||||
{{- end -}}
|
||||
{{- with .pre -}}
|
||||
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
{{- if $avatar -}}
|
||||
<div class="home-avatar">
|
||||
{{- $menus := $.Site.Menus.main | default slice -}}
|
||||
{{- $optim := slice
|
||||
(dict "Process" "fill center 96x96 webp q75" "descriptor" "96w")
|
||||
(dict "Process" "fill center 144x144 webp q75" "descriptor" "144w")
|
||||
(dict "Process" "fill center 192x192 webp q75" "descriptor" "192w")
|
||||
-}}
|
||||
{{- $avatarMenuIndex := 0 -}}
|
||||
{{- if $profile.avatarMenu -}}
|
||||
{{- range $index, $menu := $menus -}}
|
||||
@@ -28,10 +33,10 @@
|
||||
{{- $url = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
<a href="{{ $url }}"{{ with .Title | default .Name }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreferrer" target="_blank"{{ end }}>
|
||||
{{- dict "Src" $avatar "Alt" $.Site.Params.author.name "Width" 96 "Height" 96 | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" $avatar "Alt" "Home avatar" "Width" 96 "Height" 96 "OptimConfig" $optim | partial "plugin/image.html" -}}
|
||||
</a>
|
||||
{{- else -}}
|
||||
{{- dict "Src" $avatar "Alt" $.Site.Params.author.name "Width" 96 "Height" 96 | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" $avatar "Alt" "Home avatar" "Width" 96 "Height" 96 "OptimConfig" $optim | partial "plugin/image.html" -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- .Scratch.Set "version" "v0.3.16" -}}
|
||||
{{- .Scratch.Set "version" "v0.3.19" -}}
|
||||
{{- .Scratch.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with $features | uniq -}}
|
||||
{{- delimit . "%2C" | printf "https://polyfill.io/v3/polyfill.min.js?features=%v" | dict "Source" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- delimit . "%2C" | printf "https://cdnjs.cloudflare.com/polyfill/v3/polyfill.js?features=%v" | dict "Source" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
{{- /* Echarts support for code fences extended and shortcodes. */ -}}
|
||||
{{- $width := .Options.width | default "100%" -}}
|
||||
{{- $height := .Options.height | default "30rem" -}}
|
||||
{{- $js := .Options.js | default false -}}
|
||||
{{- $attrs := printf `style="width: %v; height: %v;"` $width $height -}}
|
||||
<div class="echarts" {{ $attrs | safeHTMLAttr }}></div>
|
||||
<template>{{ .Inner | transform.Unmarshal | jsonify }}</template>
|
||||
{{- /* EOF */ -}}
|
||||
{{- if $js -}}
|
||||
{{- $content := strings.TrimSpace .Inner -}}
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{- $content = replaceRE `[\s]+` " " $content -}}
|
||||
{{- end -}}
|
||||
{{- if not ((hasPrefix $content "{") | and (hasSuffix $content "}")) -}}
|
||||
{{- errorf "ECharts format error\nPlease use JS object literal for Echarts, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#object_literals" -}}
|
||||
{{- end -}}
|
||||
<template data-fmt="js">{{ $content | safeJS }}</template>
|
||||
{{- else -}}
|
||||
<template>{{ .Inner | transform.Unmarshal | jsonify }}</template>
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
{{- warnf "Deprecated image-legacy.html and will be removed in the next minor release, please use image.html instead." -}}
|
||||
{{- $params := partial "function/params.html" -}}
|
||||
{{- $class := .Class | default "" -}}
|
||||
{{- $style := "" -}}
|
||||
{{- $loading := .Loading | default "lazy" -}}
|
||||
{{- $onload := "" -}}
|
||||
{{- $onerror := "" -}}
|
||||
{{- $cacheRemoteImages := $params.cacheRemoteImages -}}
|
||||
{{- $suffixList := slice ".jpeg" ".jpg" ".png" ".gif" ".bmp" ".tif" ".tiff" ".webp" -}}
|
||||
{{- $responsive := .Responsive -}}
|
||||
|
||||
{{- if hasPrefix .Src "data:image" -}}
|
||||
{{- $responsive = false -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* handle for default size image */ -}}
|
||||
{{- $src := .Src -}}
|
||||
{{- $suffixValid := dict "Path" $src "Suffixes" $suffixList | partial "function/suffix-validation.html" -}}
|
||||
{{- with dict "Path" $src "Resources" .Resources "CacheRemoteImages" $cacheRemoteImages.enable | partial "function/resource.html" -}}
|
||||
{{- $url := urls.Parse $src -}}
|
||||
{{- if not $url.Host | or $cacheRemoteImages.replace -}}
|
||||
{{- $src = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- /* only available for image resources that are raster images */ -}}
|
||||
{{- if (eq .ResourceType "image") | and $suffixValid | and $responsive -}}
|
||||
{{- $style = printf "--width: %vpx;--aspect-ratio: %v / %v;" .Width .Width .Height | safeHTMLAttr -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $srcSmall := .SrcSmall | default $src -}}
|
||||
{{- $srcMedium := $src -}}
|
||||
{{- $srcLarge := .SrcLarge | default $src -}}
|
||||
|
||||
{{- if $responsive }}
|
||||
{{- /* handle for small size image */ -}}
|
||||
{{- $suffixValidSmall := dict "Path" $srcSmall "Suffixes" $suffixList | partial "function/suffix-validation.html" -}}
|
||||
{{- with dict "Path" .SrcSmall "Resources" .Resources "CacheRemoteImages" $cacheRemoteImages.enable | partial "function/resource.html" -}}
|
||||
{{- $url := urls.Parse $.SrcSmall -}}
|
||||
{{- if not $url.Host | or $cacheRemoteImages.replace -}}
|
||||
{{- $srcSmall = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- if (eq .ResourceType "image") | and $suffixValidSmall -}}
|
||||
{{- $style = printf "%v--width-small: %vpx;--aspect-ratio-small: %v / %v;" $style .Width .Width .Height | safeHTMLAttr -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* handle for large size image */ -}}
|
||||
{{- $suffixValidLarge := dict "Path" $srcLarge "Suffixes" $suffixList | partial "function/suffix-validation.html" -}}
|
||||
{{- with dict "Path" .SrcLarge "Resources" .Resources "CacheRemoteImages" $cacheRemoteImages.enable | partial "function/resource.html" -}}
|
||||
{{- $url := urls.Parse $.SrcLarge -}}
|
||||
{{- if not $url.Host | or $cacheRemoteImages.replace -}}
|
||||
{{- $srcLarge = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- if (eq .ResourceType "image") | and $suffixValidLarge -}}
|
||||
{{- $style = printf "%v--width-large: %vpx;--aspect-ratio-large: %v / %v;" $style .Width .Width .Height | safeHTMLAttr -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* handle for invalid suffix */ -}}
|
||||
{{- if not $suffixValid | and $src -}}
|
||||
{{- $class = printf "%v suffix-invalid" $class -}}
|
||||
{{- end -}}
|
||||
{{- if not $suffixValidSmall | and $srcSmall -}}
|
||||
{{- $class = printf "%v suffix-invalid__small" $class -}}
|
||||
{{- end -}}
|
||||
{{- if not $suffixValidLarge | and $srcLarge -}}
|
||||
{{- $class = printf "%v suffix-invalid__large" $class -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* set image srcset */ -}}
|
||||
{{- if (eq $src $srcSmall) | and (eq $src $srcLarge) -}}
|
||||
{{- $srcSmall = printf (cond (strings.Contains $srcSmall "?") "%v&size=small" "%v?size=small") $srcSmall -}}
|
||||
{{- $srcMedium = printf (cond (strings.Contains $srcMedium "?") "%v&size=medium" "%v?size=medium") $srcMedium -}}
|
||||
{{- $srcLarge = printf (cond (strings.Contains $srcLarge "?") "%v&size=large" "%v?size=large") $srcLarge -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* set image alt and caption */ -}}
|
||||
{{- $alt := .Alt | default $src -}}
|
||||
{{- $caption := .Caption | default $alt -}}
|
||||
|
||||
{{- /* set image lazy loading */ -}}
|
||||
{{- /* for details, see https://lruihao.cn/posts/native-img-loading-lazy/ */ -}}
|
||||
{{- if eq $loading "lazy" -}}
|
||||
{{- /* TODO move to theme.js */ -}}
|
||||
{{- $commonScript := "this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}" -}}
|
||||
{{- $onload = printf " onload=\"%vthis.dataset.lazyloaded='';\"" $commonScript | safeHTMLAttr -}}
|
||||
{{- $onerror = printf " onerror=\"%v\"" $commonScript | safeHTMLAttr -}}
|
||||
{{- $style = printf " style=\"%vbackground: url(%v) no-repeat center;\"" $style (resources.Get "images/loading.svg" | minify).RelPermalink | safeHTMLAttr -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* structure of lightgallery or img */ -}}
|
||||
{{- if .Linked -}}
|
||||
<a class="lightgallery" href="{{ $srcLarge | safeURL }}" data-thumbnail="{{ $srcSmall | safeURL }}"{{ with $caption }} data-sub-html="<h2>{{ . }}</h2>{{ with $.Title }}<p>{{ . }}</p>{{ end }}"{{ end }}{{ with .Rel }} rel="{{ . }}"{{ end }}>
|
||||
{{- end -}}
|
||||
<img loading="{{ $loading }}" src="{{ $src | safeURL }}" alt="{{ $alt }}"
|
||||
{{- if $responsive }} srcset="{{ $srcSmall | safeURL }}, {{ $srcMedium | safeURL }} 1.5x, {{ $srcLarge | safeURL }} 2x"{{- end -}}
|
||||
{{- if eq $loading "lazy" }} data-title="{{ .Title | default $alt }}"
|
||||
{{- else }} title="{{ .Title | default $alt }}"{{- end -}}
|
||||
{{- with .Width }} width="{{ . }}"{{- end -}}
|
||||
{{- with .Height }} height="{{ . }}"{{- end -}}
|
||||
{{- with $class }} class="{{ trim . " " }}"{{- end -}}
|
||||
{{- with .Decoding }} decoding="{{ . }}"{{- end -}}
|
||||
{{- with .Referrerpolicy }} referrerpolicy="{{ . }}"{{- end -}}
|
||||
{{- with $style -}}{{ . }}{{- end -}}
|
||||
{{- with $onload -}}{{ . }}{{- end -}}
|
||||
{{- with $onerror -}}{{ . }}{{- end -}}
|
||||
/>
|
||||
{{- if .Linked -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
@@ -1,111 +1,81 @@
|
||||
{{- /* TODO refactor */ -}}
|
||||
{{- $params := partial "function/params.html" -}}
|
||||
{{- $class := .Class | default "" -}}
|
||||
{{- $style := "" -}}
|
||||
{{- $loading := .Loading | default "lazy" -}}
|
||||
{{- $onload := "" -}}
|
||||
{{- $onerror := "" -}}
|
||||
{{- $cacheRemoteImages := $params.cacheRemoteImages -}}
|
||||
{{- $suffixList := slice ".jpeg" ".jpg" ".png" ".gif" ".bmp" ".tif" ".tiff" ".webp" -}}
|
||||
{{- $responsive := .Responsive -}}
|
||||
{{- /*
|
||||
The image plugin is a partial that handles image resources.
|
||||
|
||||
{{- if hasPrefix .Src "data:image" -}}
|
||||
{{- $responsive = false -}}
|
||||
Parameters:
|
||||
- Src: The path to the image.
|
||||
It can be a page resource (inside a page bundle) https://gohugo.io/methods/page/resources/
|
||||
or a global resource (inside the assets directory) https://gohugo.io/functions/resources/get/
|
||||
or a link to a remote resource, which can be cached if the site parameter is set https://gohugo.io/functions/resources/getremote/
|
||||
- Resources: If the image is a page resource, this parameter is required. It is the .Resources of the page.
|
||||
- OptimConfig: optimisation parameter, defined like
|
||||
{{- $optim := slice
|
||||
(dict "Process" "resize 800x Center webp q75" "descriptor" "800w")
|
||||
(dict "Process" "resize 1200x Center webp q75" "descriptor" "1200w")
|
||||
(dict "Process" "resize 1600x Center webp q75" "descriptor" "1600w")
|
||||
-}}
|
||||
See https://gohugo.io/content-management/image-processing/ for more information.
|
||||
- Alt: alt text for the image. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#alt
|
||||
- Height: The intrinsic height of the image, in pixels. Must be an integer without a unit.
|
||||
We try to generate this value automatically if possible. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#height
|
||||
- Width: The intrinsic width of the image, in pixels. Must be an integer without a unit.
|
||||
We try to generate this value automatically if possible. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#width
|
||||
- Loading: Indicates how the browser should load the image: eager or lazy. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#loading
|
||||
- Optimise: Override the site parameter to optimise the image.
|
||||
- CacheRemote: Override the site parameter to cache remote images.
|
||||
|
||||
Thanks @HEIGE-PCloud for the original code in the DoIt theme.
|
||||
https://github.com/HEIGE-PCloud/DoIt/blob/main/layouts/partials/plugin/image.html
|
||||
*/ -}}
|
||||
|
||||
{{- $isInline := strings.HasPrefix .Src "data:image" -}}
|
||||
{{- $isRemote := urls.Parse .Src | partial "function/is-url-remote.html" -}}
|
||||
{{- $resource := dict -}}
|
||||
|
||||
{{- if not $isRemote | and (not $isInline) -}}
|
||||
{{- $resource = (.Resources.Get .Src) | default (resources.Get .Src) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* handle for default size image */ -}}
|
||||
{{- $src := .Src -}}
|
||||
{{- $suffixValid := dict "Path" $src "Suffixes" $suffixList | partial "function/suffix-validation.html" -}}
|
||||
{{- with dict "Path" $src "Resources" .Resources "CacheRemoteImages" $cacheRemoteImages.enable | partial "function/resource.html" -}}
|
||||
{{- $url := urls.Parse $src -}}
|
||||
{{- if not $url.Host | or $cacheRemoteImages.replace -}}
|
||||
{{- $src = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- /* only available for image resources that are raster images */ -}}
|
||||
{{- if (eq .ResourceType "image") | and $suffixValid | and $responsive -}}
|
||||
{{- $style = printf "--width: %vpx;--aspect-ratio: %v / %v;" .Width .Width .Height | safeHTMLAttr -}}
|
||||
{{- $cacheRemote := .CacheRemote | default site.Params.image.cacheRemote | default false -}}
|
||||
{{- $optimise := .Optimise | default site.Params.image.optimise | default false -}}
|
||||
|
||||
{{- if not $resource | and $cacheRemote -}}
|
||||
{{- with partial "function/get-remote-image.html" (dict "Src" .Src) -}}
|
||||
{{- $resource = . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $srcSmall := .SrcSmall | default $src -}}
|
||||
{{- $srcMedium := $src -}}
|
||||
{{- $srcLarge := .SrcLarge | default $src -}}
|
||||
|
||||
{{- if $responsive }}
|
||||
{{- /* handle for small size image */ -}}
|
||||
{{- $suffixValidSmall := dict "Path" $srcSmall "Suffixes" $suffixList | partial "function/suffix-validation.html" -}}
|
||||
{{- with dict "Path" .SrcSmall "Resources" .Resources "CacheRemoteImages" $cacheRemoteImages.enable | partial "function/resource.html" -}}
|
||||
{{- $url := urls.Parse $.SrcSmall -}}
|
||||
{{- if not $url.Host | or $cacheRemoteImages.replace -}}
|
||||
{{- $srcSmall = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- if (eq .ResourceType "image") | and $suffixValidSmall -}}
|
||||
{{- $style = printf "%v--width-small: %vpx;--aspect-ratio-small: %v / %v;" $style .Width .Width .Height | safeHTMLAttr -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* handle for large size image */ -}}
|
||||
{{- $suffixValidLarge := dict "Path" $srcLarge "Suffixes" $suffixList | partial "function/suffix-validation.html" -}}
|
||||
{{- with dict "Path" .SrcLarge "Resources" .Resources "CacheRemoteImages" $cacheRemoteImages.enable | partial "function/resource.html" -}}
|
||||
{{- $url := urls.Parse $.SrcLarge -}}
|
||||
{{- if not $url.Host | or $cacheRemoteImages.replace -}}
|
||||
{{- $srcLarge = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- if (eq .ResourceType "image") | and $suffixValidLarge -}}
|
||||
{{- $style = printf "%v--width-large: %vpx;--aspect-ratio-large: %v / %v;" $style .Width .Width .Height | safeHTMLAttr -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* handle for invalid suffix */ -}}
|
||||
{{- if not $suffixValid | and $src -}}
|
||||
{{- $class = printf "%v suffix-invalid" $class -}}
|
||||
{{- end -}}
|
||||
{{- if not $suffixValidSmall | and $srcSmall -}}
|
||||
{{- $class = printf "%v suffix-invalid__small" $class -}}
|
||||
{{- end -}}
|
||||
{{- if not $suffixValidLarge | and $srcLarge -}}
|
||||
{{- $class = printf "%v suffix-invalid__large" $class -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* set image srcset */ -}}
|
||||
{{- if (eq $src $srcSmall) | and (eq $src $srcLarge) -}}
|
||||
{{- $srcSmall = printf (cond (strings.Contains $srcSmall "?") "%v&size=small" "%v?size=small") $srcSmall -}}
|
||||
{{- $srcMedium = printf (cond (strings.Contains $srcMedium "?") "%v&size=medium" "%v?size=medium") $srcMedium -}}
|
||||
{{- $srcLarge = printf (cond (strings.Contains $srcLarge "?") "%v&size=large" "%v?size=large") $srcLarge -}}
|
||||
{{- end -}}
|
||||
{{- $isSvg := false -}}
|
||||
{{- if $resource -}}
|
||||
{{- $isSvg = (eq $resource.MediaType.SubType "svg") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* set image alt and caption */ -}}
|
||||
{{- $optim := .OptimConfig -}}
|
||||
{{- $srcset := "" -}}
|
||||
{{- if $optim | and $resource | and $optimise | and (not $isSvg) -}}
|
||||
{{ $srcsetSlice := slice -}}
|
||||
{{- range $optim -}}
|
||||
{{- if .Process -}}
|
||||
{{- $processed := $resource.Process .Process -}}
|
||||
{{- $srcsetSlice = $srcsetSlice | append (printf "%s %s" $processed.RelPermalink .descriptor) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $srcset = delimit $srcsetSlice ", " -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $src := $resource.RelPermalink | default .Src -}}
|
||||
{{- $alt := .Alt | default $src -}}
|
||||
{{- $caption := .Caption | default $alt -}}
|
||||
|
||||
{{- /* set image lazy loading */ -}}
|
||||
{{- /* for details, see https://lruihao.cn/posts/native-img-loading-lazy/ */ -}}
|
||||
{{- if eq $loading "lazy" -}}
|
||||
{{- /* TODO move to theme.js */ -}}
|
||||
{{- $commonScript := "this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}" -}}
|
||||
{{- $onload = printf " onload=\"%vthis.dataset.lazyloaded='';\"" $commonScript | safeHTMLAttr -}}
|
||||
{{- $onerror = printf " onerror=\"%v\"" $commonScript | safeHTMLAttr -}}
|
||||
{{- $style = printf " style=\"%vbackground: url(%v) no-repeat center;\"" $style (resources.Get "images/loading.svg" | minify).RelPermalink | safeHTMLAttr -}}
|
||||
{{- $height := .Height -}}
|
||||
{{- $width := .Width -}}
|
||||
{{- if not $isSvg -}}
|
||||
{{- $height = $height | default $resource.Height | default "" -}}
|
||||
{{- $width = $width | default $resource.Width | default "" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* structure of lightgallery or img */ -}}
|
||||
{{- if .Linked -}}
|
||||
<a class="lightgallery" href="{{ $srcLarge | safeURL }}" data-thumbnail="{{ $srcSmall | safeURL }}"{{ with $caption }} data-sub-html="<h2>{{ . }}</h2>{{ with $.Title }}<p>{{ . }}</p>{{ end }}"{{ end }}{{ with .Rel }} rel="{{ . }}"{{ end }}>
|
||||
<a class="lightgallery" href="{{ $src }}" title="{{ .Title | default $alt }}" data-thumbnail="{{ $src }}"{{ with $caption }} data-sub-html="<h2>{{ . }}</h2>{{ with $.Title }}<p>{{ . }}</p>{{ end }}"{{ end }}{{ with .Rel }} rel="{{ . }}"{{ end }}>
|
||||
{{- end -}}
|
||||
<img loading="{{ $loading }}" src="{{ $src | safeURL }}" alt="{{ $alt }}"
|
||||
{{- if $responsive }} srcset="{{ $srcSmall | safeURL }}, {{ $srcMedium | safeURL }} 1.5x, {{ $srcLarge | safeURL }} 2x"{{- end -}}
|
||||
{{- if eq $loading "lazy" }} data-title="{{ .Title | default $alt }}"
|
||||
{{- else }} title="{{ .Title | default $alt }}"{{- end -}}
|
||||
{{- with .Width }} width="{{ . }}"{{- end -}}
|
||||
{{- with .Height }} height="{{ . }}"{{- end -}}
|
||||
{{- with $class }} class="{{ trim . " " }}"{{- end -}}
|
||||
{{- with .Decoding }} decoding="{{ . }}"{{- end -}}
|
||||
{{- with .Referrerpolicy }} referrerpolicy="{{ . }}"{{- end -}}
|
||||
{{- with $style -}}{{ . }}{{- end -}}
|
||||
{{- with $onload -}}{{ . }}{{- end -}}
|
||||
{{- with $onerror -}}{{ . }}{{- end -}}
|
||||
/>
|
||||
<img {{- with .Class }} class="{{ . }}"{{ end }}{{ with .Loading }} loading="{{ . }}"{{ end }} {{ printf "src='%v'" $src | safeHTMLAttr }}{{ with $srcset }} srcset="{{ . }}"{{ end }}{{ with .Sizes }} sizes="{{ . }}"{{ end }}{{ with $alt }} alt="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with .Decoding }} decoding="{{ . }}"{{ end }}{{ with .Referrerpolicy }} referrerpolicy="{{ . }}"{{ end }}>
|
||||
{{- if .Linked -}}
|
||||
</a>
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
@@ -42,11 +42,10 @@
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $cardIcon := .CardIcon -}}
|
||||
{{- if $url.Host | and (eq .CardIcon true) -}}
|
||||
{{- $cardIcon = false -}}
|
||||
{{- /* 实验性功能:中国大陆地区无法使用,如果你有更好的 API 或者方案,欢迎 PR! */ -}}
|
||||
{{- $favicon := partial "function/get-remote-image.html" (dict "Path" (add "https://www.google.com/s2/favicons?sz=64&domain=" $url.Host) "Pass" true) -}}
|
||||
{{- with $favicon -}}
|
||||
{{- if (not $cardIcon) | and $url.Host -}}
|
||||
{{- with partial "function/get-remote-image.html" (dict "Src" (add "https://favicon.im/" $url.Host)) -}}
|
||||
{{- $cardIcon = .RelPermalink -}}
|
||||
{{- else with partial "function/get-remote-image.html" (dict "Src" (add "https://api.lruihao.cn/google/s2/favicons?sz=64&domain=" $url.Host)) -}}
|
||||
{{- $cardIcon = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
{{- /*
|
||||
PostChat AI service.
|
||||
PostChat: https://postchat.zhheo.com/addCode.html
|
||||
PostSummary: https://postchat.zhheo.com/summary.html
|
||||
*/ -}}
|
||||
{{- $params := .Params | merge .Site.Params -}}
|
||||
{{- $chatConfig := $params.postChat -}}
|
||||
{{- $summaryConfig := $params.postSummary -}}
|
||||
{{- $key := $chatConfig.key | default $summaryConfig.key -}}
|
||||
{{- $sourcePrefix := "https://ai.tianli0.top/static/public/" -}}
|
||||
{{- $jsMap := dict
|
||||
"chat" "postChatUser.min.js"
|
||||
"summary" "tianli_gpt.min.js"
|
||||
"both" "postChatUser_summary.min.js"
|
||||
-}}
|
||||
{{- /* PostSummary only for public posts */ -}}
|
||||
{{- $password := .Params.password | default .Site.Params.page.password -}}
|
||||
{{- $isPost := (eq .Kind "page") | and (eq .Type "posts") | and (not $password) -}}
|
||||
{{- $summaryEnable := cond $isPost $summaryConfig.enable false -}}
|
||||
{{- $enable := $chatConfig.enable | or $summaryEnable -}}
|
||||
|
||||
{{- if $enable | and $key -}}
|
||||
{{- $configJS := "" -}}
|
||||
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
||||
{{- $sourceOpts := dict "Fingerprint" $fingerprint "Defer" true -}}
|
||||
|
||||
{{- /* PostSummary */ -}}
|
||||
{{- if $summaryEnable -}}
|
||||
{{- $postChatCSS := "https://ai.tianli0.top/static/public/postChatUser_summary.min.css" -}}
|
||||
{{- dict "Source" $postChatCSS "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $p := "tianliGPT" -}}
|
||||
{{- $postSummaryConfig := printf "let %v_postSelector='#content';" $p -}}
|
||||
{{- with $summaryConfig.title -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_Title='%v';" $p .) -}}
|
||||
{{- end -}}
|
||||
{{- with $summaryConfig.theme -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_theme='%v';" $p .) -}}
|
||||
{{- end -}}
|
||||
{{- with $summaryConfig.postURL -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_postURL='%v';" $p .) -}}
|
||||
{{- end -}}
|
||||
{{- with $summaryConfig.blacklist -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_blacklist='%v';" $p .) -}}
|
||||
{{- end -}}
|
||||
{{- with $summaryConfig.wordLimit -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_wordLimit=%d;" $p .) -}}
|
||||
{{- end -}}
|
||||
{{- if eq $summaryConfig.typingAnimate false -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_typingAnimate=false;" $p) -}}
|
||||
{{- end -}}
|
||||
{{- with $summaryConfig.beginningText -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_BeginningText='%v';" $p .) -}}
|
||||
{{- end -}}
|
||||
{{- with eq $summaryConfig.loadingText false -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_loadingText=false;" $p) -}}
|
||||
{{- end -}}
|
||||
{{- if $chatConfig.enable -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_recommendation=true;" $p) -}}
|
||||
{{- else -}}
|
||||
{{- $postSummaryConfig = add $postSummaryConfig (printf "let %v_key='%v';" $p $key) -}}
|
||||
{{- end -}}
|
||||
{{- $configJS = add $configJS $postSummaryConfig -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* PostChat */ -}}
|
||||
{{- if $chatConfig.enable -}}
|
||||
{{- $sourceOpts = dict "Attr" (printf "data-postChat_key=%q" $key) | merge $sourceOpts -}}
|
||||
{{- $blackDom := slice
|
||||
".expiration-reminder"
|
||||
"meting-js"
|
||||
".lnt"
|
||||
-}}
|
||||
{{- with $chatConfig.blackDom -}}
|
||||
{{- $blackDom = $blackDom | append . -}}
|
||||
{{- end -}}
|
||||
{{- $upLoadWeb := cond (.IsHome | or $password | or (eq .Kind "404")) false $chatConfig.upLoadWeb -}}
|
||||
{{- $postChatConfig := dict
|
||||
"userMode" $chatConfig.userMode
|
||||
"defaultInput" $chatConfig.defaultInput
|
||||
"left" $chatConfig.left
|
||||
"bottom" $chatConfig.bottom
|
||||
"width" $chatConfig.width
|
||||
"height" $chatConfig.height
|
||||
"fill" $chatConfig.fill
|
||||
"backgroundColor" $chatConfig.backgroundColor
|
||||
"upLoadWeb" $upLoadWeb
|
||||
"showInviteLink" $chatConfig.showInviteLink
|
||||
"userTitle" $chatConfig.userTitle
|
||||
"userDesc" $chatConfig.userDesc
|
||||
"addButton" $chatConfig.addButton
|
||||
"blackDom" $blackDom
|
||||
"frameWidth" $chatConfig.frameWidth
|
||||
"frameHeight" $chatConfig.frameHeight
|
||||
"userIcon" $chatConfig.userIcon
|
||||
"defaultChatQuestions" $chatConfig.defaultChatQuestions
|
||||
"defaultSearchQuestions" $chatConfig.defaultSearchQuestions
|
||||
-}}
|
||||
{{- $configJS = add $configJS ($postChatConfig | jsonify | printf "var postChatConfig=%s") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Insert config */ -}}
|
||||
{{- $configJS | dict "Content" | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
|
||||
{{- /* Insert script */ -}}
|
||||
{{- $postChatJS := "" -}}
|
||||
{{- if $chatConfig.enable | and $summaryEnable -}}
|
||||
{{- $postChatJS = add $sourcePrefix (index $jsMap "both") -}}
|
||||
{{- else if $chatConfig.enable -}}
|
||||
{{- $postChatJS = add $sourcePrefix (index $jsMap "chat") -}}
|
||||
{{- else if $summaryEnable -}}
|
||||
{{- $postChatJS = add $sourcePrefix (index $jsMap "summary") -}}
|
||||
{{- end -}}
|
||||
{{- $sourceOpts = dict "Source" $postChatJS | merge $sourceOpts -}}
|
||||
{{- $sourceOpts | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
@@ -18,7 +18,10 @@
|
||||
{{- $scopePages = .Scratch.Get "mainSectionPages" -}}
|
||||
{{- end -}}
|
||||
{{- $scopePages = where $scopePages.ByLastmod.Reverse "Section" "!=" "" -}}
|
||||
{{- /* {{- $scopePages = where $scopePages "File.IsContentAdapter" "ne" true -}} */ -}}
|
||||
{{- $hiddenAdapters := .Param "hiddenAdapters" | default false -}}
|
||||
{{- if $hiddenAdapters -}}
|
||||
{{- $scopePages = where $scopePages "File.IsContentAdapter" "ne" true -}}
|
||||
{{- end -}}
|
||||
{{- range first $maxPostCount $scopePages -}}
|
||||
{{- if gt (add .Lastmod.Unix (mul 86900 $days)) now.Unix -}}
|
||||
{{- if ne .Lastmod.Unix .Date.Unix }}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<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" }}
|
||||
<span class="collection-name" data-collections="{{ T "collections" }}">{{ .LinkTitle }}</span>
|
||||
<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" -}}
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{{- $type = "warning" -}}
|
||||
{{- $icon = "fa-exclamation-triangle" -}}
|
||||
{{- end -}}
|
||||
<div class="details admonition {{ $type }} open">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
{{- $params := .Params | merge .Site.Params.page -}}
|
||||
{{- $author := partial "function/get-author-map.html" .Params.author -}}
|
||||
{{- .Store.Set "author" $author -}}
|
||||
{{- $optim := slice
|
||||
(dict "Process" "resize 16x16 Center webp q75" "descriptor" "16w")
|
||||
(dict "Process" "resize 24x24 Center webp q75" "descriptor" "24w")
|
||||
(dict "Process" "resize 32x32 Center webp q75" "descriptor" "32w")
|
||||
-}}
|
||||
|
||||
<span class="post-author">
|
||||
{{- $content := $author.name | default "Anonymous" -}}
|
||||
{{- $icon := dict "Class" "fa-solid fa-user-circle" -}}
|
||||
{{- /* Deprecate $params.authorAvatar in favor of $params.showAvatar and dd front matter gravatar {bool} */ -}}
|
||||
{{- /* Deprecate $params.authorAvatar in favor of $params.showAvatar and add front matter gravatar {bool} */ -}}
|
||||
{{- if $author.avatar | and $params.authorAvatar -}}
|
||||
{{- $content = printf "%v %v" (dict "Src" $author.avatar "Class" "avatar" "Alt" $content "Width" 20 "Height" 20 | partial "plugin/image.html") $content -}}
|
||||
{{- $content = printf "%v %v" (dict "Src" $author.avatar "Class" "avatar" "Alt" $content "Width" 16 "Height" 16 "OptimConfig" $optim | partial "plugin/image.html") $content -}}
|
||||
{{- $icon = "" -}}
|
||||
{{- end -}}
|
||||
{{- if $author.link -}}
|
||||
|
||||
@@ -137,12 +137,20 @@
|
||||
|
||||
{{- /* Featured image */ -}}
|
||||
{{- $image := $params.featuredimage -}}
|
||||
{{- with dict "Path" $image "Resources" .Resources | partial "function/resource.html" }}
|
||||
{{- $image = .RelPermalink }}
|
||||
{{- end }}
|
||||
{{- with .Resources.GetMatch "featured-image" -}}
|
||||
{{- $image = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- with $image -}}
|
||||
<div class="featured-image">
|
||||
{{- dict "Src" . "Title" $.Description | partial "plugin/image.html" -}}
|
||||
{{- $optim := slice
|
||||
(dict "Process" "resize 800x webp q75" "descriptor" "800w")
|
||||
(dict "Process" "resize 1200x webp q75" "descriptor" "1200w")
|
||||
(dict "Process" "resize 1600x webp q75" "descriptor" "1600w")
|
||||
-}}
|
||||
{{- dict "Src" . "Title" $.Description "OptimConfig" $optim | partial "plugin/image.html" -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
@@ -159,6 +167,9 @@
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Custom block before post content */ -}}
|
||||
{{- block "custom-post__content:before" . }}{{ end -}}
|
||||
|
||||
{{- /* Content */ -}}
|
||||
{{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
||||
<div class="content" id="content"{{ with $params.endFlag }} data-end-flag="{{ . }}"{{ end }}>
|
||||
@@ -169,6 +180,9 @@
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{- /* Custom block after post content */ -}}
|
||||
{{- block "custom-post__content:after" . }}{{ end -}}
|
||||
|
||||
{{- /* Related Content */ -}}
|
||||
{{- partial "single/related.html" . -}}
|
||||
|
||||
@@ -203,6 +217,9 @@
|
||||
</article>
|
||||
|
||||
<aside class="toc" id="toc-auto" aria-label="{{ T "single.contents" }}">
|
||||
{{- /* Custom block before post toc */ -}}
|
||||
{{- block "custom-post__toc:before" . }}{{ end -}}
|
||||
|
||||
{{- /* Auto TOC */ -}}
|
||||
{{- if $showToc -}}
|
||||
<h2 class="toc-title{{ with $params.password }} encrypted-hidden{{ end }}">
|
||||
@@ -211,5 +228,8 @@
|
||||
</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 -}}
|
||||
|
||||
{{- /* Custom block after post toc */ -}}
|
||||
{{- block "custom-post__toc:after" . }}{{ end -}}
|
||||
</aside>
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{{- $link := .Get "link" -}}
|
||||
{{- $query := querify "url" $link -}}
|
||||
{{- $request := printf "https://embed.bsky.app/oembed?%s" $query -}}
|
||||
{{- $jsonOembed := resources.GetRemote $request -}}
|
||||
{{- $jsonOembed = $jsonOembed | transform.Unmarshal -}}
|
||||
{{- $jsonOHTML := $jsonOembed.html -}}
|
||||
{{- $jsonOHTML | safeHTML -}}
|
||||
@@ -1,12 +1,71 @@
|
||||
{{- $summary := .Get "summary" | default (.Get 0) -}}
|
||||
{{- /*
|
||||
Renders an HTML details element.
|
||||
|
||||
@param {string} [class] The value of the element's class attribute.
|
||||
@param {string} [name] The value of the element's name attribute.
|
||||
@param {string} [summary] The content of the child summary element.
|
||||
@param {string} [title] The value of the element's title attribute.
|
||||
@param {bool} [open=false] Whether to initially display the content of the details element.
|
||||
|
||||
@reference https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
||||
|
||||
@examples
|
||||
|
||||
{{< details >}}
|
||||
A basic collapsible section.
|
||||
{{< /details >}}
|
||||
|
||||
{{< details summary="Custom Summary Text" >}}
|
||||
Showing custom `summary` text.
|
||||
{{< /details >}}
|
||||
|
||||
{{< details summary="Open Details" open=true >}}
|
||||
Contents displayed initially by using `open`.
|
||||
{{< /details >}}
|
||||
|
||||
{{< details summary="Styled Content" class="my-custom-class" >}}
|
||||
Content can be styled with CSS by specifying a `class`.
|
||||
|
||||
Target details element:
|
||||
|
||||
```css
|
||||
details.my-custom-class { }
|
||||
```
|
||||
|
||||
Target summary element:
|
||||
|
||||
```css
|
||||
details.my-custom-class > summary > * { }
|
||||
```
|
||||
|
||||
Target inner content:
|
||||
|
||||
```css
|
||||
details.my-custom-class > :not(summary) { }
|
||||
```
|
||||
{{< /details >}}
|
||||
|
||||
{{< details summary="Grouped Details" name="my-details" >}}
|
||||
Specifying a `name` allows elements to be connected, with only one able to be open at a time.
|
||||
{{< /details >}}
|
||||
|
||||
*/}}
|
||||
|
||||
{{- /* Get arguments. */}}
|
||||
{{- $summary := .Get "summary" | default (.Get 0) | default "Details" }}
|
||||
{{- $open := .Get "open" | default (.Get 1) | default false -}}
|
||||
{{- $center := .Get "center" | default (.Get 2) | default false -}}
|
||||
{{- $class := .Get "class" | default (.Get 2) | default "" }}
|
||||
{{- $name := or (.Get "name") "" }}
|
||||
{{- $title := or (.Get "title") "" }}
|
||||
|
||||
{{- /* Render. */}}
|
||||
<details
|
||||
{{- with $open }} open{{ end -}}
|
||||
{{- with $class }} class="{{ . }}" {{- end }}
|
||||
{{- with $name }} name="{{ . }}" {{- end }}
|
||||
{{- with $open }} open {{- end }}
|
||||
{{- with $title }} title="{{ . }}" {{- end -}}
|
||||
>
|
||||
<summary
|
||||
{{- if $center }} class="text-center"{{ end -}}
|
||||
>{{ $summary | .Page.RenderString }}</summary>
|
||||
{{ .Inner | .Page.RenderString }}
|
||||
<summary>{{ $summary | .Page.RenderString }}</summary>
|
||||
{{ .Inner | .Page.RenderString (dict "display" "block") -}}
|
||||
</details>
|
||||
{{- /* EOF */ -}}
|
||||
{{- /* EOF */ -}}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{{- $options := .Get "width" | default (.Get 0) | dict "width" -}}
|
||||
{{- $options = .Get "height" | default (.Get 1) | dict "height" | merge $options -}}
|
||||
{{- $options = .Get "js" | default (.Get 2) | dict "js" | merge $options -}}
|
||||
{{- dict "Options" $options "Inner" .Inner | partial "plugin/echarts.html" -}}
|
||||
{{- .Page.Store.Set "hasEcharts" true -}}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<script src="https://gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>
|
||||
{{- /* EOF */ -}}
|
||||
@@ -3,16 +3,22 @@
|
||||
{{- $caption := cond .IsNamedParams (.Get "caption") (.Get 2) | .Page.RenderString -}}
|
||||
{{- $options = dict "Caption" $caption | merge $options -}}
|
||||
{{- $options = dict "Resources" .Page.Resources | merge $options -}}
|
||||
{{- $optim := slice
|
||||
(dict "Process" "resize 800x webp q75" "descriptor" "800w")
|
||||
(dict "Process" "resize 1200x webp q75" "descriptor" "1200w")
|
||||
(dict "Process" "resize 1600x webp q75" "descriptor" "1600w")
|
||||
-}}
|
||||
{{- $options = dict "OptimConfig" $optim | merge $options -}}
|
||||
|
||||
{{- if .IsNamedParams -}}
|
||||
{{- $options = dict "Title" (.Get "title") | merge $options -}}
|
||||
{{- $options = dict "SrcSmall" (.Get "src_s") | merge $options -}}
|
||||
{{- $options = dict "SrcLarge" (.Get "src_l") | merge $options -}}
|
||||
{{- $options = dict "Height" (.Get "height") | merge $options -}}
|
||||
{{- $options = dict "Width" (.Get "width") | merge $options -}}
|
||||
{{- $options = .Get "linked" | ne false | dict "Linked" | merge $options -}}
|
||||
{{- $options = dict "Rel" (.Get "rel") | merge $options -}}
|
||||
{{- $options = dict "Loading" (.Get "loading") | merge $options -}}
|
||||
{{- $options = dict "Loading" (.Get "loading" | default "lazy") | merge $options -}}
|
||||
{{- with (.Get "optimise") -}}{{- $options = dict "Optimise" . | merge $options -}}{{- end -}}
|
||||
{{- with (.Get "cacheRemote") -}}{{- $options = dict "CacheRemote" . | merge $options -}}{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $options = cond $caption true false | dict "Linked" | merge $options -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
{{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" }} <sup>{{ len .Data.Terms.ByCount }}</sup>
|
||||
</h1>
|
||||
{{- /* Render miscellaneous terms */ -}}
|
||||
{{- .Render (add "terms/" $taxonomies) -}}
|
||||
{{- .Render $taxonomies -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
Generated
-328
@@ -1,328 +0,0 @@
|
||||
{
|
||||
"name": "fixit-core",
|
||||
"version": "0.3.16",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "fixit-core",
|
||||
"version": "0.3.16",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@hugo-fixit/fixit-releaser": "^1.0.1",
|
||||
"husky": "^9.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@hugo-fixit/fixit-releaser": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@hugo-fixit/fixit-releaser/-/fixit-releaser-1.0.1.tgz",
|
||||
"integrity": "sha512-hYCxiwm3eeUNYXbWvan3AhBFbsAdPmk8Ys/3jn02QJzOqKtCxyHloKeM/80EkrBTCXAw//0DJVS+zBMw2cl31A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"auto-changelog": "^2.4.0"
|
||||
},
|
||||
"bin": {
|
||||
"fixit-releaser": "scripts/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/auto-changelog": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/auto-changelog/-/auto-changelog-2.4.0.tgz",
|
||||
"integrity": "sha512-vh17hko1c0ItsEcw6m7qPRf3m45u+XK5QyCrrBFViElZ8jnKrPC1roSznrd1fIB/0vR/zawdECCRJtTuqIXaJw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"commander": "^7.2.0",
|
||||
"handlebars": "^4.7.7",
|
||||
"node-fetch": "^2.6.1",
|
||||
"parse-github-url": "^1.0.2",
|
||||
"semver": "^7.3.5"
|
||||
},
|
||||
"bin": {
|
||||
"auto-changelog": "src/index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.3"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
||||
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/handlebars": {
|
||||
"version": "4.7.8",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
||||
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.5",
|
||||
"neo-async": "^2.6.2",
|
||||
"source-map": "^0.6.1",
|
||||
"wordwrap": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"handlebars": "bin/handlebars"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.7"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"uglify-js": "^3.1.4"
|
||||
}
|
||||
},
|
||||
"node_modules/husky": {
|
||||
"version": "9.1.7",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
|
||||
"integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"husky": "bin.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/typicode"
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/neo-async": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/parse-github-url": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.3.tgz",
|
||||
"integrity": "sha512-tfalY5/4SqGaV/GIGzWyHnFjlpTPTNpENR9Ea2lLldSJ8EWXMsvacWucqY3m3I4YPtas15IxTLQVQ5NSYXPrww==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"parse-github-url": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.6.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
|
||||
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/uglify-js": {
|
||||
"version": "3.19.3",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
||||
"integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"bin": {
|
||||
"uglifyjs": "bin/uglifyjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
||||
"dev": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@hugo-fixit/fixit-releaser": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@hugo-fixit/fixit-releaser/-/fixit-releaser-1.0.1.tgz",
|
||||
"integrity": "sha512-hYCxiwm3eeUNYXbWvan3AhBFbsAdPmk8Ys/3jn02QJzOqKtCxyHloKeM/80EkrBTCXAw//0DJVS+zBMw2cl31A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"auto-changelog": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"auto-changelog": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/auto-changelog/-/auto-changelog-2.4.0.tgz",
|
||||
"integrity": "sha512-vh17hko1c0ItsEcw6m7qPRf3m45u+XK5QyCrrBFViElZ8jnKrPC1roSznrd1fIB/0vR/zawdECCRJtTuqIXaJw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "^7.2.0",
|
||||
"handlebars": "^4.7.7",
|
||||
"node-fetch": "^2.6.1",
|
||||
"parse-github-url": "^1.0.2",
|
||||
"semver": "^7.3.5"
|
||||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
||||
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||
"dev": true
|
||||
},
|
||||
"handlebars": {
|
||||
"version": "4.7.8",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
||||
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.5",
|
||||
"neo-async": "^2.6.2",
|
||||
"source-map": "^0.6.1",
|
||||
"uglify-js": "^3.1.4",
|
||||
"wordwrap": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"husky": {
|
||||
"version": "9.1.7",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
|
||||
"integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
|
||||
"dev": true
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||
"dev": true
|
||||
},
|
||||
"neo-async": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||
"dev": true
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"parse-github-url": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.3.tgz",
|
||||
"integrity": "sha512-tfalY5/4SqGaV/GIGzWyHnFjlpTPTNpENR9Ea2lLldSJ8EWXMsvacWucqY3m3I4YPtas15IxTLQVQ5NSYXPrww==",
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.6.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
|
||||
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
||||
"dev": true
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.19.3",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
||||
"integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
|
||||
"dev": true
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"name": "fixit-core",
|
||||
"version": "0.3.16",
|
||||
"version": "0.3.19",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@10.5.2",
|
||||
"description": "Hugo FixIt core theme component source files",
|
||||
"keywords": [
|
||||
"hugo",
|
||||
@@ -30,7 +31,7 @@
|
||||
"prepare": "husky"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@hugo-fixit/fixit-releaser": "^1.0.1",
|
||||
"@hugo-fixit/fixit-releaser": "^1.1.5",
|
||||
"husky": "^9.1.7"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
Generated
+170
@@ -0,0 +1,170 @@
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
devDependencies:
|
||||
'@hugo-fixit/fixit-releaser':
|
||||
specifier: ^1.1.5
|
||||
version: 1.1.5
|
||||
husky:
|
||||
specifier: ^9.1.7
|
||||
version: 9.1.7
|
||||
|
||||
packages:
|
||||
|
||||
'@hugo-fixit/fixit-releaser@1.1.5':
|
||||
resolution: {integrity: sha512-QEVSLlgn1h6MZ+IuowmCYP9N5tJsinNyWsq2OJgr/iwNuaykMZ3N8z3BY99//uTJNzejfFy+o3MyFKuqPgWW/A==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
|
||||
auto-changelog@2.5.0:
|
||||
resolution: {integrity: sha512-UTnLjT7I9U2U/xkCUH5buDlp8C7g0SGChfib+iDrJkamcj5kaMqNKHNfbKJw1kthJUq8sUo3i3q2S6FzO/l/wA==}
|
||||
engines: {node: '>=8.3'}
|
||||
hasBin: true
|
||||
|
||||
commander@7.2.0:
|
||||
resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==}
|
||||
engines: {node: '>= 10'}
|
||||
|
||||
handlebars@4.7.8:
|
||||
resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==}
|
||||
engines: {node: '>=0.4.7'}
|
||||
hasBin: true
|
||||
|
||||
husky@9.1.7:
|
||||
resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
|
||||
import-cwd@3.0.0:
|
||||
resolution: {integrity: sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
import-from@3.0.0:
|
||||
resolution: {integrity: sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
minimist@1.2.8:
|
||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||
|
||||
neo-async@2.6.2:
|
||||
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
|
||||
|
||||
node-fetch@2.7.0:
|
||||
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
|
||||
engines: {node: 4.x || >=6.0.0}
|
||||
peerDependencies:
|
||||
encoding: ^0.1.0
|
||||
peerDependenciesMeta:
|
||||
encoding:
|
||||
optional: true
|
||||
|
||||
parse-github-url@1.0.3:
|
||||
resolution: {integrity: sha512-tfalY5/4SqGaV/GIGzWyHnFjlpTPTNpENR9Ea2lLldSJ8EWXMsvacWucqY3m3I4YPtas15IxTLQVQ5NSYXPrww==}
|
||||
engines: {node: '>= 0.10'}
|
||||
hasBin: true
|
||||
|
||||
resolve-from@5.0.0:
|
||||
resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
semver@7.7.1:
|
||||
resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==}
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
|
||||
source-map@0.6.1:
|
||||
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
tr46@0.0.3:
|
||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||
|
||||
uglify-js@3.19.3:
|
||||
resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==}
|
||||
engines: {node: '>=0.8.0'}
|
||||
hasBin: true
|
||||
|
||||
webidl-conversions@3.0.1:
|
||||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||
|
||||
whatwg-url@5.0.0:
|
||||
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
|
||||
|
||||
wordwrap@1.0.0:
|
||||
resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@hugo-fixit/fixit-releaser@1.1.5':
|
||||
dependencies:
|
||||
auto-changelog: 2.5.0
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
auto-changelog@2.5.0:
|
||||
dependencies:
|
||||
commander: 7.2.0
|
||||
handlebars: 4.7.8
|
||||
import-cwd: 3.0.0
|
||||
node-fetch: 2.7.0
|
||||
parse-github-url: 1.0.3
|
||||
semver: 7.7.1
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
commander@7.2.0: {}
|
||||
|
||||
handlebars@4.7.8:
|
||||
dependencies:
|
||||
minimist: 1.2.8
|
||||
neo-async: 2.6.2
|
||||
source-map: 0.6.1
|
||||
wordwrap: 1.0.0
|
||||
optionalDependencies:
|
||||
uglify-js: 3.19.3
|
||||
|
||||
husky@9.1.7: {}
|
||||
|
||||
import-cwd@3.0.0:
|
||||
dependencies:
|
||||
import-from: 3.0.0
|
||||
|
||||
import-from@3.0.0:
|
||||
dependencies:
|
||||
resolve-from: 5.0.0
|
||||
|
||||
minimist@1.2.8: {}
|
||||
|
||||
neo-async@2.6.2: {}
|
||||
|
||||
node-fetch@2.7.0:
|
||||
dependencies:
|
||||
whatwg-url: 5.0.0
|
||||
|
||||
parse-github-url@1.0.3: {}
|
||||
|
||||
resolve-from@5.0.0: {}
|
||||
|
||||
semver@7.7.1: {}
|
||||
|
||||
source-map@0.6.1: {}
|
||||
|
||||
tr46@0.0.3: {}
|
||||
|
||||
uglify-js@3.19.3:
|
||||
optional: true
|
||||
|
||||
webidl-conversions@3.0.1: {}
|
||||
|
||||
whatwg-url@5.0.0:
|
||||
dependencies:
|
||||
tr46: 0.0.3
|
||||
webidl-conversions: 3.0.1
|
||||
|
||||
wordwrap@1.0.0: {}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
+2
-2
@@ -3,11 +3,11 @@
|
||||
|
||||
name = "FixIt"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/hugo-fixit/FixIt/blob/master/LICENSE"
|
||||
licenselink = "https://github.com/hugo-fixit/FixIt/blob/main/LICENSE"
|
||||
description = "A Clean, Elegant but Advanced Hugo Theme for Hugo."
|
||||
homepage = "https://github.com/hugo-fixit/FixIt"
|
||||
demosite = "https://fixit.lruihao.cn"
|
||||
min_version = "0.134.1"
|
||||
min_version = "0.146.0"
|
||||
|
||||
tags = [
|
||||
"blog",
|
||||
|
||||
Reference in New Issue
Block a user