Compare commits

..

57 Commits

Author SHA1 Message Date
Xin
a184cfd41e fix: use relURL only for link starts with slash (#54) 2023-09-13 05:40:00 -04:00
Xin
76ac694542 feat: add backdrop blur for nav bar (#53) 2023-09-13 10:02:38 +01:00
Xin
f70ba59ca0 fix: use relative url for card link (#52)
* fix: cards links should not redirect to 404

* docs: update card links

* fix: use relURL for card link
2023-09-13 09:49:01 +01:00
Xin
4a9a2850fc docs: add instruction for using markdown in tabs (#47) 2023-09-13 07:54:44 +01:00
Xin
4553a8eda2 docs: add more instruction for favicon (#44) 2023-09-11 17:15:24 -04:00
Xin
237d890f67 ci: use dynamic repo and username for baseURL 2023-09-10 15:20:17 +01:00
Xin
04e131f93a chore: normalize headings (#42)
* chore: minor update to card component

* chore: normalize headings of blog and single page
2023-09-10 14:54:30 +01:00
Xin
61e41f247b chore: add contributing guide
[skip ci]
2023-09-10 12:07:04 +01:00
6d00cb32b0 docs: add Logo, Favicon in Configurations (#37)
* Add Configuration for Logo, Favicon.

---------

Co-authored-by: Xin <xin@imfing.com>
2023-09-05 23:45:05 +01:00
939acc02a8 fix: add line break for steps shortcode example usage
* there needs to be a line break between {{% steps %}} and the first H3

If there is no line break between {{% steps %}}  and the first heading, the content is not rendered correctly.

* Update exampleSite/content/docs/guide/shortcodes/steps.md

* Update exampleSite/content/docs/guide/shortcodes/steps.md
2023-09-05 06:24:51 -04:00
Sid
e4c36236df ci: setup actions/checkout@v3 to fetch complete Git history (#32)
Attempt to fix #31
2023-09-03 19:05:33 +01:00
Xin
4381f31085 chore: make index page container wider (#30)
* chore: enable footer by default

* chore: make index container wider
2023-09-03 16:12:53 +01:00
Xin
171399889d docs: add instruction to update theme 2023-09-02 16:02:28 +01:00
Xin
3bcdf84ad4 feat: details shortcode (#28)
* feat: details shortcode

* docs: add details shortcode page

* chore: update shortcodes page

* docs: update

* Revert "chore: update shortcodes page"

This reverts commit c005ad4cb1.
2023-09-02 16:01:34 +01:00
Xin
8e8f7f23c9 chore: increase home heading text line height 2023-09-02 00:10:51 +00:00
Xin
5b71912ab2 feat: support markdown for copyright text (#25)
* feat: support markdown for copyright text

* docs: add info about supporting markdown in copyright
2023-09-01 22:38:49 +01:00
34c6f6c7f3 docs: added info to configure footer (#23) 2023-09-01 22:19:14 +01:00
Xin
8a4e093f12 fix: toc should display headings as is (#20) 2023-09-01 00:34:50 +01:00
Xin
ed14cf01c3 chore: update local dev config
[skip ci]
2023-08-31 20:49:28 +01:00
Xin
b709452d16 chore(i18n): improve translations of zh-cn (#14) 2023-08-30 21:35:04 +01:00
e1a2109a68 i18n: Add some zh-cn translation of exampleSite(docs) (#12)
---------

Co-authored-by: Xin <xin@imfing.com>
2023-08-30 21:21:31 +01:00
392c6f8dde current instructions show a 404 and pages dont render correctly (#10) 2023-08-30 08:11:40 +01:00
7993dc3230 i18n: Add translation of zh-cn and zh-hk (#8)
* Add translation of zh-cn

* Add translation of zh-hk

---------
Co-authored-by: Xin <xin@imfing.com>
2023-08-29 20:57:44 +01:00
Xin
b96eb01af3 docs: enchance pages navigation 2023-08-28 22:45:29 +01:00
Xin
e1fa9e73d2 chore: replace space with nbsp 2023-08-28 22:32:50 +01:00
Xin
c0d15f89e8 chore: proper dev and prod styles handling 2023-08-28 22:32:07 +01:00
Xin
283c7daaf2 chore: add github actions and netlify badges
[skip ci]
2023-08-28 21:47:06 +01:00
Xin
49e1e01c6d chore: add netlify.toml 2023-08-28 21:33:54 +01:00
Xin
2d62e74e97 fix: missing integrity value in head css (#6) 2023-08-28 20:59:06 +01:00
Xin
57134eae36 fix: whitespace in home page title
replace with &nbsp;
2023-08-28 12:59:40 +01:00
Sid
a7c48b4b0a chore: use environment variable to specify Hugo version (#2) 2023-08-28 10:32:29 +01:00
Sid
faefe548bc fix: card link - closes #4 (#3)
The existing card for Syntax Highlighting leads to a 404 page, I have replaced it with appropriate link
2023-08-28 10:29:37 +01:00
Xin
1a8d881a2e chore: add screenshots
[skip ci]
2023-08-28 00:41:05 +01:00
Xin
dd4c09070a chore: update theme meta
[skip ci]
2023-08-28 00:16:38 +01:00
Xin
6727ef01aa fix: [html] does not have [lang] attribute 2023-08-27 23:50:51 +01:00
Xin
0a0202657a fix: urls in site.webmanifest 2023-08-27 23:49:09 +01:00
Xin
cc099724a0 fix: add alt to home page images 2023-08-27 23:45:41 +01:00
Xin
a1f2859944 chore: updated page description partial 2023-08-27 23:44:43 +01:00
Xin
259b050dfb chore: update README.md
[skip ci]
2023-08-27 20:57:39 +01:00
Xin
5cf72e9764 Update README.md
[skip ci]
2023-08-27 20:51:07 +01:00
Xin
19c95e9bd8 docs: minor update to the features section 2023-08-27 20:00:07 +01:00
Xin
6a2f0766f8 chore: update README.md 2023-08-27 19:50:09 +01:00
Xin
5186f2988e fix: site.webmanifest should use relative url 2023-08-27 19:49:51 +01:00
Xin
c8b1d764e0 chore: add more i18n options and update templates 2023-08-27 17:32:44 +01:00
Xin
d9c44bc503 docs: add content to about page 2023-08-27 16:20:25 +01:00
Xin
03c8421b99 fix: image urls on home page 2023-08-27 15:58:54 +01:00
Xin
a52279446a chore: add feature cards to home page 2023-08-27 15:53:12 +01:00
Xin
cef7fc0a11 docs: add instruction for using template repo 2023-08-26 15:36:46 +01:00
Xin
ede8991728 fix: card links for getting started page 2023-08-26 15:01:06 +01:00
Xin
af77173a35 chore: update build configs 2023-08-26 12:21:02 +01:00
Xin
d1bc057c09 chore: update home page 2023-08-26 12:20:39 +01:00
Xin
739178889f chore: add hextra home layout 2023-08-25 01:09:36 +01:00
Xin
35dd9b8e58 fix: icon fill color should be current color 2023-08-25 01:06:02 +01:00
Xin
97f31e92a7 chore: add displayPlaceholder option to sidebar 2023-08-24 22:29:53 +01:00
Xin
d14091cd81 chore: update default list layout 2023-08-24 00:36:36 +01:00
Xin
0db055da11 chore: remove taskfile 2023-08-24 00:36:18 +01:00
Xin
4e250a449c chore: update css height calc to use height var 2023-08-24 00:36:10 +01:00
92 changed files with 3341 additions and 2065 deletions

110
.github/CONTRIBUTING.md vendored Normal file
View File

@ -0,0 +1,110 @@
# Contribute to Hextra
👋 Thank you for being interested in contributing to Hextra! As an open source project, we welcome contributions of many forms including bug reports, feature requests, documentation improvements, and code contributions.
<!-- omit in toc -->
## Table of Contents
- [Guidelines](#guidelines)
- [Contributing Code](#contributing-code)
- [Contributing Documentation](#contributing-documentation)
- [💬 GitHub Discussions](#-github-discussions)
- [GitHub Issues](#github-issues)
- [Development](#development)
- [Local development setup](#local-development-setup)
- [Project structure](#project-structure)
- [Start the development server](#start-the-development-server)
- [Compile the styles](#compile-the-styles)
## Guidelines
### Contributing Code
To contribute, please follow the ["Fork and Pull Request"][fork and pull] workflow
Fork the repository, make your changes, and then submit a pull request.
Please make sure to include a description of the changes you made and why you made them.
Use [Conventional Commits][conventional commits] message to make it easier to understand the changes you made.
### Contributing Documentation
Similar to contributing code, you can also contribute to the documentation by submitting a pull request.
The documentation site is located in the [`exampleSite`](../exampleSite/) folder.
You can make changes to the documentation and create a pull request. A preview of the new documentation will be automatically generated and displayed in the pull request comment via [Netlify][netlify deploy preview].
### 💬 GitHub Discussions
Were using [Discussions][discussions] as a place to connect with other members using Hextra:
- Ask questions youre wondering about.
- Share ideas.
- Engage with other users.
### GitHub Issues
If you find a bug or have a feature request, please [open an issue][issues].
Please make sure to include a description of the bug or feature you are requesting. If you are reporting a bug, please include steps to reproduce the bug.
We recommend that you search existing [issues][issues] or discussions before opening a new one to prevent duplicates.
## Development
> **Note**
> You can start developing on [GitHub Codespaces][open in codespaces] or use [devcontainer][devcontainer] locally without installing any dependencies.
### Local development setup
- [Hugo][hugo] >= v0.115.0 (extended version)
- [Node.js][nodejs]
- [Go][go]
Install dependencies:
```bash
npm i
```
### Project structure
- [`assets`](../assets/): CSS styles and JavaScript files.
- [`data`](../data/): The theme data files. Now only contains the `icons.yaml` file.
- [`exampleSite`](../exampleSite/): The documentation site for the theme.
- [`i18n`](../i18n/): The theme translation files.
- [`layouts`](../layouts/): The theme layouts.
- [`static`](../static/): The static files for the theme. For example, the favicon and the site logo.
Please refer to the [Hugo documentation][hugo] for more information.
### Start the development server
```bash
npm run dev:theme
```
It will start the Hugo server on `http://localhost:1313/` for the `exampleSite` content.
### Compile the styles
For development preview, we compile the Tailwind CSS styles on the fly. But for production, we need to compile the styles first.
```bash
npm run build:css
```
It will compile the Tailwind CSS styles and generate the `assets/css/compiled/main.css` file.
<!--links-->
[fork and pull]: https://docs.github.com/en/get-started/quickstart/contributing-to-projects
[conventional commits]: https://www.conventionalcommits.org
[issues]: https://github.com/imfing/hextra/issues
[discussions]: https://github.com/imfing/hextra/discussions
[nodejs]: https://nodejs.org/en/
[hugo]: https://gohugo.io/
[go]: https://golang.org/doc/install
[devcontainer]: https://code.visualstudio.com/docs/devcontainers/containers
[open in codespaces]: https://codespaces.new/imfing/hextra
[netlify deploy preview]: https://docs.netlify.com/site-deploys/deploy-previews/

View File

@ -35,6 +35,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v4 uses: actions/setup-go@v4
with: with:
@ -42,7 +44,7 @@ jobs:
- name: Setup Hugo - name: Setup Hugo
uses: peaceiris/actions-hugo@v2 uses: peaceiris/actions-hugo@v2
with: with:
hugo-version: '0.117.0' hugo-version: ${{ env.HUGO_VERSION }}
extended: true extended: true
- name: Build with Hugo - name: Build with Hugo
env: env:
@ -53,7 +55,7 @@ jobs:
hugo \ hugo \
--minify \ --minify \
--themesDir=../.. --source=exampleSite \ --themesDir=../.. --source=exampleSite \
--baseURL "https://imfing.github.io/hextra/" --baseURL "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v2 uses: actions/upload-pages-artifact@v2
with: with:

View File

@ -1,7 +1,7 @@
{ {
"goTemplateBracketSpacing": true, "goTemplateBracketSpacing": true,
"htmlWhitespaceSensitivity": "css", "htmlWhitespaceSensitivity": "css",
"printWidth": 100, "printWidth": 200,
"singleQuote": false, "singleQuote": false,
"tabWidth": 2, "tabWidth": 2,
"trailingComma": "es5", "trailingComma": "es5",

View File

@ -1,4 +1,5 @@
{ {
"editor.tabSize": 2, "editor.tabSize": 2,
"css.customData": [".vscode/tailwind.json"] "css.customData": [".vscode/tailwind.json"],
"markdown.extension.toc.levels": "2..6"
} }

View File

@ -1 +1,47 @@
# Hextra <div align="center">
<h1 align="center">Hextra</h1>
<p align="center">Modern, responsive, batteries-included Hugo theme for creating beautiful static websites.</p>
Demo → [imfing.github.io/hextra](https://imfing.github.io/hextra/)
</div>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/5097752/263550533-c18343ca-3848-4230-b5c0-ee989d7916da.png">
<img alt="Hextra" src="https://user-images.githubusercontent.com/5097752/263550528-663599f9-17a1-4686-b5c4-3da233b5034d.png">
</picture>
<div align="right">
<a href="https://github.com/imfing/hextra/actions/workflows/pages.yml"><img alt="GitHub Actions Status" src="https://github.com/imfing/hextra/actions/workflows/pages.yml/badge.svg"></a> <a href="https://app.netlify.com/sites/hugo-hextra/deploys"><img alt="Netlify Status" src="https://api.netlify.com/api/v1/badges/61d6e55a-2447-487e-b59f-c9537e5df175/deploy-status"></a>
</div>
## Features
- **Beautiful Design** - Inspired by Nextra, Hextra utilizes Tailwind CSS to offer a modern design that makes your site look outstanding.
- **Responsive Layout and Dark Mode** - It looks great on all devices, from mobile, tablet to desktop. Dark mode is also supported to accomodate various lighting conditions.
- **Fast and Lightweight** - Powered by Hugo, a lightning-fast static-site generator housed in a single binary file, Hextra keeps its footprint minimal. No Javascript or Node.js are needed to use it.
- **Full-text Search** - Built-in offline full-text search powered by FlexSearch, no additional configuration required.
- **Battery-included** - Markdown, syntax highlighting, LaTeX math formulae, diagrams and Shortcodes elements to enhance your content. Table of contents, breadcumbs, pagination, sidebar navigation and more are all automatically generated.
- **Multi-language and SEO Ready** - Multi-language sites made easy with Hugo's multilingual mode. Out-of-the-box support is included for SEO tags, Open Graph, and Twitter Cards.
## Quick Start
### Use the template
Using the [Hextra Starter Template](https://github.com/imfing/hextra-starter-template) is the simplest method to bootstrap a new website with Hextra theme. Get started by clicking the "Use this template" button on the template repository page.
The template repository also includes a [GitHub Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow) for deploying your website to GitHub Pages.
<img alt="Hextra Starter Template" src="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" width=600/>
### Usage
Refer to the [documentation](https://imfing.github.io/hextra/docs) for more information.
## Contributing
Contributions are welcome!
Check out the [contributing guide](.github/CONTRIBUTING.md) to get started.
## License
[MIT License](./LICENSE)

44
README.zh-cn.md Normal file
View File

@ -0,0 +1,44 @@
<div align="center">
<h1 align="center">Hextra</h1>
<p align="center">用于创建美观的静态站点的现代化, 响应式, 功能强大的 Hugo 主题.</p>
演示 → [imfing.github.io/hextra](https://imfing.github.io/hextra/)
</div>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/5097752/263550533-c18343ca-3848-4230-b5c0-ee989d7916da.png">
<img alt="Hextra" src="https://user-images.githubusercontent.com/5097752/263550528-663599f9-17a1-4686-b5c4-3da233b5034d.png">
</picture>
<div align="right">
<a href="https://github.com/imfing/hextra/actions/workflows/pages.yml"><img alt="GitHub Actions Status" src="https://github.com/imfing/hextra/actions/workflows/pages.yml/badge.svg"></a> <a href="https://app.netlify.com/sites/hugo-hextra/deploys"><img alt="Netlify Status" src="https://api.netlify.com/api/v1/badges/61d6e55a-2447-487e-b59f-c9537e5df175/deploy-status"></a>
</div>
## 特性
- **美观的设计** - 受 Nextra 的启发Hextra 利用 Tailwind CSS 提供现代化的设计,使您的网站看起来美观有加.
- **响应式布局和深色模式支持** - 在任何设备上看起来都足够美观, 无论是手机, 平板电脑或者电脑. 深色模式的支持使 Hextra 可以应对各种照明环境.
- **快速且轻量** - 由 Hugo 强力支持, Hugo 是一个快如闪电的静态站点生成器, 这一切都只需一个可执行文件, Hextra 始终保持最小化, 无需 Javascript 或者 Node.js.
- **全文搜索** - 集成了 Flexsearch 的全文搜索, 无需额外的配置.
- **网站中的瑞士军刀** - Markdown, 代码高亮, LaTex 数学公式, diagrams 图表和 Shortcodes 都可以用于丰富你的内容. 目录, 面包屑导航, 分页, 侧边栏等均由 Hextra 自动生成。
- **多语言和 SEO Ready** - Hugo 的多语言模式使得构建多语言网站更简单. 具有 SEO tags, Open Graph, 和 Twitter Cards 等诸多开箱即用的功能.
## 快速开始
### 使用模板
使用 [Hextra stater template](https://github.com/imfing/hextra-starter-template) 是使用 Hextra 主题的最简单方法. 点击仓库页面上的 `Use this template` 按钮开始使用.
此仓库中包含一个 [GitHub Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow) 来帮助你免费在 GitHub Pages 上自动构建和部署网站.
### 使用
转至[文档](https://imfing.github.io/hextra/zh-cn/docs)
## 贡献
该项目正在积极开发中. 欢迎贡献!
## 许可证
[MIT License](./LICENSE)

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,14 @@ nav {
} }
} }
@supports (
(-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
.nav-container-blur {
@apply backdrop-blur-md bg-white/[.85] dark:!bg-dark/80;
}
}
.hamburger-menu svg { .hamburger-menu svg {
g { g {
@apply origin-center; @apply origin-center;

View File

@ -1,3 +1,5 @@
@import "tailwind.css";
@import "typography.css"; @import "typography.css";
@import "highlight.css"; @import "highlight.css";
@import "components/cards.css"; @import "components/cards.css";
@ -6,10 +8,6 @@
@import "components/sidebar.css"; @import "components/sidebar.css";
@import "components/navbar.css"; @import "components/navbar.css";
@tailwind base;
@tailwind components;
@tailwind utilities;
html { html {
@apply text-base antialiased; @apply text-base antialiased;
font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1; font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1;

3
assets/css/tailwind.css Normal file
View File

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -6,6 +6,7 @@
// {{ if hugo.IsProduction }} // {{ if hugo.IsProduction }}
// {{ $searchData := $searchData | minify | fingerprint }} // {{ $searchData := $searchData | minify | fingerprint }}
// {{ end }} // {{ end }}
// {{ $noResultsFound := (T "noResultsFound") | default "No results found." }}
(function () { (function () {
const searchDataURL = '{{ $searchData.RelPermalink }}'; const searchDataURL = '{{ $searchData.RelPermalink }}';
@ -300,7 +301,7 @@
if (!resultsElement) return; if (!resultsElement) return;
if (!results.length) { if (!results.length) {
resultsElement.innerHTML = `<span class="no-result">No results found.</span>`; resultsElement.innerHTML = `<span class="no-result">{{ $noResultsFound | safeHTML }}</span>`;
return; return;
} }

View File

@ -1,30 +0,0 @@
build:
buildStats:
enable: true
disableIDs: true
cacheBusters:
- source: assets/watching/hugo_stats\.json
target: styles\.css
- source: assets/.*\.(js|ts|jsx|tsx)
target: (js|scripts|javascript)
- source: assets/.*\.(css|sass|scss)$
target: (css|styles|scss|sass)
- source: (postcss|tailwind)\.config\.js
target: (css|styles|scss|sass)
- source: assets/.*\.(.*)$
target: $1
module:
mounts:
- source: static
target: static
- source: layouts
target: layouts
- source: data
target: data
- source: assets
target: assets
- source: i18n
target: i18n
- source: archetypes
target: archetypes

View File

@ -265,8 +265,8 @@ zoom-out: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24
# Socials # Socials
instagram: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path fill="currentColor" fill-rule="evenodd" d="M12.91 12.909c.326-.327.582-.72.749-1.151c.16-.414.27-.886.302-1.578c.032-.693.04-.915.04-2.68c0-1.765-.008-1.987-.04-2.68c-.032-.692-.142-1.164-.302-1.578a3.185 3.185 0 0 0-.75-1.151a3.187 3.187 0 0 0-1.151-.75c-.414-.16-.886-.27-1.578-.302C9.487 1.007 9.265 1 7.5 1c-1.765 0-1.987.007-2.68.04c-.692.03-1.164.14-1.578.301a3.2 3.2 0 0 0-1.151.75a3.2 3.2 0 0 0-.75 1.151c-.16.414-.27.886-.302 1.578C1.007 5.513 1 5.735 1 7.5c0 1.765.007 1.987.04 2.68c.03.692.14 1.164.301 1.578c.164.434.42.826.75 1.151c.325.33.718.586 1.151.75c.414.16.886.27 1.578.302c.693.031.915.039 2.68.039c1.765 0 1.987-.008 2.68-.04c.692-.03 1.164-.14 1.578-.301a3.323 3.323 0 0 0 1.151-.75ZM2 6.735v1.53c-.002.821-.002 1.034.02 1.5c.026.586.058 1.016.156 1.34c.094.312.199.63.543 1.012c.344.383.675.556 1.097.684c.423.127.954.154 1.415.175c.522.024.73.024 1.826.024H8.24c.842.001 1.054.002 1.526-.02c.585-.027 1.015-.059 1.34-.156c.311-.094.629-.2 1.011-.543c.383-.344.556-.676.684-1.098c.127-.422.155-.953.176-1.414C13 9.247 13 9.04 13 7.947v-.89c0-1.096 0-1.303-.023-1.826c-.021-.461-.049-.992-.176-1.414c-.127-.423-.3-.754-.684-1.098c-.383-.344-.7-.449-1.011-.543c-.325-.097-.755-.13-1.34-.156A27.29 27.29 0 0 0 8.24 2H7.057c-1.096 0-1.304 0-1.826.023c-.461.021-.992.049-1.415.176c-.422.128-.753.301-1.097.684c-.344.383-.45.7-.543 1.012c-.098.324-.13.754-.156 1.34c-.022.466-.022.679-.02 1.5ZM7.5 5.25a2.25 2.25 0 1 0 0 4.5a2.25 2.25 0 0 0 0-4.5ZM4.25 7.5a3.25 3.25 0 1 1 6.5 0a3.25 3.25 0 0 1-6.5 0Zm6.72-2.72a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5Z" clip-rule="evenodd"/></svg> instagram: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path fill="currentColor" fill-rule="evenodd" d="M12.91 12.909c.326-.327.582-.72.749-1.151c.16-.414.27-.886.302-1.578c.032-.693.04-.915.04-2.68c0-1.765-.008-1.987-.04-2.68c-.032-.692-.142-1.164-.302-1.578a3.185 3.185 0 0 0-.75-1.151a3.187 3.187 0 0 0-1.151-.75c-.414-.16-.886-.27-1.578-.302C9.487 1.007 9.265 1 7.5 1c-1.765 0-1.987.007-2.68.04c-.692.03-1.164.14-1.578.301a3.2 3.2 0 0 0-1.151.75a3.2 3.2 0 0 0-.75 1.151c-.16.414-.27.886-.302 1.578C1.007 5.513 1 5.735 1 7.5c0 1.765.007 1.987.04 2.68c.03.692.14 1.164.301 1.578c.164.434.42.826.75 1.151c.325.33.718.586 1.151.75c.414.16.886.27 1.578.302c.693.031.915.039 2.68.039c1.765 0 1.987-.008 2.68-.04c.692-.03 1.164-.14 1.578-.301a3.323 3.323 0 0 0 1.151-.75ZM2 6.735v1.53c-.002.821-.002 1.034.02 1.5c.026.586.058 1.016.156 1.34c.094.312.199.63.543 1.012c.344.383.675.556 1.097.684c.423.127.954.154 1.415.175c.522.024.73.024 1.826.024H8.24c.842.001 1.054.002 1.526-.02c.585-.027 1.015-.059 1.34-.156c.311-.094.629-.2 1.011-.543c.383-.344.556-.676.684-1.098c.127-.422.155-.953.176-1.414C13 9.247 13 9.04 13 7.947v-.89c0-1.096 0-1.303-.023-1.826c-.021-.461-.049-.992-.176-1.414c-.127-.423-.3-.754-.684-1.098c-.383-.344-.7-.449-1.011-.543c-.325-.097-.755-.13-1.34-.156A27.29 27.29 0 0 0 8.24 2H7.057c-1.096 0-1.304 0-1.826.023c-.461.021-.992.049-1.415.176c-.422.128-.753.301-1.097.684c-.344.383-.45.7-.543 1.012c-.098.324-.13.754-.156 1.34c-.022.466-.022.679-.02 1.5ZM7.5 5.25a2.25 2.25 0 1 0 0 4.5a2.25 2.25 0 0 0 0-4.5ZM4.25 7.5a3.25 3.25 0 1 1 6.5 0a3.25 3.25 0 0 1-6.5 0Zm6.72-2.72a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5Z" clip-rule="evenodd"/></svg>
facebook: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95z"/></svg> facebook: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95z"/></svg>
discord: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"></path></svg> discord: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"></path></svg>
twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"></path></svg> twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"></path></svg>
mastodon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"></path></svg> mastodon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"></path></svg>
youtube: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104l.022.26l.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105l-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006l-.087-.004l-.171-.007l-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103l.003-.052l.008-.104l.022-.26l.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007l.172-.006l.086-.003l.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z"/></svg> youtube: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104l.022.26l.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105l-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006l-.087-.004l-.171-.007l-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103l.003-.052l.008-.104l.022-.26l.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007l.172-.006l.086-.003l.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z"/></svg>
x-twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg> x-twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg>

23
dev.toml Normal file
View File

@ -0,0 +1,23 @@
# Theme development config for exampleSite
# https://gohugo.io/getting-started/configuration/#configure-cache-busters
[build]
[build.buildStats]
enable = true
disableIDs = true
[[build.cachebusters]]
source = 'assets/watching/hugo_stats\.json'
target = 'styles\.css'
[[build.cachebusters]]
source = '(postcss|tailwind)\.config\.js'
target = 'css'
[[build.cachebusters]]
source = 'assets/.*\.(js|ts|jsx|tsx)'
target = 'js'
[[build.cachebusters]]
source = 'assets/.*\.(.*)$'
target = '$1'
[module]
[[module.mounts]]
source = "hugo_stats.json"
target = "assets/watching/hugo_stats.json"

View File

@ -1,4 +1,4 @@
--- ---
title: Hextra Theme title: Hextra Theme
toc: false layout: hextra-home
--- ---

View File

@ -0,0 +1,20 @@
---
title: "このサイトについて"
toc: false
---
Hextraは、現代的な静的ウェブサイトを構築するためのシンプルで高速で柔軟なテーマとして設計されています。特にドキュメンテーションウェブサイトに適していますが、ブログ、ポートフォリオなどのさまざまなタイプのサイトにも使用できます。
Hugoは、Jekyllと同様に静的サイトジェネレーターです。Hugoの特徴は、単一のバイナリであることで、さまざまなプラットフォームで簡単にインストールして実行できることです。また、数千ページのサイトをミリ秒単位でレンダリングできるほど非常に高速で信頼性があります。
Hextraは、最小限のフットプリントに焦点を当てた考え方で構築されています。始めるためには、Node.jsのような追加の依存関係は必要ありません。必要なのは、単一のYAML設定ファイルと、Markdownのコンテンツだけです。そのため、ツールのセットアップではなく、質の高いコンテンツの作成に集中できます。
## クレジット
Hextraをビルドするには、次のツールとインスピレーションが必要です
- [Hugo](https://gohugo.io/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Heroicons](https://heroicons.com/)
- [Nextra](https://nextra.vercel.app/)
- [Next.js](https://nextjs.org/)

View File

@ -3,4 +3,18 @@ title: About
toc: false toc: false
--- ---
This is the about page. Hextra is designed to be a simple, fast, and flexible theme for building modern static websites. It is especially well-suited for documentation websites but can also be used for various types of sites, such as blogs, portfolios, and more.
Hugo, like Jekyll, is a static site generator. What sets Hugo apart is that it is a single binary, making it easy to install and run on various platforms. It is also extremely fast and reliable, capable of rendering a site with thousands of pages in milliseconds.
Hextra is built with a mindset focused on having a minimal footprint. To get started, no extra dependencies like Node.js packages are required; all you need is a single YAML configuration file, along with your Markdown content. Thus, we can focus on writing quality content instead of setting up tooling.
## Credits
Hextra cannot be built without the following tools and inspirations:
- [Hugo](https://gohugo.io/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Heroicons](https://heroicons.com/)
- [Nextra](https://nextra.vercel.app/)
- [Next.js](https://nextjs.org/)

View File

@ -0,0 +1,20 @@
---
title: 关于
toc: false
---
Hextra 是一款简洁、快速、灵活的主题适用于构建现代化静态站点。Hextra 特别适用于文档网站,但也可用于构建博客、个人网站等各种类型的网站。
Hugo 和 Jekyll 类似是一个静态网站生成器。但与其他生成器不同Hugo 只有单个可执行文件这使得它可以轻松地在各种平台上安装和运行。Hugo 的运行速度非常快且可靠性高,能够在几毫秒内渲染数千页的网站。
Hextra 被设计为轻量级,具有最小化的内存占用。使用 Hextra 无需安装繁杂的依赖,比如 Node.js相反你只需要一个简单的 YAML 配置文件和 Markdown 内容。因此,我们可以专注于内容而非在配置环境上浪费精力。
## 鸣谢
Hextra 的设计离不开这些项目的支持和其提供的灵感:
- [Hugo](https://gohugo.io/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Heroicons](https://heroicons.com/)
- [Nextra](https://nextra.vercel.app/)
- [Next.js](https://nextjs.org/)

View File

@ -0,0 +1,3 @@
---
title: "博客"
---

View File

@ -0,0 +1,137 @@
---
title: Markdown 语法指南
date: 2020-01-01
authors:
- name: John Doe
link: https://example.com/johndoe
excludeSearch: true
---
这篇文章提供了一些基础的 Markdown 语法样例,这些可以在 Hugo 的内容文件中使用。
<!--more-->
## 基础语法
### 标题
```
# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题
```
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题
```text
*这段文字将是斜体*
_这也将是斜体_
**这段文字将是粗体**
__这也将是粗体__
_你 **可以** 组合它们_
```
*这段文字将是斜体*
_这也将是斜体_
**这段文字将是粗体**
__这也将是粗体__
_你 **可以** 组合它们_
### 列表
#### 无序列表
* 项目 1
* 项目 2
* 项目 2a
* 项目 2b
#### 有序列表
1. 项目 1
2. 项目 2
3. 项目 3
1. 项目 3a
2. 项目 3b
### 图片
```markdown
![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
```
![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
### 链接
```markdown
[Hugo](https://gohugo.io)
```
[Hugo](https://gohugo.io)
### 块引用
```markdown
牛顿曾说:
> 如果我看得更远,那是因为我站在巨人的肩膀上。
```
> 如果我看得更远,那是因为我站在巨人的肩膀上。
### 行内代码
```markdown
行内 `代码``反引号` 包围。
```
行内 `代码``反引号` 包围。
### 代码块
#### 语法高亮
````markdown
```go
func main() {
fmt.Println("Hello World")
}
```
````
```go
func main() {
fmt.Println("Hello World")
}
```
### 表格
```markdown
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
```
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
## 参考
- [Markdown Syntax](https://www.markdownguide.org/basic-syntax/)
- [Hugo Markdown](https://gohugo.io/content-management/formats/#markdown)

View File

@ -3,7 +3,15 @@ linkTitle: "ドキュメンテーション"
title: Hextraへようこそ title: Hextraへようこそ
--- ---
**Hextra**は、[Tailwind CSS](https://tailwindcss.com/)で構築された、モダンでレスポンシブでパワフルな[Hugo](https://gohugo.io/)テーマです。 👋 こんにちはHextraドキュメンテーションへようこそ
[Next.js](https://nextjs.org/)テーマの[Nextra](https://github.com/shuding/nextra)にインスパイアされています。
## クイックスタート <!--more-->
## Hextraとは
Hextraは、[Hugo][hugo]テーマの一つで、[Tailwind CSS][tailwind-css]を使用して作られた、現代的で高速なバッテリー内蔵のテーマです。
ドキュメンテーション、ブログ、ウェブサイトの美しいウェブサイトを構築するために設計され、様々な要件に対応するための機能と柔軟性を提供します。
[hugo]: https://gohugo.io/
[flex-search]: https://github.com/nextapps-de/flexsearch
[tailwind-css]: https://tailwindcss.com/

View File

@ -5,6 +5,8 @@ title: Introduction
👋 Hello! Welcome to the Hextra documentation! 👋 Hello! Welcome to the Hextra documentation!
<!--more-->
## What is Hextra? ## What is Hextra?
Hextra is a modern, fast and batteries-included [Hugo][hugo] theme built with [Tailwind CSS][tailwind-css]. Hextra is a modern, fast and batteries-included [Hugo][hugo] theme built with [Tailwind CSS][tailwind-css].
@ -12,12 +14,12 @@ Designed for building beautiful websites for documentation, blogs and websites,
## Features ## Features
- **Beautiful Design** - Inspired by Nextra, it uses Tailwind CSS to provide a modern design that makes your site look outstanding. - **Beautiful Design** - Inspired by Nextra, Hextra utilizes Tailwind CSS to offer a modern design that makes your site look outstanding.
- **Responsive Layout and Dark Mode** - It looks great on all devices, from mobile, tablet to desktop. Dark mode is also supported to accomodate various lighting conditions. - **Responsive Layout and Dark Mode** - It looks great on all devices, from mobile, tablet to desktop. Dark mode is also supported to accomodate various lighting conditions.
- **Fast and Lightweight** - Powered by Hugo, a lightning-fast static-site generator within a single binary file, Hextra keeps its footprint minimal. No Javascript or Node.js are needed to use it. - **Fast and Lightweight** - Powered by Hugo, a lightning-fast static-site generator housed in a single binary file, Hextra keeps its footprint minimal. No Javascript or Node.js are needed to use it.
- **Full-text Search** - Built-in offline full-text search powered by [FlexSearch][flex-search]. No configuration is required. - **Full-text Search** - Built-in offline full-text search powered by FlexSearch, no additional configuration required.
- **Battery-included** - Markdown, syntax highlighting, LaTeX math formulae, diagrams and [Shortcodes](guide/shortcodes) elements to enhance your content. Table of contents, breadcumbs, pagination, sidebar navigation and more are all automatically generated. - **Battery-included** - Markdown, syntax highlighting, LaTeX math formulae, diagrams and Shortcodes elements to enhance your content. Table of contents, breadcumbs, pagination, sidebar navigation and more are all automatically generated.
- **Multi-language and SEO Ready** - Multi-language sites made easy with Hugo's multilingual mode. Out of the box support for SEO tags, Open Graph, and Twitter Cards. - **Multi-language and SEO Ready** - Multi-language sites made easy with Hugo's multilingual mode. Out-of-the-box support is included for SEO tags, Open Graph, and Twitter Cards.
## Questions or Feedback? ## Questions or Feedback?

View File

@ -0,0 +1,40 @@
---
linkTitle: "文档"
title: 介绍
---
👋 你好!欢迎来到 Hextra 文档!
<!--more-->
## Hextra 是什么?
Hextra 是一款现代、快速且内置丰富功能的 [Hugo][hugo] 主题,它是用 [Tailwind CSS][tailwind-css] 构建的。该主题旨在创建美观的文档、博客和网站,提供了开箱即用的功能和灵活性以满足各种需求。
## 功能特点
- **优美的设计** - 受到 Nextra 的启发Hextra 利用 Tailwind CSS 提供了一种现代设计,使您的网站看起来出色。
- **响应式布局和深色模式** - 无论是在移动设备、平板还是桌面上,都表现出色。同时支持深色模式以适应各种光线条件。
- **快速和轻量级** - 由 Hugo 驱动一个轻量级且超快的静态网站生成器封装在一个单一的二进制文件中Hextra 保持其占用极小。使用它不需要 Javascript 或 Node.js。
- **全文搜索** - 内置的离线全文搜索由 FlexSearch 提供支持,无需额外配置。
- **功能全面** - 支持 Markdown、语法高亮、LaTeX 数学公式、图表以及 Shortcodes 元素以增强您的内容。目录、面包屑、分页、侧边栏导航等都会自动生成。
- **多语言和 SEO 支持** - Hugo 的多语言模式轻松支持多语言网站。对于 SEO 标签、Open Graph 和 Twitter 卡片,也提供了开箱即用的支持。
## 有问题或反馈?
{{< callout emoji="❓" >}}
Hextra 仍在积极开发中。
有问题或反馈?请随时[提出问题](https://github.com/imfing/hextra/issues)
{{< /callout >}}
## 接下来
直接进入以下部分开始:
{{< cards >}}
{{< card link="getting-started" title="入门指南" icon="document-text" subtitle="学习如何使用 Hextra 创建网站" >}}
{{< /cards >}}
[hugo]: https://gohugo.io/
[flex-search]: https://github.com/nextapps-de/flexsearch
[tailwind-css]: https://tailwindcss.com/

View File

@ -1,6 +1,8 @@
--- ---
linkTitle: Advanced linkTitle: Advanced
title: Advanced Topics title: Advanced Topics
prev: /docs/guide/shortcodes/tabs
next: /docs/advanced/multi-language
--- ---
This section covers some advanced topics of the theme. This section covers some advanced topics of the theme.

View File

@ -0,0 +1,15 @@
---
linkTitle: 高级配置
title: 高级配置
prev: /docs/guide/shortcodes/tabs
next: /docs/advanced/multi-language
---
此部分提供了 Hextra 的一些高级配置。
<!--more-->
{{< cards >}}
{{< card link="multi-language" title="多语言" icon="translate" >}}
{{< card link="customization" title="定制化" icon="pencil" >}}
{{< /cards >}}

View File

@ -0,0 +1,58 @@
---
title: 自定义 Hextra
linkTitle: 自定义
---
Hextra 在 `hugo.yaml` 中提供了一些自定义选项来配置主题。
本页介绍了可用选项以及如何进一步自定义主题。
<!--more-->
## 自定义 CSS
要添加自定义 CSS我们需要在站点中创建一个文件 `assets/css/custom.css`。Hextra 将自动加载该文件,比如自定义字体:
```css {filename="assets/css/custom.css"}
.content {
font-family: "Times New Roman", Times, serif;
}
```
### 主题色
主题色可以通过设置 `--primary-hue` 变量来自定义:
```css {filename="assets/css/custom.css"}
:root {
--primary-hue: 100deg;
}
```
### 代码高亮
代码高亮风格的详细信息可在 [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html) 中找到。 可以使用以下命令生成样式表:
```bash
$ hugo gen chromastyles --style=github
```
可将生成的样式添加到自定义 CSS 文件中以覆盖默认代码高亮样式。
## 自定义 Script
你可以添加以下文件以自定义 `script` 添加到每页的 `head` 最后:
```
layouts/partials/custom/head-end.html
```
## 自定义布局
可以在站点的 `layouts` 目录中创建同名文件来覆盖主题的默认布局。
例如,要覆盖文档的 `single.html` 布局,在站点中创建文件 `layouts/docs/single.html`。
如需或许更多信息,转至 [Hugo Templates](https://gohugo.io/templates/)。
## 进一步定制 Hextra
没有找到你想修改的东西?在 GitHub 上[创建 Issues](https://github.com/imfing/hextra/issues) 或为 Hextra 贡献你的智慧!

View File

@ -1,6 +1,7 @@
--- ---
title: "Multi-language" title: "Multi-language"
weight: 1 weight: 1
prev: /docs/advanced
--- ---
Hextra supports creating site with multiple languages using Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/). Hextra supports creating site with multiple languages using Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/).

View File

@ -0,0 +1,74 @@
---
title: "多语言"
weight: 1
prev: /docs/advanced
---
Hextra 支持使用 Hugo 的[多语言模式](https://gohugo.io/content-management/multilingual/) 创建多语言的网站。
<!--more-->
## 启用多语言支持
为了使我们的网站支持多语言,我们需要告诉 Hugo 需要支持的语言。 在站点配置文件中添加:
```yaml {filename="hugo.yaml"}
defaultContentLanguage: en
languages:
en:
languageName: English
weight: 1
fr:
languageName: Français
weight: 2
ja:
languageName: 日本語
weight: 3
```
## 按文件名管理翻译
Hugo 支持按文件名管理翻译。例如,如果我们有一个英文文件 `content/docs/_index.md`,我们可以创建一个翻译为法语的文件 `content/docs/_index.fr.md`。
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" state="open" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="_index.fr.md" >}}
{{< filetree/file name="_index.ja.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
注意Hugo 还支持[按内容目录管理翻译](https://gohugo.io/content-management/multilingual/#translation-by-content-directory)。
## 翻译菜单项
要翻译导航栏中的菜单项,我们需要设置 `identifier` 字段:
```yaml {filename="hugo.yaml"}
menu:
main:
- identifier: documentation
name: Documentation
pageRef: /docs
weight: 1
- identifier: blog
name: Blog
pageRef: /blog
weight: 2
```
## 翻译字符串
要翻译其他地方的字符串,我们需要将翻译添加到相应的 `i18n` 文件中:
```yaml {filename="i18n/fr.yaml"}
readMore: Lire la suite
```
## 更多参考
- [Hugo Multilingual Mode](https://gohugo.io/content-management/multilingual/)
- [Hugo Multilingual Part 1: Content translation](https://www.regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/)
- [Hugo Multilingual Part 2: Strings localization](https://www.regisphilibert.com/blog/2018/08/hugo-multilingual-part-2-i18n-string-localization/)

View File

@ -5,6 +5,18 @@ next: /docs/guide
prev: /docs prev: /docs
--- ---
## Quick Start from Template
{{< icon "github" >}}&nbsp;[imfing/hextra-starter-template](https://github.com/imfing/hextra-starter-template)
You will be able to quickly get started by using the above template repository.
<img src="https://docs.github.com/assets/cb-77734/mw-1440/images/help/repository/use-this-template-button.webp" width="500">
We have provided a [GitHub Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow) which can help automatically build and deploy your site to GitHub Pages, and host it for free.
[🌐 Demo ↗](https://imfing.github.io/hextra-starter-template/)
## Start as New Project ## Start as New Project
### Prerequisites ### Prerequisites
@ -53,7 +65,7 @@ $ hugo new content/docs/_index.md
### Preview the site locally ### Preview the site locally
```shell ```shell
$ hugo server $ hugo server --buildDrafts --disableFastRender
``` ```
Voila! You can see your new site at `http://localhost:1313/`. Voila! You can see your new site at `http://localhost:1313/`.
@ -61,12 +73,27 @@ Voila! You can see your new site at `http://localhost:1313/`.
{{% /steps %}} {{% /steps %}}
## Update Theme
{{% details title="How to update theme?" %}}
To update the theme to the [latest released version](https://github.com/imfing/hextra/releases), run the following command:
```shell
$ hugo mod get -u
```
See [Hugo Modules](https://gohugo.io/hugo-modules/use-modules/#update-all-modules) for more details.
{{% /details %}}
## Next ## Next
Explore the following sections to start adding more contents: Explore the following sections to start adding more contents:
{{< cards >}} {{< cards >}}
{{< card link="organize-files" title="Organize Files" icon="document-duplicate" >}} {{< card link="../guide/organize-files" title="Organize Files" icon="document-duplicate" >}}
{{< card link="configuration" title="Configuration" icon="adjustments" >}} {{< card link="../guide/configuration" title="Configuration" icon="adjustments" >}}
{{< card link="markdown" title="Markdown" icon="markdown" >}} {{< card link="../guide/markdown" title="Markdown" icon="markdown" >}}
{{< /cards >}} {{< /cards >}}

View File

@ -0,0 +1,83 @@
---
title: 快速开始
weight: 1
next: /docs/guide
prev: /docs
---
## 使用模板快速开始
{{< icon "github" >}}&nbsp;[imfing/hextra-starter-template](https://github.com/imfing/hextra-starter-template)
通过使用上面的模板仓库,您将能够快速地开始。
<img src="https://docs.github.com/assets/cb-77734/mw-1440/images/help/repository/use-this-template-button.webp" width="500">
我们提供了一个 [GitHub Actions 工作流](https://docs.github.com/cn/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow),它可以帮助您自动构建并部署您的网站到 GitHub Pages并免费托管。
[🌐 演示 ↗](https://imfing.github.io/hextra-starter-template/)
## 作为新项目开始
### 前提条件
在开始之前,请确保我们已经安装了 [Hugo](https://gohugo.io/)。
请参考 Hugo 的[官方安装指南](https://gohugo.io/installation/)以获取更多详情。
[Hugo 模块](https://gohugo.io/hugo-modules/)是管理 Hugo 主题的推荐方式。要使用 Hugo 模块,我们需要安装 [Git](https://git-scm.com/) 和 [Go](https://go.dev/)。
{{% steps %}}
### 初始化 Hugo 站点
```bash
$ hugo new site my-site --format=yaml
```
### 通过模块配置 Hextra 主题
```shell
# 初始化 Hugo 模块
$ cd my-site
$ hugo mod init github.com/username/my-site
# 添加 Hextra
$ hugo mod get github.com/imfing/hextra
```
编辑 `hugo.yaml` 以启用 Hextra
```yaml
module:
imports:
- path: github.com/imfing/hextra
```
### 创建你的第一个内容页
让我们为主页和文档页面创建一个新的内容页面:
```shell
$ hugo new content/_index.md
$ hugo new content/docs/_index.md
```
### 在本地预览站点
```shell
$ hugo server --buildDrafts --disableFastRender
```
瞧!你现在可以在 `http://localhost:1313/` 看到你的新站点。
{{% /steps %}}
## 接下来
你可以探索以下部分来添加更多内容:
{{< cards >}}
{{< card link="../guide/organize-files" title="目录结构" icon="document-duplicate" >}}
{{< card link="../guide/configuration" title="配置文件指南" icon="adjustments" >}}
{{< card link="../guide/markdown" title="Markdown" icon="markdown" >}}
{{< /cards >}}

View File

@ -1,6 +1,7 @@
--- ---
title: Guide title: Guide
weight: 2 weight: 2
prev: /docs/getting-started
next: /docs/guide/organize-files next: /docs/guide/organize-files
sidebar: sidebar:
open: true open: true
@ -8,6 +9,8 @@ sidebar:
Explore the following sections to learn to compose content using Hextra: Explore the following sections to learn to compose content using Hextra:
<!--more-->
{{< cards >}} {{< cards >}}
{{< card link="organize-files" title="Organize Files" icon="document-duplicate" >}} {{< card link="organize-files" title="Organize Files" icon="document-duplicate" >}}
{{< card link="configuration" title="Configuration" icon="adjustments" >}} {{< card link="configuration" title="Configuration" icon="adjustments" >}}

View File

@ -0,0 +1,22 @@
---
title: 指南
weight: 2
prev: /docs/getting-started
next: /docs/guide/organize-files
sidebar:
open: true
---
探索以下各节以学习如何使用 Hextra 编写内容:
<!--more-->
{{< cards >}}
{{< card link="organize-files" title="目录结构" icon="document-duplicate" >}}
{{< card link="configuration" title="配置" icon="adjustments" >}}
{{< card link="markdown" title="Markdown" icon="markdown" >}}
{{< card link="syntax-highlighting" title="代码高亮" icon="sparkles" >}}
{{< card link="latex" title="LaTeX 公式" icon="variable" >}}
{{< card link="diagrams" title="图表" icon="chart-square-bar" >}}
{{< card link="shortcodes" title="短代码" icon="template" >}}
{{< /cards >}}

View File

@ -7,6 +7,8 @@ Hugo reads its configuration from `hugo.yaml` in the root of your Hugo site.
The config file is where you can configure all aspects of your site. The config file is where you can configure all aspects of your site.
You can find the config file for this site in `exampleSite/hugo.yaml` as a good starting point. You can find the config file for this site in `exampleSite/hugo.yaml` as a good starting point.
<!--more-->
## Navigation ## Navigation
### Menu ### Menu
@ -63,6 +65,24 @@ There are different types of menu items:
These menu items can be sorted by setting the `weight` parameter. These menu items can be sorted by setting the `weight` parameter.
### Logo and Title
To modify the default logo, edit `hugo.yaml` and add the path to your logo file under `static` directory.
Optionally, you can change the link that users are redirected to when clicking on your logo, as well as set the width & height of the logo in pixels.
```yaml {filename="hugo.yaml"}
params:
navbar:
displayTitle: true
displayLogo: true
logo:
path: images/logo.svg
dark: images/logo-dark.svg
link: /
width: 40
height: 20
```
## Sidebar ## Sidebar
### Main Sidebar ### Main Sidebar
@ -122,3 +142,41 @@ params:
editURL: "https://example.com/edit/this/page" editURL: "https://example.com/edit/this/page"
--- ---
``` ```
## Footer
### Copyright
To modify the copyright text displayed in your website's footer, you'll need to create a file named `i18n/en.yaml`.
In this file, specify your new copyright text as shown below:
```yaml {filename="i18n/en.yaml"}
copyright: "© 2023 YOUR TEXT HERE"
```
For your reference, an example [`i18n/en.yaml`](https://github.com/imfing/hextra/blob/main/i18n/en.yaml) file can be found in the GitHub repository. Additionally, you could use Markdown format in the copyright text.
## Others
### Favicon
To customize the [favicon](https://en.wikipedia.org/wiki/Favicon) for your site, place icon files under the `static` folder to override the [default favicons from the theme](https://github.com/imfing/hextra/tree/main/static):
{{< filetree/container >}}
{{< filetree/folder name="static" >}}
{{< filetree/file name="android-chrome-192x192.png" >}}
{{< filetree/file name="android-chrome-512x512.png" >}}
{{< filetree/file name="apple-touch-icon.png" >}}
{{< filetree/file name="favicon-16x16.png" >}}
{{< filetree/file name="favicon-32x32.png" >}}
{{< filetree/file name="favicon-dark.svg" >}}
{{< filetree/file name="favicon.ico" >}}
{{< filetree/file name="favicon.svg" >}}
{{< filetree/file name="site.webmanifest" >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
Include both `favicon.ico` and `favicon.svg` files in your project to ensure your site's favicons display correctly.
While `favicon.ico` is generally for older browsers, `favicon.svg` is supported by modern ones. The optional `favicon-dark.svg` can be included for a tailored experience in dark mode.
Feel free to use tools like [favicon.io](https://favicon.io/) or [favycon](https://github.com/ruisaraiva19/favycon) to generate these icons.

View File

@ -0,0 +1,125 @@
---
title: 配置文件
weight: 2
---
Hugo 从 Hugo 网站根目录下的 `hugo.yaml` 读取配置。
在配置文件中,您可以配置站点的所有选项。
你可以在 `exampleSite/hugo.yaml` 中找到此站点的配置文件作为开始。
<!--more-->
## 导航栏
### 菜单
右上角的菜单在配置文件的 `menu.main` 中配置:
```yaml {filename="hugo.yaml"}
menu:
main:
- name: Documentation
pageRef: /docs
weight: 1
- name: Blog
pageRef: /blog
weight: 2
- name: About
pageRef: /about
weight: 3
- name: Search
weight: 4
params:
type: search
- name: GitHub
weight: 5
url: "https://github.com/imfing/hextra"
params:
icon: github
```
有几种不同类型的菜单项:
1. Link to a page in the site with `pageRef`
```yaml
- name: Documentation
pageRef: /docs
```
2. Link to an external URL with `url`
```yaml
- name: GitHub
url: "https://github.com"
```
3. Search bar with `type: search`
```yaml
- name: Search
params:
type: search
```
4. Icon
```yaml
- name: GitHub
params:
icon: github
```
这些菜单项可以通过设置 `weight` 进行排序。
## 侧边栏
### 主侧边栏
主侧边栏是自动从 `content` 目录结构生成的。
有关更多详细信息,转至 [目录结构](/docs/guide/organize-files)。
### 额外链接
侧边栏的额外链接在配置文件的 `menu.sidebar` 部分中配置:
```yaml {filename="hugo.yaml"}
menu:
sidebar:
- name: More
params:
type: separator
weight: 1
- name: "About"
pageRef: "/about"
weight: 2
- name: "Hugo Docs ↗"
url: "https://gohugo.io/documentation/"
weight: 3
```
## 右侧边栏
### 目录
目录是根据内容文件中的标题自动生成的,可以在 `front matter` 设置 `tocfalse` 来禁用它。
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
toc: false
---
```
### 编辑此页链接
要配置编辑此页链接,我们可以在配置文件中设置 `params.editURL.base`
```yaml {filename="hugo.yaml"}
params:
editURL:
base: "https://github.com/your-username/your-repo/edit/main"
```
将为每个页面自动生成编辑链接。
如需为特定页面设置编辑链接,可以在页面的 `front matter` 中设置 `params.editURL`
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
params:
editURL: "https://example.com/edit/this/page"
---
```

View File

@ -1,6 +1,7 @@
--- ---
title: Diagrams title: Diagrams
weight: 6 weight: 6
next: /docs/guide/shortcodes
--- ---
Currently, Hextra supports [Mermaid](#mermaid) for diagrams. Currently, Hextra supports [Mermaid](#mermaid) for diagrams.

View File

@ -0,0 +1,53 @@
---
title: 图表
weight: 6
next: /docs/guide/shortcodes
---
目前Hextra 支持 [Mermain](#mermaid) 的图表。
<!--more-->
## Mermaid
[Mermaid](https://github.com/mermaid-js/mermaid#readme) 是一个基于 JavaScript 的图表绘制工具,它的文本定义和 Markdown 类似,可在浏览器中动态创建图表。例如:流程图、序列图、饼图等。
在 Hextra 中使用 Mermain 就像使用代码块一样简单:
````markdown
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
````
将呈现为:
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
Sequence diagram
```mermaid
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
如需获取更多信息,转至 [Mermaid Documentation](https://mermaid-js.github.io/mermaid/#/)。

View File

@ -6,6 +6,8 @@ math: true
$\KaTeX$ is used for rendering LaTeX math expressions. It can be enabled per page by setting `math` to `true` in the page front matter. $\KaTeX$ is used for rendering LaTeX math expressions. It can be enabled per page by setting `math` to `true` in the page front matter.
<!--more-->
```yaml {filename="Markdown"} ```yaml {filename="Markdown"}
--- ---
title: "My Page with LaTeX" title: "My Page with LaTeX"

View File

@ -0,0 +1,59 @@
---
title: "LaTeX 公式"
weight: 4
math: true
---
$\KaTeX$ 用于呈现 LaTeX 数学表达式。可在 `frontmatter``math` 设置为 `true` 来启用。
<!--more-->
```yaml {filename="Markdown"}
---
title: "My Page with LaTeX"
math: true
---
```
启用后KaTeX 中的脚本,样式表和字体将自动包含在你的网站中。这样就可以在 Markdown 内容中使用 LaTeX 数学表达式。
## 示例
Markdown 内容支持行内和独立段落的 LaTeX 数学表达式。
### 行内
```markdown {filename="page.md"}
This $\sigma(z) = \frac{1}{1 + e^{-z}}$ is inline.
```
This $\sigma(z) = \frac{1}{1 + e^{-z}}$ is inline.
### 独立段落
```markdown {filename="page.md"}
$$F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t} \, dt$$
```
将被渲染为:
$$F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t} \, dt$$
## 支持的功能
有关支持的符号列表,转至 [KaTeX 支持的公式](https://katex.org/docs/supported.html)。
## 化学表达式
通过 [mhchem](https://mhchem.github.io/MathJax-mhchem/) 支持化学表达式。
行内:$\ce{H2O}$ 是水。
独立段落:
```markdown {filename="page.md"}
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
```
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$

View File

@ -46,7 +46,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-
### Code Blocks ### Code Blocks
{{< cards >}} {{< cards >}}
{{< card link="syntax-highlighting" title="Syntax Highlighting" icon="sparkles" >}} {{< card link="../../guide/syntax-highlighting" title="Syntax Highlighting" icon="sparkles" >}}
{{< /cards >}} {{< /cards >}}
### Lists ### Lists

View File

@ -0,0 +1,105 @@
---
title: Markdown
weight: 2
---
Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容,创建列表等。本页将向你展示一些最常见的 Markdown 语法示例。
<!--more-->
## Markdown 示例
### 文本样式
| Style | Syntax | Example | Output |
| -------- | -------- | ------ | ------ |
| Bold | `**bold text**` | `**bold text**` | **bold text** |
| Italic | `*italicized text*` | `*italicized text* | *italicized text* |
| Strikethrough | `~~strikethrough text~~` | `~~strikethrough text~~` | ~~strikethrough text~~ |
| Subscript | `<sub></sub>` | `This is a <sub>subscript</sub> text` | This is a <sub>subscript</sub> text |
| Superscript | `<sup></sup>` | `This is a <sup>superscript</sup> text` | This is a <sup>superscript</sup> text |
### 引用
带角标的块引用:
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
### 表格
表格并非核心 Markdown 规范,但 Hugo 支持开箱即用的表格:
Name | Age
--------|------
Bob | 27
Alice | 23
#### Markdown 表格中的内联
| Italics | Bold | Code |
| -------- | -------- | ------ |
| *italics* | **bold** | `code` |
### 代码块
{{< cards >}}
{{< card link="../../guide/syntax-highlighting" title="Syntax Highlighting" icon="sparkles" >}}
{{< /cards >}}
### 列表
#### 有序列表
1. First item
2. Second item
3. Third item
#### 无序列表
* List item
* Another item
* And another item
#### 嵌套列表
* Fruit
* Apple
* Orange
* Banana
* Dairy
* Milk
* Cheese
### 图片
![](https://source.unsplash.com/featured/800x600?landscape)
带有标题:
![](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape")
## 配置
Hugo 使用 [Goldmark](https://github.com/yuin/goldmark) 解析 Markdown。
Markdown 渲染可以在 `hugo.yaml` 中的 `markup.goldmark` 中配置。以下是Hextra的默认配置
```yaml {filename="hugo.yaml"}
markup:
goldmark:
renderer:
unsafe: true
highlight:
noClasses: false
```
如需了解更多选项,转至 [Configure Markup](https://gohugo.io/getting-started/configuration-markup/)。
## 参考资料
* [Markdown Guide](https://www.markdownguide.org/)
* [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
* [Markdown Tutorial](https://www.markdowntutorial.com/)
* [Markdown Reference](https://commonmark.org/help/)

View File

@ -1,6 +1,7 @@
--- ---
title: Organize Files title: Organize Files
weight: 1 weight: 1
prev: /docs/guide
--- ---
## Directory Structure ## Directory Structure
@ -8,6 +9,8 @@ weight: 1
By default, Hugo searches for Markdown files in the `content` directory, and the structure of the directory determines the final output structure of your website. By default, Hugo searches for Markdown files in the `content` directory, and the structure of the directory determines the final output structure of your website.
Take the example site as an example: Take the example site as an example:
<!--more-->
{{< filetree/container >}} {{< filetree/container >}}
{{< filetree/folder name="content" >}} {{< filetree/folder name="content" >}}
{{< filetree/file name="_index.md" >}} {{< filetree/file name="_index.md" >}}

View File

@ -0,0 +1,65 @@
---
title: 目录结构
weight: 1
prev: /docs/guide
---
## 目录结构
默认情况下Hugo 在 `context` 目录中搜索 Markdown 文件,目录的结构决定了网站的最终输出结构。
以示例网站为例:
<!--more-->
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/folder name="docs" state="open" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="getting-started.md" >}}
{{< filetree/folder name="guide" state="open" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="organize-files.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< filetree/folder name="blog" state="open" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="post-1.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
每个 `_index.md` 文件都是相应部分的索引页,其他 Markdown 文件则是常规页面。
```
content
├── _index.md // <- /
├── docs
│ ├── _index.md // <- /docs/
│ ├── getting-started.md // <- /docs/getting-started/
│ └── guide
│ ├── _index.md // <- /docs/guide/
│ └── organize-files.md // <- /docs/guide/organize-files/
└── blog
├── _index.md // <- /blog/
└── post-1.md // <- /blog/post-1/
```
## 侧边栏导航
侧边栏导航是根据内容组织的字母顺序自动生成的。要手动配置侧边栏顺序,可以在 Markdown 文件的 `frontmatter ` 中使用 `weight` 配置。
```yaml {filename="content/docs/guide/_index.md"}
---
title: Guide
weight: 2
---
```
{{< callout emoji="">}}
建议侧边栏不要太深。如果内容太多,请考虑 **将它们分成多个部分**。
{{< /callout >}}
## 配置内容目录
如果需要为的内容使用不同的目录,可以在站点配置文件中设置 [`contentDir`](https://gohugo.io/getting-started/configuration/#contentdir) 来实现。

View File

@ -1,6 +1,8 @@
--- ---
title: Shortcodes title: Shortcodes
weight: 9 weight: 9
prev: /docs/guide/diagrams
next: /docs/guide/shortcodes/callout
--- ---
[Hugo Shortcodes](https://gohugo.io/content-management/shortcodes/) are simple snippets inside your content files calling built-in or custom templates. [Hugo Shortcodes](https://gohugo.io/content-management/shortcodes/) are simple snippets inside your content files calling built-in or custom templates.
@ -9,8 +11,9 @@ Hextra provides a collection of beautiful shortcodes to enhance your content.
{{< cards >}} {{< cards >}}
{{< card link="callouts" title="Callouts" icon="warning" >}} {{< card link="callout" title="Callout" icon="warning" >}}
{{< card link="cards" title="Cards" icon="card" >}} {{< card link="cards" title="Cards" icon="card" >}}
{{< card link="details" title="Details" icon="chevron-right" >}}
{{< card link="filetree" title="FileTree" icon="folder-tree" >}} {{< card link="filetree" title="FileTree" icon="folder-tree" >}}
{{< card link="icon" title="Icon" icon="badge-check" >}} {{< card link="icon" title="Icon" icon="badge-check" >}}
{{< card link="steps" title="Steps" icon="one" >}} {{< card link="steps" title="Steps" icon="one" >}}

View File

@ -0,0 +1,19 @@
---
title: 短代码
weight: 9
prev: /docs/guide/diagrams
next: /docs/guide/shortcodes/callout
---
[Hugo 短代码](https://gohugo.io/content-management/shortcodes/) 是你的内容文件中调用内置或自定义模板的简单片段。
Hextra 提供了一系列美观的短代码以增强你的内容。
{{< cards >}}
{{< card link="callout" title="注意事项" icon="warning" >}}
{{< card link="cards" title="卡片" icon="card" >}}
{{< card link="filetree" title="文件树" icon="folder-tree" >}}
{{< card link="icon" title="图标" icon="badge-check" >}}
{{< card link="steps" title="步骤" icon="one" >}}
{{< card link="tabs" title="标签" icon="collection" >}}
{{< /cards >}}

View File

@ -1,10 +1,15 @@
--- ---
title: Callout Component title: Callout Component
linkTitle: Callout linkTitle: Callout
aliases:
- callouts
prev: /docs/guide/shortcodes
--- ---
A built-in component to show important information to the reader. A built-in component to show important information to the reader.
<!--more-->
## Example ## Example
{{< callout emoji="👾">}} {{< callout emoji="👾">}}

View File

@ -6,7 +6,7 @@ linkTitle: Cards
## Example ## Example
{{< cards >}} {{< cards >}}
{{< card link="/" title="Callout" icon="warning" >}} {{< card link="../callout" title="Callout" icon="warning" >}}
{{< card link="/" title="No Icon" >}} {{< card link="/" title="No Icon" >}}
{{< /cards >}} {{< /cards >}}
@ -19,7 +19,7 @@ linkTitle: Cards
``` ```
{{</* cards */>}} {{</* cards */>}}
{{</* card link="/" title="Callout" icon="warning" */>}} {{</* card link="../callout" title="Callout" icon="warning" */>}}
{{</* card link="/" title="No Icon" */>}} {{</* card link="/" title="No Icon" */>}}
{{</* /cards */>}} {{</* /cards */>}}
``` ```

View File

@ -0,0 +1,43 @@
---
title: Details
---
A built-in component to display a collapsible content.
<!--more-->
## Example
{{% details title="Details" %}}
This is the content of the details.
Markdown is **supported**.
{{% /details %}}
{{% details title="Click me to reveal" closed="true" %}}
This will be hidden by default.
{{% /details %}}
## Usage
````
{{%/* details title="Details" */%}}
This is the content of the details.
Markdown is **supported**.
{{%/* /details */%}}
````
````
{{%/* details title="Click me to reveal" closed="true" */%}}
This will be hidden by default.
{{%/* /details */%}}
````

View File

@ -29,6 +29,7 @@ Put Markdown h3 header within `steps` shortcode.
``` ```
{{%/* steps */%}} {{%/* steps */%}}
### Step 1 ### Step 1
This is the first step. This is the first step.
@ -36,5 +37,6 @@ This is the first step.
### Step 2 ### Step 2
This is the second step. This is the second step.
{{%/* /steps */%}} {{%/* /steps */%}}
``` ```

View File

@ -1,5 +1,6 @@
--- ---
title: Tabs title: Tabs
next: /docs/advanced/
--- ---
## Example ## Example
@ -49,3 +50,44 @@ The `YAML` tab will be selected by default.
{{< tab >}}**TOML**: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.{{< /tab >}} {{< tab >}}**TOML**: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.{{< /tab >}}
{{< /tabs >}} {{< /tabs >}}
### Use Markdown
Markdown syntax including code block is also supported:
````
{{</* tabs items="JSON,YAML,TOML" */>}}
{{</* tab */>}}
```json
{ "hello": "world" }
```
{{</* /tab */>}}
... add other tabs similarly
{{</* /tabs */>}}
````
{{< tabs items="JSON,YAML,TOML" >}}
{{< tab >}}
```json
{ "hello": "world" }
```
{{< /tab >}}
{{< tab >}}
```yaml
hello: world
```
{{< /tab >}}
{{< tab >}}
```toml
hello = "world"
```
{{< /tab >}}
{{< /tabs >}}

View File

@ -6,6 +6,8 @@ weight: 3
Hugo uses [Chroma](https://github.com/alecthomas/chroma), a general purpose syntax highlighter in pure Go, for syntax highlighting. Hugo uses [Chroma](https://github.com/alecthomas/chroma), a general purpose syntax highlighter in pure Go, for syntax highlighting.
It is recommended to use backticks for code blocks in Markdown content. For example: It is recommended to use backticks for code blocks in Markdown content. For example:
<!--more-->
````markdown {filename="Markdown"} ````markdown {filename="Markdown"}
```python ```python
def say_hello(): def say_hello():

View File

@ -0,0 +1,89 @@
---
title: "代码高亮"
weight: 3
---
Hugo 使用 [Chroma](https://github.com/alecthomas/chroma),一种纯 Golang 实现的代码高亮渲染器。
建议对 Markdown 内容中的代码块使用反引号,例如:
<!--more-->
````markdown {filename="Markdown"}
```python
def say_hello():
print("Hello!")
```
````
将呈现为:
```python
def say_hello():
print("Hello!")
```
## 特性
### 文件名
要向代码块添加文件名或标题,请设置 `filename`
````markdown {filename="Markdown"}
```python {filename="hello.py"}
def say_hello():
print("Hello!")
```
````
```python {filename="hello.py"}
def say_hello():
print("Hello!")
```
### 行号
如需设置行号,将 `linenos` 设置为 `table`,并将 `linenostart` 设置为起始行号:
````markdown {filename="Markdown"}
```python {linenos=table,linenostart=42}
def say_hello():
print("Hello!")
```
````
```python {linenos=table,linenostart=42}
def say_hello():
print("Hello!")
```
### 高亮行
显示高亮行,设置 `hl_lines` 为行号:
````markdown {filename="Markdown"}
```python {linenos=table,hl_lines=[2,4],linenostart=1,filename="hello.py"}
def say_hello():
print("Hello!")
def main():
say_hello()
```
````
```python {linenos=table,hl_lines=[2,4],linenostart=1,filename="hello.py"}
def say_hello():
print("Hello!")
def main():
say_hello()
```
### 复制按钮
默认情况下,代码块复制按钮已自动启用。
## 支持的编程语言
如需了解支持的编程语言,转至 [Chroma's documentation](https://github.com/alecthomas/chroma#supported-languages)。

View File

@ -5,7 +5,7 @@ title: "Hextra"
enableRobotsTXT: true enableRobotsTXT: true
enableGitInfo: true enableGitInfo: true
# enableEmoji: false # enableEmoji: false
# hasCJKLanguage: true hasCJKLanguage: true
outputs: outputs:
home: [HTML] home: [HTML]
@ -22,6 +22,10 @@ languages:
languageName: 日本語 languageName: 日本語
weight: 2 weight: 2
title: "Hextra テーマ" title: "Hextra テーマ"
zh-cn:
languageName: 简体中文
weight: 3
title: Hextra
module: module:
hugoVersion: hugoVersion:
@ -66,18 +70,23 @@ menu:
icon: github icon: github
sidebar: sidebar:
- name: More - identifier: more
name: More
params: params:
type: separator type: separator
weight: 1 weight: 1
- name: "About" - identifier: about
name: "About"
pageRef: "/about" pageRef: "/about"
weight: 2 weight: 2
- name: "Hugo Docs ↗" - identifier: hugoDocs
name: "Hugo Docs ↗"
url: "https://gohugo.io/documentation/" url: "https://gohugo.io/documentation/"
weight: 3 weight: 3
params: params:
description: Modern, responsive, batteries-included Hugo theme for creating beautiful static websites.
navbar: navbar:
displayTitle: true displayTitle: true
displayLogo: true displayLogo: true

View File

@ -11,6 +11,7 @@
"cite", "cite",
"code", "code",
"del", "del",
"details",
"div", "div",
"em", "em",
"figcaption", "figcaption",
@ -39,10 +40,12 @@
"path", "path",
"pre", "pre",
"script", "script",
"section",
"span", "span",
"strong", "strong",
"style", "style",
"sub", "sub",
"summary",
"sup", "sup",
"svg", "svg",
"table", "table",
@ -73,18 +76,32 @@
"active:shadow-sm", "active:shadow-sm",
"align-text-bottom", "align-text-bottom",
"appearance-none", "appearance-none",
"aspect-auto",
"before:absolute", "before:absolute",
"before:bg-glass-gradient",
"before:bg-gray-200", "before:bg-gray-200",
"before:content-[\"\"]", "before:content-[\"\"]",
"before:content-['#']", "before:content-['#']",
"before:content-['']",
"before:inline-block",
"before:inset-0",
"before:inset-y-1", "before:inset-y-1",
"before:mr-1",
"before:opacity-25", "before:opacity-25",
"before:pointer-events-none",
"before:transition-transform",
"before:w-px", "before:w-px",
"bg-black/[.05]", "bg-black/[.05]",
"bg-blue-100", "bg-blue-100",
"bg-clip-text",
"bg-gradient-to-b",
"bg-gradient-to-r",
"bg-gray-100", "bg-gray-100",
"bg-neutral-50",
"bg-orange-50", "bg-orange-50",
"bg-primary-100", "bg-primary-100",
"bg-primary-400",
"bg-primary-600",
"bg-primary-700/5", "bg-primary-700/5",
"bg-red-100", "bg-red-100",
"bg-transparent", "bg-transparent",
@ -140,6 +157,7 @@
"cursor-default", "cursor-default",
"cursor-pointer", "cursor-pointer",
"dark:before:bg-neutral-800", "dark:before:bg-neutral-800",
"dark:before:invert",
"dark:bg-blue-900/30", "dark:bg-blue-900/30",
"dark:bg-dark", "dark:bg-dark",
"dark:bg-dark/50", "dark:bg-dark/50",
@ -149,6 +167,7 @@
"dark:bg-orange-400/20", "dark:bg-orange-400/20",
"dark:bg-primary-300/10", "dark:bg-primary-300/10",
"dark:bg-primary-400/10", "dark:bg-primary-400/10",
"dark:bg-primary-600",
"dark:bg-red-900/30", "dark:bg-red-900/30",
"dark:bg-yellow-700/30", "dark:bg-yellow-700/30",
"dark:block", "dark:block",
@ -162,11 +181,16 @@
"dark:border-yellow-200/30", "dark:border-yellow-200/30",
"dark:contrast-more:border-neutral-400", "dark:contrast-more:border-neutral-400",
"dark:focus:bg-dark", "dark:focus:bg-dark",
"dark:focus:ring-primary-800",
"dark:from-gray-100",
"dark:hidden", "dark:hidden",
"dark:hover:bg-gray-100/5", "dark:hover:bg-gray-100/5",
"dark:hover:bg-neutral-700", "dark:hover:bg-neutral-700",
"dark:hover:bg-neutral-800",
"dark:hover:bg-neutral-900", "dark:hover:bg-neutral-900",
"dark:hover:bg-primary-100/5", "dark:hover:bg-primary-100/5",
"dark:hover:bg-primary-700",
"dark:hover:border-gray-600",
"dark:hover:border-neutral-500", "dark:hover:border-neutral-500",
"dark:hover:border-neutral-700", "dark:hover:border-neutral-700",
"dark:hover:border-neutral-800", "dark:hover:border-neutral-800",
@ -177,6 +201,7 @@
"dark:hover:text-gray-50", "dark:hover:text-gray-50",
"dark:hover:text-neutral-50", "dark:hover:text-neutral-50",
"dark:hover:text-white", "dark:hover:text-white",
"dark:opacity-80",
"dark:placeholder:text-gray-400", "dark:placeholder:text-gray-400",
"dark:ring-white/20", "dark:ring-white/20",
"dark:shadow-[0_-12px_16px_#111]", "dark:shadow-[0_-12px_16px_#111]",
@ -195,6 +220,7 @@
"dark:text-red-200", "dark:text-red-200",
"dark:text-slate-100", "dark:text-slate-100",
"dark:text-yellow-200", "dark:text-yellow-200",
"dark:to-gray-400",
"data-[state=closed]:hidden", "data-[state=closed]:hidden",
"data-[state=open]:hidden", "data-[state=open]:hidden",
"data-[state=selected]:block", "data-[state=selected]:block",
@ -208,6 +234,9 @@
"flex", "flex",
"flex-col", "flex-col",
"focus:bg-white", "focus:bg-white",
"focus:outline-none",
"focus:ring-4",
"focus:ring-primary-300",
"font-bold", "font-bold",
"font-extrabold", "font-extrabold",
"font-medium", "font-medium",
@ -217,21 +246,26 @@
"footnote-backref", "footnote-backref",
"footnote-ref", "footnote-ref",
"footnotes", "footnotes",
"from-gray-800",
"from-gray-900",
"gap-1", "gap-1",
"gap-2", "gap-2",
"gap-4", "gap-4",
"grid", "grid",
"grid-cols-1",
"group", "group",
"group-[.copied]/copybtn:block", "group-[.copied]/copybtn:block",
"group-[.copied]/copybtn:hidden", "group-[.copied]/copybtn:hidden",
"group-data-[theme=dark]:hidden", "group-data-[theme=dark]:hidden",
"group-data-[theme=light]:hidden", "group-data-[theme=light]:hidden",
"group-hover/code:opacity-100", "group-hover/code:opacity-100",
"group-open:before:rotate-90",
"group/code", "group/code",
"group/copybtn", "group/copybtn",
"grow", "grow",
"h-0", "h-0",
"h-16", "h-16",
"h-2",
"h-4", "h-4",
"h-5", "h-5",
"h-7", "h-7",
@ -250,9 +284,11 @@
"hover:bg-gray-100", "hover:bg-gray-100",
"hover:bg-gray-800/5", "hover:bg-gray-800/5",
"hover:bg-primary-50", "hover:bg-primary-50",
"hover:bg-primary-700",
"hover:bg-slate-50", "hover:bg-slate-50",
"hover:border-gray-200", "hover:border-gray-200",
"hover:border-gray-300", "hover:border-gray-300",
"hover:border-gray-400",
"hover:dark:bg-primary-500/10", "hover:dark:bg-primary-500/10",
"hover:dark:text-primary-600", "hover:dark:text-primary-600",
"hover:opacity-60", "hover:opacity-60",
@ -279,9 +315,14 @@
"justify-start", "justify-start",
"language-options", "language-options",
"language-switcher", "language-switcher",
"last-of-type:mb-0",
"leading-5", "leading-5",
"leading-6",
"leading-7", "leading-7",
"leading-tight", "leading-tight",
"left-[24px]",
"left-[36px]",
"lg:grid-cols-3",
"line-clamp-3", "line-clamp-3",
"list-none", "list-none",
"lntable", "lntable",
@ -307,14 +348,17 @@
"ltr:text-right", "ltr:text-right",
"m-[11px]", "m-[11px]",
"max-h-64", "max-h-64",
"max-h-[calc(100vh-4rem-env(safe-area-inset-bottom))]", "max-h-[calc(100vh-var(--navbar-height)-env(safe-area-inset-bottom))]",
"max-h-[min(calc(50vh-11rem-env(safe-area-inset-bottom)),400px)]", "max-h-[min(calc(50vh-11rem-env(safe-area-inset-bottom)),400px)]",
"max-lg:min-h-[340px]",
"max-md:[transform:translate3d(0,-100%,0)]", "max-md:[transform:translate3d(0,-100%,0)]",
"max-md:hidden", "max-md:hidden",
"max-md:min-h-[340px]",
"max-w-6xl", "max-w-6xl",
"max-w-[50%]", "max-w-[50%]",
"max-w-[90rem]", "max-w-[90rem]",
"max-w-[min(calc(100vw-2rem),calc(100%+20rem))]", "max-w-[min(calc(100vw-2rem),calc(100%+20rem))]",
"max-w-none",
"max-w-screen-xl", "max-w-screen-xl",
"max-xl:hidden", "max-xl:hidden",
"mb-10", "mb-10",
@ -323,11 +367,13 @@
"mb-2", "mb-2",
"mb-4", "mb-4",
"mb-8", "mb-8",
"md:aspect-[1.1/1]",
"md:h-[calc(100vh-var(--navbar-height)-var(--menu-height))]", "md:h-[calc(100vh-var(--navbar-height)-var(--menu-height))]",
"md:hidden", "md:hidden",
"md:inline-block", "md:inline-block",
"md:justify-start", "md:justify-start",
"md:max-h-[min(calc(100vh-5rem-env(safe-area-inset-bottom)),400px)]", "md:max-h-[min(calc(100vh-5rem-env(safe-area-inset-bottom)),400px)]",
"md:pt-12",
"md:px-12", "md:px-12",
"md:self-start", "md:self-start",
"md:shrink-0", "md:shrink-0",
@ -339,7 +385,6 @@
"md:w-64", "md:w-64",
"mermaid", "mermaid",
"min-h-[100px]", "min-h-[100px]",
"min-h-[calc(100vh-4rem)]",
"min-h-[calc(100vh-var(--navbar-height))]", "min-h-[calc(100vh-var(--navbar-height))]",
"min-w-0", "min-w-0",
"min-w-[18px]", "min-w-[18px]",
@ -362,6 +407,8 @@
"mx-auto", "mx-auto",
"my-1.5", "my-1.5",
"my-2", "my-2",
"nav-container",
"nav-container-blur",
"next-error-h1", "next-error-h1",
"no-underline", "no-underline",
"not-prose", "not-prose",
@ -378,10 +425,11 @@
"overflow-y-auto", "overflow-y-auto",
"overscroll-contain", "overscroll-contain",
"p-0.5", "p-0.5",
"p-1",
"p-1.5", "p-1.5",
"p-2", "p-2",
"p-4", "p-4",
"pb-6", "p-6",
"pb-8", "pb-8",
"pb-[env(safe-area-inset-bottom)]", "pb-[env(safe-area-inset-bottom)]",
"pb-px", "pb-px",
@ -409,12 +457,15 @@
"py-12", "py-12",
"py-2", "py-2",
"py-2.5", "py-2.5",
"py-3",
"py-4", "py-4",
"relative", "relative",
"right-0", "right-0",
"ring-1", "ring-1",
"ring-black/5", "ring-black/5",
"rounded", "rounded",
"rounded-3xl",
"rounded-full",
"rounded-lg", "rounded-lg",
"rounded-md", "rounded-md",
"rounded-sm", "rounded-sm",
@ -423,6 +474,7 @@
"rtl:-ml-4", "rtl:-ml-4",
"rtl:-rotate-180", "rtl:-rotate-180",
"rtl:before:right-0", "rtl:before:right-0",
"rtl:before:rotate-180",
"rtl:left-1.5", "rtl:left-1.5",
"rtl:left-3", "rtl:left-3",
"rtl:md:right-auto", "rtl:md:right-auto",
@ -455,8 +507,13 @@
"shrink-0", "shrink-0",
"sidebar-active-item", "sidebar-active-item",
"sidebar-container", "sidebar-container",
"sm:block",
"sm:flex", "sm:flex",
"sm:grid-cols-2",
"sm:items-start", "sm:items-start",
"sm:px-4",
"sm:text-xl",
"sm:w-[110%]",
"sr-only", "sr-only",
"steps", "steps",
"sticky", "sticky",
@ -480,18 +537,23 @@
"text-gray-800", "text-gray-800",
"text-gray-900", "text-gray-900",
"text-left", "text-left",
"text-lg",
"text-orange-800", "text-orange-800",
"text-primary-800", "text-primary-800",
"text-red-900", "text-red-900",
"text-slate-900", "text-slate-900",
"text-sm", "text-sm",
"text-transparent",
"text-white",
"text-xl", "text-xl",
"text-xs", "text-xs",
"text-yellow-900", "text-yellow-900",
"theme-toggle", "theme-toggle",
"to-gray-600",
"top-0", "top-0",
"top-16", "top-16",
"top-8", "top-8",
"top-[40%]",
"top-full", "top-full",
"tracking-tight", "tracking-tight",
"tracking-tighter", "tracking-tighter",
@ -502,9 +564,12 @@
"transition-transform", "transition-transform",
"underline", "underline",
"underline-offset-2", "underline-offset-2",
"w-2",
"w-3.5", "w-3.5",
"w-4", "w-4",
"w-64", "w-64",
"w-[110%]",
"w-[180%]",
"w-full", "w-full",
"w-max", "w-max",
"w-screen", "w-screen",

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -1,6 +1,5 @@
article: onThisPage: "On this page"
on_this_page: "On this page" editThisPage: "Edit this page on GitHub →"
edit_this_page: "Edit this page on GitHub →" lastUpdated: "Last updated on"
footer: copyright: "© 2023 Hextra Project."
copyright: "© 2023 Hextra Project."

View File

@ -1,8 +1,16 @@
# Navbar
documentation: "ドキュメンテーション" documentation: "ドキュメンテーション"
blog: "ブログ" blog: "ブログ"
about: "このサイトについて" about: "このサイトについて"
search_placeholder: "検索ドキュメント..." more: "もっと"
hugoDocs: "Hugoドキュメント ↗"
article: searchPlaceholder: "検索ドキュメント..."
on_this_page: "このページでは" noResultsFound: "検索結果が見つかりませんでした"
onThisPage: "このページでは"
editThisPage: "このページをGitHubで編集する →"
lastUpdated: "最終更新日"
copyright: "© 2023 Hextra Project."

15
i18n/zh-cn.yaml Normal file
View File

@ -0,0 +1,15 @@
documentation: "文档"
blog: "博客"
about: "关于"
more: "更多"
hugoDocs: "Hugo 文档 ↗"
searchPlaceholder: "搜索文档..."
noResultsFound: "无结果"
onThisPage: "此页上"
editThisPage: "在 GitHub 上编辑此页 →"
lastUpdated: "最后更新于"
copyright: "© 2023 Hextra Project."

15
i18n/zh-tw.yaml Normal file
View File

@ -0,0 +1,15 @@
documentation: "文檔"
blog: "博客"
about: "關於"
more: "更多"
hugoDocs: "Hugo 文檔 ↗"
searchPlaceholder: "搜索文檔..."
noResultsFound: "無結果"
onThisPage: "此頁上"
editThisPage: "在 GitHub 上編輯此頁 →"
lastUpdated: "最後更新於"
copyright: "© 2023 Hextra Project."

BIN
images/screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

BIN
images/tn.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="{{ .Site.Language.Lang }}">
{{- partial "head.html" . -}} {{- partial "head.html" . -}}
<body dir="ltr"> <body dir="ltr">
{{- partial "navbar.html" . -}} {{- partial "navbar.html" . -}}
{{- block "main" . }}{{ end -}} {{- block "main" . }}{{ end -}}
{{- if not .Site.Params.footer.disabled }}{{ partial "footer.html" . }}{{ end }} {{- if (.Site.Params.footer.enable | default true) }}{{ partial "footer.html" . }}{{ end }}
</body> </body>
{{ partial "scripts.html" . }} {{ partial "scripts.html" . }}
</html> </html>

View File

@ -1,5 +1,16 @@
{{ define "main" }} {{ define "main" }}
<div class="mx-auto flex max-w-[90rem]"> <div class="mx-auto flex max-w-screen-xl">
<p class="p-4">Unimplemented</p> {{ partial "sidebar.html" (dict "context" .) }}
{{ partial "toc.html" . }}
<article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
<div class="content">
<h1>{{ .Title }}</h1>
{{ .Content }}
</div>
<div class="mt-16"></div>
{{ partial "components/last-updated.html" . }}
</main>
</article>
</div> </div>
{{ end }} {{ end }}

View File

@ -1,10 +1,12 @@
{{ define "main" }} {{ define "main" }}
<div class="mx-auto flex max-w-screen-xl"> <div class="mx-auto flex max-w-screen-xl">
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }} {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }}
{{ partial "toc.html" . }} {{ partial "toc.html" . }}
<article class="w-full break-words flex min-h-[calc(100vh-4rem)] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]"> <article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12"> <main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
<br class="mt-1.5 text-sm" />
<h1 class="text-center mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100">{{ .Title }}</h1> <h1 class="text-center mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100">{{ .Title }}</h1>
<div class="mb-16"></div>
<div class="content"> <div class="content">
{{ .Content }} {{ .Content }}
</div> </div>

View File

@ -1,9 +1,10 @@
{{ define "main" }} {{ define "main" }}
<div class="mx-auto flex max-w-screen-xl"> <div class="mx-auto flex max-w-screen-xl">
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }} {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }}
<article class="w-full break-words flex min-h-[calc(100vh-4rem)] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]"> <article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12"> <main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
<h1 class="text-4xl tracking-tighter text-center font-extrabold md:text-5xl mt-8 pb-6">{{ .Title }}</h1> <br class="mt-1.5 text-sm" />
<h1 class="text-center mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100">{{ .Title }}</h1>
<div class="content">{{ .Content }}</div> <div class="content">{{ .Content }}</div>
{{ range .Pages.ByDate }} {{ range .Pages.ByDate }}
<div class="mb-10"> <div class="mb-10">

View File

@ -1,6 +1,6 @@
{{ define "main" }} {{ define "main" }}
<div class="mx-auto flex max-w-screen-xl"> <div class="mx-auto flex max-w-screen-xl">
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }} {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }}
{{ partial "toc.html" . }} {{ partial "toc.html" . }}
<article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]"> <article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12"> <main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">

View File

@ -2,7 +2,7 @@
<div class="mx-auto flex max-w-screen-xl"> <div class="mx-auto flex max-w-screen-xl">
{{ partial "sidebar.html" (dict "context" .) }} {{ partial "sidebar.html" (dict "context" .) }}
{{ partial "toc.html" . }} {{ partial "toc.html" . }}
<article class="w-full break-words flex min-h-[calc(100vh-4rem)] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]"> <article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12"> <main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
<div class="content"> <div class="content">

View File

@ -2,7 +2,7 @@
<div class="mx-auto flex max-w-screen-xl"> <div class="mx-auto flex max-w-screen-xl">
{{ partial "sidebar.html" (dict "context" .) }} {{ partial "sidebar.html" (dict "context" .) }}
{{ partial "toc.html" . }} {{ partial "toc.html" . }}
<article class="w-full break-words flex min-h-[calc(100vh-4rem)] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]"> <article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12"> <main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
<div class="content"> <div class="content">

118
layouts/hextra-home.html Normal file
View File

@ -0,0 +1,118 @@
{{ define "main" }}
<div class="mx-auto flex max-w-screen-xl">
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }}
<div class="w-full break-words flex flex-col min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-start pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<section class="flex max-w-[90rem] flex-col items-start gap-2 px-6 sm:px-4 pt-8 md:pt-12">
<a
href="https://github.com/imfing/hextra"
target="_blank"
rel="noreferrer"
class="inline-flex items-center rounded-full gap-2 px-3 py-1 text-xs text-gray-600 dark:text-gray-400 bg-gray-100 dark:bg-neutral-800 dark:border-neutral-800 border hover:border-gray-400 dark:hover:text-gray-50 dark:hover:border-gray-600"
>
<div class="w-2 h-2 rounded-full bg-primary-400"></div>
<span>Free, open source</span>
{{- partial "utils/icon" (dict "name" "arrow-circle-right" "attributes" "height=14") -}}
</a>
<h1
class="text-4xl font-bold leading-tight tracking-tighter md:text-5xl mt-6 bg-clip-text text-transparent bg-gradient-to-r from-gray-900 to-gray-600 dark:from-gray-100 dark:to-gray-400"
>
Build modern websites&nbsp;<br class="sm:block hidden" />
with Markdown and Hugo
</h1>
<p class="mt-4 text-xl text-gray-600 dark:text-gray-400 sm:text-xl">
Fast, batteries-included Hugo theme <br class="sm:block hidden" />
for creating beautiful static websites.
</p>
<div class="mt-8">
{{- $docsURL := "docs" | relURL -}}
<a
href="{{ $docsURL }}"
class="font-medium cursor-pointer px-6 py-3 text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-4 focus:ring-primary-300 rounded-full text-center mr-2 mb-2 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"
>
Get Started
</a>
</div>
</section>
<section class="flex max-w-[90rem] flex-col items-start gap-2 px-6 sm:px-4 pt-8 pb-8">
<h2 class="mt-12 text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-b from-gray-800 to-gray-600 dark:from-gray-100 dark:to-gray-400">What's in Hextra?</h2>
<div class="mt-6 grid sm:grid-cols-2 lg:grid-cols-3 grid-cols-1 gap-4 w-full">
{{ template "hextra-feature-card" (dict
"title" "Fast and Full-featured"
"subtitle" "Simple and easy to use, yet powerful and feature-rich. "
"class" "aspect-auto md:aspect-[1.1/1] max-md:min-h-[340px]"
"image" "images/hextra-doc.webp"
"imageClass" "top-[40%] left-[24px] w-[180%] sm:w-[110%] dark:opacity-80"
"style" "background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));"
)
}}
{{ template "hextra-feature-card" (dict
"title" "Markdown is All You Need"
"subtitle" "Compose with just Markdown. Enrich with Shortcode components."
"class" "aspect-auto md:aspect-[1.1/1] max-lg:min-h-[340px]"
"image" "images/hextra-markdown.webp"
"imageClass" "top-[40%] left-[36px] w-[180%] sm:w-[110%] dark:opacity-80"
"style" "background: radial-gradient(ellipse at 50% 80%,rgba(142,53,74,0.15),hsla(0,0%,100%,0));"
)
}}
{{ template "hextra-feature-card" (dict
"title" "Full Text Search"
"subtitle" "Built-in full text search with FlexSearch, no extra setup required."
"class" "aspect-auto md:aspect-[1.1/1] max-md:min-h-[340px]"
"image" "images/hextra-search.webp"
"imageClass" "top-[40%] left-[36px] w-[110%] sm:w-[110%] dark:opacity-80"
"style" "background: radial-gradient(ellipse at 50% 80%,rgba(221,210,59,0.15),hsla(0,0%,100%,0));"
)
}}
{{ template "hextra-feature-card" (dict
"title" "Lightweight as a Feather"
"subtitle" "No dependency or Node.js is needed to use Hextra. Powered by Hugo, one of *the fastest* static site generators, building your site in just seconds with a single binary."
)
}}
{{ template "hextra-feature-card" (dict
"title" "Reponsive with Dark Mode Included"
"subtitle" "Looks great on different screen sizes. Built-in dark mode support, with auto-switching based on user's system preference."
)
}}
{{ template "hextra-feature-card" (dict
"title" "Build and Host for Free"
"subtitle" "Build with GitHub Actions, and host for free on GitHub Pages. Alternatively it can be hosted on any static hosting service."
)
}}
{{ template "hextra-feature-card" (dict
"title" "Multi-Language Made Easy"
"subtitle" "Create multi-language pages by just adding locales suffix to the Markdown file. Adding i18n support to your site is intuitive."
)
}}
{{ template "hextra-feature-card" (dict
"title" "And Much More..."
"subtitle" "Syntax highlighting / Table of contents / SEO / RSS / LaTeX / Mermaid / Customizable / and more..."
)
}}
</div>
</section>
</div>
</div>
{{ end }}
{{- define "hextra-feature-card" -}}
{{- $title := .title -}}
{{- $subtitle := .subtitle -}}
{{- $class := .class -}}
{{- $image := .image -}}
{{- $imageClass := .imageClass -}}
{{- $style := .style -}}
<div
{{ with $style }}style="{{ . | safeCSS }}"{{ end }}
class="{{ $class }} relative overflow-hidden rounded-3xl border border-gray-200 hover:border-gray-300 dark:border-neutral-800 dark:hover:border-neutral-700 before:pointer-events-none before:absolute before:inset-0 before:bg-glass-gradient"
>
<div class="relative w-full p-6">
<h3 class="text-2xl font-medium leading-6 mb-2">{{ $title }}</h3>
<p class="text-gray-500 text-sm leading-6">{{ $subtitle | markdownify }}</p>
</div>
{{- with $image -}}
<img src="{{ . }}" class="absolute max-w-none {{ $imageClass }}" alt="{{ $title }}" />
{{- end -}}
</div>
{{- end -}}

View File

@ -1,8 +1,8 @@
{{ define "main" }} {{ define "main" }}
<div class="mx-auto flex max-w-screen-xl"> <div class="mx-auto flex max-w-[90rem]">
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }} {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }}
{{ partial "toc.html" . }} {{ partial "toc.html" . }}
<article class="w-full break-words flex min-h-[calc(100vh-4rem)] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]"> <article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12"> <main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
<h1 class="text-center mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100">{{ .Title }}</h1> <h1 class="text-center mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100">{{ .Title }}</h1>
<div class="content"> <div class="content">

View File

@ -1,13 +1,13 @@
<div class="mt-1.5 flex items-center gap-1 overflow-hidden text-sm text-gray-500 dark:text-gray-400 contrast-more:text-current"> <div class="mt-1.5 flex items-center gap-1 overflow-hidden text-sm text-gray-500 dark:text-gray-400 contrast-more:text-current">
{{ range .Ancestors.Reverse }} {{- range .Ancestors.Reverse }}
{{ if not .IsHome }} {{- if not .IsHome }}
<div class="whitespace-nowrap transition-colors min-w-[24px] overflow-hidden text-ellipsis hover:text-gray-900 dark:hover:text-gray-100"> <div class="whitespace-nowrap transition-colors min-w-[24px] overflow-hidden text-ellipsis hover:text-gray-900 dark:hover:text-gray-100">
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a> <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</div> </div>
{{ partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"w-3.5 shrink-0\"") }} {{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"w-3.5 shrink-0\"") -}}
{{ end }} {{ end -}}
{{ end }} {{ end -}}
<div class="whitespace-nowrap transition-colors font-medium text-gray-700 contrast-more:font-bold contrast-more:text-current dark:text-gray-100 contrast-more:dark:text-current"> <div class="whitespace-nowrap transition-colors font-medium text-gray-700 contrast-more:font-bold contrast-more:text-current dark:text-gray-100 contrast-more:dark:text-current">
{{ .LinkTitle }} {{- .LinkTitle -}}
</div> </div>
</div> </div>

View File

@ -1,10 +1,12 @@
{{ if site.Params.displayUpdatedDate }} {{- $lastUpdated := (T "lastUpdated") | default "Last updated on" -}}
{{- if site.Params.displayUpdatedDate -}}
{{- with .Lastmod -}} {{- with .Lastmod -}}
{{ $datetime := (time.Format "2006-01-02T15:04:05.000Z" .) }} {{ $datetime := (time.Format "2006-01-02T15:04:05.000Z" .) }}
<div class="mt-12 mb-8 block text-xs text-gray-500 ltr:text-right rtl:text-left dark:text-gray-400">Last updated on <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time></div> <div class="mt-12 mb-8 block text-xs text-gray-500 ltr:text-right rtl:text-left dark:text-gray-400">{{ $lastUpdated }} <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time></div>
{{- else -}} {{- else -}}
<div class="mt-16"></div> <div class="mt-16"></div>
{{- end -}} {{- end -}}
{{ else }} {{- else -}}
<div class="mt-16"></div> <div class="mt-16"></div>
{{ end }} {{- end -}}

View File

@ -20,13 +20,21 @@
{{- if or $prev $next -}} {{- if or $prev $next -}}
<div class="mb-8 flex items-center border-t pt-8 dark:border-neutral-800 contrast-more:border-neutral-400 dark:contrast-more:border-neutral-400 print:hidden"> <div class="mb-8 flex items-center border-t pt-8 dark:border-neutral-800 contrast-more:border-neutral-400 dark:contrast-more:border-neutral-400 print:hidden">
{{- if $prev -}} {{- if $prev -}}
<a href="{{ $prev.RelPermalink }}" class="flex max-w-[50%] items-center gap-1 py-4 text-base font-medium text-gray-600 transition-colors [word-break:break-word] hover:text-primary-600 dark:text-gray-300 md:text-lg ltr:pr-4 rtl:pl-4"> <a
href="{{ $prev.RelPermalink }}"
title="{{ $prev.LinkTitle }}"
class="flex max-w-[50%] items-center gap-1 py-4 text-base font-medium text-gray-600 transition-colors [word-break:break-word] hover:text-primary-600 dark:text-gray-300 md:text-lg ltr:pr-4 rtl:pl-4"
>
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"inline h-5 shrink-0 ltr:rotate-180\"") -}} {{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"inline h-5 shrink-0 ltr:rotate-180\"") -}}
{{- $prev.LinkTitle -}} {{- $prev.LinkTitle -}}
</a> </a>
{{- end -}} {{- end -}}
{{- if $next -}} {{- if $next -}}
<a href="{{ $next.RelPermalink }}" class="flex max-w-[50%] items-center gap-1 py-4 text-base font-medium text-gray-600 transition-colors [word-break:break-word] hover:text-primary-600 dark:text-gray-300 md:text-lg ltr:ml-auto ltr:pl-4 ltr:text-right rtl:mr-auto rtl:pr-4 rtl:text-left"> <a
href="{{ $next.RelPermalink }}"
title="{{ $next.LinkTitle }}"
class="flex max-w-[50%] items-center gap-1 py-4 text-base font-medium text-gray-600 transition-colors [word-break:break-word] hover:text-primary-600 dark:text-gray-300 md:text-lg ltr:ml-auto ltr:pl-4 ltr:text-right rtl:mr-auto rtl:pr-4 rtl:text-left"
>
{{- $next.LinkTitle -}} {{- $next.LinkTitle -}}
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"inline h-5 shrink-0\"") -}} {{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"inline h-5 shrink-0\"") -}}
</a> </a>

View File

@ -4,4 +4,4 @@
<link rel="icon" href="{{ "favicon-16x16.png" | relURL }}" type="image/png" sizes="16x16" /> <link rel="icon" href="{{ "favicon-16x16.png" | relURL }}" type="image/png" sizes="16x16" />
<link rel="icon" href="{{ "favicon-32x32.png" | relURL }}" type="image/png" sizes="32x32" /> <link rel="icon" href="{{ "favicon-32x32.png" | relURL }}" type="image/png" sizes="32x32" />
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}" sizes="180x180" /> <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}" sizes="180x180" />
<link fetchpriority="low" href="/site.webmanifest" rel="manifest" /> <link fetchpriority="low" href="{{ "site.webmanifest" | relURL }}" rel="manifest" />

View File

@ -1,5 +1,7 @@
{{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}} {{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}}
{{- $copyright := (T "copyright") | default "© 2023 Hextra." -}}
<footer class="hextra-footer bg-gray-100 pb-[env(safe-area-inset-bottom)] dark:bg-neutral-900 print:bg-transparent"> <footer class="hextra-footer bg-gray-100 pb-[env(safe-area-inset-bottom)] dark:bg-neutral-900 print:bg-transparent">
{{- if $enableFooterSwitches }} {{- if $enableFooterSwitches }}
@ -9,17 +11,20 @@
</div> </div>
{{ end -}} {{ end -}}
<hr class="dark:border-neutral-800" /> <hr class="dark:border-neutral-800" />
<div class="mx-auto flex max-w-screen-xl justify-center py-12 pl-[max(env(safe-area-inset-left),1.5rem)] pr-[max(env(safe-area-inset-right),1.5rem)] text-gray-600 dark:text-gray-400 md:justify-start"> <div
class="mx-auto flex max-w-screen-xl justify-center py-12 pl-[max(env(safe-area-inset-left),1.5rem)] pr-[max(env(safe-area-inset-right),1.5rem)] text-gray-600 dark:text-gray-400 md:justify-start"
>
<div class="flex w-full flex-col items-center sm:items-start"> <div class="flex w-full flex-col items-center sm:items-start">
{{- if (.Site.Params.footer.displayPoweredBy | default true) }}<div class="font-semibold">{{ template "theme-credit" . }}</div>{{ end }} {{- if (.Site.Params.footer.displayPoweredBy | default true) }}<div class="font-semibold">{{ template "theme-credit" . }}</div>{{ end }}
{{- if .Site.Params.footer.displayCopyright }}<p class="mt-6 text-xs">{{ i18n "footer.copyright" }}</p>{{ end }} {{- if .Site.Params.footer.displayCopyright }}<p class="mt-6 text-xs">{{ $copyright | markdownify }}</p>{{ end }}
</div> </div>
</div> </div>
</footer> </footer>
{{- define "theme-credit" -}} {{- define "theme-credit" -}}
<a class="flex text-sm items-center gap-1 text-current" target="_blank" rel="noopener noreferrer" title="Hextra GitHub Homepage" href="https://github.com/imfing/hextra"> <a class="flex text-sm items-center gap-1 text-current" target="_blank" rel="noopener noreferrer" title="Hextra GitHub Homepage" href="https://github.com/imfing/hextra">
<span>Powered by Hextra <span
>Powered by Hextra
{{- partial "utils/icon.html" (dict "name" "hextra" "attributes" "height=1em class=\"inline-block ml-1 align-text-bottom\"") -}} {{- partial "utils/icon.html" (dict "name" "hextra" "attributes" "height=1em class=\"inline-block ml-1 align-text-bottom\"") -}}
</span> </span>
</a> </a>

View File

@ -1,14 +1,25 @@
{{ if and (not hugo.IsProduction) (eq hugo.Environment "theme")}} {{- if and (not hugo.IsProduction) (eq hugo.Environment "theme") }}
{{ $styles := resources.Get "css/styles.css" }} {{- $styles := resources.Get "css/styles.css" }}
{{ $styles = $styles | resources.PostCSS (dict "inlineImports" true) }} {{- $styles = $styles | resources.PostCSS (dict "inlineImports" true) }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" /> <link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
{{ else }} {{- else }}
{{ $styles := resources.Get "css/compiled/main.css" }} {{- $styles := resources.Get "css/compiled/main.css" -}}
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
<link rel="preload" href="{{ $styles.RelPermalink }}" as="style" />
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" integrity="{{ $styles.Data.integrity }}" />
{{ end }}
{{ $custom := resources.Get "css/custom.css" }} {{- if hugo.IsProduction }}
{{ $custom = $custom | minify | fingerprint }} {{- $styles = $styles | minify | fingerprint }}
<link href="{{ $custom.RelPermalink }}" rel="stylesheet" integrity="{{ $custom.Data.integrity }}" /> <link rel="preload" href="{{ $styles.RelPermalink }}" as="style" />
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" integrity="{{ $styles.Data.Integrity }}" />
{{- else }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
{{- end }}
{{- end }}
<!-- Custom CSS -->
{{- $custom := resources.Get "css/custom.css" }}
{{- if hugo.IsProduction -}}
{{- $custom = $custom | minify | fingerprint }}
<link href="{{ $custom.RelPermalink }}" rel="stylesheet" integrity="{{ $custom.Data.Integrity }}" />
{{- else }}
<link href="{{ $custom.RelPermalink }}" rel="stylesheet" />
{{- end }}

View File

@ -3,19 +3,33 @@
{{- $grow := .grow -}} {{- $grow := .grow -}}
{{- $hideLabel := .hideLabel | default false -}} {{- $hideLabel := .hideLabel | default false -}}
{{- $changeLanguage := (T "changeLanguage") | default "Change language" -}}
{{- if site.IsMultiLingual -}} {{- if site.IsMultiLingual -}}
<div class="flex justify-items-start {{ if $grow }}grow{{ end }}"> <div class="flex justify-items-start {{ if $grow }}grow{{ end }}">
<button title="Change language" data-state="closed" class="language-switcher h-7 rounded-md px-2 text-left text-xs font-medium text-gray-600 transition-colors dark:text-gray-400 hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-primary-100/5 dark:hover:text-gray-50 grow" type="button" aria-label="Switch Language"> <button
title="{{ $changeLanguage }}"
data-state="closed"
class="language-switcher h-7 rounded-md px-2 text-left text-xs font-medium text-gray-600 transition-colors dark:text-gray-400 hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-primary-100/5 dark:hover:text-gray-50 grow"
type="button"
aria-label="{{ $changeLanguage }}"
>
<div class="flex items-center gap-2 capitalize"> <div class="flex items-center gap-2 capitalize">
{{- partial "utils/icon" (dict "name" "globe-alt" "attributes" "height=12") -}} {{- partial "utils/icon" (dict "name" "globe-alt" "attributes" "height=12") -}}
{{- if not $hideLabel }}<span>{{ site.Language.LanguageName }}</span>{{ end -}} {{- if not $hideLabel }}<span>{{ site.Language.LanguageName }}</span>{{ end -}}
</div> </div>
</button> </button>
<ul class="language-options hidden z-20 max-h-64 overflow-auto rounded-md ring-1 ring-black/5 bg-white py-1 text-sm shadow-lg dark:ring-white/20 dark:bg-neutral-800" style="position: fixed; inset: auto auto 0px 0px; margin: 0px; min-width: 100px;"> <ul
class="language-options hidden z-20 max-h-64 overflow-auto rounded-md ring-1 ring-black/5 bg-white py-1 text-sm shadow-lg dark:ring-white/20 dark:bg-neutral-800"
style="position: fixed; inset: auto auto 0px 0px; margin: 0px; min-width: 100px;"
>
{{ range site.Languages }} {{ range site.Languages }}
{{ $link := partial "utils/lang-link" (dict "lang" .Lang "context" $page) }} {{ $link := partial "utils/lang-link" (dict "lang" .Lang "context" $page) }}
<li class="flex flex-col"> <li class="flex flex-col">
<a href="{{ $link }}" class="text-gray-800 dark:text-gray-100 hover:bg-primary-50 hover:text-primary-600 hover:dark:bg-primary-500/10 hover:dark:text-primary-600 relative cursor-pointer whitespace-nowrap py-1.5 transition-colors ltr:pl-3 ltr:pr-9 rtl:pr-3 rtl:pl-9"> <a
href="{{ $link }}"
class="text-gray-800 dark:text-gray-100 hover:bg-primary-50 hover:text-primary-600 hover:dark:bg-primary-500/10 hover:dark:text-primary-600 relative cursor-pointer whitespace-nowrap py-1.5 transition-colors ltr:pl-3 ltr:pr-9 rtl:pr-3 rtl:pl-9"
>
{{- .LanguageName -}} {{- .LanguageName -}}
{{- if eq .LanguageName site.Language.LanguageName -}} {{- if eq .LanguageName site.Language.LanguageName -}}
<span class="absolute inset-y-0 flex items-center ltr:right-3 rtl:left-3"> <span class="absolute inset-y-0 flex items-center ltr:right-3 rtl:left-3">

View File

@ -5,8 +5,8 @@
{{- $logoDarkPath := .Site.Params.navbar.logo.dark | default $logoPath -}} {{- $logoDarkPath := .Site.Params.navbar.logo.dark | default $logoPath -}}
<div class="sticky top-0 z-20 w-full bg-transparent print:hidden"> <div class="nav-container sticky top-0 z-20 w-full bg-transparent print:hidden">
<div class="pointer-events-none absolute z-[-1] h-full w-full bg-white shadow-[0_2px_4px_rgba(0,0,0,.02),0_1px_0_rgba(0,0,0,.06)] contrast-more:shadow-[0_0_0_1px_#000] dark:bg-dark dark:shadow-[0_-1px_0_rgba(255,255,255,.1)_inset] contrast-more:dark:shadow-[0_0_0_1px_#fff]"></div> <div class="nav-container-blur pointer-events-none absolute z-[-1] h-full w-full bg-white dark:bg-dark shadow-[0_2px_4px_rgba(0,0,0,.02),0_1px_0_rgba(0,0,0,.06)] contrast-more:shadow-[0_0_0_1px_#000] dark:shadow-[0_-1px_0_rgba(255,255,255,.1)_inset] contrast-more:dark:shadow-[0_0_0_1px_#fff]"></div>
<nav class="mx-auto flex items-center justify-end gap-2 h-16 px-6 max-w-[90rem]"> <nav class="mx-auto flex items-center justify-end gap-2 h-16 px-6 max-w-[90rem]">
<a class="flex items-center hover:opacity-75 ltr:mr-auto rtl:ml-auto" href="{{ $logoLink }}"> <a class="flex items-center hover:opacity-75 ltr:mr-auto rtl:ml-auto" href="{{ $logoLink }}">

View File

@ -1,14 +1,25 @@
{{- $placeholder := (T "search_placeholder") | default "Search..." -}} {{- $placeholder := (T "searchPlaceholder") | default "Search..." -}}
<div class="search-wrapper relative md:w-64"> <div class="search-wrapper relative md:w-64">
<div class="relative flex items-center text-gray-900 contrast-more:text-gray-800 dark:text-gray-300 contrast-more:dark:text-gray-300"> <div class="relative flex items-center text-gray-900 contrast-more:text-gray-800 dark:text-gray-300 contrast-more:dark:text-gray-300">
<input placeholder="{{ $placeholder }}" class="search-input block w-full appearance-none rounded-lg px-3 py-2 transition-colors text-base leading-tight md:text-sm bg-black/[.05] dark:bg-gray-50/10 focus:bg-white dark:focus:bg-dark placeholder:text-gray-500 dark:placeholder:text-gray-400 contrast-more:border contrast-more:border-current" type="search" value="" spellcheck="false" /> <input
<kbd class="absolute my-1.5 select-none ltr:right-1.5 rtl:left-1.5 h-5 rounded bg-white px-1.5 font-mono text-[10px] font-medium text-gray-500 border dark:border-gray-100/20 dark:bg-dark/50 contrast-more:border-current contrast-more:text-current contrast-more:dark:border-current items-center gap-1 transition-opacity pointer-events-none hidden sm:flex"> <span class="text-xs"></span>K </kbd> placeholder="{{ $placeholder }}"
class="search-input block w-full appearance-none rounded-lg px-3 py-2 transition-colors text-base leading-tight md:text-sm bg-black/[.05] dark:bg-gray-50/10 focus:bg-white dark:focus:bg-dark placeholder:text-gray-500 dark:placeholder:text-gray-400 contrast-more:border contrast-more:border-current"
type="search"
value=""
spellcheck="false"
/>
<kbd
class="absolute my-1.5 select-none ltr:right-1.5 rtl:left-1.5 h-5 rounded bg-white px-1.5 font-mono text-[10px] font-medium text-gray-500 border dark:border-gray-100/20 dark:bg-dark/50 contrast-more:border-current contrast-more:text-current contrast-more:dark:border-current items-center gap-1 transition-opacity pointer-events-none hidden sm:flex"
>
<span class="text-xs"></span>K
</kbd>
</div> </div>
<div> <div>
<ul class="search-results hidden border border-gray-200 bg-white text-gray-100 dark:border-neutral-800 dark:bg-neutral-900 absolute top-full z-20 mt-2 overflow-auto overscroll-contain rounded-xl py-2.5 shadow-xl max-h-[min(calc(50vh-11rem-env(safe-area-inset-bottom)),400px)] md:max-h-[min(calc(100vh-5rem-env(safe-area-inset-bottom)),400px)] inset-x-0 ltr:md:left-auto rtl:md:right-auto contrast-more:border contrast-more:border-gray-900 contrast-more:dark:border-gray-50 w-screen min-h-[100px] max-w-[min(calc(100vw-2rem),calc(100%+20rem))]" <ul
class="search-results hidden border border-gray-200 bg-white text-gray-100 dark:border-neutral-800 dark:bg-neutral-900 absolute top-full z-20 mt-2 overflow-auto overscroll-contain rounded-xl py-2.5 shadow-xl max-h-[min(calc(50vh-11rem-env(safe-area-inset-bottom)),400px)] md:max-h-[min(calc(100vh-5rem-env(safe-area-inset-bottom)),400px)] inset-x-0 ltr:md:left-auto rtl:md:right-auto contrast-more:border contrast-more:border-gray-900 contrast-more:dark:border-gray-50 w-screen min-h-[100px] max-w-[min(calc(100vw-2rem),calc(100%+20rem))]"
style="transition: max-height 0.2s ease 0s;" style="transition: max-height 0.2s ease 0s;"
></ul> ></ul>
</div> </div>

View File

@ -1,6 +1,9 @@
{{- $context := .context -}} {{- $context := .context -}}
{{- $disableSidebar := .disableSidebar | default false -}} {{- $disableSidebar := .disableSidebar | default false -}}
{{- $sidebarClass := cond $disableSidebar "md:hidden xl:block" "md:sticky" -}} {{- $displayPlaceholder := .displayPlaceholder | default false -}}
{{- $sidebarClass := cond $disableSidebar (cond $displayPlaceholder "md:hidden xl:block" "md:hidden") "md:sticky" -}}
{{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}} {{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}}
{{- $navPages := union $navRoot.RegularPages $navRoot.Sections -}} {{- $navPages := union $navRoot.RegularPages $navRoot.Sections -}}
@ -20,8 +23,8 @@
</ul> </ul>
<!-- Sidebar on large screen --> <!-- Sidebar on large screen -->
{{- if $disableSidebar }} {{- if $disableSidebar -}}
<div class="max-xl:hidden h-0 w-64 shrink-0"></div> {{- if $displayPlaceholder }}<div class="max-xl:hidden h-0 w-64 shrink-0"></div>{{ end -}}
{{ .context.Scratch.Set "enableFooterSwitches" true }} {{ .context.Scratch.Set "enableFooterSwitches" true }}
{{- else -}} {{- else -}}
<ul class="flex flex-col gap-1 max-md:hidden"> <ul class="flex flex-col gap-1 max-md:hidden">
@ -117,12 +120,13 @@
{{- define "sidebar-footer" -}} {{- define "sidebar-footer" -}}
{{- range site.Menus.sidebar -}} {{- range site.Menus.sidebar -}}
{{- $name := or (T .Identifier) .Name -}}
{{ if eq .Params.type "separator" }} {{ if eq .Params.type "separator" }}
<li class="[word-break:break-word] mt-5 mb-2 px-2 py-1.5 text-sm font-semibold text-gray-900 first:mt-0 dark:text-gray-100"> <li class="[word-break:break-word] mt-5 mb-2 px-2 py-1.5 text-sm font-semibold text-gray-900 first:mt-0 dark:text-gray-100">
<span class="cursor-default">{{ .Name }}</span> <span class="cursor-default">{{ $name }}</span>
</li> </li>
{{ else }} {{ else }}
<li>{{ template "sidebar-item-link" dict "active" false "title" .Name "link" .URL }}</li> <li>{{ template "sidebar-item-link" dict "active" false "title" $name "link" (.URL | relLangURL) }}</li>
{{ end }} {{ end }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View File

@ -1,7 +1,15 @@
{{- $hideLabel := .hideLabel | default false -}} {{- $hideLabel := .hideLabel | default false -}}
{{- $changeTheme := (T "changeTheme") | default "Change theme" -}}
<button title="Change theme" data-theme="light" class="theme-toggle group h-7 rounded-md px-2 text-left text-xs font-medium text-gray-600 transition-colors dark:text-gray-400 hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-primary-100/5 dark:hover:text-gray-50" type="button" aria-label="Toggle Dark Mode">
<button
title="{{ $changeTheme }}"
data-theme="light"
class="theme-toggle group h-7 rounded-md px-2 text-left text-xs font-medium text-gray-600 transition-colors dark:text-gray-400 hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-primary-100/5 dark:hover:text-gray-50"
type="button"
aria-label="Toggle Dark Mode"
>
<div class="flex items-center gap-2 capitalize"> <div class="flex items-center gap-2 capitalize">
{{- partial "utils/icon.html" (dict "name" "sun" "attributes" "height=12 class=\"group-data-[theme=light]:hidden\"") -}} {{- partial "utils/icon.html" (dict "name" "sun" "attributes" "height=12 class=\"group-data-[theme=light]:hidden\"") -}}
{{- if not $hideLabel }}<span class="group-data-[theme=light]:hidden">Light</span>{{ end -}} {{- if not $hideLabel }}<span class="group-data-[theme=light]:hidden">Light</span>{{ end -}}

View File

@ -1,13 +1,14 @@
{{/* Table of Contents */}} {{/* Table of Contents */}}
{{/* TODO: toc bottom part should be able to hide */}} {{/* TODO: toc bottom part should be able to hide */}}
{{- $toc := .Params.toc | default true -}} {{- $toc := .Params.toc | default true -}}
{{- $onThisPage := (T "onThisPage") | default "On this page"}}
{{- $editThisPage := (T "editThisPage") | default "Edit this page"}}
<nav class="hextra-toc order-last hidden w-64 shrink-0 xl:block print:hidden px-4" aria-label="table of contents"> <nav class="hextra-toc order-last hidden w-64 shrink-0 xl:block print:hidden px-4" aria-label="table of contents">
{{- if $toc }} {{- if $toc }}
<div class="sticky top-16 overflow-y-auto pr-4 pt-6 text-sm [hyphens:auto] max-h-[calc(100vh-4rem-env(safe-area-inset-bottom))] ltr:-mr-4 rtl:-ml-4"> <div class="sticky top-16 overflow-y-auto pr-4 pt-6 text-sm [hyphens:auto] max-h-[calc(100vh-var(--navbar-height)-env(safe-area-inset-bottom))] ltr:-mr-4 rtl:-ml-4">
{{- with .Fragments.Headings -}} {{- with .Fragments.Headings -}}
<p class="mb-4 font-semibold tracking-tight">{{ i18n "article.on_this_page" }}</p> <p class="mb-4 font-semibold tracking-tight">{{ $onThisPage }}</p>
{{- range . -}} {{- range . -}}
<ul> <ul>
{{- with .Headings -}}{{ template "toc-subheading" (dict "headings" . "level" 0) }}{{- end -}} {{- with .Headings -}}{{ template "toc-subheading" (dict "headings" . "level" 0) }}{{- end -}}
@ -26,7 +27,7 @@
{{- $editURL := site.Params.editURL.base | default "" -}} {{- $editURL := site.Params.editURL.base | default "" -}}
{{- with .File -}}{{ $editURL = urls.JoinPath $editURL .Path }}{{- end -}} {{- with .File -}}{{ $editURL = urls.JoinPath $editURL .Path }}{{- end -}}
{{- with .Params.editURL -}}{{ $editURL = .Params.editURL }}{{- end -}} {{- with .Params.editURL -}}{{ $editURL = .Params.editURL }}{{- end -}}
<a class="text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 contrast-more:text-gray-800 contrast-more:dark:text-gray-50" href="{{ $editURL }}" target="_blank" rel="noreferer">{{ i18n "article.edit_this_page" }}</a> <a class="text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 contrast-more:text-gray-800 contrast-more:dark:text-gray-50" href="{{ $editURL }}" target="_blank" rel="noreferer">{{ $editThisPage }}</a>
{{- end -}} {{- end -}}
</div> </div>
</div> </div>
@ -48,7 +49,7 @@
{{- if .Title }} {{- if .Title }}
<li class="my-2 scroll-my-6 scroll-py-6"> <li class="my-2 scroll-my-6 scroll-py-6">
<a class="{{ $class }} inline-block text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300 contrast-more:text-gray-900 contrast-more:underline contrast-more:dark:text-gray-50 w-full break-words" href="#{{ anchorize .ID }}"> <a class="{{ $class }} inline-block text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300 contrast-more:text-gray-900 contrast-more:underline contrast-more:dark:text-gray-50 w-full break-words" href="#{{ anchorize .ID }}">
{{- .Title -}} {{- .Title | safeHTML }}
</a> </a>
</li> </li>
{{- end -}} {{- end -}}

View File

@ -1,11 +1,11 @@
{{ with .Description | plainify -}} {{ with .Description | plainify -}}
{{ . -}} {{ . -}}
{{ else -}} {{ else -}}
{{ if .IsPage -}} {{ if .IsHome -}}
{{ .Summary | plainify | chomp -}}
{{ else -}}
{{ with .Site.Params.description | plainify -}} {{ with .Site.Params.description | plainify -}}
{{ . -}} {{ . -}}
{{ end -}} {{ end -}}
{{ else -}}
{{ .Summary | plainify | chomp -}}
{{ end -}} {{ end -}}
{{ end -}} {{ end -}}

View File

@ -1,4 +1,4 @@
{{- $href := .Get "link" -}} {{- $link := .Get "link" -}}
{{- $title := .Get "title" -}} {{- $title := .Get "title" -}}
{{- $icon := .Get "icon" -}} {{- $icon := .Get "icon" -}}
{{- $subtitle := .Get "subtitle" }} {{- $subtitle := .Get "subtitle" }}
@ -10,19 +10,26 @@
{{ $linkClass = "hover:border-gray-300 bg-gray-100 shadow dark:border-neutral-700 dark:bg-neutral-800 dark:text-gray-50 hover:shadow-lg dark:hover:border-neutral-500 dark:hover:bg-neutral-700" }} {{ $linkClass = "hover:border-gray-300 bg-gray-100 shadow dark:border-neutral-700 dark:bg-neutral-800 dark:text-gray-50 hover:shadow-lg dark:hover:border-neutral-500 dark:hover:bg-neutral-700" }}
{{- end -}} {{- end -}}
{{- $external := strings.HasPrefix $link "http" -}}
{{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}}
<a <a
class="hextra-card group flex flex-col justify-start overflow-hidden rounded-lg border border-gray-200 text-current no-underline dark:shadow-none hover:shadow-gray-100 dark:hover:shadow-none shadow-gray-100 active:shadow-sm active:shadow-gray-200 transition-all duration-200 {{ $linkClass }}" class="hextra-card group flex flex-col justify-start overflow-hidden rounded-lg border border-gray-200 text-current no-underline dark:shadow-none hover:shadow-gray-100 dark:hover:shadow-none shadow-gray-100 active:shadow-sm active:shadow-gray-200 transition-all duration-200 {{ $linkClass }}"
href="{{ $href }}" href="{{ $href }}"
{{- if $external }}
target="_blank" rel="noreferrer"
{{- end -}}
> >
{{- with $image -}} {{- with $image -}}
<img alt="{{ $title }}" loading="lazy" decoding="async" style="color: transparent;" src="{{ $image }}" /> <img alt="{{ $title }}" loading="lazy" decoding="async" style="color: transparent;" src="{{ $image | safeURL }}" />
{{- end -}} {{- end -}}
{{ $padding := "p-4"}} {{- $padding := "p-4" -}}
{{- with $subtitle -}} {{- with $subtitle -}}
{{ $padding = "pt-4 px-4"}} {{- $padding = "pt-4 px-4" -}}
{{- end -}} {{- end -}}
<span class="flex font-semibold items-start gap-2 {{ $padding }} text-gray-700 hover:text-gray-900 dark:text-neutral-200 dark:hover:text-neutral-50"> <span class="flex font-semibold items-start gap-2 {{ $padding }} text-gray-700 hover:text-gray-900 dark:text-neutral-200 dark:hover:text-neutral-50">
{{- with $icon }}{{ partial "utils/icon.html" (dict "name" $icon) -}}{{ end -}} {{- with $icon }}{{ partial "utils/icon.html" (dict "name" $icon) -}}{{ end -}}
{{- $title -}} {{- $title -}}

View File

@ -1,8 +1,8 @@
{{- $title := .Get "title" | default "" -}} {{- $title := .Get "title" | default "" -}}
{{- $closed := eq (.Get "closed") "true" | default false -}} {{- $closed := eq (.Get "closed") "true" | default false -}}
<details class="last-of-type:mb-0 rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2 mt-4" data-expanded="true" {{ if not $closed }}open{{ end }}> <details class="last-of-type:mb-0 rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2 mt-4 group" {{ if not $closed }}open{{ end }}>
<summary class="flex items-center cursor-pointer select-none list-none p-1 transition-colors hover:bg-gray-100 dark:hover:bg-neutral-800 before:mr-1 before:inline-block before:transition-transform before:content-[''] dark:before:invert rtl:before:rotate-180 [[data-expanded]>&]:before:rotate-90"> <summary class="flex items-center cursor-pointer select-none list-none p-1 rounded transition-colors hover:bg-gray-100 dark:hover:bg-neutral-800 before:mr-1 before:inline-block before:transition-transform before:content-[''] dark:before:invert rtl:before:rotate-180 group-open:before:rotate-90">
<strong class="text-lg">{{ $title | markdownify }}</strong> <strong class="text-lg">{{ $title | markdownify }}</strong>
</summary> </summary>
<div class="p-2 overflow-hidden"> <div class="p-2 overflow-hidden">

10
netlify.toml Normal file
View File

@ -0,0 +1,10 @@
[build]
publish = "exampleSite/public"
command = "cd exampleSite && hugo --gc --minify --themesDir ../.. -b ${DEPLOY_PRIME_URL}"
# Always trigger a rebuild, even if the files haven't changed.
# See https://docs.netlify.com/configure-builds/file-based-configuration/#ignore-builds
ignore = "false"
[build.environment]
HUGO_VERSION = "0.117.0"

View File

@ -1,6 +1,6 @@
{ {
"scripts": { "scripts": {
"dev:theme": "hugo server --environment=theme --source=exampleSite --themesDir=../.. --disableFastRender -D --port 1313", "dev:theme": "hugo server --logLevel=debug --config=hugo.yaml,../dev.toml --environment=theme --source=exampleSite --themesDir=../.. --disableFastRender -D --port 1313",
"dev": "hugo server --source=exampleSite --themesDir=../.. --disableFastRender -D --port 1313", "dev": "hugo server --source=exampleSite --themesDir=../.. --disableFastRender -D --port 1313",
"build:css": "npx postcss --config postcss.config.js --env production assets/css/styles.css -o assets/css/compiled/main.css", "build:css": "npx postcss --config postcss.config.js --env production assets/css/styles.css -o assets/css/compiled/main.css",
"build": "hugo --gc --minify --themesDir=../.. --source=exampleSite" "build": "hugo --gc --minify --themesDir=../.. --source=exampleSite"

View File

@ -3,10 +3,10 @@ const tailwind = require('tailwindcss')(tailwindConfig);
const autoprefixer = require('autoprefixer'); const autoprefixer = require('autoprefixer');
module.exports = { module.exports = {
plugins: [ plugins: [
require('postcss-import'), require('postcss-import'),
require('@tailwindcss/nesting'), require('@tailwindcss/nesting'),
tailwind, tailwind,
...(process.env.HUGO_ENVIRONMENT === 'production' ? [autoprefixer] : []) autoprefixer
], ],
}; };

View File

@ -1,14 +1,15 @@
{ {
"name": "Hextra", "name": "Hextra",
"short_name": "Hextra", "short_name": "Hextra",
"start_url": "index.html",
"icons": [ "icons": [
{ {
"src": "/android-chrome-192x192.png", "src": "android-chrome-192x192.png",
"sizes": "192x192", "sizes": "192x192",
"type": "image/png" "type": "image/png"
}, },
{ {
"src": "/android-chrome-512x512.png", "src": "android-chrome-512x512.png",
"sizes": "512x512", "sizes": "512x512",
"type": "image/png" "type": "image/png"
} }

View File

@ -1,19 +0,0 @@
version: "3"
tasks:
dev:
cmds:
- hugo server --logLevel debug --enableGitInfo --source=exampleSite --themesDir=../.. --environment=theme --disableFastRender --buildDrafts --port 1313
build:
deps: [css]
cmds:
- hugo --minify --source=exampleSite --themesDir=../..
css:
cmds:
- npx postcss --config postcss.config.js --env production assets/css/styles.css -o assets/css/compiled/main.css
clean:
cmds:
- rm -rf public resources

View File

@ -4,11 +4,11 @@
name = "Hextra" name = "Hextra"
license = "MIT" license = "MIT"
licenselink = "https://github.com/imfing/hextra/blob/main/LICENSE" licenselink = "https://github.com/imfing/hextra/blob/main/LICENSE"
description = "Modern, versatile theme for building beautiful websites with Hugo" description = "Modern, responsive, batteries-included Hugo theme for creating beautiful static websites."
homepage = "https://github.com/imfing/hextra/" homepage = "https://github.com/imfing/hextra/"
demosite = "" demosite = "https://imfing.github.io/hextra/"
tags = ["Modern", "Elegant", "Blog", "Documentation"] tags = ["Modern", "Elegant", "Blog", "Documentation", "Responsive", "Clean", "Light", "Dark", "Minimal"]
features = ["Responsive", "Dark Mode", "Search", "Syntax Highlighting", "Multilingual"] features = ["Responsive", "Dark Mode", "Search", "Syntax Highlighting", "Multilingual", "Social", "Blog", "RSS", "Customization"]
min_version = "0.111.0" min_version = "0.111.0"
[author] [author]