Skip to documentation
SLOP

tiny.zen.buildSite

Reference tiny.zen buildSite

Defined in tiny.zen.

Called byCallsNo direct callersprivate sourcelib.zen.src.site.publishbackupPathprivate sourcelib.zen.src.site.publishbuildIntoprivate sourcelib.zen.src.site.publishdeleteOutputprivate sourcelib.zen.src.site.publishinsideRootsiteparentSiteOwnsBase+6 moretiny.zenbuildSite
Static calls · unresolved targets: 2 · external targets: 2.

Source

Source: lib/zen/src/site/publish.zig:168

zig
pub fn buildSite(allocator: Allocator, options: BuildOptions) !BuildResult {    if (options.source.len == 0) return error.InvalidSource;    if (options.base.len != 0 and        (options.base[0] != '/' or options.base[options.base.len - 1] == '/')) return error.InvalidBase;    if (options.parent_site_base) |parent_site_base| {        if (!parentSiteOwnsBase(parent_site_base, options.base)) {            return error.InvalidParentSiteBase;        }    }    if (options.output.len == 0) return error.InvalidOutput;    if (!options.clean and options.before_publish != null) {        return error.PublishHookRequiresClean;    }    if (!options.clean and options.publish_authored_routes) {        return error.AuthoredRouteManifestRequiresClean;    }    const source_root = try realPathOwned(allocator, options.source);    defer allocator.free(source_root);    const planned_output_root = try plannedOutputRoot(allocator, options.output);    defer allocator.free(planned_output_root);    if (insideRoot(source_root, planned_output_root)) return error.OutputInsideSource;    var loaded_theme = try theme.load(allocator, source_root, options.theme_files, options.theme);    defer loaded_theme.deinit(allocator);    var active_options = options;    active_options.theme = loaded_theme.value;    if (active_options.publish_authored_routes and active_options.theme.style.len != 0 and        std.mem.eql(u8, active_options.theme.style_path, site_catalog.manifest_path))    {        return error.AuthoredRouteManifestPathConflict;    }    if (!options.clean) {        try std.Io.Dir.cwd().createDirPath(io, options.output);        const output_root = try realPathOwned(allocator, options.output);        defer allocator.free(output_root);        if (insideRoot(source_root, output_root)) return error.OutputInsideSource;        return try buildInto(allocator, active_options, source_root, output_root);    }    const staging = try stagingPath(allocator, options.output);    defer allocator.free(staging);    const backup = try backupPath(allocator, options.output);    defer allocator.free(backup);    if (pathExists(staging)) try deleteOutput(staging);    try std.Io.Dir.cwd().createDirPath(io, staging);    errdefer if (pathExists(staging)) deleteOutput(staging) catch {};    const output_root = try realPathOwned(allocator, staging);    defer allocator.free(output_root);    if (insideRoot(source_root, output_root)) return error.OutputInsideSource;    const result = try buildInto(allocator, active_options, source_root, output_root);    if (options.before_publish) |hook| {        try hook.run(hook.context, allocator, output_root);    }    try swapOutput(options.output, staging, backup);    return result;}

Source: lib/zen/src/root.zig:342

zig
/// Publishes through staging; render and hook failures preserve prior output.pub const buildSite = site.buildSite;

Also reachable as

site.buildSite.

Complete call list

11 direct calls.

Audit

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433