| 开发者 | youheiokubo |
|---|---|
| 更新时间 | 2026年8月20日 19:11 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
distan_after_generate, distan_dispatch), so you connect your own rsync, git push, FTP, or CI. Nothing to trust with your server keys.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).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, when forms, search, comments, or membership are required, or for sites of only a few pages. 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.
wp-content/plugins/, or install the ZIP from Plugins → Add New → Upload.wp-content/uploads/distan/dist/.No. The output is static HTML. That is the point: there is no application to attack or maintain on the production server.
Distan does not deploy for you and never stores server credentials. It fires distan_after_generate when a run finishes, 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.
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_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).