struct

Hwaro::Config::Options::ServeOptions

Inherits Struct < Value < Object

Constants

DEV_OUTPUT_DIR = ".hwaro/serve"

Where hwaro serve builds. A dedicated directory, NOT the configured output_dir (issue #756): serve derives base_url from its bind address, so its pages carry dev URLs (http://127.0.0.1:3000) — sharing the output dir let a serve session silently poison a previously deployable hwaro build, and hosting the leftover tree leaked those dev links. Keep this directory out of version control (alongside .hwaro_cache.json).

Constructors

new(host : String = "127.0.0.1", port : Int32 = 3000, base_url : String | Nil = nil, drafts : Bool = false, include_expired : Bool = false, include_future : Bool = false, minify : Bool = false, workers : Int32 = 0, open_browser : Bool = false, verbose : Bool = false, debug : Bool = false, access_log : Bool = false, error_overlay : Bool = true, live_reload : Bool = true, profile : Bool = false, cache_busting : Bool = true, env : String | Nil = nil, skip_og_image : Bool = false, skip_image_processing : Bool = false, cache : Bool = false, stream : Bool = false, memory_limit : String | Nil = nil, json : Bool = false, fast_start : Bool = false, fast_start_count : Int32 = 20, headers : Hash(String, String) = {} of String => String)
Source

Class methods

url_host(host : String) : String

Host as it must appear inside a URL. An IPv6 literal has to be bracketed (RFC 3986) — without this hwaro serve -b ::1 produced http://::1:3000, which no browser can resolve, and baked that string into every link, canonical and OG URL of the served site.

Source
wildcard_host?(host : String) : Bool

-b 0.0.0.0 / -b :: listen on every interface but are not an address anything can connect TO: as the derived base_url they put http://0.0.0.0:3000/… into every link, stylesheet and canonical (unconnectable on Windows, meaningless from another device). Like an empty host, they stand for "localhost" in URLs.

Source

Instance methods

access_log
Source
access_log=(access_log : Bool)
Source
base_url
Source
base_url=(base_url : String | Nil)
Source
cache
Source
cache=(cache : Bool)
Source
cache_busting
Source
cache_busting=(cache_busting : Bool)
Source
debug
Source
debug=(debug : Bool)
Source
drafts
Source
drafts=(drafts : Bool)
Source
env=(env : String | Nil)
Source
error_overlay
Source
error_overlay=(error_overlay : Bool)
Source
fast_start
Source
fast_start=(fast_start : Bool)
Source
fast_start_count
Source
fast_start_count=(fast_start_count : Int32)
Source
headers

Custom response headers to inject during serve (from config.toml [serve.headers] + CLI --header)

Source
headers=(headers : Hash(String, String))

Custom response headers to inject during serve (from config.toml [serve.headers] + CLI --header)

Source
host
Source
host=(host : String)
Source
include_expired
Source
include_expired=(include_expired : Bool)
Source
include_future
Source
include_future=(include_future : Bool)
Source
json
Source
json=(json : Bool)
Source
live_reload
Source
live_reload=(live_reload : Bool)
Source
memory_limit
Source
memory_limit=(memory_limit : String | Nil)
Source
minify
Source
minify=(minify : Bool)
Source
open_browser
Source
open_browser=(open_browser : Bool)
Source
port
Source
port=(port : Int32)
Source
profile
Source
profile=(profile : Bool)
Source
skip_image_processing
Source
skip_image_processing=(skip_image_processing : Bool)
Source
skip_og_image
Source
skip_og_image=(skip_og_image : Bool)
Source
stream
Source
stream=(stream : Bool)
Source
to_build_options

Convert to BuildOptions for initial build

Source
verbose
Source
verbose=(verbose : Bool)
Source
workers

Concurrent render workers (0 = auto). See BuildOptions#workers.

Source
workers=(workers : Int32)

Concurrent render workers (0 = auto). See BuildOptions#workers.

Source