class

Hwaro::Services::Doctor

Inherits Reference / Object

Constants

KNOWN_CONFIG_SECTIONS = ConfigSnippets::KNOWN_SECTIONS

Delegate to ConfigSnippets for the single source of truth

KNOWN_SUB_SECTIONS = ConfigSnippets::KNOWN_SUB_SECTIONS
OPTIONAL_SECTIONS = Set {"pwa", "amp", "image_processing", "image_processing.lqip", "og.auto_image", "build", "deployment", "permalinks", "auto_includes", "links", "assets", "sass", "related", "series", "pagination", "menus", "content.new", "robots", "llms", "serve"}

Sections that are advanced/niche or low-value for most users. These are now treated as opt-in by default (not auto-suggested in normal doctor, and not added by plain --fix unless the user explicitly wants them).

Goal: Reduce config bloat and the "you should add all these things" pressure.

VALID_CHANGEFREQS = ["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"] of ::String
VALID_MATH_ENGINES = ["katex", "mathjax"] of ::String

Mirrors MarkdownConfig#initialize defaults — only katex/mathjax render math at runtime; other strings load nothing.

VALID_SEARCH_FORMATS = ["fuse_json", "fuse_javascript", "elasticlunr_json", "elasticlunr_javascript"] of ::String

Constructors

new(content_dir : String = "content", config_path : String = "config.toml", templates_dir : String = "templates", static_dir : String = "static")
Source

Instance methods

fix_config(approve_sections : Bool = false, dry_run : Bool = false, apply_value_fixes : Bool = true) : FixSummary

Apply real fixes (Phase 1: value corrections like base_url trailing slash) and optionally approve/add recommended config sections (Phase 2).

  • apply_value_fixes: Phase 1 value corrections. --fix and --full enable this; a bare --approve must NOT edit real values — the documented model is "--fix normalizes, --approve adds sections".
  • approve_sections: When true, doctor will add the recommended/optional config sections as commented documentation (--approve / --full).

This separation makes --fix focused on corrections, while --approve / --full controls bringing in the larger set of recommendations.

Source
missing_config_sections

Returns the list of config section keys missing from the user's config.toml. On I/O or TOML parse failure, returns an empty array — those paths are already reported by check_config as classified issues, so silent-empty here lets the main run loop carry on without double-reporting. Callers that need a clearer signal (e.g. fix_config) should probe the file directly via readable_config_toml / parse_config_toml.

Source

Nested types