Overview of @hugo-fixit/shared
main@hugo-fixit workspace packages. It provides common helpers for path resolution, shell command execution, string manipulation, and logging to maintain consistency across the monorepo.repository·main·Indexed 22 days ago
https://github.com/hugo-fixit/fixitA high-performance, feature-rich Hugo theme for advanced blogging. It includes AI integration, diverse comment systems, rich Markdown extensions (KaTeX, Mermaid, ECharts), and PWA support. The ecosystem provides specialized tools such as @hugo-fixit/encrypt for AES-256-GCM content encryption, @hugo-fixit/chroma-lexers for SCSS map generation, and @hugo-fixit/gen-docs for automated API reference documentation.
@hugo-fixit workspace packages. It provides common helpers for path resolution, shell command execution, string manipulation, and logging to maintain consistency across the monorepo.FixIt is an advanced Hugo theme designed for performance and rich functionality. Key feature areas include:
To balance simplicity and extensibility, FixIt provides a suite of specialized Hugo theme components. These components can be used to add specific functionality to your site without bloating the core theme.
Key components include:
asciinema-embed: For embedding asciinema recordings.caniuse: For displaying Can I Use data.docs-bookmark: To embed bookmarks for FixIt Docs.missing-translation: To indicate missing translations.mmt-netease: For NetEase Cloud random comments.reward-log / sponsor-log: For displaying reward or sponsor logs.FixIt provides an ecosystem of Hugo theme components to balance simplicity with extensibility. You can use individual components for specific features or use fixit-bundle to include the core theme and all components in a single package.
fixit-bundle: Bundles the FixIt core theme and all hugo-fixit components into a single component.cmpt-flyfish: A canvas-implemented animation effect of small fish swimming.cmpt-mdevtools: Mobile devtools component powered by vConsole and eruda.cmpt-santa-hat: A Christmas Easter Egg implemented with JavaScript.cmpt-translate: A component for automatic site translation.shortcode-missing-translation: A component providing a missing-translation shortcode.component-projects: Displays GitHub projects and generates blog posts from README files.hugo-atom-feed: Custom Output Format for ATOM feeds.hugo-json-feed: Custom Output Format for JSON feeds.shortcode-asciinema: Provides the asciinema-embed shortcode.shortcode-caniuse: Provides the caniuse shortcode.shortcode-docs-bookmark: Embeds a bookmark of FixIt Docs.shortcode-mmt-netease: Provides a NetEase Cloud random comment shortcode.shortcode-rewards: Provides reward-log or sponsor-log shortcodes.The @hugo-fixit/chroma-lexers package automates the creation of the $chroma-lexers SCSS map through the following pipeline:
$chroma-lexers) that maps these aliases to their canonical language names.src/custom-types.ts file to the generated map.The integration process follows a specific sequence to ensure a clean and organized unified directory:
public/ directory to prevent stale files from persisting.apps/demo/public/ directly into the root public/ directory.apps/test/public/ into a subdirectory named public/test/.This structure allows the demo application to serve from the root while the test application is isolated within its own path.
The behavior of the versioning tool depends on the mode selected:
v[patch]-[base36_timestamp] (e.g., v0.3.21-mq7veaoa). This mode is intended to run on dev or main branches during a pre-commit hook, specifically when theme files have changed.package.json. It also performs cleanup by removing the nextVersion field if it exists.The tool performs post-build encryption on HTML files by following these steps:
.html files in the target --input directory.<template data-password="..."> elements, which serve as encryption placeholders.data-password hash with a PBKDF2-protected version and writes the encrypted payload back to the template.base64(salt).base64(iv).base64(ciphertext+tag).Encryption is CPU-bound due to the PBKDF2 key derivation. Expect approximately ~53ms per template regardless of file size or count.
You can run the encryption tool using several methods depending on your setup:
npm run postbuild if configured in package.json.npx @hugo-fixit/encrypt without installing globally.npm install -g @hugo-fixit/encrypt and run the fixit-encrypt command directly.npx @hugo-fixit/encryptWhen creating new posts, use the archetypes/posts.md template to define the initial front matter. This archetype automatically generates a title based on the filename and sets a short slug using the first 7 characters of the file's unique ID.
Key fields available in the post front matter include:
title: Automatically derived from the filename.slug: A short identifier (first 7 chars of UniqueID).draft: Set to true by default.repost: An object to control reposting behavior with enable (boolean) and url (string).password and message: Used for content protection/encryption.featured_image and featured_image_preview: For managing post thumbnails.For a full list of supported front matter keys, refer to the official documentation at https://fixit.lruihao.cn/docs/content-management/front-matter/.
---
title: {{ replace .TranslationBaseName "-" " " | title }}
subtitle:
date: {{ .Date }}
slug: {{ substr .File.UniqueID 0 7 }}
draft: true
description:
keywords:
weight: 0
categories:
- draft
collections:
- draft
tags:
- draft
summary:
featured_image:
featured_image_preview:
password:
message:
repost:
enable: false
url:
# See: https://fixit.lruihao.cn/docs/content-management/front-matter/
---
<!--more-->