salvatori / alma
基于 Alma 的 WordPress 主题,使用 Vite 构建
6.1.0
2024-03-22 05:11 UTC
Requires
- php: ^8.2
- generoi/sage-woocommerce: ^1.1.2
- illuminate/encryption: ^10.46
- illuminate/queue: ^10.46
- illuminate/support: ^10.33
- illuminate/testing: ^10.46
- livewire/livewire: ^3.4
- log1x/acf-composer: ^3.0.20
- log1x/pagi: ^1.0
- log1x/poet: ^2.0
- log1x/sage-directives: ^1.1
- log1x/sage-html-forms: ^1.0
- log1x/sage-svg: ^1.1
- log1x/wp-smtp: ^1.0
- roots/acorn: ^4.0.0
- stoutlogic/acf-builder: ^1.12
Requires (Dev)
- laravel/pint: ^1.13
- spatie/laravel-ignition: ^2.4
- squizlabs/php_codesniffer: 3.7.1
This package is auto-updated.
Last update: 2024-09-04 01:59:44 UTC
README
特性
- Solar(基于:Locomotive with Lenis、Gsap、Barba、Mouse Follower、Bulma 以及一些其他好东西的甜味实现)
- Laravel 路由
- Laravel Blade
- Laravel 组件、Composers 和控制器
- Sage 指令
- Sage WooCommerce
- Alpine
技术
主题安装
- 此框架包含 Acorn v3。请阅读文档(https://roots.io/acorn/docs/)
- 从 WordPress 主题目录使用 Composer 安装 Alma(将下面的
your-theme-name
替换为您的主题名称)
# @ app/themes/ or wp-content/themes/
$ composer create-project salvatori/alma your-theme-name
要安装 Alma 的最新开发版本,请在命令末尾添加 dev-lightning
$ composer create-project salvatori/alma your-theme-name dev-lightning
主题结构
themes/alma/ # → Root of your Alma based theme ├── app/ # → Theme PHP │ ├── Providers/ # → Service providers │ ├── View/ # → View models │ ├── filters.php # → Theme filters │ ├── helpers.php # → Global helpers │ ├── medias.php # → Medias helper │ └── setup.php # → Theme setup ├── composer.json # → Autoloading for `app/` files ├── routes/web.php # → Place non WP routes here. ├── public/ # → Built theme assets (never edit) ├── functions.php # → Theme bootloader ├── index.php # → Theme template wrapper ├── node_modules/ # → Node.js packages (never edit) ├── package.json # → Node.js dependencies and scripts ├── resources/ # → Theme assets and templates │ ├── fonts/ # → Theme fonts │ ├── images/ # → Theme images │ ├── scripts/ # → Theme javascript │ ├── styles/ # → Theme stylesheets │ └── views/ # → Theme templates │ ├── components/ # → Component templates │ ├── forms/ # → Form templates │ ├── layouts/ # → Base templates │ ├── partials/ # → Partial templates └── woocommerce/ # → Woocommerce templates ├── screenshot.png # → Theme screenshot for WP admin ├── style.css # → Theme meta information ├── vendor/ # → Composer packages (never edit) └── vite.config.js # → Vite configuration
主题开发
- 在主题目录中运行
yarn
以安装依赖项 - 更新
vite.config.js
以调整打包器
构建命令
yarn dev
— 启动开发服务器和热模块替换yarn build
— 编译资源yarn lint
— 检查样式表和 JavaScriptyarn lint:css
— 检查样式表yarn lint:js
— 检查 JavaScript
热模块替换
项目侧
在您的项目 .env
中添加以下变量
# Hot module reload enabled? This should be turned off in production. HMR_ENABLED=true # Endpoint where the bundler serve your assets HMR_ENTRYPOINT=https://:5173 # Add an APP_KEY for LiveWire APP_KEY= #some 32 characters randomized string
维护模式
Alma 集成了一个基本的简单维护模式。如果您想启用它,只需使用这个 .env 变量
WP_MAINTAINANCE_MODE="true"