Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:expstaticbuild

Build a static copy of a target's siteaccess into its folder (static publishing): crawled as the anonymous user, links rewritten, files collected, extras and manifest written.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/expstaticbuild.md

On this page

exp:expstaticbuild

Build a static copy of a target's siteaccess into its folder (static publishing): crawled as the anonymous user, links rewritten, files collected, extras and manifest written.

Script bin/php/expstaticbuild.php, code in kernel/private/classes/commands/expstaticbuild.php. Run it from the installation root, as the user the web server runs as:

./console exp:expstaticbuild --help
./console exp:static:build --help
php bin/php/expstaticbuild.php --help

Help text

Build a static copy of a site
Crawls the target's siteaccesses as the anonymous user, strips debug output, form tokens and
session ids, refuses pages that still carry one, rewrites the links (relative, or below the base
path), collects the files the pages name (and the storage's images with Assets=referenced-and-storage),
writes .nojekyll, 404.html, robots.txt, sitemap.xml and the manifest, checks the links and replaces the
content of var/<site>/static-publish/<target>/. Targets are staticcache.ini [Target_<id>] blocks.

./console exp:static:build github-public
./console exp:static:build github-public --dry-run          report what would change
./console exp:static:build github-public --paths=/about-us  only this page
./console exp:static:build github-public --only-siteaccess=ger    only the siteaccess ger of a target of several
./console exp:static:build github-public --format=json --report=var/log/static.json

Options

OptionValueHelp
--fullCrawl the whole site (the default without --paths or --nodes); not with --paths or --nodes
--pathsrequiredBuild only these pages, by their path in the copy (/about-us, /ger/about-us for a siteaccess in a folder; a comma list or repeated); the rest of the last build stays
--nodesrequiredBuild only the pages of these nodes (node ids; a comma list or repeated), in each siteaccess of the target; the rest of the last build stays
--dry-runBuild into the staging folder, report what would change and leave the target folder as it is
--reportrequiredAlso write the report (exp-static/1, JSON) to this file
--formatrequiredtext (default) or json (the machine output exp-static/1)
--crawl-urlrequiredFetch the pages from this address instead of the target's CrawlURL or the siteaccess's SiteURL (http://127.0.0.1:8080)
--max-pagesrequiredStop the crawl after this many pages (default the target's MaxPages)
--keep-stagingKeep the staging folder of the build (its path is in the report) instead of removing it
--loginrequiredRun as this user (the administration starts its jobs so); recorded as who ran it
--run-idrequiredThe id of the run (date-time-6 hex digits) instead of a new one (the administration passes its job's id)
--progressrequiredAlso append the progress, one JSON object per line, to this file (the administration follows it)
--only-siteaccessrequiredBuild only this one of the target's siteaccesses (a target of several, SiteAccessList[]); the others' pages of the last build stay

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).

Arguments: [target].


Generated by ./console exp:help:examples from bin/php/expstaticbuild.php, kernel/private/classes/commands/expstaticbuild.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x