Linux 软件免费装
Banner图

Distan

开发者 youheiokubo
更新时间 2026年10月10日 23:29
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

deploy headless jamstack static site generator static export

下载

1.8.0 0.9.13 0.9.16 1.1.3 1.1.6 1.2.0 1.4.0 1.9.1 1.9.2 1.1.4 0.9.14 1.0.0 0.9.18 1.1.0 1.9.0 0.9.15 0.9.17 1.1.5 1.1.7 1.1.8 1.1.9 1.3.0 1.4.1 1.5.0 1.1.1 1.6.0 1.6.2 1.6.3 1.6.1 1.6.4 1.7.0

详情介绍:

Distan turns WordPress into a build environment for static HTML deliverables. You author in WordPress, then export clean, self-contained HTML that runs anywhere. No WordPress, no PHP, and no database are required on the production server. Distan is designed for projects where the agency maintains the source and hands over HTML files: recruitment sites, campaign pages, or a section of an existing corporate site where another WordPress installation is not an option. Edit in WordPress, regenerate, review the changes, and deliver the files through your existing publishing process. Built around the handoff What it does Requirements Requires WordPress 6.0+, PHP 8.0+, writable uploads and working loopback HTTP (the site being able to request itself). ZIP downloads require ZipArchive. No direct SQL, no 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.

安装:

  1. Upload the plugin to wp-content/plugins/, or install the ZIP from Plugins → Add New → Upload.
  2. Activate it.
  3. Open the Distan menu, check the environment, set the public URL, and generate.
The output is written to wp-content/uploads/distan/dist/.

屏幕截图:

  • 「使い方」ヘルプ。Distan の考え方(WordPress は作る場所、書き出した HTML が納品物)と、環境の確認 → 書き出し → 受け取り・公開の流れ、主な設定の要点を確認できます。

常见问题:

Does the production server need WordPress?

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.

How do I deploy the result?

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.

Do template functions work?

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.

What does not work?

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.

A script fetches a file (e.g. JSON) that is not being copied. Why?

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.

Can I export the content for AI tools?

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.

Can I open the generated files directly?

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.

Does it work with block (Full Site Editing) themes?

Yes. Classic and block themes are both supported, including the block navigation's interactivity, importmap paths, and module files.

A page changes its content based on a URL query parameter (?filter=chair). Can Distan handle it?

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.

更新日志:

1.9.2 1.9.1 1.9.0 1.8.0 1.7.0 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.0 1.4.1 1.4.0 1.3.0 1.2.0 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.0 0.9.18 0.9.17 0.9.16 0.9.15 0.9.14 0.9.13