chore(docs): rename exampleSite to docs and create examples (#813)

* chore(docs): rename `exampleSite` to `docs` and create `examples`

* chore(build): update build script to support new version format and source directories; add v0.10 to documentation menu
This commit is contained in:
Xin
2025-09-06 12:06:26 +01:00
committed by GitHub
parent f8eae96c11
commit 83f3b5052e
156 changed files with 62 additions and 43 deletions

View File

@@ -31,7 +31,7 @@ Use [Conventional Commits][conventional commits] message to make it easier to un
Similar to contributing code, you can also contribute to the documentation by submitting a pull request. 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. The documentation site is located in the [`docs`](../docs/) 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]. 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 ### 💬 GitHub Discussions
@@ -71,7 +71,7 @@ npm i
- [`assets`](../assets/): CSS styles and JavaScript files. - [`assets`](../assets/): CSS styles and JavaScript files.
- [`data`](../data/): The theme data files. Now only contains the `icons.yaml` file. - [`data`](../data/): The theme data files. Now only contains the `icons.yaml` file.
- [`exampleSite`](../exampleSite/): The documentation site for the theme. - [`docs`](../docs/): The documentation site for the theme.
- [`i18n`](../i18n/): The theme translation files. - [`i18n`](../i18n/): The theme translation files.
- [`layouts`](../layouts/): The theme layouts. - [`layouts`](../layouts/): The theme layouts.
- [`static`](../static/): The static files for the theme. For example, the favicon and the site logo. - [`static`](../static/): The static files for the theme. For example, the favicon and the site logo.
@@ -84,7 +84,7 @@ Please refer to the [Hugo documentation][hugo] for more information.
npm run dev:theme npm run dev:theme
``` ```
It will start the Hugo server on `http://localhost:1313/` for the `exampleSite` content. It starts the Hugo server on `http://localhost:1313/` for the `docs` content.
### Compile the styles ### Compile the styles

View File

@@ -84,12 +84,12 @@ assets/
### Example Site Development ### Example Site Development
The `exampleSite/` directory serves as both documentation and testing ground: The `docs/` directory serves as both documentation and testing ground:
- Test new features here before releasing - Test new features here before releasing
- Configuration examples in `exampleSite/hugo.yaml` showing multi-language setup - Configuration examples in `docs/hugo.yaml` showing multi-language setup
- Content examples demonstrate all theme capabilities - Content examples demonstrate all theme capabilities
- Run from exampleSite with: `hugo server --themesDir=../..` - Run from docs with: `hugo server --themesDir=../..`
### CSS Development Workflow ### CSS Development Workflow
@@ -115,7 +115,7 @@ The `exampleSite/` directory serves as both documentation and testing ground:
### Key Configuration Files ### Key Configuration Files
- `exampleSite/hugo.yaml` - Example Hugo configuration with multi-language setup - `docs/hugo.yaml` - Example Hugo configuration with multi-language setup
- `postcss.config.mjs` - PostCSS configuration for CSS processing - `postcss.config.mjs` - PostCSS configuration for CSS processing
- `package.json` - Node.js dependencies and build scripts - `package.json` - Node.js dependencies and build scripts
- `taskfile.yaml` - Task runner configuration - `taskfile.yaml` - Task runner configuration
@@ -155,7 +155,7 @@ The `exampleSite/` directory serves as both documentation and testing ground:
### Testing & Quality Assurance ### Testing & Quality Assurance
- Test all changes in `exampleSite/` before releasing - Test all changes in `docs/` before releasing
- Use `npm run dev:theme` for theme development with hot reloading - Use `npm run dev:theme` for theme development with hot reloading
- Format code with `npx prettier --write .` before committing - Format code with `npx prettier --write .` before committing
- Verify multi-language functionality across supported languages - Verify multi-language functionality across supported languages

View File

@@ -7,12 +7,13 @@ BASE_URL=${1:-"http://localhost:1313"}
echo "Using base URL: $BASE_URL" echo "Using base URL: $BASE_URL"
# Version configuration - modify these arrays to specify versions to build # Version configuration - modify these arrays to specify versions to build
# Format: "ref:display_name" (ref can be tag, branch, or commit hash, display name is what will appear in URL) # MAIN_VERSION format: "ref:display_name"
# VERSIONS format: "ref:display_name:source_dir" where source_dir is either "docs" or "exampleSite"
MAIN_VERSION="v0.11.0:latest" MAIN_VERSION="v0.11.0:latest"
VERSIONS=( VERSIONS=(
"main:latest" # latest version always builds from main "main:latest:docs" # latest version always builds from main
"v0.9.6:v0.9" "v0.10.2:v0.10:docs"
"v0.8.6:v0.8" "v0.9.6:v0.9:exampleSite"
) )
# Parse main version # Parse main version
@@ -29,13 +30,13 @@ GIT_HASH=$(git rev-parse --short HEAD)
echo "Building main site from $MAIN_REF (commit: $GIT_HASH)" echo "Building main site from $MAIN_REF (commit: $GIT_HASH)"
hugo \ hugo \
--minify \ --minify \
--themesDir=../.. --source=exampleSite \ --themesDir=../.. --source=docs \
--baseURL "$BASE_URL/" \ --baseURL "$BASE_URL/" \
--destination=../public --destination=../public
# Build all versions # Build all versions
for VERSION in "${VERSIONS[@]}"; do for VERSION in "${VERSIONS[@]}"; do
IFS=':' read -r REF NAME <<< "$VERSION" IFS=':' read -r REF NAME DIR <<< "$VERSION"
git checkout $REF git checkout $REF
GIT_HASH=$(git rev-parse --short HEAD) GIT_HASH=$(git rev-parse --short HEAD)
@@ -44,7 +45,7 @@ for VERSION in "${VERSIONS[@]}"; do
mkdir -p "public/versions/$NAME" mkdir -p "public/versions/$NAME"
hugo \ hugo \
--minify \ --minify \
--themesDir=../.. --source=exampleSite \ --themesDir=../.. --source=$DIR \
--baseURL "$BASE_URL/versions/$NAME/" \ --baseURL "$BASE_URL/versions/$NAME/" \
--destination="../public/versions/$NAME" --destination="../public/versions/$NAME"
done done

