| 开发者 | youheiokubo |
|---|---|
| 更新时间 | 2026年10月10日 23:29 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
assets/, uploads move to media/. The wp-content directory disappears from the deliverable.noindex.sitemap.xml and a minimal robots.txt, built from the pages actually generated, using the production URL.content.md) that combines every page's main content into one file — handy for feeding a site into AI tools (Gemini Notebook / NotebookLM, and similar).url() and @import), laid out at their real paths, with a README of ground rules. In-page markers can drop the block-library CSS (distan:no-block-styles) or drop scripts and styles under a path prefix (distan:drop-assets).distan_extra_assets) — for assets referenced only from inside a script, such as a JSON file fetched by JavaScript.exec(), no external binaries, no external APIs. It runs on Local, MAMP, XAMPP, DDEV, Docker, or shared hosting, and works offline.
Not for every case
Distan is not suitable when the client updates the site themselves, or when forms, search, comments, or membership are required. If you need built-in deployment to many destinations, scheduled or change-based publishing, or managed static hosting, a larger tool such as Simply Static or Staatic will fit better.
Structured data: add only what is known, inspect what is delivered
Enable the schema.org option to add basic WebPage JSON-LD to exported pages without existing JSON-LD. Configure the production URL first. Directory and page exclusions use source paths relative to the WordPress home URL, one per line (for example /private/ and /contact/thanks/). Directory rules include descendants; page rules match only that path. Trailing slashes are ignored and query variants share the rule. Existing JSON-LD is retained even when excluded or disabled. Regenerate after changing settings.
Every generated page is also checked for basic JSON-LD syntax and URL consistency, even when automatic additions are off. See the generation screen and delivery report for per-page outcomes, block numbers and issues. Existing data is never automatically repaired. Limited or failed inspection is explicitly recorded. Use Schema.org Validator and Google Rich Results Test for additional validation; this local audit does not guarantee search appearance.
wp-content/plugins/, or install the ZIP from Plugins → Add New → Upload.wp-content/uploads/distan/dist/.No. The output is static HTML. The delivered site does not require the WordPress application or its database. The production host and the separate WordPress authoring environment still need appropriate maintenance.
Distan does not deploy for you and never stores server credentials. It fires distan_after_generate when a run finishes without recorded errors, and an optional distan_dispatch action when you press the deploy button after reviewing the output. Hook either one to your own rsync, git push, FTP, or CI step. You can also just download the ZIP.
Yes. Generation sends a normal HTTP request per page, so get_header(), get_template_part(), template hierarchy, conditional tags, and custom fields all behave exactly as they do on the live site.
Anything that needs server-side processing: search forms, comment submission, contact forms, and membership. Values that depend on the current time (a copyright year printed with date('Y'), relative dates) are frozen at generation time.
Distan collects assets by reading the generated HTML and CSS, so a path built inside a script — fetch('../assets/json/data.json') — is invisible to it and the file is left out. List the file or directory with the distan_extra_assets filter to bundle it anyway; its path is flattened the same way as other theme assets, so the relative fetch keeps working.
Yes. Enable the Markdown export and Distan writes content.md, combining every page's main content into one file with production URLs — ready to hand to an AI notebook or a retrieval index. An optional content.local.md keeps development URLs. You can also narrow what goes into it by post type and publish date, and hand-pick individual fixed pages, so the transcript can be limited to (for example) just your articles while the static site is still delivered in full.
Yes, with a classic theme. Block themes load their JavaScript as ES modules, which browsers refuse to load over file://. HTML, CSS, images, and links work either way; use a local server for a complete preview.
Yes. Classic and block themes are both supported, including the block navigation's interactivity, importmap paths, and module files.
Yes, with an explicit opt-in. Name the query keys that change the page with the distan_variant_keys filter, then register the specific URLs you want to ship with the distan_sources filter — usually built in a loop from the same terms or posts the page's pulldown or checkboxes are built from. Each value becomes its own static file. Because a plain static host addresses files by path only, the query is folded into the path: the published URL becomes /products/filter-chair/ rather than /products/?filter=chair. Distan does not discover these automatically — pulldown and multi-checkbox URLs are not links in the page, and their combinations are unbounded — so you decide which ones to generate. See README.md for copy-paste examples.
distan:no-block-styles marker removes the block library CSS and global styles, and distan:drop-assets wp-includes/ wp-content/plugins/foo/ removes scripts and stylesheets whose output path starts with the given prefixes (directory or single file). The referenced tags are removed with the files so nothing dangles, and the marker comments are stripped from the delivered template. Distan does not guess what is unused; it acts on what the template declares.distan_dispatch action hook and an optional manual "デプロイ" (dispatch) button on the generate screen. After reviewing the generated output, pressing the button fires distan_dispatch so a project can promote the reviewed build (git push, rsync, a build webhook). Distan stores no approval state — only the time of the last dispatch, shown on screen. The button is off by default; enable it in settings.distan_after_generate action hook, fired when a generation run completes, for wiring up automatic deployment (git push, rsync, build webhooks, etc.).distan_url_replacements filter for custom production URL replacements (applied across the whole output, including JSON-LD).