heyblackmagic/wp-foundation

WordPress 模板,使用 Composer,更易配置,以及改进的目录结构

v1.0.0 2023-05-15 16:20 UTC

This package is auto-updated.

Last update: 2024-09-15 19:23:56 UTC


README

从头开始开发

  1. 运行 composer create-project heyblackmagic/wp-foundation ./PATH 使用 Composer 创建 WP 实例。
  2. 在项目安装的目录中,运行 composer update 安装插件和 composer 依赖。
  3. 然后运行 npm install && npm run build 安装 node 包并生成资源包。
  4. 在终端进入 ./public_html 目录,执行 valet link VHOST_NAME,其中 VHOST_NAME 是本地域名的名称。例如:“valet link foundation”。

从 git pull 继续开发

  1. 拉取/克隆项目。
  2. 转到项目文件夹,运行命令 composer updatenpm installnpm run build
  3. env.example 重命名为 .env 并更新变量。
  4. 在终端进入 ./public_html 目录,执行 valet link VHOST_NAME,其中 VHOST_NAME 是本地域名的名称。例如:“valet link foundation”。

目录

.
├── LICENSE.md
├── README.md
├── composer.json
├── composer.lock
├── config
│   ├── application.php
│   └── environments
│       ├── development.php
│       └── staging.php
├── package-lock.json
├── package.json
├── phpcs.xml
├── postcss.config.js
├── public_html
│   ├── app
│   │   ├── mu-plugins
│   │   │   └── bedrock-autoloader.php
│   │   ├── plugins
│   │   ├── themes
│   │   │   └── foundation
│   │   │       ├── assets
│   │   │       │   └── img.jpg
│   │   │       ├── components
│   │   │       │   ├── component-footer.php
│   │   │       │   └── component-header.php
│   │   │       ├── footer.php
│   │   │       ├── front-page.php
│   │   │       ├── functions.php
│   │   │       ├── header.php
│   │   │       ├── home.php
│   │   │       ├── inc
│   │   │       │   ├── child-items.php
│   │   │       │   ├── helpers.php
│   │   │       │   ├── menu-items.php
│   │   │       │   ├── template-functions.php
│   │   │       │   ├── vite-constants.php
│   │   │       │   ├── vite-env.php
│   │   │       │   └── vite-scripts.php
│   │   │       ├── index.php
│   │   │       ├── meta
│   │   │       │   ├── favicon.php
│   │   │       │   └── fonts.php
│   │   │       ├── page.php
│   │   │       ├── snippets
│   │   │       └── style.css
│   │   └── uploads
│   ├── index.php
│   └── wp-config.php
├── src
│   ├── js
│   │   └── app.js
│   ├── public
│   └── scss
│       ├── abstracts
│       │   ├── _mixins.scss
│       │   ├── _variables.scss
│       │   └── index.scss
│       ├── app.scss
│       ├── base
│       │   ├── _buttons.scss
│       │   ├── _helpers.scss
│       │   ├── _images.scss
│       │   ├── _reset.scss
│       │   ├── _root.scss
│       │   ├── _typography.scss
│       │   └── index.scss
│       ├── components
│       │   └── index.scss
│       ├── snippets
│       │   └── index.scss
│       ├── templates
│       │   └── index.scss
│       └── vendor
│           └── index.scss
├── templates -> public_html/app/themes/foundation
├── vite.config.js
└── wp-cli.yml