|
| 1 | +<h1 align="center"> |
| 2 | +boowa |
| 3 | +</h1> |
| 4 | +<p align="center"><strong> <img src="https://avatars2.githubusercontent.com/u/34954489?s=200&v=4" width="25px"/> = a fun blog generator </strong></p> |
| 5 | + |
| 6 | +<br /> |
| 7 | + |
| 8 | +<div align="center"> |
| 9 | + <!-- Stability --> |
| 10 | + <a href="https://nodejs.org/api/documentation.html#documentation_stability_index"> |
| 11 | + <img src="https://img.shields.io/badge/stability-stable-green.svg?style=flat-square" |
| 12 | + alt="API stability" /> |
| 13 | + </a> |
| 14 | + |
| 15 | + <!-- travis ci --> |
| 16 | + <a href="https://travis-ci.org/boowajs/boowa"> |
| 17 | + <img src="https://img.shields.io/travis/boowajs/boowa.svg?style=flat-square" |
| 18 | + alt="test status" /> |
| 19 | + </a> |
| 20 | + |
| 21 | + <!-- npm version --> |
| 22 | + <a href="https://npmjs.org/package/boowa"> |
| 23 | + <img src="https://img.shields.io/npm/v/boowa.svg?style=flat-square" |
| 24 | + alt="npm version" /> |
| 25 | + </a> |
| 26 | + |
| 27 | + <!-- code style --> |
| 28 | + <a href="https://github.com/feross/standard"> |
| 29 | + <img src="https://img.shields.io/badge/code%20style-standard-blue.svg?style=flat-square" |
| 30 | + alt="code style: standard" /> |
| 31 | + </a> |
| 32 | +</div> |
| 33 | +<br /> |
| 34 | + |
| 35 | +**Table of Contents** |
| 36 | +- [Themes](#Themes) |
| 37 | +- [Features](#Features) |
| 38 | +- [Quick Start](#Quick Start) |
| 39 | +- [Why my name is boowa](#Why my name is boowa) |
| 40 | +- [API](#API) |
| 41 | + |
| 42 | +## Themes |
| 43 | +Let's see some boowa blogs first, will add more themes later: |
| 44 | +- [code_theme](https://boowajs.github.io/code_theme/) |
| 45 | +- [austere_theme](https://boowajs.github.io/austere_theme/) |
| 46 | + |
| 47 | +## Features |
| 48 | +- __colorful:__ provide kinds of styles to take your fancy |
| 49 | +- __simple:__ few tips to play your blog |
| 50 | +- __support offline:__ keep reading even if there's no wifi |
| 51 | +- __very modern:__ works very well with async functions (node 7.6+) |
| 52 | +- __fast as lightning:__ it takes almost no time to generate a blog! |
| 53 | + |
| 54 | +## Quick Start |
| 55 | + |
| 56 | +1. Install boowa globally |
| 57 | +```sh |
| 58 | +npm install boowa -g |
| 59 | +``` |
| 60 | + |
| 61 | +2. Make a directory to generate your blog |
| 62 | +```sh |
| 63 | +mkdir myBlog && cd myBlog |
| 64 | +boowa |
| 65 | +``` |
| 66 | + |
| 67 | +3. Select one style from the inquiring list |
| 68 | + |
| 69 | +4. Generate html files from markdown files |
| 70 | +```sh |
| 71 | +boowa build |
| 72 | +``` |
| 73 | + |
| 74 | +5. Install the dependencies |
| 75 | +```sh |
| 76 | +npm install |
| 77 | +``` |
| 78 | + |
| 79 | +6. Start a development server |
| 80 | +```sh |
| 81 | +npm run start |
| 82 | +``` |
| 83 | + |
| 84 | +7. then, you will see a complete blog demo |
| 85 | + |
| 86 | +## Why my name is boowa |
| 87 | +boowa is built with: |
| 88 | +- [bankai](https://github.com/choojs/bankai) - 🚉 - friendly web compiler |
| 89 | +- [choo](https://choo.io/) - 🚂 4kb framework for creating sturdy frontend applications |
| 90 | +- [awoo](https://github.com/awoojs/awoo) - 🔸 declarative small site generator |
| 91 | + |
| 92 | +so, boowa |
| 93 | + |
| 94 | +## API |
| 95 | + |
| 96 | +### `boowa` |
| 97 | +Generate a new blog app in a empty directory |
| 98 | + |
| 99 | +### app structure |
| 100 | +<img src="https://github.com/boowajs/boowa/blob/master/pics/structure.png"/ width="150px"> |
| 101 | + |
| 102 | +Actually a choo app yeah~, but you only need to handle markdown files and `_config.json` |
| 103 | + |
| 104 | +### `boowa create` |
| 105 | +<img src="https://github.com/boowajs/boowa/blob/master/pics/create.png" width="350px"> |
| 106 | + |
| 107 | +Run this command to generate a new markdown file contains the necessary structure, and it will build the html file automatically: |
| 108 | + |
| 109 | +<img src="https://github.com/boowajs/boowa/blob/master/pics/sub_stru.png" width="150px"> |
| 110 | + |
| 111 | +⚠️ Put content in `markdown-body`: |
| 112 | + |
| 113 | +<img src="https://github.com/boowajs/boowa/blob/master/pics/md.png" width="250px"> |
| 114 | + |
| 115 | +### `_config.json` |
| 116 | +This file contains metadatas like name, email etc. |
| 117 | + |
| 118 | +### `boowa build` |
| 119 | +Generate new templates after you edit `_config.json` or modify your markdown files |
| 120 | + |
| 121 | +### `npm run start` |
| 122 | +Start a development server |
| 123 | + |
| 124 | +### `npm run build` |
| 125 | +Compile all files to dist/ |
| 126 | + |
| 127 | +### `boowa serve <port | 8080>` |
| 128 | +Boowa has a simple built-in server , after `npm run build && cd dist`, run this command to serve the production code. |
| 129 | + |
| 130 | +### update the newest code |
| 131 | +After install the newest boowa, run `boowa` in the boowa-existed directory, this update would not rewrite the markdown files and `_config.json`. |
| 132 | + |
| 133 | +### support offline locally |
| 134 | +Service-worker normally runs unlocally under https, so if you want to test the offline function, for chrome, run this command first: |
| 135 | +```sh |
| 136 | +/Applications/Google\ Chrome.app/Conts/MacOS/Google\ Chrome --user-data-dir=/tmp/foo --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=http://localhost:port |
| 137 | +``` |
| 138 | + |
| 139 | +You will see `ServiceWorker registration successful with scope: http://localhost:port/` in the developer tool, if service-worker register successfully. |
| 140 | + |
| 141 | +## License |
| 142 | +[MIT](https://tldrlegal.com/license/mit-license) |
0 commit comments