Repository for WordPress theme development for http://hgnm.org.
-
Use
hgnm-wp-dev
to set up a development environment & bootstrap dependencies (including this theme repo). -
Once
hgnm-wp-dev
is up and running,cd
to the theme directory:cd ~/Local\ Sites/hgnm/app/public/wp-content/themes/hgnm-2014
-
Install development dependencies (requires Node/npm):
npm install
That’s it! Using the hgnm-wp-dev
set-up with Local by Flywheel, a fully functional WordPress install can be found at http://hgnm.local.
Changes to any of the PHP theme files can be seen by refreshing your browser.
hgnm-2014
’s stylesheets are written using SASS and can be found in the scss
directory. These need to be compiled to a CSS file to be used in the browser. There are two ways to achieve this:
-
Compile to CSS once:
npm run css:build
-
Watch the
scss
directory and auto-compile to CSS when something changes:npm run css:watch
⚠️ If SCSS files do not follow the style rules set in.sass-lint.yml
, you will see build errors
💡 Use Atom with
linter
andlinter-sass-lint
to see feedback about style errors while you edit
hgnm-2014
uses the Conventional Commits standard for commit messages. This enables automatic changelog generation and easier semantic versioning.
To ensure your commits conform to this format, use the Commitizen command line tool instead of git commit
:
npx git-cz
Commitizen will show you a series of prompts to fill out and format your responses into a tidy commit message.
⚠️ If a commit message does not conform to the standard,commitlint
will reject it on the command line and on Travis-CI.
-
Bump version numbers, update the changelog, and tag a new release:
npm run release
-
Push your changes including the newly created tag to GitHub:
git push --follow-tags
After you have pushed your tag, Travis CI will build
hgnm-2014.zip
and attach it to the GitHub release. This archive is used by automatic theme updates in WordPress. -
Copy the changes listed in
CHANGELOG.md
to the release notes on GitHub.
To build the theme, producing a bundled hgnm-2014.zip
theme archive, run:
npm run build
For more details on how hgnm-2014
is structured and implements its functionality, see ARCHITECTURE.
These are automatically installed if you use the hgnm-wp-dev
environment.
-
Elliot Condon’s Advanced Custom Fields {v5}
Used to manage complex custom back-end input fields, which will be displayed within the theme.