class

Hwaro::Services::Scaffolds::Remote

Inherits Hwaro::Services::Scaffolds::Base < Reference < Object

Constants

CONTENT_EXTENSIONS = {".md", ".markdown"}

Content files the build reads as pages (ReadContent::PAGE_EXTENSIONS).

EXTRA_DIRS = {"data/", "i18n/"}

Root-level directories copied verbatim alongside the four built-in categories. data/ feeds sidebars/menus and i18n/ the translations, so a scaffold that relies on them built without errors but rendered empty navigation.

FETCH_CONCURRENCY = 8

Downloads in flight at once. Unbounded fan-out (one fiber per file) ran a large scaffold out of file descriptors, and every failed request used to become an empty file.

Constructors

new(source : String)
Source

Class methods

classify(path : String) : Tuple(Symbol, String) | Nil

Map a repository path (relative to the scaffold root) to the category it is installed under, or nil to skip it.

Source
dangerous_settings(config_data : String) : Array(String)

Settings in a remote config.toml that run shell commands: [build.hooks] pre/post and every deploy target's command. Read from the parsed document — a text match on hooks.pre = missed the [build.hooks] table form the loader actually reads.

Source
parse(source : String) : Source

Parse a remote source string, keeping the branch a /tree/<branch>/… URL names.

Source
parse_source(source : String) : Tuple(String, String, String)

Parse a remote source string into {owner, repo, subpath}

Source
ref_candidates(branch : String, subpath : String) : Array(Tuple(String, String))

Every {branch, subpath} split of a /tree/<a>/<b>/<c> URL, the shortest branch first: GitHub branch names may contain / (feature/x), and the URL alone cannot say where the branch ends.

Source
remote?(source : String) : Bool

Check if a scaffold source string represents a remote scaffold

Source

Instance methods

archetype_files

Remote scaffolds mirror the upstream repo verbatim; we don't inject a built-in default.md because the remote might deliberately not use archetypes. Its own archetypes/ is carried over.

Source
config_content(skip_taxonomies : Bool = false, multilingual_languages : Array(String) = [] of String) : String

Returns the config.toml content. multilingual_languages (from --include-multilingual) is threaded through so the full config emits a real, enabled [languages] block instead of the commented placeholder. The --full-config config.toml: every section, in one fixed order, with a discoverability banner per section. Scaffolds do not restate this list — they opt sections out through ships_taxonomies? and supply their menu entries through menus_config (empty by default), and bare overrides the whole method for its subset.

Source
content_files(skip_taxonomies : Bool = false) : Hash(String, String)

Returns sample content files as a hash of path => content

Source
description

Returns the description of this scaffold

Source
extra_files

Files outside content/templates/static/archetypes, keyed by their path relative to the project root (e.g. data/sidebar.yml). Built-in scaffolds ship none; a remote scaffold carries its data/ and i18n/ over.

Source
minimal_config_content(skip_taxonomies : Bool = false, multilingual_languages : Array(String) = [] of String) : String

If the remote provided a config.toml, use it as-is (even for --minimal-config). If not (remote can be templates-only), fall back to the built-in minimal generator.

Source
shortcode_files

Returns shortcode files as a hash of path => content

Source
static_files

Returns static files as a hash of path => content. Every scaffold inherits a tiny SVG favicon so a freshly-generated site doesn't show a blank tab icon. Scaffolds that override static_files (blog/docs/book) merge super to keep it.

Source
template_files(skip_taxonomies : Bool = false) : Hash(String, String)

Returns template files as a hash of path => content

Source
type

Returns the scaffold type

Source

Nested types