View File

@@ -1,4 +1,4 @@
# Theme development config for exampleSite # Theme development config for documentation site
# https://gohugo.io/configuration/build/#cache-busters # https://gohugo.io/configuration/build/#cache-busters
[build] [build]
[build.buildStats] [build.buildStats]

View File

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 168 KiB

View File

@@ -7,7 +7,7 @@ tags:
Hugo تنظیمات خود را از فایل `hugo.yaml` در ریشه سایت شما می‌خواند. Hugo تنظیمات خود را از فایل `hugo.yaml` در ریشه سایت شما می‌خواند.
فایل پیکربندی جایی است که می‌توانید تمام جنبه‌های سایت خود را تنظیم کنید. فایل پیکربندی جایی است که می‌توانید تمام جنبه‌های سایت خود را تنظیم کنید.
برای آشنایی جامع با تنظیمات موجود و بهترین روش‌ها، فایل پیکربندی این سایت [`exampleSite/hugo.yaml`](https://github.com/imfing/hextra/blob/main/exampleSite/hugo.yaml) را در GitHub بررسی کنید. برای آشنایی جامع با تنظیمات موجود و بهترین روش‌ها، فایل پیکربندی این سایت [`docs/hugo.yaml`](https://github.com/imfing/hextra/blob/main/docs/hugo.yaml) را در GitHub بررسی کنید.
<!--more--> <!--more-->
@@ -416,4 +416,4 @@ outputs:
سایر ویژگی‌های Open Graph می‌توانند فقط یک مقدار داشته باشند. سایر ویژگی‌های Open Graph می‌توانند فقط یک مقدار داشته باشند.
به عنوان مثال، این صفحه یک تگ `og:image` (که تصویری برای پیش‌نمایش در اشتراک‌گذاری‌های اجتماعی پیکربندی می‌کند) و یک تگ `og:audio` دارد. به عنوان مثال، این صفحه یک تگ `og:image` (که تصویری برای پیش‌نمایش در اشتراک‌گذاری‌های اجتماعی پیکربندی می‌کند) و یک تگ `og:audio` دارد.
```yaml {filename ```yaml {filename

View File

@@ -7,7 +7,7 @@ tags:
Hugo はサイトのルートにある `hugo.yaml` から設定を読み込みます。 Hugo はサイトのルートにある `hugo.yaml` から設定を読み込みます。
この設定ファイルであなたのサイトのあらゆる側面を設定できます。 この設定ファイルであなたのサイトのあらゆる側面を設定できます。
利用可能な設定項目とベストプラクティスを網羅的に理解するには、GitHub 上のこのサイトの設定ファイル [`exampleSite/hugo.yaml`](https://github.com/imfing/hextra/blob/main/exampleSite/hugo.yaml) を参照してください。 利用可能な設定項目とベストプラクティスを網羅的に理解するには、GitHub 上のこのサイトの設定ファイル [`docs/hugo.yaml`](https://github.com/imfing/hextra/blob/main/docs/hugo.yaml) を参照してください。
<!--more--> <!--more-->
@@ -422,4 +422,4 @@ params:
images: images:
- "/img/config-image.jpg" - "/img/config-image.jpg"
audio: "config-talk.mp3" audio: "config-talk.mp3"
``` ```

View File

@@ -7,7 +7,7 @@ tags:
Hugo reads its configuration from `hugo.yaml` in the root of your Hugo site. 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.
Check out the config file for this site [`exampleSite/hugo.yaml`](https://github.com/imfing/hextra/blob/main/exampleSite/hugo.yaml) on GitHub to get a comprehensive idea of available settings and best practices. Check out the config file for this site [`docs/hugo.yaml`](https://github.com/imfing/hextra/blob/main/docs/hugo.yaml) on GitHub to get a comprehensive idea of available settings and best practices.
<!--more--> <!--more-->

View File

@@ -7,7 +7,7 @@ tags:
Hugo 从站点根目录的 `hugo.yaml` 读取配置。 Hugo 从站点根目录的 `hugo.yaml` 读取配置。
配置文件可用来调整站点的所有方面。 配置文件可用来调整站点的所有方面。
查看本网站的示例配置文件 [`exampleSite/hugo.yaml`](https://github.com/imfing/hextra/blob/main/exampleSite/hugo.yaml) 以全面了解可用设置和最佳实践。 查看本网站的示例配置文件 [`docs/hugo.yaml`](https://github.com/imfing/hextra/blob/main/docs/hugo.yaml) 以全面了解可用设置和最佳实践。
<!--more--> <!--more-->
@@ -422,4 +422,4 @@ params:
images: images:
- "/img/config-image.jpg" - "/img/config-image.jpg"
audio: "config-talk.mp3" audio: "config-talk.mp3"
``` ```

Some files were not shown because too many files have changed in this diff Show More