class

Hwaro::Models::StaticConfig

Inherits Reference / Object

[static] — controls which files under static/ get published.

static/ is copied verbatim into the site root, so OS/editor/VCS cruft placed there (.DS_Store, Thumbs.db, .git/, vim swap files, …) would otherwise be deployed. A built-in denylist filters the common offenders; exclude adds project-specific patterns — a glob like *.bak filters at any depth, drafts/** scopes a subtree, and a literal name is anchored to an exact file or directory (drafts drops drafts/…) — and use_default_excludes = false opts out of the built-in list entirely.

Note: this only filters cruft. Legitimate dot-paths such as .well-known/ are NOT in the denylist and are always published.

Constants

DEFAULT_EXCLUDE_NAMES = Set {".DS_Store", ".AppleDouble", ".LSOverride", ".Spotlight-V100", ".Trashes", ".fseventsd", ".DocumentRevisions-V100", ".TemporaryItems", ".VolumeIcon.icns", "__MACOSX", "Thumbs.db", "ehthumbs.db", "ehthumbs_vista.db", "desktop.ini", ".directory", ".git", ".gitignore", ".gitattributes", ".gitmodules", ".gitkeep", ".svn", ".hg", ".bzr"}

Exact file/dir names that should essentially never be published. Matched per path segment, so an entry like .git filters that directory (and everything under it) at any depth.

DEFAULT_EXCLUDE_SUFFIXES = [".swp", ".swo"]

Suffixes for vim swap files, matched against the leaf file name only. Kept deliberately narrow: a name ending in .swp/.swo is never a legitimate published asset, so the always-on default denylist can't silently drop real content. Emacs-style ~ backups are intentionally NOT here — a trailing tilde is a legal file name, so filtering it is left to an explicit exclude pattern.

GLOB_METACHARS = /[*?\[{]/

Glob metacharacters that distinguish an exclude glob from a literal path/name.

Constructors

Instance methods

exclude
Source
exclude=(exclude : Array(String))
Source
excluded?(relative_path : String) : Bool

Whether relative_path (relative to static/) should be filtered out of the published output.

exclude entries match two ways depending on their shape:

  • a glob (contains * ? [ {) matches the relative path, and — when it has no / — the bare file name too, so *.bak filters at any depth while drafts/** scopes to a subtree;
  • a literal is anchored: it matches that exact path or, when it names a directory, the whole subtree under it. So drafts drops drafts/... but config only drops a top-level config, never a same-named file nested elsewhere.
Source
use_default_excludes
Source
use_default_excludes=(use_default_excludes : Bool)
Source