A small theme for YiiPress that changes only two files of the built-in
minimal theme: the footer and the stylesheet. Everything else comes from minimal. Use it to see how an installable
theme is built, or copy it as the start of your own.
The theme needs YiiPress 0.2.0 or later. Run this in the root of your site, where you run yiipress build:
yiipress get:theme --url=https://github.com/yiipress/theme-sampleYiiPress picks the newest release that supports your version, installs package/ into themes/theme-sample,
records it in yiipress.lock and sets theme: theme-sample in content/config.yaml. Commit themes/,
yiipress.lock and config.yaml with your site; add .yiipress/ to .gitignore. Updating, removing and restoring
the theme are covered in the extension docs.
extension.yaml the manifest: ID, version, supported YiiPress versions, license, theme fields
package/ the installed files
├── assets/style.css minimal's style.css, then the sample's changes below «Sample theme»
└── partials/footer.php minimal's footer with a credit line
screenshots/home.png shown in the catalog; not installed
example/content/ a small site to try the theme
.github/workflows/ checks the manifest and builds the example on every push
extension.yaml sets fallback: minimal, so every template, partial, translation and asset the theme does not
have is taken from minimal. A theme that ships assets/style.css replaces the stylesheet of minimal as a whole,
which is why this one starts with a copy of it.
mkdir -p example/themes
cp -r package example/themes/theme-sample
cd example
yiipress serve- Copy this repository. Change
id(<your GitHub user or organization>/<name>),name,description,authors,homepageandlicenseinextension.yaml. The theme installs intothemes/<name>. - Change or add files in
package/: any template or partial ofminimal(entry.php,partials/header.php, …) or asset. Template variables are listed in the templates docs. - Replace
screenshots/home.png. - Push, let the workflow check the manifest, then publish a GitHub release whose tag matches
version(v1.0.0forversion: 1.0.0). - To list it in the YiiPress extension catalog, open a pull request there
that adds
extensions/<vendor>/<name>.yaml.
BSD-3-Clause, see LICENSE.md.
