mirror of
https://github.com/zeon-studio/hugoplate.git
synced 2026-09-10 07:06:19 -04:00
chore: added AGENTS and hugo-template-guidance skill
This commit is contained in:
parent
ff2305e1cb
commit
fa59cb0197
|
|
@ -1,101 +0,0 @@
|
|||
---
|
||||
name: hugoplate-best-practices
|
||||
description: Best practices and architectural patterns for working with the Hugoplate Hugo boilerplate. Use this when modifying theme tokens, configuration, content, layouts, or Tailwind v4 styles in a Hugoplate project.
|
||||
license: MIT
|
||||
---
|
||||
|
||||
# Hugoplate Agent Skill
|
||||
|
||||
This skill provides the best practices and architectural patterns for working with the **Hugoplate** boilerplate. Use this as your primary guide when modifying theme tokens, configuration, content, or layouts.
|
||||
|
||||
## 1. Core Architecture
|
||||
|
||||
Hugoplate is a modern Hugo boilerplate built with:
|
||||
|
||||
- **Hugo (Extended)**: Static site generator.
|
||||
- **Tailwind CSS v4**: Utility-first CSS using Hugo Pipes and the `@theme` directive.
|
||||
- **Hugo Modules**: Theme and feature functionality are imported as modules.
|
||||
- **Theme Generator**: A custom Node.js script (`scripts/themeGenerator.js`) that syncs `data/theme.json` with Tailwind CSS variables.
|
||||
|
||||
## 2. Design System (`theme.json`)
|
||||
|
||||
All design tokens (colors, fonts, sizes) are managed in `exampleSite/data/theme.json`.
|
||||
|
||||
### 2.1 Color Tokens
|
||||
|
||||
- **Default (Light)**: `colors.default.theme_color` and `colors.default.text_color`.
|
||||
- **Dark Mode**: `colors.darkmode.theme_color` and `colors.darkmode.text_color`.
|
||||
- **Logic**: The `themeGenerator.js` script maps these to CSS variables (e.g., `--color-primary`, `--color-darkmode-primary`).
|
||||
|
||||
### 2.2 Typography
|
||||
|
||||
- **Google Fonts**: Defined in `fonts.font_family`. Use the syntax `Family:wght@weights` (e.g., `Inter:wght@400;700`).
|
||||
- **Scale**: `fonts.font_size.scale` controls the heading hierarchy (H1-H6).
|
||||
- **Base**: `fonts.font_size.base` sets the root font size in pixels.
|
||||
|
||||
### 2.3 Workflow: Design Changes
|
||||
|
||||
1. **Modify `theme.json`**: Update colors or fonts.
|
||||
2. **Run Dev Server**: `npm run dev` or `pnpm dev`. This automatically runs `themeGenerator.js` and `hugo server`.
|
||||
3. **Verify**: Check `assets/css/generated-theme.css` to see the updated variables.
|
||||
|
||||
## 3. Configuration System
|
||||
|
||||
Configuration is split across several files in `exampleSite/config/_default/`:
|
||||
|
||||
- `hugo.toml`: Core site settings, build options, and asset fingerprinting.
|
||||
- `params.toml`: Theme-specific toggles (dark mode, search, navigation, etc.).
|
||||
- `menus.en.toml`: Menu structures for English.
|
||||
- `languages.toml`: Multilingual setup.
|
||||
- `module.toml`: Import declarations for Hugo Modules.
|
||||
|
||||
### 3.1 Feature Toggles (`params.toml`)
|
||||
|
||||
Most UI components (e.g., `preloader`, `announcement`, `cookies`) have an `enable` flag. Toggle them here without touching the code.
|
||||
|
||||
## 4. Content Development
|
||||
|
||||
Content is located in `exampleSite/content/english/`.
|
||||
|
||||
### 4.1 Section Content
|
||||
|
||||
Files in `content/english/sections/` are typically used for homepage sections. They often use `build.render = "never"` because they are pulled into `index.html` via `site.GetPage`.
|
||||
|
||||
### 4.2 Front Matter Standards
|
||||
|
||||
Always include `title`, `description` (for SEO), and `image` (feature image). Use `draft: false` to publish.
|
||||
|
||||
## 5. Layouts & Templates
|
||||
|
||||
- **Base**: `layouts/baseof.html` is the master wrapper.
|
||||
- **Homepage**: `layouts/index.html` iterates through section files.
|
||||
- **Partials**: Reusable fragments in `layouts/partials/`.
|
||||
- **Overriding Modules**: To override a module partial, create a file with the same path in your local `layouts/` directory.
|
||||
|
||||
## 6. CSS & Tailwind Best Practices
|
||||
|
||||
- **Tailwind v4**: Uses `@theme` in `assets/css/main.css`. Avoid creating `tailwind.config.js` as it's not the primary way to configure v4 in this project.
|
||||
- **Layers**: Add custom CSS to `assets/css/custom.css` or within `@layer` blocks in `main.css`.
|
||||
- **Images**: Use the `partial "image"` for automatic Hugo responsive processing and WebP conversion.
|
||||
|
||||
## 7. Development Commands
|
||||
|
||||
| Command | Purpose |
|
||||
|---------|---------|
|
||||
| `npm run dev` | Start dev server with theme watching. |
|
||||
| `npm run build` | Production build with minification and fingerprinting. |
|
||||
| `npm run update-modules` | Clean and update Hugo modules to latest. |
|
||||
| `npm run remove-darkmode` | Permanently remove dark mode functionality. |
|
||||
| `npm run remove-multilang` | Permanently remove multilingual support. |
|
||||
|
||||
## 8. Troubleshooting
|
||||
|
||||
- **Styles not updating**: Ensure `npm run dev` is running (it needs to regenerate `generated-theme.css`).
|
||||
- **Classes missing**: Tailwind v4 in this project scans `hugo_stats.json`. If a new class isn't working, try a full rebuild.
|
||||
- **Google Fonts error**: Check for spaces or incorrect weight syntax in `theme.json`.
|
||||
|
||||
## 9. AI Agent Guidelines
|
||||
|
||||
- **Always Read Context**: Before modifying a layout, check if a partial exists in `layouts/partials/essentials/` that might already handle it.
|
||||
- **Prefer Tokens**: Never hardcode hex colors in CSS. Add them to `theme.json` and use the generated Tailwind classes.
|
||||
- **Check Params**: Before writing logic to hide/show a section, check `params.toml` for an existing toggle.
|
||||
32
.agents/skills/find-skills/SKILL.md
Normal file
32
.agents/skills/find-skills/SKILL.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
name: find-skills
|
||||
description: Helps users discover and install agent skills when they ask "how do I do X", "find a skill for X", "is there a skill that can...", or want to extend capabilities.
|
||||
---
|
||||
|
||||
# Find Skills
|
||||
|
||||
Discover and install skills from the open agent-skills ecosystem.
|
||||
|
||||
## When to use
|
||||
|
||||
User asks "how do I do X" / "find a skill for X" / "can you do X", wants to search tools or workflows, or wishes for help in a domain (design, testing, deployment…).
|
||||
|
||||
## Skills CLI (`npx skills`)
|
||||
|
||||
- `npx skills find [query]` — search
|
||||
- `npx skills add <owner/repo@skill> -g -y` — install (`-g` global, `-y` no prompt)
|
||||
- `npx skills check` / `update` — updates
|
||||
- Browse: https://skills.sh/
|
||||
|
||||
## How to help
|
||||
|
||||
1. **Identify** domain + specific task; judge if a skill likely exists.
|
||||
2. **Check the leaderboard** (https://skills.sh/) first — ranked by installs. Known good: `vercel-labs/agent-skills`, `anthropics/skills`.
|
||||
3. **Search** if needed: `npx skills find hugo seo`.
|
||||
4. **Verify before recommending**: install count (prefer 1K+, wary <100), source reputation (official > unknown), GitHub stars.
|
||||
5. **Present**: name + what it does, install count/source, install command, skills.sh link.
|
||||
6. **Offer to install** if they want.
|
||||
|
||||
## Tips & fallback
|
||||
|
||||
Use specific keywords ("hugo seo" > "seo"); try synonyms (deploy/deployment/ci-cd). If nothing found: say so, offer to do the task directly, suggest `npx skills init` for a custom skill.
|
||||
30
.agents/skills/hugo-template-guidance/SKILL.md
Normal file
30
.agents/skills/hugo-template-guidance/SKILL.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
name: hugo-template-guidance
|
||||
description: Use whenever you need to understand how this theme works — adding pages, managing content, configuring the site, using partials/components/modules, project architecture, scripts, or Tailwind v4 styling/theming. Use for ANY question about the structure, usage, or customization of the template or theme.
|
||||
---
|
||||
|
||||
# Template Guidance
|
||||
|
||||
Handbook for this theme (Hugo Extended + Tailwind v4 + Hugo Modules), assuming the standard **project-setup** layout (site at root, theme vendored in `themes/<theme>/` — the single folder under `themes/`; see `references/detect-mode.md` to find its name). Progressive disclosure: **read the matching `references/` file before acting.**
|
||||
|
||||
> If `exampleSite/hugo.toml` exists, the repo is still in theme-setup — run `pnpm project-setup` first (see `references/detect-mode.md`) before using anything below.
|
||||
|
||||
## Routing Guide
|
||||
|
||||
| Request | Read |
|
||||
| ----------------------------------------------------------- | ------------------------------------ |
|
||||
| Detect or convert setup mode (theme-setup vs project-setup) | `references/detect-mode.md` |
|
||||
| Architecture, folder layout, data flow | `references/project-architecture.md` |
|
||||
| Add a page, route, or homepage section | `references/adding-new-pages.md` |
|
||||
| Partials, components, shortcodes, Hugo Modules | `references/component-usage.md` |
|
||||
| Add, remove, or enable a Hugo Module (`module.toml`) | `references/hugo-modules.md` |
|
||||
| Markdown content, frontmatter, taxonomies | `references/content-management.md` |
|
||||
| Add/configure a new language, multilingual, i18n, translate | `references/i18n-guidance.md` |
|
||||
| Site config, menus, social, feature toggles, SEO | `references/page-configuration.md` |
|
||||
| pnpm/Node scripts, generators, module updates | `references/script-usage.md` |
|
||||
| Tailwind v4, dark mode, design tokens (`data/theme.json`) | `references/styling-and-theming.md` |
|
||||
|
||||
## Steps
|
||||
|
||||
1. Read the matching reference.
|
||||
2. Follow it.
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
# Adding New Pages or New Sections
|
||||
|
||||
Hugo derives the URL from the content path under the language `contentDir`, and the template from section/kind/`layout`. Content goes under `content/english/` (root, project-setup).
|
||||
|
||||
There are three distinct things you'll be asked for — pick the matching recipe:
|
||||
|
||||
| Asking for... | It means... | Recipe |
|
||||
| --------------------------------------------------------------- | --------------------------------------------------------------------- | -------- |
|
||||
| "Add a page like About" (custom layout, image, hero, etc.) | Content + a **dedicated template** selected via `layout:` frontmatter | Recipe 1 |
|
||||
| "Add a page like Elements / Privacy Policy" (just text content) | Content only, rendered by the **existing generic template** | Recipe 2 |
|
||||
| "Add a section like Call to Action" (homepage block) | A **content block** + **partial** wired into `home.html` | Recipe 3 |
|
||||
|
||||
## Where new/overridden layouts go — root `layouts/`, never `themes/<theme>/layouts/`
|
||||
|
||||
Hugo's union filesystem makes root take precedence over the theme for the **same relative path**. This is the standard Hugo way to customize a theme without forking it, and it's how this theme stays upgradeable:
|
||||
|
||||
- **New templates, template overrides, new sections, new partials/components** → create them under root `layouts/` at the same relative path the theme would use (e.g. `layouts/about.html`, `layouts/_partials/components/my-card.html`).
|
||||
- **Never create or edit files directly under `themes/<theme>/layouts/`** — those are vendored and reset/overwritten on theme updates (`pnpm update:theme` etc.).
|
||||
- To override an existing theme template/partial, copy it from `themes/<theme>/layouts/...` to the identical path under root `layouts/...`, then edit the copy.
|
||||
- To add something brand new (a new partial, a new template, a new shortcode), just create it under root `layouts/...` directly — no theme copy needed.
|
||||
|
||||
## Recipe 1 — Custom-templated page with frontmatter (like `about`)
|
||||
|
||||
Use when the page needs its own layout (hero image, custom sections) beyond plain content — not just a title + body.
|
||||
|
||||
1. **Content** — `content/english/<section>/_index.md` (or `pages/my-page.md`).
|
||||
|
||||
2. **Template** — `layouts/<layout-name>.html` (root, mirroring the theme path — see above). Define `"main"` and read `.Title`, `.Params.*`, `.Content`.
|
||||
- The frontmatter `layout: "<name>"` must match the template filename (`layouts/<name>.html`).
|
||||
- **Analyze an existing template first** (`about.html`, `contact.html`)
|
||||
- `baseof.html` supplies head/header/footer/SEO around `"main"` — never omit `{{ define "main" }}`.
|
||||
|
||||
## Recipe 2 — Generic markdown page (like `elements`, `privacy-policy`)
|
||||
|
||||
Use when the page is just a title + long-form content — no custom layout needed.
|
||||
|
||||
1. **Content only** — `content/english/pages/my-page.md`, frontmatter has **no `layout` field**:
|
||||
2. **No template needed** — falls through to the existing `single.html`.
|
||||
|
||||
## Recipe 3 — New section (like `call-to-action`)
|
||||
|
||||
Use when adding a new block to the homepage or any other page that's toggled on/off and editable via content frontmatter.
|
||||
|
||||
1. **Content block** — `content/english/sections/my-section.md`. Must include `enable: true/false` and `build.render: "never"` (so it doesn't become a standalone page); add whatever params the partial needs:
|
||||
|
||||
```yaml
|
||||
---
|
||||
enable: true
|
||||
title: "Section title"
|
||||
image: "/images/my-section.png"
|
||||
description: "Section description"
|
||||
button:
|
||||
enable: true
|
||||
label: "Call to action"
|
||||
link: "https://example.com"
|
||||
build:
|
||||
render: "never"
|
||||
---
|
||||
```
|
||||
|
||||
2. **Partial** — `layouts/_partials/my-section.html` (root, new file — no theme copy needed). Fetch the content via `site.GetPage`, gate on `.Params.enable`, render using `.Title` / `.Params.*`:
|
||||
|
||||
```go-html-template
|
||||
<!-- My Section -->
|
||||
{{ with site.GetPage "sections/my-section" }}
|
||||
{{ if .Params.enable }}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h2>{{ .Title | markdownify }}</h2>
|
||||
<p>{{ .Params.description | markdownify }}</p>
|
||||
{{ with .Params.button }}
|
||||
{{ if .enable }}
|
||||
<a class="btn btn-primary" href="{{ .link | absURL }}">{{ .label }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- /My Section -->
|
||||
```
|
||||
|
||||
3. **Wire into the page layout** — `layouts/home.html` (root override; copy from `themes/<theme>/layouts/home.html` first if not already present), add:
|
||||
|
||||
```go-html-template
|
||||
{{ partial "my-section" . }}
|
||||
```
|
||||
|
||||
Place it in the right position relative to the other `{{ partial ... }}` / section blocks already in `home.html`.
|
||||
|
||||
## Navigation
|
||||
|
||||
Surface a page (Recipes 1 & 2) via `config/_default/menus.en.toml` (don't hardcode links):
|
||||
|
||||
```toml
|
||||
[[main]]
|
||||
name = "My New Page" url = "/my-new-page" weight = 5 # parent = "Pages" to nest
|
||||
```
|
||||
|
||||
## Linking other pages with relative URLs
|
||||
|
||||
`<a href="{{ .link | absURL }}">` — Hugo's `absURL` generates the correct URL based on the content path and `[permalinks]` config. Don't hardcode paths.
|
||||
|
||||
## DO NOT
|
||||
|
||||
- Use legacy paths — `_partials/`, `home.html`, top-level `baseof.html`.
|
||||
- Create or edit files directly under `themes/<theme>/layouts/` — add new templates/sections/components or override existing ones under root `layouts/` at the same relative path.
|
||||
- Add a `layout:` frontmatter field that doesn't match an existing/new `layouts/<name>.html` (Recipe 1) — Hugo silently falls back to the default template.
|
||||
- Omit `{{ define "main" }}` — page renders with no head/header/footer/SEO.
|
||||
- Invent frontmatter — copy a same-recipe page (e.g. copy `about` for Recipe 1, `privacy-policy` for Recipe 2, `call-to-action` for Recipe 3).
|
||||
- Create a section file (Recipe 3) without `build.render: "never"` (stray page).
|
||||
- Hardcode nav links; guess permalink behavior — check `[permalinks]` in `hugo.toml`.
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
# Component Usage
|
||||
|
||||
Template/partial/module architecture. Theme templates live in `themes/<theme>/layouts/`; override by recreating the same path under **root** `layouts/` (Hugo unions root over theme).
|
||||
|
||||
## New template system (don't "fix" to legacy)
|
||||
|
||||
Hugo 0.146+: partials in **`layouts/_partials/`** (not `partials/`), homepage **`home.html`** (not `index.html`), base **`baseof.html`** top-level (not `_default/baseof.html`).
|
||||
|
||||
```text
|
||||
themes/<theme>/layouts/
|
||||
baseof.html # <html>/<head>/body, {{ block "main" . }}
|
||||
home.html single.html list.html taxonomy.html term.html about.html contact.html 404.en.html
|
||||
blog/ authors/ # section list.html + single.html
|
||||
_partials/ # reusable partials
|
||||
essentials/ # head, header, footer, script, style (used by baseof)
|
||||
components/ # author-card, blog-card, breadcrumb, pagination, theme-switcher, language-switcher, tw-size-indicator
|
||||
widgets/ # categories, tags, widget-wrapper
|
||||
page-header.html call-to-action.html
|
||||
```
|
||||
|
||||
**List `themes/<theme>/layouts/` + `_partials/` (and any root `layouts/` overrides) before assuming a template exists.** Many partials (`image`, `basic-seo`, `search-modal`, `favicon`, `manifest`, `announcement`…) come from **Hugo Modules**, not this repo.
|
||||
|
||||
## Partials & Modules
|
||||
|
||||
- `{{ partial "name.html" . }}`; `{{ partialCached ... }}` for page-invariant output (styles, scripts, announcement) — `baseof.html` does this deliberately; match it.
|
||||
- Override a **module** partial by creating the same path in root `layouts/_partials/` (union FS wins).
|
||||
- `config/_default/module.toml` lists available `gethugothemes/hugo-modules` modules, check `https://github.com/gethugothemes/hugo-modules` for more.
|
||||
- **Active:** `llms-txt`, `search`, `pwa`, `images`, `videos`, `icons/font-awesome`, `gzip-caching`, `adsense`, `accordion`, `table-of-contents``tab`, `modal`, `gallery-slider`, `components/{preloader,announcement,cookie-consent,social-share,custom-script,open-remark,render-link}`, `shortcode{button,notice,mermaid}`, `seo-tools/{basic-seo,site-verifications,google-tag-manager}`.
|
||||
- **Disabled but available** (commented out): `icons/themify-icons`, `components/{valine-comment,crisp-chat}`, `seo-tools/{baidu-analyticmatomo-analytics,plausible-analytics,counter-analytics}`.
|
||||
- You can create custom partial components into `layouts/_partials/` and use them in templates, but for anything non-trivial, check if a module already provides it first.
|
||||
- You can create custom shortcodes in `layouts/shortcodes/` and use them in content, but check if a module already provides it first (e.g. `button`, `notice`, `mermaid`, accordion/tab/modal/gallery shortcodes come from modules).
|
||||
|
||||
# Most used Shortcodes or Partials
|
||||
|
||||
- **Image Module**: responsive images with Tailwind classes, lazy loading, optional XL display; accepts `Src`, `Alt`, `Class`, `Loading`, and `DisplayXL` etc keys in a dict. check `https://github.com/gethugothemes/hugo-modules/tree/master/images` for more (e.g. `DisplayXL` makes it full-width on XL screens and above, but normal on smaller screens and can use background-image can also use at shortcode). Also very important the images are stored in `/assets/images/` (not `static/`) so they get processed by Hugo's image pipeline and can be used with the `image` partial/shortcode.
|
||||
partial example: `{{ partial "image" (dict "Src" .Params.featured_image "Alt" .Title "Class" "my-4 rounded-lg") }}`
|
||||
shortcode example: `{{< image src="/path/to/image.jpg" alt="Alt text" class="my-4 rounded-lg" display_xl=true >}}`
|
||||
- **Page Header**: used on almost all single, list or custom templates; accepts `Title`, `Subtitle`, and `Background` keys in a dict; check `layouts/_partials/page-header.html` for usage.
|
||||
example: `{{ partial "page-header" . }}` or `{{ partial "page-header" (dict "Title" .Title "Subtitle" .Params.subtitle "Background" .Params.featured_image) }}`
|
||||
|
||||
# Reusable components
|
||||
|
||||
Reusable components should be added as partials under `layouts/_partials/components/` and used via `{{ partial "components/name.html" . }}`. Check the existing components for examples of how to write them, and check if a Hugo Module already provides the component before creating a new one.
|
||||
|
||||
## Styling
|
||||
|
||||
Tailwind utilities + tokens (`text-primary`, `bg-body`, `dark:bg-darkmode-body`); reusable CSS classes in `assets/css/components.css` or `custom.css`. See `references/styling-and-theming.md`.
|
||||
|
||||
## DO NOT
|
||||
|
||||
- Rename `_partials/`→`partials/`, `home.html`→`index.html`, or move `baseof.html` into `_default/`.
|
||||
- Assume a partial is missing because it's not in `themes/<theme>/layouts/` — check `module.toml` first.
|
||||
- Edit a vendored module in the Go cache, or files under `themes/<theme>/` directly — override via root `layouts/`.
|
||||
- Hand-roll `<img>` for content images — use `partial "image"`. Hardcode hex — use tokens.
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
# Content Management
|
||||
|
||||
Markdown under the language content dir, rendered via Hugo's content/layout pairing. Content lives at root: `content/english/`.
|
||||
|
||||
## Architecture
|
||||
|
||||
Multilingual — each language sets `contentDir` in `config/_default/languages.toml` (English → `content/english/`). **List the dir before assuming the language** (e.g. `content/english/blog/post.md` → English, not `content/blog/post.md`).
|
||||
Common examples often found here include:
|
||||
|
||||
- **Blog Posts**: `blog/` (posts + `_index.md`).
|
||||
- **Authors**: `authors/` (one file each + `_index.md`).
|
||||
- **Pages**: `about/_index.md`, `contact/_index.md`, `pages/*.md`.
|
||||
- **Reuseable Sections**: `sections/*.md`.
|
||||
|
||||
## Frontmatter (common fields)
|
||||
|
||||
Hugo reads what templates expect, so **mirror an existing file in the same section** rather than guessing.
|
||||
|
||||
- `title`: String. The main title of the post.
|
||||
- `date`: ISO Date string (e.g., `2022-04-04T05:00:00Z`), use exact current time for `date` otherwise Hugo won't render it.
|
||||
- `description`: String. Short summary used for lists and SEO.
|
||||
- `image`: String. Path to the cover image (starts with `/images/`).
|
||||
- `draft`: Boolean (`true`/`false`).
|
||||
|
||||
## Section-specific common frontmatter:
|
||||
|
||||
- **Blog post**: `title`, `meta_title`, `description`, `date`, `image`, `categories[]`, `tags[]`, `author`, `draft`. `author` must match an author `title` in `authors/`; `categories`/`tags` are taxonomies (links auto); `draft: true` hides in prod.
|
||||
- **Author**: `title`, `email`, `image`, `description`, `social[]`.
|
||||
- **any reuseable section** (`sections/*.md`): `enable`, `title`, `image`, `description`, `button` (`enable`/`label`/`link`), and `build.render: "never"`
|
||||
|
||||
## Naming, Images, i18n
|
||||
|
||||
- Kebab-case filenames → URL slug (`my-post.md` → `/blog/my-post/`). Section landing = `_index.md` (branch bundle); co-located resources = `page/index.md` (leaf bundle).
|
||||
- Images go under `assets/images/` and use image module `{{ partial "image" (dict "Src" .image "Alt" "..." "Loading" "eager" "Class" "..." "DisplayXL" "800x") }}` — don't hand-write `<img>`.
|
||||
|
||||
## Common Mistakes / What NOT to do
|
||||
|
||||
- **DO NOT** Reference an `author` with no file in `authors/`.
|
||||
- **DO NOT** Drop `build.render: "never"` from section files (creates stray pages).
|
||||
- **DO NOT** Use relative image paths — use `/images/...` under `assets/images/`.
|
||||
- **DO NOT** Put content outside the language `contentDir`.
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
# Detect Setup Mode
|
||||
|
||||
This theme ships in two structures; the same logical file lives at a different path in each. **Always detect the current mode first** — before reading or editing any content, config, layout, style, or script file.
|
||||
|
||||
## Detection
|
||||
|
||||
- **`exampleSite/hugo.toml` exists → theme-setup** — theme at root (`layouts/`, `assets/`, `theme.toml`), demo site in `exampleSite/`.
|
||||
- **Root `hugo.toml` + `themes/` → project-setup** — site at root (`content/`, `config/`, `data/`, `hugo.toml`), theme vendored in `themes/<theme>/` (the single folder under `themes/` — run `ls themes/` to confirm its name; in this repo it's `hugoplate`).
|
||||
|
||||
### Edge case
|
||||
|
||||
If all of the following are true:
|
||||
|
||||
- `exampleSite/` exists
|
||||
- `themes/<theme>/` exists
|
||||
- `exampleSite/hugo.toml` is the active Hugo config
|
||||
- `themes/<theme>/layouts/home.html` does **not** exist
|
||||
|
||||
then treat the repository as **theme-setup**, not **project-setup**. So Before running `pnpm project-setup` or `pnpm dev` ask user if they want to delete the `themes/` directory and run `pnpm project-setup` to convert to project-setup, deleting `themes/` is required otherwise when running `pnpm project-setup`, it will detect current mode as `project-setup` which is false.
|
||||
|
||||
## Always work in `project-setup` mode
|
||||
|
||||
If the repo or project is currently in theme-setup, run `pnpm project-setup` **before** editing or reading any content, config, layout, or style file — this is non-negotiable.
|
||||
|
||||
- **Idempotent** — logs "Project already setup" and no-ops if already converted, so it's always safe to run.
|
||||
- **Never move files between modes by hand** — only `pnpm project-setup` / `pnpm theme-setup` (reverse) do this correctly.
|
||||
- `dev:example` / `build:example` / `preview:example` scripts exist only for theme-setup (run against `exampleSite/`). Once converted via `pnpm project-setup`, they no longer apply — don't reach for them as a shortcut to avoid converting.
|
||||
|
||||
## After conversion
|
||||
|
||||
For the full project-setup folder layout and path-resolution table, see `references/project-architecture.md`.
|
||||
|
||||
## Canonical source
|
||||
|
||||
This file is the canonical source for setup-mode detection and conversion. `AGENTS.md` and the other references in this skill link here instead of repeating the rule.
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
# Adding or Removing Hugo Modules
|
||||
|
||||
Hugo Modules (`https://github.com/gethugothemes/hugo-modules`) provide most non-trivial functionality — search, SEO, images, PWA, accordions/tabs/modals, shortcodes, announcement bar, analytics, etc. Each is a separate Go module declared as an `[[imports]]` block in **`config/_default/module.toml`**.
|
||||
|
||||
## Enable a module
|
||||
|
||||
1. In `config/_default/module.toml`, either uncomment an existing `# [[imports]]` / `# path = "..."` pair, or add a new block:
|
||||
|
||||
```toml
|
||||
[[imports]]
|
||||
path = "github.com/gethugothemes/hugo-modules/<module-name>"
|
||||
```
|
||||
|
||||
Module names are paths under `github.com/gethugothemes/hugo-modules/` (e.g. `search`, `pwa`, `icons/themify-icons`, `seo-tools/plausible-analytics`, `components/crisp-chat`).
|
||||
|
||||
2. Run `pnpm update-modules` to fetch the module and rewrite `go.mod`/`go.sum`.
|
||||
3. Restart the dev server (`npx kill-port 1313 -y && pnpm dev`).
|
||||
4. Use the partials/shortcodes/config the module adds — check the module's source (URL is the `path` value) for its partial names, shortcode names, and any `params`/`config` block it expects in `config/_default/params.toml` or similar and what kind of data it expects accoding to its docs (e.g. `images` module's `image` partial expects a dict with `Src`, `Alt`, `Loading`, `Class`, and `DisplayXL` keys).
|
||||
|
||||
## Disable or delete a module
|
||||
|
||||
1. Delete or comment out its `[[imports]]` block in `config/_default/module.toml`.
|
||||
2. Remove anything in the site that depends on it — `partial`/`partialCached` calls, shortcodes used in content, and any related config block (e.g. `[search]` in `params.toml`). Leaving these in place causes build errors ("partial not found") once the module is gone.
|
||||
3. Run `pnpm update-modules`.
|
||||
4. Restart the dev server.
|
||||
|
||||
## Currently available but disabled (commented out in `module.toml`)
|
||||
|
||||
`icons/themify-icons`, `components/valine-comment`, `components/crisp-chat`, `seo-tools/baidu-analytics`, `seo-tools/matomo-analytics`, `seo-tools/plausible-analytics`, `seo-tools/counter-analytics` — uncomment + `pnpm update-modules` to enable.
|
||||
|
||||
## DO NOT
|
||||
|
||||
- Hand-edit `go.mod` / `go.sum` — they're regenerated by `pnpm update-modules`.
|
||||
- Edit a module's files under the Go module cache or `themes/<theme>/` — modules are read-only dependencies; override their partials via root `layouts/_partials/` instead (see `references/component-usage.md`).
|
||||
- Remove an `[[imports]]` block while partials/shortcodes from that module are still referenced — fix or remove those usages first.
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# Adding a New Language, Translations, i18n Strings, and Menu Items
|
||||
|
||||
Multilingual via Hugo's standard system. Mirrors an existing language (`en`) — config, menu, i18n strings, content tree.
|
||||
|
||||
## Files involved (all at root)
|
||||
|
||||
| File | Path |
|
||||
| ---------------- | --------------------------------- |
|
||||
| Languages config | `config/_default/languages.toml` |
|
||||
| Menu | `config/_default/menus.<xx>.toml` |
|
||||
| i18n strings | `i18n/<xx>.yaml` |
|
||||
| Content | `content/<langdir>/` |
|
||||
| Build/verify | `pnpm dev` / `pnpm build` |
|
||||
|
||||
## Adding New Language Checklist
|
||||
|
||||
1. **`config/_default/languages.toml`** — add a block:
|
||||
|
||||
```toml
|
||||
[xx]
|
||||
label = "Native Name" # <- shown in the header language switcher
|
||||
locale = "xx-yy"
|
||||
contentDir = "content/<langdir>"
|
||||
weight = N
|
||||
```
|
||||
|
||||
2. **`config/_default/menus.<xx>.toml`** — copy `menus.en.toml`, translate `name` values (keep `url`/`weight`/`parent` keys as-is so routes still match).
|
||||
|
||||
3. **`i18n/<xx>.yaml`** — copy `i18n/en.yaml`, translate values.
|
||||
|
||||
4. **`content/<langdir>/`** — copy `content/english/` (or the existing language's content), keeping the same relative paths (e.g., `content/english/blog/post.md` → `content/<langdir>/blog/post.md`), then translate frontmatter and markdown.
|
||||
|
||||
## Verify
|
||||
|
||||
Build with `pnpm build` — **never bare `hugo`**
|
||||
|
||||
## DO NOT
|
||||
|
||||
- Don't translate paths/filenames in `content/<langdir>/` — Hugo matches translations by identical relative path.
|
||||
- Don't run `pnpm remove-multilang` to "reset" — it's destructive and permanent.
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# Page and Site Configuration
|
||||
|
||||
Global settings, navigation, social, feature toggles, SEO. Files are at the project root (`hugo.toml`, `config/_default/`, `data/`). **Read the actual file before editing; prefer toggling a flag over deleting keys.**
|
||||
|
||||
## Files
|
||||
|
||||
- **`hugo.toml`** — core: `baseURL`, `title`, `timeZone`, taxonomies/permalinks, pagination, `[build.buildStats]` (feeds Tailwind), `[outputs]`, markup, imaging, `[[params.plugins.css/js]]` asset lists. The `theme =` line is comment-managed by the setup scripts — don't toggle by hand.
|
||||
- **`config/_default/params.toml`** — theme params + **feature toggles** (most components have an `enable` flag): branding (`logo*`, `favicon`), `navbar_fixed`, `theme_switcher`, `theme_default`, `mainSections`; `[preloader]`/`[search]`/`[announcement]`/`[cookies]`/`[subscription]`/`[google_map]`/`[open_remark]`/`[navigation_button]`; SEO `[metadata]`; `[llms]`; `[site_verification]`. **Check here for an existing toggle before writing show/hide template logic.**
|
||||
- **`config/_default/menus.en.toml`** — header `[[main]]` (`name`, `url`, `weight`; nest via `parent`), footer `[[footer]]`. One file per language.
|
||||
- **`config/_default/languages.toml`** — per-language `label`/`locale`/`contentDir`/`weight`.
|
||||
- **`config/_default/module.toml`** — `[hugoVersion]` range + `[[imports]]` (the `gethugothemes/hugo-modules` packages). Self-import comment-managed by setup scripts. See `references/component-usage.md`.
|
||||
- **`config/_default/security.toml`** — Hugo security policy; touch only if a build is blocked.
|
||||
- **`data/social.json`** — footer/social links (`name`, `icon` FA class, `link`); empty/remove to hide.
|
||||
- **`data/theme.json`** — colors/fonts → see `references/styling-and-theming.md`.
|
||||
|
||||
## SEO
|
||||
|
||||
Resolves with fallback (via `basic-seo` module): per-page frontmatter (`title`, `meta_title`, `description`, `image`) → global `params.toml [metadata]`.
|
||||
|
||||
## DO NOT
|
||||
|
||||
- Toggle `theme =` (`hugo.toml`) or `[[imports]]` (`module.toml`) by hand — the setup scripts own that state.
|
||||
- Delete keys to disable a feature — set its `enable = false`.
|
||||
- Hardcode nav links into templates — use `menus.*.toml`.
|
||||
- Use a relative `baseURL` in production — fully-qualified URL.
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
# Project Architecture
|
||||
|
||||
This theme = **Hugo Extended (0.158+)** + **Tailwind v4** + **Hugo Modules**.
|
||||
|
||||
This reference assumes the **project-setup** layout: site files at root, theme vendored in `themes/<theme>/`. If `exampleSite/hugo.toml` exists instead, run `pnpm project-setup` first (see `references/detect-mode.md`).
|
||||
|
||||
## Folder Structure
|
||||
|
||||
**Always list the root + `themes/<theme>/` to confirm before assuming a path.**
|
||||
|
||||
```text
|
||||
hugo.toml # entry config
|
||||
config/_default/ # params, menus, languages, module, security
|
||||
content/english/ # site content (per-language)
|
||||
data/ # theme.json, social.json
|
||||
i18n/ # translation strings
|
||||
static/ # byte-for-byte files (robots.txt, _redirects)
|
||||
assets/ # root overrides: images/, css/custom.css
|
||||
go.mod / go.sum # Hugo Modules checksum
|
||||
|
||||
themes/<theme>/ # vendored theme
|
||||
theme.toml
|
||||
layouts/ # THEME templates (new system):
|
||||
baseof.html home.html single.html list.html taxonomy.html term.html
|
||||
blog/ authors/ # section list+single
|
||||
_partials/ # essentials/, components/, widgets/
|
||||
assets/ # THEME assets: css/ (Tailwind entry + layers + generated-theme.css), js/, plugins/
|
||||
```
|
||||
|
||||
> **Hugo unions root over theme** — a root `assets/`, `layouts/`, `static/`, or `content/` file **overrides** the same path in `themes/<theme>/`. That's the correct way to customize without editing vendored files (e.g. `assets/css/custom.css` at root overrides the theme's copy).
|
||||
|
||||
Much functionality (search, SEO, images, PWA, shortcodes, announcement…) comes from **Hugo Modules** in `config/_default/module.toml` (`gethugothemes/hugo-modules`), not local code — see `references/component-usage.md`.
|
||||
|
||||
## Data Flow
|
||||
|
||||
1. Markdown in `content/english/<section>/` carries frontmatter.
|
||||
2. Hugo maps section→template (e.g. `blog/*` → `layouts/blog/{single,list}.html`; `_index.md` → `home.html`) — resolved from `themes/<theme>/layouts/`, or a root `layouts/` override if present.
|
||||
3. Template defines `"main"`; `baseof.html` wraps it with `_partials/essentials/*`.
|
||||
4. Homepage blocks live in `content/english/sections/*.md` (`build.render = "never"`), pulled via `site.GetPage`/`.Params`.
|
||||
5. `themes/<theme>/assets/css/main.css` imports Tailwind + `generated-theme.css` + custom layers (root `assets/css/custom.css` layers on top).
|
||||
|
||||
## Edit vs. Never-touch
|
||||
|
||||
**✅ Edit:** `content/**`, `config/_default/**` + `hugo.toml`, `data/theme.json` + `data/social.json`, `assets/css/custom.css`, `i18n/**`. Override theme templates/styles by recreating the same path under root `layouts/` / `assets/`.
|
||||
|
||||
**🚫 Never touch:** `themes/<theme>/assets/css/generated-theme.css` (auto-generated from `data/theme.json`), `hugo_stats.json` (Hugo build stat, feeds Tailwind), `scripts/` (breaks the CSS pipeline / mode switches), files under `themes/<theme>/` directly (override via root instead).
|
||||
|
||||
## Build Pipeline
|
||||
|
||||
`pnpm dev` / `pnpm build` →
|
||||
|
||||
1. `themeGenerator.js` reads `data/theme.json` → writes `themes/<theme>/assets/css/generated-theme.css` (`--watch` in dev).
|
||||
2. Hugo build; `[build.buildStats]` writes `hugo_stats.json` which Tailwind scans (`@source "hugo_stats.json"`) for class detection.
|
||||
3. Modules resolved from the Go cache (`go.sum`).
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
# Script Usage
|
||||
|
||||
Package manager is **`pnpm`**. This reference assumes project-setup (see `references/detect-mode.md` for the one-time `pnpm project-setup` conversion).
|
||||
|
||||
## Dev & Build
|
||||
|
||||
| Command | Does |
|
||||
| ---------------- | ----------------------------------------------------------- |
|
||||
| `pnpm dev` | `themeGenerator.js --watch` + `hugo server` concurrently |
|
||||
| `pnpm build` | `themeGenerator.js` then `hugo --gc --minify` |
|
||||
| `pnpm preview` | production-flavored local server |
|
||||
|
||||
**Never run bare `hugo server`** — it skips `themeGenerator.js`, leaving `generated-theme.css` stale and colors/fonts broken.
|
||||
|
||||
## Modules & Maintenance
|
||||
|
||||
| Command | Does |
|
||||
| ----------------------- | -------------------------------------------------------------------- |
|
||||
| `pnpm update-modules` | `clearModules.js` + `hugo mod clean --all` / `get -u ./...` / `tidy` |
|
||||
| `pnpm update-theme` | pull latest theme updates from upstream |
|
||||
| `pnpm remove-darkmode` | **permanently** strips dark mode, then `pnpm format` |
|
||||
| `pnpm remove-multilang` | **permanently** strips multilingual scaffolding |
|
||||
| `pnpm format` | Prettier (Go-template + Tailwind plugins) |
|
||||
|
||||
`remove-*` are destructive and not cleanly reversible — confirm + commit first.
|
||||
|
||||
## `scripts/`
|
||||
|
||||
`themeGenerator.js` (theme.json → generated-theme.css, `--watch`; never bypass) · `projectSetup.js`/`themeSetup.js` (mode switches, see `references/detect-mode.md`) · `themeUpdate.js` · `clearModules.js` · `removeDarkmode.js`/`removeMultilang.js`.
|
||||
|
||||
## DO NOT
|
||||
|
||||
- Run `hugo server` directly — use `pnpm dev`.
|
||||
- Hand-edit `generated-theme.css` / `hugo_stats.json` — edit `data/theme.json`, let the generator run.
|
||||
- Move files between modes manually — use `pnpm project-setup` / `pnpm theme-setup`.
|
||||
- Run `remove-darkmode`/`remove-multilang` casually — they rewrite source permanently.
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
# Styling and Theming
|
||||
|
||||
**Tailwind v4** (CSS-first) + a **design-token engine** driven by `data/theme.json` (root). Generated/source CSS lives in `themes/<theme>/assets/css/`; your overrides go in root `assets/css/custom.css` (Hugo unions root over theme).
|
||||
|
||||
## Tokens (`data/theme.json`)
|
||||
|
||||
Colors, fonts, type scale live here. **Read it before editing** (schema may be customized). `scripts/themeGenerator.js` reads it → writes `generated-theme.css` (a Tailwind `@theme` block); runs automatically in `pnpm dev`/`build`.
|
||||
|
||||
```json
|
||||
"colors": {
|
||||
"default": { "theme_color": {...}, "text_color": {...} },
|
||||
"darkmode": { "theme_color": {...}, "text_color": {...} }
|
||||
},
|
||||
"fonts": {
|
||||
"font_family": { "primary": "Heebo:wght@400;600", "primary_type": "sans-serif", "secondary": "...", "secondary_type": "..." },
|
||||
"font_size": { "base": "16", "scale": "1.2" }
|
||||
}
|
||||
```
|
||||
|
||||
- Colors → utilities: `default` → `--color-primary` → `text-primary`, `bg-body`; `darkmode` → `--color-darkmode-*` → use via `dark:` (`dark:bg-darkmode-body`).
|
||||
- Fonts: Google syntax `Family:wght@weights`, `_type` = fallback. `base`→`--text-base` (px); `scale`→ heading sizes `--text-h1…h6`. Stray spaces/bad weights break the font request.
|
||||
|
||||
**Change flow:** edit `data/theme.json` → `pnpm dev` (generator watches) → verify in browser.
|
||||
|
||||
## Tailwind v4 (`themes/<theme>/assets/css/main.css`)
|
||||
|
||||
Config is all in CSS:
|
||||
|
||||
```css
|
||||
@import "tailwindcss";
|
||||
@plugin "@tailwindcss/forms";
|
||||
@plugin "@tailwindcss/typography";
|
||||
@plugin 'tailwind-bootstrap-grid';
|
||||
@source "hugo_stats.json"; /* class detection */
|
||||
@custom-variant dark (&:where(.dark, .dark *));
|
||||
@import "./generated-theme.css"; /* auto-generated tokens */
|
||||
@import "./safe.css";
|
||||
@import "./utilities.css";
|
||||
@layer base {
|
||||
@import "./base.css";
|
||||
}
|
||||
@layer components {
|
||||
@import "./components.css";
|
||||
@import "./navigation.css";
|
||||
@import "./buttons.css";
|
||||
}
|
||||
/* module layers ... */
|
||||
@import "module-overrides.css";
|
||||
@import "custom.css";
|
||||
```
|
||||
|
||||
**Class detection = `hugo_stats.json`**, not a content glob. Tailwind scans it (Hugo emits it via `[build.buildStats]`). New class not applying? Full rebuild so `hugo_stats.json` regenerates.
|
||||
|
||||
CSS files (in `themes/<theme>/assets/css/`): `generated-theme.css` (**DO NOT EDIT**) · `base/components/utilities/navigation/buttons/safe.css` (theme layers) · `module-overrides.css` (module CSS) · `custom.css` (**your** styles — create/edit at root `assets/css/custom.css` to override the theme copy).
|
||||
|
||||
## Dark Mode
|
||||
|
||||
`.dark` on `<html>` activates `darkmode` tokens via the `dark:` variant. Toggle/default in `params.toml` (`theme_switcher`, `theme_default`). Remove entirely with `pnpm remove-darkmode`.
|
||||
|
||||
## DO NOT
|
||||
|
||||
- Edit `generated-theme.css` — overwritten each dev/build; edit `theme.json`.
|
||||
- Hardcode hex (`text-[#121212]`) — use tokens (`text-primary`, `bg-body`).
|
||||
- Create `tailwind.config.js` — v4 configures in `main.css`; add rules to `custom.css` or a `@layer`.
|
||||
- Add a content `@source` glob expecting template scanning — detection is `hugo_stats.json`.
|
||||
90
AGENTS.md
Normal file
90
AGENTS.md
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<!-- BEGIN:hugo-agent-rules -->
|
||||
|
||||
# Hugo: verify against docs, not memory
|
||||
|
||||
Treat <https://gohugo.io/documentation/> as truth. Two project specifics your training data gets wrong:
|
||||
|
||||
1. **New template system** (Hugo 0.146+): partials in `layouts/_partials/`, homepage is `home.html`, `baseof.html` is top-level. Never "fix" to `partials/`, `index.html`, or `_default/baseof.html`.
|
||||
2. **Tailwind CSS v4**, CSS-first via `@theme`/`data/theme.json` -> `generated-theme.css`, imported in `assets/css/main.css`. No `tailwind.config.js`.
|
||||
|
||||
<!-- END:hugo-agent-rules -->
|
||||
|
||||
<!-- BEGIN:setup-mode-detection-rules -->
|
||||
|
||||
# Detect setup mode, then convert to project-setup FIRST before changing or reading anything, after project-setup check the edge case rules
|
||||
|
||||
This theme ships in two structures; the same logical file lives at a different path in each. Detect before touching anything:
|
||||
|
||||
- **`exampleSite/hugo.toml` exists → theme-setup** — theme at root (`layouts/`, `assets/`, `theme.toml`), demo site in `exampleSite/`.
|
||||
- **Root `hugo.toml` + `themes/` → project-setup** — site at root (`content/`, `config/`, `data/`, `hugo.toml`), theme vendored in `themes/<theme>/` (the single folder under `themes/` — run `ls themes/` to confirm its name; in this repo it's `hugoplate`).
|
||||
|
||||
### Edge case
|
||||
|
||||
If all of the following are true:
|
||||
|
||||
- `exampleSite/` exists
|
||||
- `themes/<theme>/` exists
|
||||
- `exampleSite/hugo.toml` is the active Hugo config
|
||||
- `themes/<theme>/layouts/home.html` does **not** exist
|
||||
|
||||
then treat the repository as **theme-setup**, not **project-setup**. So Before running `pnpm project-setup` or `pnpm dev` ask user if they want to delete the `themes/` directory and run `pnpm project-setup` to convert to project-setup, deleting `themes/` is required otherwise when running `pnpm project-setup`, it will detect current mode as `project-setup` which is false.
|
||||
|
||||
**Always work in project-setup.** If the repo is currently in theme-setup, run `pnpm project-setup` BEFORE editing any content, config, layout, or style file — this is non-negotiable. The script is idempotent (it logs "Project already setup" and no-ops if already converted), so it's always safe to run. Never move files between modes by hand — only `pnpm project-setup` / `pnpm theme-setup` (reverse).
|
||||
|
||||
Full detail and path-resolution table: `template-guidance` skill → `references/detect-mode.md`.
|
||||
|
||||
<!-- END:setup-mode-detection-rules -->
|
||||
|
||||
<!-- BEGIN:preflight-checks-rules -->
|
||||
|
||||
# Pre-flight checks before running, starting or reading the project
|
||||
|
||||
Before `pnpm install` / `pnpm dev` / `pnpm build` / `pnpm preview` (or any other request to run/build/preview the project), verify all of:
|
||||
|
||||
1. **Setup mode** — project-setup (see above); run `pnpm project-setup` first if not.
|
||||
2. **Node** — `node -v` succeeds.
|
||||
3. **Hugo Extended ≥ 0.158.0** — run `hugo version`; output must contain `extended` and a version `>= 0.158.0`
|
||||
4. **pnpm** — `pnpm -v` succeeds.
|
||||
|
||||
If any check fails — tool missing, Hugo not the extended build, or Hugo older than 0.158.0 — **stop and ask the user to install/upgrade it**; don't try to work around it. Recommend [mise](https://mise.jdx.dev/):
|
||||
|
||||
- Install mise if missing (see mise's install docs for the OS).
|
||||
- `mise use hugo-extended@0.161.1` — installs and pins the correct extended Hugo build for this project.
|
||||
- Node/pnpm: `mise use node@lts` and `mise use pnpm@latest` (or the user's existing version manager).
|
||||
|
||||
<!-- END:preflight-checks-rules -->
|
||||
|
||||
<!-- BEGIN:running-the-project-rules -->
|
||||
|
||||
# Running the project
|
||||
|
||||
**Even for a plain "run/build/preview the project" request**: run the pre-flight checks above first. If the repo is in theme-setup, run `pnpm project-setup` first, then use the project-setup commands below — don't reach for the `:example` scripts as a shortcut to avoid converting.
|
||||
|
||||
Package manager is **pnpm**. Always use these scripts — never run bare `hugo`/`hugo server`, since that skips `themeGenerator.js` and leaves `generated-theme.css` (Tailwind tokens) stale.
|
||||
|
||||
| Command | Use |
|
||||
| -------------- | ----------------------------------------------------------------- |
|
||||
| `pnpm install` | install dependencies (first run / after pulling) |
|
||||
| `pnpm dev` | dev server with live theme regen, default `http://localhost:1313` |
|
||||
| `pnpm build` | production build to `public/` |
|
||||
| `pnpm preview` | production-flavored local server |
|
||||
|
||||
The `dev:example` / `build:example` / `preview:example` variants exist only for theme-setup (running against `exampleSite/`) — once converted via `pnpm project-setup`, they no longer apply.
|
||||
|
||||
## Restart the dev server after changes
|
||||
|
||||
After changing content, code, or layouts etc., restart it:
|
||||
|
||||
```sh
|
||||
npx kill-port 1313 -y && pnpm dev
|
||||
```
|
||||
|
||||
<!-- END:running-the-project-rules -->
|
||||
|
||||
<!-- BEGIN:template-guidance-rules -->
|
||||
|
||||
# Read template guidance before changing or reading structure
|
||||
|
||||
Before modifying or reading structure, styles, pages, config, content, or scripts, trigger the `template-guidance` skill for the relevant reference so you follow project conventions (modes, theme tokens, Hugo Modules, the theme generator, adding languages).
|
||||
|
||||
<!-- END:template-guidance-rules -->
|
||||
|
|
@ -1,427 +0,0 @@
|
|||
{
|
||||
"htmlElements": {
|
||||
"tags": [
|
||||
"a",
|
||||
"article",
|
||||
"blockquote",
|
||||
"body",
|
||||
"button",
|
||||
"code",
|
||||
"del",
|
||||
"details",
|
||||
"div",
|
||||
"em",
|
||||
"footer",
|
||||
"form",
|
||||
"g",
|
||||
"h1",
|
||||
"h2",
|
||||
"h3",
|
||||
"h4",
|
||||
"h5",
|
||||
"h6",
|
||||
"head",
|
||||
"header",
|
||||
"hr",
|
||||
"html",
|
||||
"i",
|
||||
"iframe",
|
||||
"img",
|
||||
"input",
|
||||
"kbd",
|
||||
"label",
|
||||
"li",
|
||||
"link",
|
||||
"main",
|
||||
"meta",
|
||||
"nav",
|
||||
"ol",
|
||||
"p",
|
||||
"path",
|
||||
"picture",
|
||||
"polygon",
|
||||
"pre",
|
||||
"script",
|
||||
"section",
|
||||
"source",
|
||||
"span",
|
||||
"strong",
|
||||
"style",
|
||||
"summary",
|
||||
"svg",
|
||||
"table",
|
||||
"tbody",
|
||||
"td",
|
||||
"textarea",
|
||||
"th",
|
||||
"thead",
|
||||
"title",
|
||||
"tr",
|
||||
"ul",
|
||||
"video"
|
||||
],
|
||||
"classes": [
|
||||
"-translate-x-1/2",
|
||||
"-translate-y-1/2",
|
||||
"2xl:bg-pink-200",
|
||||
"2xl:block",
|
||||
"2xl:hidden",
|
||||
"absolute",
|
||||
"accordion",
|
||||
"accordion-content",
|
||||
"accordion-header",
|
||||
"accordion-icon",
|
||||
"active",
|
||||
"announcement",
|
||||
"announcement-button",
|
||||
"announcement-hide",
|
||||
"bg-body",
|
||||
"bg-gradient",
|
||||
"bg-gradient-to-b",
|
||||
"bg-gray-200",
|
||||
"bg-light",
|
||||
"bg-white",
|
||||
"block",
|
||||
"blog",
|
||||
"border-b",
|
||||
"border-border",
|
||||
"border-r",
|
||||
"border-t",
|
||||
"btn",
|
||||
"btn-outline-primary",
|
||||
"btn-primary",
|
||||
"btn-sm",
|
||||
"capitalize",
|
||||
"col-12",
|
||||
"container",
|
||||
"content",
|
||||
"cursor-pointer",
|
||||
"dark:bg-darkmode-body",
|
||||
"dark:bg-darkmode-light",
|
||||
"dark:border-darkmode-border",
|
||||
"dark:from-darkmode-body",
|
||||
"dark:hover:bg-darkmode-primary",
|
||||
"dark:hover:text-darkmode-primary",
|
||||
"dark:hover:text-text-dark",
|
||||
"dark:opacity-0",
|
||||
"dark:opacity-100",
|
||||
"dark:text-darkmode-primary",
|
||||
"dark:text-darkmode-text-dark",
|
||||
"dark:text-darkmode-text-light",
|
||||
"dark:text-white",
|
||||
"dark:to-darkmode-light",
|
||||
"fa",
|
||||
"fa-arrow-right",
|
||||
"fa-brands",
|
||||
"fa-check",
|
||||
"fa-circle-user",
|
||||
"fa-clock",
|
||||
"fa-facebook",
|
||||
"fa-folder",
|
||||
"fa-github",
|
||||
"fa-linkedin",
|
||||
"fa-regular",
|
||||
"fa-search",
|
||||
"fa-solid",
|
||||
"fa-twitter",
|
||||
"fab",
|
||||
"fediverse-check-button",
|
||||
"fediverse-input",
|
||||
"fediverse-input-wrapper",
|
||||
"fediverse-share",
|
||||
"fill-current",
|
||||
"fixed",
|
||||
"flex",
|
||||
"flex-col",
|
||||
"font-bold",
|
||||
"font-primary",
|
||||
"font-semibold",
|
||||
"form-input",
|
||||
"form-label",
|
||||
"from-body",
|
||||
"gallery",
|
||||
"gallery-item",
|
||||
"gallery-slider",
|
||||
"glightbox",
|
||||
"group",
|
||||
"grow",
|
||||
"gx-5",
|
||||
"h-4",
|
||||
"h-6",
|
||||
"h2",
|
||||
"h3",
|
||||
"h5",
|
||||
"header",
|
||||
"hidden",
|
||||
"highlight",
|
||||
"hover:bg-primary",
|
||||
"hover:text-primary",
|
||||
"hover:text-white",
|
||||
"img",
|
||||
"img-center",
|
||||
"img-dark",
|
||||
"img-fluid",
|
||||
"img-light",
|
||||
"info",
|
||||
"inlin-block",
|
||||
"inline-block",
|
||||
"inline-flex",
|
||||
"invisible",
|
||||
"items-center",
|
||||
"items-start",
|
||||
"justify-between",
|
||||
"justify-center",
|
||||
"left-0",
|
||||
"left-1/2",
|
||||
"lg:!max-w-[800px]",
|
||||
"lg:absolute",
|
||||
"lg:bg-green-200",
|
||||
"lg:block",
|
||||
"lg:col-10",
|
||||
"lg:col-3",
|
||||
"lg:col-4",
|
||||
"lg:col-6",
|
||||
"lg:col-7",
|
||||
"lg:col-8",
|
||||
"lg:flex",
|
||||
"lg:group-hover:opacity-100",
|
||||
"lg:group-hover:visible",
|
||||
"lg:hidden",
|
||||
"lg:inline-block",
|
||||
"lg:invisible",
|
||||
"lg:justify-end",
|
||||
"lg:mb-0",
|
||||
"lg:ml-0",
|
||||
"lg:mt-0",
|
||||
"lg:opacity-0",
|
||||
"lg:order-1",
|
||||
"lg:pb-0",
|
||||
"lg:space-x-2",
|
||||
"lg:text-h1",
|
||||
"lg:text-left",
|
||||
"lg:text-right",
|
||||
"lg:w-auto",
|
||||
"m-1",
|
||||
"m-3",
|
||||
"max-w-[600px]",
|
||||
"mb-10",
|
||||
"mb-12",
|
||||
"mb-14",
|
||||
"mb-2",
|
||||
"mb-28",
|
||||
"mb-3",
|
||||
"mb-4",
|
||||
"mb-6",
|
||||
"mb-8",
|
||||
"mb:md-0",
|
||||
"md:bg-yellow-200",
|
||||
"md:block",
|
||||
"md:col-10",
|
||||
"md:col-5",
|
||||
"md:col-6",
|
||||
"md:col-7",
|
||||
"md:col-8",
|
||||
"md:col-9",
|
||||
"md:hidden",
|
||||
"md:mb-0",
|
||||
"md:order-1",
|
||||
"md:order-2",
|
||||
"mermaid",
|
||||
"min-h-screen",
|
||||
"ml-0",
|
||||
"ml-2",
|
||||
"ml-4",
|
||||
"ml-auto",
|
||||
"mr-1",
|
||||
"mr-2",
|
||||
"mr-3",
|
||||
"mr-4",
|
||||
"mr-5",
|
||||
"ms-1",
|
||||
"mt-10",
|
||||
"mt-11",
|
||||
"mt-4",
|
||||
"mt-6",
|
||||
"mt-8",
|
||||
"mt-9",
|
||||
"mx-auto",
|
||||
"nav-dropdown",
|
||||
"nav-dropdown-item",
|
||||
"nav-dropdown-link",
|
||||
"nav-dropdown-list",
|
||||
"nav-item",
|
||||
"nav-link",
|
||||
"navbar",
|
||||
"navbar-brand",
|
||||
"navbar-nav",
|
||||
"note",
|
||||
"notice",
|
||||
"notice-body",
|
||||
"notice-head",
|
||||
"opacity-0",
|
||||
"opacity-100",
|
||||
"order-0",
|
||||
"order-1",
|
||||
"order-3",
|
||||
"p-6",
|
||||
"p-8",
|
||||
"pb-0",
|
||||
"pb-14",
|
||||
"pb-16",
|
||||
"pb-6",
|
||||
"peer",
|
||||
"peer-checked:block",
|
||||
"pl-2",
|
||||
"pl-6",
|
||||
"pr-5",
|
||||
"pt-14",
|
||||
"pt-7",
|
||||
"px-2",
|
||||
"px-3",
|
||||
"px-4",
|
||||
"px-7",
|
||||
"px-8",
|
||||
"py-1",
|
||||
"py-10",
|
||||
"py-14",
|
||||
"py-16",
|
||||
"py-2",
|
||||
"py-7",
|
||||
"py-[2.5px]",
|
||||
"quote",
|
||||
"relative",
|
||||
"rounded",
|
||||
"rounded-2xl",
|
||||
"rounded-full",
|
||||
"rounded-lg",
|
||||
"rounded-xl",
|
||||
"row",
|
||||
"search-icon",
|
||||
"search-modal",
|
||||
"search-modal-overlay",
|
||||
"search-reset",
|
||||
"search-result",
|
||||
"search-result-empty",
|
||||
"search-result-info",
|
||||
"search-wrapper",
|
||||
"search-wrapper-body",
|
||||
"search-wrapper-footer",
|
||||
"search-wrapper-header",
|
||||
"section",
|
||||
"section-sm",
|
||||
"share-copy",
|
||||
"share-email",
|
||||
"share-facebook",
|
||||
"share-fediverse",
|
||||
"share-icon",
|
||||
"share-icons",
|
||||
"share-link",
|
||||
"share-x",
|
||||
"sm:bg-red-200",
|
||||
"sm:block",
|
||||
"sm:col-10",
|
||||
"sm:hidden",
|
||||
"social-icons",
|
||||
"space-x-1",
|
||||
"space-y-4",
|
||||
"sr-only",
|
||||
"sticky",
|
||||
"swiper",
|
||||
"swiper-button-next",
|
||||
"swiper-button-prev",
|
||||
"swiper-slide",
|
||||
"swiper-wrapper",
|
||||
"tab",
|
||||
"tab-content",
|
||||
"tab-content-panel",
|
||||
"tab-nav",
|
||||
"tab-nav-item",
|
||||
"table-of-content",
|
||||
"testimonial-slider",
|
||||
"testimonial-slider-pagination",
|
||||
"text-[12px]",
|
||||
"text-[8rem]",
|
||||
"text-black",
|
||||
"text-center",
|
||||
"text-h3",
|
||||
"text-lg",
|
||||
"text-primary",
|
||||
"text-red-500",
|
||||
"text-text-dark",
|
||||
"text-text-light",
|
||||
"text-xl",
|
||||
"theme-switcher",
|
||||
"tip",
|
||||
"to-light",
|
||||
"top-0",
|
||||
"top-1.5",
|
||||
"top-1/2",
|
||||
"underline",
|
||||
"uppercase",
|
||||
"w-4",
|
||||
"w-[30px]!",
|
||||
"w-full",
|
||||
"warning",
|
||||
"xl:bg-blue-200",
|
||||
"xl:block",
|
||||
"xl:col-6",
|
||||
"xl:hidden",
|
||||
"xl:p-20",
|
||||
"xl:space-x-8",
|
||||
"z-10",
|
||||
"z-30",
|
||||
"z-50",
|
||||
"zoomable"
|
||||
],
|
||||
"ids": [
|
||||
"SVGRepo_bgCarrier",
|
||||
"SVGRepo_iconCarrier",
|
||||
"SVGRepo_tracerCarrier",
|
||||
"TableOfContents",
|
||||
"accordions",
|
||||
"announcement",
|
||||
"announcement-button",
|
||||
"blockquote",
|
||||
"button",
|
||||
"code-and-syntax-highlighting",
|
||||
"creative-design",
|
||||
"custom-video",
|
||||
"email",
|
||||
"emphasis",
|
||||
"gallery",
|
||||
"gathering-of-personal-information",
|
||||
"heading-1",
|
||||
"heading-2",
|
||||
"heading-3",
|
||||
"heading-4",
|
||||
"heading-5",
|
||||
"heading-6",
|
||||
"hey-there-i-am-a-tab",
|
||||
"hide-button",
|
||||
"i-wanna-talk-about-the-assassination-attempt",
|
||||
"image",
|
||||
"link",
|
||||
"message",
|
||||
"name",
|
||||
"nav-menu",
|
||||
"nav-toggle",
|
||||
"notice",
|
||||
"ordered-list",
|
||||
"paragraph",
|
||||
"privacy-policy-changes",
|
||||
"protection-of-personal--information",
|
||||
"responsibility-of-contributors",
|
||||
"search-modal-input",
|
||||
"show-button",
|
||||
"slider",
|
||||
"submenu-pages",
|
||||
"tab",
|
||||
"tables",
|
||||
"theme-switcher",
|
||||
"this-is-a-title",
|
||||
"unordered-list",
|
||||
"we-know-youre-dealing-in-stolen-ore",
|
||||
"youtube-video"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
"main",
|
||||
"meta",
|
||||
"nav",
|
||||
"noscript",
|
||||
"ol",
|
||||
"option",
|
||||
"p",
|
||||
"path",
|
||||
"picture",
|
||||
|
|
@ -45,6 +45,7 @@
|
|||
"pre",
|
||||
"script",
|
||||
"section",
|
||||
"select",
|
||||
"source",
|
||||
"span",
|
||||
"strong",
|
||||
|
|
@ -112,7 +113,6 @@
|
|||
"dark:text-darkmode-text-light",
|
||||
"dark:text-white",
|
||||
"dark:to-darkmode-light",
|
||||
"dsq-brlink",
|
||||
"fa",
|
||||
"fa-arrow-right",
|
||||
"fa-brands",
|
||||
|
|
@ -204,7 +204,6 @@
|
|||
"lg:text-left",
|
||||
"lg:text-right",
|
||||
"lg:w-auto",
|
||||
"logo-disqus",
|
||||
"m-1",
|
||||
"m-3",
|
||||
"max-w-[600px]",
|
||||
|
|
@ -389,13 +388,15 @@
|
|||
"announcement",
|
||||
"announcement-button",
|
||||
"blockquote",
|
||||
"bn",
|
||||
"button",
|
||||
"code-and-syntax-highlighting",
|
||||
"creative-design",
|
||||
"custom-video",
|
||||
"disqus_thread",
|
||||
"email",
|
||||
"emfasis",
|
||||
"emphasis",
|
||||
"en",
|
||||
"gallery",
|
||||
"gathering-of-personal-information",
|
||||
"heading-1",
|
||||
|
|
@ -422,6 +423,7 @@
|
|||
"search-modal-input",
|
||||
"show-button",
|
||||
"slider",
|
||||
"submenu-%E0%A6%AA%E0%A7%83%E0%A6%B7%E0%A7%8D%E0%A6%A0%E0%A6%BE%E0%A6%B8%E0%A6%AE%E0%A7%82%E0%A6%B9",
|
||||
"submenu-pages",
|
||||
"tab",
|
||||
"tables",
|
||||
|
|
@ -429,7 +431,14 @@
|
|||
"this-is-a-title",
|
||||
"unordered-list",
|
||||
"we-know-youre-dealing-in-stolen-ore",
|
||||
"youtube-video"
|
||||
"youtube-video",
|
||||
"এট-একট-শরনম",
|
||||
"শরনম-1",
|
||||
"শরনম-2",
|
||||
"শরনম-3",
|
||||
"শরনম-4",
|
||||
"শরনম-5",
|
||||
"শরনম-6"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
selected
|
||||
{{ end }}
|
||||
>
|
||||
{{ .LanguageName }}
|
||||
{{ .Label }}
|
||||
</option>
|
||||
{{ else }}
|
||||
{{/* if we can't safely redirect the user to the translated page or at least to translated home, discard the language from options */}}
|
||||
|
|
|
|||
11
skills-lock.json
Normal file
11
skills-lock.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"version": 1,
|
||||
"skills": {
|
||||
"hugo-template-guidance": {
|
||||
"source": "zeon-studio/template-skills",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/hugo-template-guidance/SKILL.md",
|
||||
"computedHash": "278bdf77224514cbc13907f45042c3b7c8a369c3b69365f229d08ff79a3c661a"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue