2017 © Pedro PelΓ‘ez
 

wordpress-theme halland

Halland is a Wordpress theme based on Sage by Roots. Halland is the starting point of websites built by Region Halland.

image

regionhalland/halland

Halland is a Wordpress theme based on Sage by Roots. Halland is the starting point of websites built by Region Halland.

  • Thursday, March 1, 2018
  • by regionhalland
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 13 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Halland 🍲

Halland is a Wordpress theme built by Region Halland, based on Sage., (*1)

View theme structure
, (*2)

<, (*3)

p>, (*4)

themes/halland/           # β†’ Root
β”œβ”€β”€ app/                  # β†’ Theme PHP
β”‚   β”œβ”€β”€ Acf/              # β†’ ACF Fields
β”‚   β”œβ”€β”€ controllers/      # β†’ Controller files
β”‚   β”œβ”€β”€ Theme/            # β†’ Enqueue files, register sidebars
β”‚   β”œβ”€β”€ Traits/           # β†’ Traits used in the theme
β”‚   β”œβ”€β”€ admin.php         # β†’ Theme customizer setup
β”‚   β”œβ”€β”€ filters.php       # β†’ Theme filters
β”‚   β”œβ”€β”€ helpers.php       # β†’ Helper functions
β”‚   └── setup.php         # β†’ Theme setup
β”œβ”€β”€ composer.json         # β†’ Autoloading for `app/` files
β”œβ”€β”€ composer.lock         # β†’ Composer lock file (never edit)
β”œβ”€β”€ dist/                 # β†’ Built theme assets (never edit)
β”œβ”€β”€ node_modules/         # β†’ Node.js packages (never edit)
β”œβ”€β”€ package.json          # β†’ Node.js dependencies and scripts
β”œβ”€β”€ resources/            # β†’ Theme assets and templates
β”‚   β”œβ”€β”€ assets/           # β†’ Front-end assets
β”‚   β”‚   β”œβ”€β”€ config.json   # β†’ Settings for compiled assets
β”‚   β”‚   β”œβ”€β”€ build/        # β†’ Webpack and ESLint config
β”‚   β”‚   β”œβ”€β”€ fonts/        # β†’ Theme fonts
β”‚   β”‚   β”œβ”€β”€ images/       # β†’ Theme images
β”‚   β”‚   β”œβ”€β”€ scripts/      # β†’ Theme JS
β”‚   β”‚   └── styles/       # β†’ Theme stylesheets
β”‚   β”œβ”€β”€ functions.php     # β†’ Composer autoloader, theme includes
β”‚   β”œβ”€β”€ index.php         # β†’ Never manually edit
β”‚   β”œβ”€β”€ screenshot.png    # β†’ Theme screenshot for WP admin
β”‚   β”œβ”€β”€ style.css         # β†’ Theme meta information
β”‚   └── views/            # β†’ Theme templates
β”‚       β”œβ”€β”€ layouts/      # β†’ Base templates
β”‚       └── partials/     # β†’ Partial templates
└── vendor/               # β†’ Composer packages (never edit)

<, (*5)

p> , (*6)

Requirements

Getting started

  1. Clone Halland into the themes directory of your Wordpress installation and install dependencies:
$ cd <your site>/web/app/themes/
$ git clone https://github.com/RegionHalland/halland.git
$ cd halland
$ composer install && yarn
  1. Update resources/assets/config.json settings:

- devUrl should reflect your local development hostname, for example http://site.test - publicPath should reflect your WordPress directory structure (/web/app/themes/halland or /wp-content/themes/halland for non-Bedrock installs), (*7)

  1. Build commands

* yarn start β€” Compile assets when file changes are made, start Browsersync session * yarn build β€” Compile and optimize the files in your assets directory * yarn build:production β€” Compile assets for production, (*8)

Styleguide

Almost all of the CSS on the front-end is defined in our styleguide. Halland uses it by looking for the environment variable COMPONENT_LIBRARY_URI. If the variable can't be found, Halland defaults to the styleguide published on Github Pages., (*9)

If you want to work with CSS, set up up a local version of the styleguide by following the instructions in it's repo and make your changes there., (*10)

CORS

Allow requests to your local version of the styleguide by adding the following headers to it's nginx config:, (*11)

  1. SSH into your Homestead server and edit the styleguides nginx config:
$ cd ~/Homestead
$ homestead ssh
$ sudo nano /etc/nginx/sites-enabled/styleguide.test
  1. Place the headers in the server block of the nginx config:
# Allow CORS
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
  1. Reload the nginx config.
$ sudo service nginx reload

ACF Fields

Halland uses Advanced Custom Fields to create custom fields and ACF Export Manager to save the field definitions as .php and .json files, so that we can keep them under version control., (*12)

Importing

The field definitions are imported automatically with ACF Export Manager. The export manager will automatically import all field groups defined in /halland/Acf/Import.php., (*13)

To be imported, they must first be exported by following the instructions below. ‡️, (*14)

Exporting

  1. Create your field group in the Wordpress admin panel like you normally would under Fields β†’ Add new., (*15)

  2. Over the Save / Publish button to the right, you will find your field groups unique ID. It looks something like group_5b716c7b279da. Copy the field groups ID and add it to the array defined in /halland/Acf/Import.php:, (*16)

$acfExportManager->autoExport(array(
    ...
    ...
    'my-new-fieldgroup' => 'group_5b716c7b279da'
));
  1. Save / Publish your field group and ACF Export Manager will create a .php and a .json file for your new field group in each respective folder. Make sure to commit these files.

Editing existing field groups

  1. First of you need to identify the filename of the field group you want to edit. The easiest way to do this is probably to look at the key-value pairs found in the import array in /halland/Acf/Import.php., (*17)

  2. For minor changes you can edit the field groups directly in code. Remember to edit both the .json and the .php files found in /halland/Acf/<json or php>/my-new-field-group.<json or php>., (*18)

  3. For bigger changes you might want to use the admin panels interface. Go to Fields β†’ Tools and import your field groups .json file (found in /halland/Acf/json/my-new-field-group.json)., (*19)

  4. Edit your field group. When you Save / Publish, the changes will automatically be exported to code. Commit your changes! πŸ€“, (*20)

Child themes

TBD, (*21)

The Versions

01/03 2018

dev-master

9999999-dev https://github.com/regionhalland

Halland is a Wordpress theme based on Sage by Roots. Halland is the starting point of websites built by Region Halland.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress

21/02 2018

v0.1.2-alpha

0.1.2.0-alpha https://github.com/regionhalland

Halland is a Wordpress theme based on Sage by Roots. Halland is the starting point of websites built by Region Halland.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress

20/02 2018

v0.1.1-alpha

0.1.1.0-alpha https://github.com/regionhalland

Halland is a Wordpress theme based on Sage by Roots. Halland is the starting point of websites built by Region Halland.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress

20/02 2018

v0.1-alpha

0.1.0.0-alpha https://github.com/regionhalland

Halland is a Wordpress theme based on Sage by Roots. Halland is the starting point of websites built by Region Halland.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress