x-pages
A static site development workflow
Last updated 2 months ago by zce .
MIT · Bugs · Original npm · Tarball · package.json
$ cnpm install x-pages 
SYNC missed versions from official npm registry.

x-pages

Build Status NPM Downloads NPM Version License Dependency Status devDependency Status Code Style

A static site development workflow (Convention over Configuration)

Installation

$ yarn add x-pages --dev

# or npm
$ npm install x-pages --dev

package.json

{
  "scripts": {
    "clean": "x-pages clean",
    "lint": "x-pages lint",
    "serve": "x-pages serve",
    "build": "x-pages build",
    "start": "x-pages start",
    "deploy": "x-pages deploy --production"
  }
}

CLI Usage

$ x-pages <task> [options]

e.g.

# Runs the app in development mode
$ x-pages serve --port 5210 --open
# Builds the app for production to the `dist` folder
$ x-pages build --production

Available Scripts

yarn lint or npm run lint

Lint the styles & scripts files.

yarn compile or npm run compile

Compile the styles & scripts & pages file.

yarn serve or npm run serve

Runs the app in development mode with a automated server.

options
  • open: Open browser on start, Default: false
  • port: Specify server port, Default: 2080

yarn build or npm run build

Builds the app for production to the dist folder. It minify source in production mode for the best performance.

options
  • production: Production mode flag, Default: false
  • prod: Alias to production

yarn start or npm run start

Running projects in production mode.

options
  • open: Open browser on start, Default: false
  • port: Specify server port, Default: 2080

yarn deploy or npm run deploy

Deploy the dist folder to GitHub Pages.

options
  • branch: The name of the branch you'll be pushing to, Default: 'gh-pages'

yarn clean or npm run clean

Clean the dist & temp files.

Examples

Folder Structure

└── my-awesome-pages ································· project root
   ├─ public ········································· static folder
   │  └─ favicon.ico ································· static file (unprocessed)
   ├─ src ············································ source folder
   │  ├─ assets ······································ assets folder
   │  │  ├─ fonts ···································· fonts folder
   │  │  │  └─ pages.ttf ····························· font file (imagemin)
   │  │  ├─ images ··································· images folder
   │  │  │  └─ logo.png ······························ image file (imagemin)
   │  │  ├─ scripts ·································· scripts folder
   │  │  │  └─ main.js ······························· script file (babel / uglify)
   │  │  └─ styles ··································· styles folder
   │  │     ├─ _variables.scss ······················· partial sass file (dont output)
   │  │     └─ main.scss ····························· entry scss file (scss / postcss)
   │  ├─ layouts ····································· layouts folder
   │  │  └─ basic.html ······························· layout file (dont output)
   │  ├─ partials ···································· partials folder
   │  │  └─ header.html ······························ partial file (dont output)
   │  ├─ about.html ·································· page file (use layout & partials)
   │  └─ index.html ·································· page file (use layout & partials)
   ├─ .csscomb.json ·································· csscomb config file
   ├─ .editorconfig ·································· editor config file
   ├─ .gitignore ····································· git ignore file
   ├─ .travis.yml ···································· travis ci config file
   ├─ CHANGELOG.md ··································· repo changelog
   ├─ LICENSE ········································ repo license
   ├─ README.md ······································ repo readme
   ├─ gulpfile.js ···································· gulp tasks file
   ├─ package.json ··································· package file
   └─ yarn.lock ······································ yarn lock file

Related

Contributing

  1. Fork it on GitHub!
  2. Clone the fork to your own machine.
  3. Checkout your feature branch: git checkout -b my-awesome-feature
  4. Commit your changes to your own branch: git commit -am 'Add some feature'
  5. Push your work back up to your fork: git push -u origin my-awesome-feature
  6. Submit a Pull Request so that we can review your changes.

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

License

MIT © 汪磊

Current Tags

  • 1.0.0                                ...           latest (2 months ago)

42 Versions

  • 1.0.0                                ...           2 months ago
  • 1.0.0-beta.7                                ...           3 months ago
  • 1.0.0-beta.6                                ...           8 months ago
  • 1.0.0-beta.5                                ...           8 months ago
  • 1.0.0-beta.4                                ...           9 months ago
  • 1.0.0-beta.3                                ...           10 months ago
  • 1.0.0-beta.2                                ...           a year ago
  • 1.0.0-beta.1                                ...           a year ago
  • 1.0.0-alpha.0                                ...           a year ago
  • 0.8.1                                ...           a year ago
  • 0.8.0                                ...           a year ago
  • 0.7.2                                ...           a year ago
  • 0.7.1                                ...           a year ago
  • 0.7.0                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.1                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.2.0-rc.1                                ...           a year ago
  • 0.2.0-alpha.2                                ...           2 years ago
  • 0.2.0-alpha.1                                ...           2 years ago
  • 0.2.0-alpha.0                                ...           2 years ago
  • 0.1.0-beta.6                                ...           3 years ago
  • 0.1.0-beta.5                                ...           3 years ago
  • 0.1.0-beta.4                                ...           3 years ago
  • 0.1.0-beta.3                                ...           3 years ago
  • 0.1.0-beta.2                                ...           3 years ago
  • 0.1.0-beta.1                                ...           3 years ago
  • 0.1.0-alpha.22                                ...           3 years ago
  • 0.1.0-alpha.21                                ...           3 years ago
  • 0.1.0-alpha.20                                ...           3 years ago
  • 0.1.0-alpha.19                                ...           3 years ago
  • 0.1.0-alpha.18                                ...           3 years ago
  • 0.1.0-alpha.17                                ...           3 years ago
  • 0.1.0-alpha.16                                ...           3 years ago
  • 0.1.0-alpha.15                                ...           3 years ago
  • 0.1.0-alpha.14                                ...           3 years ago
  • 0.1.0-alpha.13                                ...           3 years ago
  • 0.1.0-alpha.12                                ...           3 years ago
  • 0.1.0-alpha.11                                ...           3 years ago
  • 0.1.0-alpha.10                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 38
Dependencies (25)
Dev Dependencies (5)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |