class

Hwaro::Models::VersionConfig

Inherits Reference < Object

One documentation version ([[versions.list]]). Versions are directory-based, modeled on languages: every content file under content/<path>/ belongs to the version, and the build maps that directory to a URL prefix (see url_dir).

Constructors

new(name : String, label : String = name, path : String = name, latest : Bool = false)
Source

Instance methods

contains?(content_path : String) : Bool

True when content_path (content-relative) lives inside this version.

Source
label
Source
label=(label : String)
Source
latest
Source
latest=(latest : Bool)
Source
name
Source
name=(name : String)
Source
parent_dir

Parent directory of path ("" for a top-level version directory). content/docs/v2 → "docs"; content/v2 → "".

Source
path

Content directory, relative to content/ (no leading/trailing slash). Defaults to name.

Source
path=(path : String)

Content directory, relative to content/ (no leading/trailing slash). Defaults to name.

Source
relative_path(content_path : String) : String | Nil

Path of content_path relative to this version's directory, or nil when the file is not inside it. docs/v2/install.md → "install.md".

Source
url_dir(latest_at_root : Bool) : String

Content-relative directory this version PUBLISHES under. The latest version renders at its parent's natural location when latest_at_root is on (docs/v2 → docs); every other version keeps a /<name>/ segment under the parent (docs/v1 → docs/v1, or docs/one when name != basename of path).

Source