ravorona / sage
Wordpress theme based on Sage starter theme using Vite
Installs: 304
Dependents: 0
Suggesters: 0
Security: 0
Stars: 45
Watchers: 4
Forks: 2
Open Issues: 2
Language:SCSS
Requires
- php: ^8.1
Requires (Dev)
- laravel/pint: ^1.13
- squizlabs/php_codesniffer: 3.7.1
Suggests
- log1x/sage-directives: A collection of useful Blade directives for WordPress and Sage (^1.0).
- log1x/sage-svg: A useful SVG directive for inlining SVG's within Blade views (^1.0).
README
𧩠Wordpress Starter Theme
Requirements
Theme installation
- Make sure that you have Acorn installed
- Install Sage using Composer from your WordPress themes directory (replace
your-theme-name
below with the name of your theme):
# @ app/themes/ or wp-content/themes/
$ composer create-project ravorona/sage your-theme-name
To install the latest development version of Sage, add dev-develop
to the end of the command:
$ composer create-project ravorona/sage your-theme-name dev-develop
Theme structure
themes/your-theme-name/ # β Root of your Sage 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 βββ 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 β βββ svg/ # β Theme svgs β βββ views/ # β Theme templates β βββ components/ # β Component templates β βββ forms/ # β Form templates β βββ layouts/ # β Base templates β βββ partials/ # β Partial templates βββ sections/ # β Section templates βββ screenshot.png # β Theme screenshot for WP admin βββ style.css # β Theme meta information βββ vendor/ # β Composer packages (never edit) βββ vite.config.ts # β Vite configuration
Theme development
- Run
yarn
from the theme directory to install dependencies - Update
vite.config.ts
for bundler fine tuning
Build commands
yarn dev
β Start dev server and hot module replacementyarn build
β Compile assetsyarn lint
β Lint stylesheets & javascriptsyarn lint:css
β Lint stylesheetsyarn lint:js
β Lint javascripts
Hot Module Replacement
Project Side
Add the following variables in your project .env
# Endpoint where the bundler serve your assets
HMR_ENTRYPOINT=http://localhost:5173
Theme side
For advanced dev server configuration, copy .env.example
according
to Vite naming convention and loading order and update variables
FYI
Running HMR Mode remove the public/manifest.json
file, so do not forget to re-run the assets compilation
with yarn build
if needed.