GithubHelp home page GithubHelp logo

pug-stylus-worktemplate-multy-page's Introduction

Pug & Stylus work Template.

This template created for multy-page layout. In this template every page has his own css file. Also, this package include bable.

Folder structure
src/
  pug/
    partials/
      layout.pug
      config.pug
      nav.pug
    index.pug  
    about.pug 
  js/
    entries/
      index.js
      about.js 
  stylus/
    style files
  images/
webpack-config

Instruction

This template include 2 demo-page. If you want create new page you must follow this instruction:

  1. In this file webpack.config.js you must add config like that:

module.exports = {
entry: {
  index: PATHS.entries + 'index.js', // default page
  about: PATHS.entries + 'about.js', // default page
  new: PATHS.entries + 'new.js' // new page!
},
...
plugins: [
  jadePage('index'), // default
  jadePage('about'), // default
  jadePage('new'), // new page!
  new ExtractTextPlugin('css/[name].css'),
  new CopyWebpackPlugin([
    { from: 'src/images', to: 'images' }
  ])
],
...
}
  1. You must create your pug's file new.pug in folder pug/
  2. Add new.js in folder js/entries
  3. The last is adding new page in nav-chain located in nav.pug
ul.nav
  +navLink('/', 'index', 'Home') // default
  +navLink('about.html', 'about', 'About') // default
  +navLink('new.html', 'new', 'New') // new page!

Adding own css file foreach page

In folder stylus/page create unique page's style file like new.styl Include style file in .js file

#index.js

import base from '../../stylus/base/index.styl' // default
import nav from '../../stylus/modules/nav.styl' // default
import hero from '../../stylus/modules/hero.styl' // default
import index from '../../stylus/page/index.styl' // NEW

Initialization

npm init
npm install

Commands

npm start - open hot-reloaded browser's window with your work.
npm build - create files for production

pug-stylus-worktemplate-multy-page's People

Contributors

egorpopovpp avatar

Watchers

 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.