Giter VIP home page Giter VIP logo

lean-theme's Introduction

Pre-requisites

You need to make sure you have at least the followings to use the theme:

You need to make sure you have installed composer globally in your terminal just by running composer -v you should have an output as follows:

$ composer -v
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.2.1 2016-09-12 11:27:19

Installation

  1. Download or clone the theme
  2. Go to the theme path and run composer install

Scripts

The theme uses composer as dependency manager for PHP libraries and script mananger for the theme, inside of the theme you have the following commands available.

To run any of the following commands you only need to type the name of the command on your terminal for instance:

composer lint

composer build

This task run:

  • composer build-deps
  • composer buld-app

composer build-deps

Install all the required packages from package.json inside of the patterns directory, this command is executed automatically after you run composer install or composer update

composer build-app

This task generates the production ready assets by running gulp build inside of the patterns directory.

composer lint

Function that executes the linter task for the .php files except on vendor directory the files are specified as follows:

 *.php src/*.php **/*.php src/**/**/*.php --ignore=vendor

If you want to change this just edit composer.json file to adjust based on your needs.

The linter for PHP uses the WordPresss Coding Standard configuration to make sure we follow the coding standards specified by the WordPress handbook.

composer set-up-php-lint

Script that is executed automatically after composer install or composer update and is used to setup the linter configuration for PHP.

composer

Script to create a organism/molecule/atom folder inside of the patterns directory, as well as php/scss files. It will also add the corresponding calls to the scss file in the general _style.scss file. To run this task:

  • composer organism -- <name-of-element>
  • composer molecule -- <name-of-element>
  • composer atom -- <name-of-element>

Actions

List of hooks and filters availables to be used with this theme.

lean/before_header

Action executed before the main <header> tag and after the <body> tag, useful if you want to add something before anyother tag on the site.

lean/after_header

Action executed after the main </header> tag. Useful if you want to add something just after the header has been rendered.

lean/before_footer

Action that is executed before the main <footer> tag. Useful to add something before the last tag of the page is added.

lean/after_footer

Action that is executed before the closing </body> tag and just after the </footer> tg. Useful to add something at the end of the site.

Filters

The following is a collection of filters available to be used to change settings and options from the theme at any point.

lean/acf_path

With this filter you can change the location of the ACF files, by default saves the ACF Groups into the acf directory located on the theme.

lean/acf_use_custom_location:

By default is set to true, with this filter you can remove the automatic save of ACF Fields into the lean/acf_path.

Helper functions

use_icon

This function renders a new icon from the sprite set.

Parameters

  • id: the file name of the icon for example if you have a file patterns/static/icons/facebook.svg the id of the icon is facebook.
  • class_name: The class_name attribute is an optional parameter that can be used to add a custom class to the specifc instance of the icon if a different style is required.

lean-theme's People

Contributors

adamf321 avatar andybar2 avatar arzola avatar btchae avatar fcog avatar mitogh avatar npmcdn-to-unpkg-bot avatar rulox avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.