en un clic
hugoplate-best-practices
// 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.
// 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.
| 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 |
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.
Hugoplate is a modern Hugo boilerplate built with:
@theme directive.scripts/themeGenerator.js) that syncs data/theme.json with Tailwind CSS variables.theme.json)All design tokens (colors, fonts, sizes) are managed in exampleSite/data/theme.json.
colors.default.theme_color and colors.default.text_color.colors.darkmode.theme_color and colors.darkmode.text_color.themeGenerator.js script maps these to CSS variables (e.g., --color-primary, --color-darkmode-primary).fonts.font_family. Use the syntax Family:wght@weights (e.g., Inter:wght@400;700).fonts.font_size.scale controls the heading hierarchy (H1-H6).fonts.font_size.base sets the root font size in pixels.theme.json: Update colors or fonts.npm run dev or yarn dev. This automatically runs themeGenerator.js and hugo server.assets/css/generated-theme.css to see the updated variables.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.params.toml)Most UI components (e.g., preloader, announcement, cookies) have an enable flag. Toggle them here without touching the code.
Content is located in exampleSite/content/english/.
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.
Always include title, description (for SEO), and image (feature image). Use draft: false to publish.
layouts/baseof.html is the master wrapper.layouts/index.html iterates through section files.layouts/partials/.layouts/ directory.@theme in assets/css/main.css. Avoid creating tailwind.config.js as it's not the primary way to configure v4 in this project.assets/css/custom.css or within @layer blocks in main.css.partial "image" for automatic Hugo responsive processing and WebP conversion.| 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. |
npm run dev is running (it needs to regenerate generated-theme.css).hugo_stats.json. If a new class isn't working, try a full rebuild.theme.json.layouts/partials/essentials/ that might already handle it.theme.json and use the generated Tailwind classes.params.toml for an existing toggle.