GithubHelp home page GithubHelp logo

asuh / sage-starter Goto Github PK

View Code? Open in Web Editor NEW
42.0 3.0 5.0 7.17 MB

The best starter theme with a modern front-end development workflow. Based on Sage, HTML5 Boilerplate, gulp, Bower, and Bootstrap.

Home Page: https://github.com/asuh/sage-starter

JavaScript 79.29% HTML 12.22% SCSS 8.48%
gulp bower starter-theme browsersync svg-sprites html5-boilerplate sass svg

sage-starter's Introduction

devDependency Status

Sage Starter is a starter theme based on Roots Sage theme version 8.6, which references HTML5 Boilerplate, Gulp, and Bower that will help you make better websites.

Requirements

Prerequisite How to check How to install
Node.js >= 6.9.x node -v nodejs.org
gulp-cli >= 2.0.0 gulp -v npm install -g gulp-cli
Bower >= 1.3.12 bower -v npm install -g bower
Optional
PHP >= 7.x.x php -v php.net

PHP is optional, but use the latest PHP version that's available.

For more installation notes, refer to the Install gulp and Bower section in this document.

Features

  • gulp build script that compiles both Sass and Less, checks for JavaScript errors, optimizes images, and concatenates and minifies files
  • BrowserSync for keeping multiple browsers and devices synchronized while testing, along with injecting updated CSS and JS into your browser while you're developing
  • Bower for front-end package management
  • asset-builder for the JSON file based asset pipeline
  • ARIA roles and microformats

Installation

Clone the git repo - git clone https://github.com/asuh/sage-starter.git and then rename the directory to the name of your theme or website.

Theme development

Sage Starter uses gulp as its build system and Bower to manage front-end packages.

Bower is outdated and not recommended since the mid-2010s, but will remain in this starter project for the time being.

Install gulp and Bower

Building this project requires node.js. For best results, update to the latest version of npm: npm i -g npm@latest. I personally recommend using NVM.

From the command line:

  1. Install gulp-cli and Bower globally with npm i -g gulp bower
  2. Navigate to the theme directory, then run npm i
  3. Run bower install

You now have all the necessary dependencies to run the build process.

Available gulp commands

  • gulp — Compile and optimize the files in your assets directory
  • gulp watch — Compile assets when file changes are made
  • gulp --production — Compile assets for production (no source maps).

Using BrowserSync

To use BrowserSync during gulp watch you need to update devUrl at the bottom of assets/manifest.json to reflect your local development hostname.

For example, if your local development URL is http://project-name.test you would update the file to read:

...
  "config": {
    "devUrl": "http://project-name.test"
  }
...

If your local development URL looks like http://localhost:8888/project-name/ you would update the file to read:

...
  "config": {
    "devUrl": "http://localhost:8888/project-name/"
  }
...

SVG support

Sage Starter has built-in SVG support! The preferred method for using SVG as implemented is an SVG sprite.

Usage

Make sure each SVG has an ID.

<svg xmlns="http://www.w3.org/2000/svg">
    <symbol id="twitter" viewBox="0 0 64 64">
        <title>Twitter</title>
        <path etc.../>
    </symbol>
</svg>

Save any SVG files you want to use into /assets/images/sprite and the build process will combine all of those images into /assets/images/sprite/sprite.svg.

To use in markup, apply the ID to an SVG's Use element.

<svg role="img" title="Twitter">
    <use xlink:href="map.svg#twitter"/>
</svg>

Check out SVG For Everybody for IE and <=Edge 12 support of SVG sprites.

Documentation

Sage theme's original documentation is available at https://docs.roots.io/sage/8.x/installation/. These instructions aren't consistent with Sage Starter but provide historical context for installation and running Gulp.

Contributing

Contributions are welcome and encouraged from everyone!

sage-starter's People

Contributors

alexsomeoddpilot avatar asuh avatar austinpray avatar cabgfx avatar cfxd avatar chriscarr avatar coreywagehoft avatar dependabot-preview[bot] avatar dependabot[bot] avatar dvregan avatar emaildano avatar fingli avatar foxaii avatar fullyint avatar hariadi avatar johnraz avatar julienmelissas avatar kalenjohnson avatar lautreamont3 avatar leoj3n avatar magox-git avatar mallorydxw avatar mwrather avatar novrian avatar ntwb avatar qwp6t avatar retlehs avatar swalkinshaw avatar weslly avatar zensimilia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sage-starter's Issues

Gulp Production

Running gulp --production generates the assets with random characters appended to the file, however, the links to those files are broken when running gulp --production watch. Do we have to manually included the assets.json file in our page, then how? Or is there something else I'm missing?

Readme checks

You have a misspelling in your Readme.
/assets/images/sprites should be /assets/images/sprite otherwise it won't produce the sprite.

Your example needs updating, too.
<use xlink:href="map.svg#twitter"/> should be <use xlink:href="dist/images/sprite/sprite.svg#twitter"/>

Bootstrap 4

Anyone who wants to make this work with Bootstrap will have to make some changes. You will need to downgrade gulp-sass version to 2.3.2 and add the bootstrap scss code manually to main.scss. Maybe BS4.0 dropped bower support.

PHP support?

Cannot GET /

Does this Gulp Boilerplate support PHP files? Or is gulp-connect-php and http-proxy required? I'm using MAMP Pro. Inside the gulpfile.js I specified .php wherever .html was present.

  "config": {
    "devUrl": "http://sage-starter.dev:8888"
  }

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.