leonstafford / static-html-output
WordPress 静态HTML输出插件。
6.6.23
2020-11-16 02:44 UTC
Requires
- php: >=7.3
- guzzlehttp/guzzle: ^6.5
- pear/net_url2: ^2.1.2
- sabberworm/php-css-parser: ^8.3.0
Requires (Dev)
- dev-develop
- 6.6.23
- 6.6.22
- 6.6.21
- 6.6.20
- 6.6.19
- 6.6.18
- 6.6.17
- 6.6.16
- 6.6.15
- 6.6.14
- 6.6.13
- 6.6.12
- 6.6.10
- 6.6.9
- 6.6.8
- dev-dependabot/composer/guzzlehttp/psr7-1.9.1
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-master
- dev-winpath_fix
- dev-handle_update
- dev-infinite-crawl
- dev-progress
- dev-unicode-filename-support
- dev-logo
- dev-debug-doc-offline-urls
- dev-dev_staging_production_ui
This package is auto-updated.
Last update: 2024-09-20 00:27:18 UTC
README
WordPress 插件,用于生成网站的静态副本并部署到 GitHub Pages、S3、Netlify 等。提高安全性、页面加载速度和托管选项。将 WordPress 集成到 CI/CD 工作流程中。
我维护的其他 WordPress SSG
WP-CLI 命令
wp statichtmloutput COMMAND
其中 COMMAND
可以是以下之一
选项
generate
deploy
deploy_cache
通过添加 --help
获取任何命令的帮助
钩子
修改要爬取的初始 URL 列表
statichtmloutput_modify_initial_crawl_list
- 过滤器钩子
签名
apply_filters( 'statichtmloutput_modify_initial_crawl_list', $url_queue );
示例用法
function add_additional_urls( $url_queue ) { $additional_urls = [ 'http://mydomain.com/custom_link_1/', 'http://mydomain.com/custom_link_2/', ]; $url_queue = array_merge( $url_queue, $additional_urls ); return $url_queue; } add_filter( 'statichtmloutput_modify_initial_crawl_list', 'add_additional_urls' );
部署后钩子
statichtmloutput_post_deploy_trigger
- 动作钩子
签名
do_action( 'statichtmloutput_post_deploy_trigger', $archive );
示例用法
function printArchiveInfo( $archive ) { error_log( print_r( $archive, true ) ); } add_filter( 'statichtmloutput_post_deploy_trigger', 'printArchiveInfo' );
示例响应
Archive Object
(
[settings] => Array
(
[selected_deployment_option] => github
[baseUrl] => https://leonstafford.github.io/demo-site-wordpress-static-html-output/
[wp_site_url] => http://example.test/
[wp_site_path] => /srv/www/example.com/current/web/wp/
[wp_uploads_path] => /srv/www/example.com/current/web/app/uploads
[wp_uploads_url] => http://example.test/app/uploads
[wp_active_theme] => /wp/wp-content/themes/twentyseventeen
[wp_themes] => /srv/www/example.com/current/web/app/themes
[wp_uploads] => /srv/www/example.com/current/web/app/uploads
[wp_plugins] => /srv/www/example.com/current/web/app/plugins
[wp_content] => /srv/www/example.com/current/web/app
[wp_inc] => /wp-includes
[crawl_increment] => 1
)
[path] => /srv/www/example.com/current/web/app/uploads/wp-static-html-output-1547668758/
[name] => wp-static-html-output-1547668758
[crawl_list] =>
[export_log] =>
)
贡献 / 开发
非常欢迎贡献!请不要因为提交问题、创建 Pull Request 或发送电子邮件(Leon)me@ljs.dev 而感到害怕。
开发
git clone git@github.com:WP2Static/static-html-output.git
cd static-html-output
composer install
composer test
composer coverage
(可选的覆盖率生成,需要 Xdebug)
构建安装 .zip 文件
composer build INSTALLER_FILENAME
这将创建安装程序并将其放置在您的 $HOME/Downloads
目录中。
在 Windows 上,您需要可用的 zip
工具来构建安装程序。我建议使用 Git Bash shell,然后根据 这些说明 手动安装 zip 工具
本地化 / 翻译
插件中不支持本地化。如果您需要帮助翻译 UI,请使用浏览器扩展,或者您可以通过任何翻译服务运行我们的文档页面。