module

Hwaro::Services::ConfigSnippets

Constants

KNOWN_SECTIONS = SECTION_REGISTRY.transform_values(&.[](:description))

Backward-compatible aliases. The registries above are the only place to edit; these dictionaries are derived for callers (and specs) that walk descriptions only.

KNOWN_SUB_SECTIONS = SUB_SECTION_REGISTRY.transform_values(&.[](:description))
SECTION_REGISTRY = {"plugins" => {description: "Content processors and extensions", snippet: -> do plugins(commented: true) end}, "highlight" => {description: "Syntax highlighting (Highlight.js)", snippet: -> do highlight(commented: true) end}, "og" => {description: "OpenGraph & Twitter Cards", snippet: -> do og(commented: true) end}, "search" => {description: "Client-side search index", snippet: -> do search(commented: true) end}, "serve" => {description: "Development server options (custom response headers)", snippet: -> do serve(commented: true) end}, "pagination" => {description: "Pagination settings", snippet: -> do pagination(commented: true) end}, "series" => {description: "Series grouping", snippet: -> do series(commented: true) end}, "related" => {description: "Related posts", snippet: -> do related(commented: true) end}, "markdown" => {description: "Markdown parser options", snippet: -> do markdown(commented: true) end}, "sitemap" => {description: "Sitemap generation", snippet: -> do sitemap(commented: true) end}, "robots" => {description: "Robots.txt generation", snippet: -> do robots(commented: true) end}, "llms" => {description: "LLM crawler instructions (llms.txt)", snippet: -> do llms(commented: true) end}, "feeds" => {description: "RSS/Atom feed generation", snippet: -> do feeds(commented: true) end}, "build" => {description: "Build hooks (pre/post commands)", snippet: -> do build(commented: true) end}, "links" => {description: "Internal link checking (broken @/ links)", snippet: -> do links(commented: true) end}, "permalinks" => {description: "URL path overrides", snippet: -> do permalinks(commented: true) end}, "auto_includes" => {description: "Automatic CSS/JS loading", snippet: -> do auto_includes(commented: true) end}, "assets" => {description: "Asset pipeline (bundling, minification)", snippet: -> do assets(commented: true) end}, "sass" => {description: "Built-in Sass/SCSS compilation", snippet: -> do sass(commented: true) end}, "deployment" => {description: "Deployment targets", snippet: -> do deployment(commented: true) end}, "image_processing" => {description: "Image resizing and LQIP placeholder generation", snippet: -> do image_processing(commented: true) end}, "pwa" => {description: "Progressive Web App (manifest.json, service worker)", snippet: -> do pwa(commented: true) end}, "amp" => {description: "AMP page generation", snippet: -> do amp(commented: true) end}, "menus" => {description: "Navigation menus (Hugo-style [[menus.*]])", snippet: -> do menus(commented: true) end}} of String => SectionEntry
SUB_SECTION_REGISTRY = { {"content", "files"} => {description: "Non-Markdown file publishing from content/", snippet: -> do content_files end}, {"content", "new"} => {description: "Front matter and bundle defaults for `hwaro new`", snippet: -> do content_new(commented: true) end}, {"og", "auto_image"} => {description: "Auto-generated OG images", snippet: -> do og_auto_image end}, {"image_processing", "lqip"} => {description: "Low-Quality Image Placeholder (LQIP) generation", snippet: -> do image_processing_lqip end}} of Tuple(String, String) => SectionEntry

Same idea for sub-sections (parent table must already exist before doctor offers to add the child).

Class methods

amp(commented : Bool = false) : String
Source
assets(commented : Bool = false) : String
Source
auto_includes(commented : Bool = false) : String
Source
build(commented : Bool = false) : String
Source
content_files
Source
content_new(commented : Bool = false) : String

[content.new] controls the front matter hwaro new writes. Defaults match ContentNewConfig#initialize in src/models/config.cr — the snippet documents the surface so users can flip from TOML to YAML/JSON or add fields without spelunking through code.

Source
deployment(commented : Bool = false) : String
Source
doctor(commented : Bool = false) : String
Source
doctor_snippet_for(key : String) : String | Nil

Resolve a snippet for the given section key, looking up the SECTION_REGISTRY (top-level keys like "pwa") or SUB_SECTION_REGISTRY (dotted keys like "og.auto_image"). The top-level [doctor] key is special-cased because it documents diagnostics behaviour and isn't surfaced via KNOWN_SECTIONS (no need to advertise it as a missing-section advisory).

Source
feeds(commented : Bool = false) : String
Source
highlight(commented : Bool = false) : String
Source
image_processing(commented : Bool = false) : String
Source
image_processing_lqip
Source
llms(commented : Bool = false) : String
Source
markdown(commented : Bool = false) : String
Source
og(commented : Bool = false) : String
Source
og_auto_image
Source
pagination(commented : Bool = false) : String
Source
plugins(commented : Bool = false) : String
Source
pwa(commented : Bool = false) : String
Source
robots(commented : Bool = false) : String
Source
sass(commented : Bool = false) : String
Source
search(commented : Bool = false) : String
Source
series(commented : Bool = false) : String
Source
serve(commented : Bool = false) : String
Source
sitemap(commented : Bool = false) : String
Source

Nested types