The change was made to include a new step in the workflow to set up Hugo with version 0.83.0 and enable extended mode. This is necessary to ensure that the correct version of Hugo is used and that extended features are available during the build process.
This commit adds a new GitHub Actions workflow file, artifacts.yml, which is triggered on push events to the main branch. The workflow consists of two jobs: "filter" and "build".
The "filter" job checks if any of the specified files (package.json and assets/**) have changed. If any file in the scope has changed, a step is executed. Otherwise, the workflow is prevented from running.
The "build" job is executed if the branch is main and the repository is not a fork. It performs the following steps:
1. Checkout the repository
2. Setup pnpm package manager
3. Get the pnpm store directory path
4. Setup pnpm cache using actions/cache
5. Install dependencies using pnpm
6. Build the artifacts
7. Configure git user email and name
8. Add all changes to the commit and commit with the message "build: update bundled artifacts [skip ci]"
9. Push the changes to the repository
feat(analytics.html): create partial to include analytics scripts for various analytics services (Google Analytics, Fathom Analytics, Baidu Analytics, Umami Analytics, Plausible Analytics, Cloudflare Analytics, Splitbee Analytics) to track website traffic and user behavior
The `script.html` partial template has been added to handle the rendering of script tags with various attributes and options. It supports the following features:
- If the `Content` variable is provided, it will be rendered as the content of the script tag.
- If the `Source` variable starts with "<script", it will be rendered as safe HTML.
- If the `Source` variable is provided and is a local resource, it will be processed as a template and minified if specified.
- If the `Fingerprint` variable is provided, the resource will be fingerprinted and the integrity attribute will be set accordingly.
- The `Link` variable can be used to specify an external script URL.
- The `Esm` variable can be set to true to render the script tag as a module.
- The `Crossorigin` variable can be set to true to add the crossorigin attribute.
- The `Async` variable can be set to true to add the async attribute.
- The `Defer` variable can be set to true to add the defer attribute.
- The `Attr` variable can be used to add additional attributes to the script tag.
This new partial template provides flexibility and customization options for rendering script tags in the application.
- Change the "dev" script to only run the rollup:dev and hugo:dev commands, removing the unnecessary file removal step.
- Update the "build" script to use the "-f" flag when removing the bundled JS files to avoid errors if the files don't exist. Also, use "yes | cp -rf" to force overwrite the CSS files when copying.
- Change the "server" script to only run the rollup:server and hugo:server commands, removing the unnecessary file removal step.
The sitemap.xml layout file is added to the project. This layout file generates a sitemap for the website using the data from the pages. The sitemap includes URLs for all pages except those in the "gallery" section. Each URL includes the location, last modified date (if available), change frequency (if available), and priority (if available). If a page is translated, alternate links are included for each translation.
The robots.txt file is added to the layouts directory. This file includes rules to block specific bots from crawling the site. The following bots are blocked: MJ12bot, AhrefsBot, BLEXBot, SISTRIX Crawler, sistrix, 007ac9, 007ac9 Crawler, UptimeRobot/2.0, Ezooms Robot, Perl LWP, netEstate NE Crawler (+http://www.website-datenbank.de/), WiseGuys Robot, Turnitin Robot, Heritrix, pricepi, SurdotlyBot, and ZoominfoBot. All other bots are allowed to crawl the site. The file also includes a sitemap directive to point to the sitemap.xml file.
The meta.html file was modified to add three meta tags. The first meta tag sets the description of the website using the `site.Params.description` value. The second meta tag sets the application name using the `site.Params.app.title` value or falls back to the site title if not provided. The third meta tag sets the apple-mobile-web-app-title using the same logic as the second meta tag. These changes were made to improve the SEO and user experience of the website.
The `langCode.html` partial template is added to the `layouts/partials/function` directory. This template is used to check if the current language code matches the site's language code. It iterates over the language codes and sets a boolean variable `$res` to `true` if there is a match. The template then returns the value of `$res`. This partial template can be used in other templates to conditionally render content based on the language code.
refactor(baseof.html): update page title to use site.Title variable for consistency and easier maintenance
refactor(nav.html): update anchor tags to use relURL instead of relLangURL for correct URL generation
refactor(nav.html): update link text to use .Title instead of .Identifier for better readability
feat(hugo.toml): enable robots.txt and set defaultContentLanguage to 'en' in hugo.toml
chore(markup.toml): update goldmark configuration in markup.toml
chore(params.toml): update description and bundled fields in params.toml
chore(sitemap.toml): update changefreq, filename, and priority in sitemap.toml
- Update font files for different languages: NotoSansCJKsc-Regular.woff2, NotoSansCJKtc-Regular.woff2, NotoSansCJKjp-Regular.woff2, NotoSansCJKkr-Regular.woff2, NotoSans-Regular.woff2
- Update font-family declarations in _typography.scss to use the new font files:
- Change font-family for body to 'sans-serif'
- Change font-family for button to 'Noto Sans', sans-serif
- Add font-family declarations for different languages in _typography.scss:
- For English language (en), use 'Geist', sans-serif
- For Simplified Chinese language (zh-cn, zh-sg), use 'Noto Sans', 'Noto Sans CJK SC', sans-serif
- For Traditional Chinese language (zh-hk, zh-mo, zh-tw), use 'Noto Sans', 'Noto Sans CJK TC', sans-serif
- For Japanese language (ja), use 'Noto Sans', 'Noto Sans CJK JP', sans-serif
- For Korean language (ko), use 'Noto Sans', 'Noto Sans CJK KR', sans-serif