Giter VIP home page Giter VIP logo

nanako's Introduction

nanako

npm react next license size

Yet another static site generator.

๐ŸŒŸ Features

  • Designed for light novels
  • CLI tools
  • Sync tool (TODO)

๐Ÿ“— Quick start

npx nanako create my-awesome-blog

๐Ÿ”ง CLI

Usage: nanako [options] [command]

Commands:
  add, a     Add a book or a chapter, or both.
  create, c  Create a nanako project.
  help       Display help
  version    Display version

Options:
  -h, --help     Output usage information
  -v, --version  Output the version number
  -y, --yes      Optional: skip the prompts and init the book or the chapter with the default meta.json.

Examples:
  - Create a nanako instance in folder my-awesome-blog.
  $ npx nanako create my-awesome-blog

  - Create a book.
  $ npx nanako add my-awesome-book

  - Create a chapter under my-awesome-book
  $ npx nanako add my-awesome-book my-awesome-chapter

๐Ÿ“š Manual Content Management

Putting your docs

docs
โ””โ”€ lixia  // book
   โ”œโ”€ chapter2  // chapter
   โ”‚  โ”œโ”€ 1.md
   โ”‚  โ””โ”€ meta.json
   โ”œโ”€ intro
   โ”‚  โ”œโ”€ archives
   โ”‚  โ”‚  โ”œโ”€ ็ซ‹ๅคๅบ็ซ ็ฎ€.epub
   โ”‚  โ”‚  โ””โ”€ ็ซ‹ๅคๅบ็ซ ็น.epub
   โ”‚  โ”œโ”€ images
   โ”‚  โ”‚  โ”œโ”€ alice.jpg
   โ”‚  โ”‚  โ”œโ”€ nanzhi1.jpg
   โ”‚  โ”‚  โ”œโ”€ nanzhi2.jpg
   โ”‚  โ”‚  โ”œโ”€ yuyao1.jpg
   โ”‚  โ”‚  โ”œโ”€ yuyao2.jpg
   โ”‚  โ”‚  โ””โ”€ yuyao3.jpg
   โ”‚  โ”œโ”€ 1.md
   โ”‚  โ”œโ”€ 10.md
   โ”‚  โ”œโ”€ 11.md
   โ”‚  โ”œโ”€ 12.md
   โ”‚  โ”œโ”€ 13.md
   โ”‚  โ”œโ”€ 14.ๅฐพๅฃฐ.md
   โ”‚  โ”œโ”€ 15.ๅŽ่ฎฐ.md
   โ”‚  โ”œโ”€ 2.md
   โ”‚  โ”œโ”€ 3.md
   โ”‚  โ”œโ”€ 4.md
   โ”‚  โ”œโ”€ 5.md
   โ”‚  โ”œโ”€ 6.md
   โ”‚  โ”œโ”€ 7.md
   โ”‚  โ”œโ”€ 8.md
   โ”‚  โ”œโ”€ 9.md
   โ”‚  โ””โ”€ meta.json
   โ””โ”€ meta.json

Creating meta.json for books and chapters

{
  "title": "็ซ‹ๅค",
  "lang": "zh-Hans",
  "index": 1,
  "category": "novel"
}

Using images in markdown

![nanzhi1](./images/nanzhi1.jpg)

Will automatically redirect to /images/nanzhi1.jpg

Modify src/nanako.json

{
  "port": 20200,
  "footer": "ๅฏนไบŽๆœฌ็ฝ‘็ซ™ๅŠๅฑ•็คบ็š„ไฝœๅ“๏ผŒไฝœ่€…ไฟ็•™ไธ€ๅˆ‡ๆƒๅŠ›ใ€‚",
  "title": "ๅฐๅ–ตๆ–ฐๅงฌ็š„ๅšๅฎข",
  "headTitle": "ๅ’•ๅ™œๅ’•ๅ™œๅ–ตๅ„ฟ",
  "cookieConsent": true,
  "categories": {
    "novel": "ๅฐ่ฏด",
    "casual": "้š็ฌ”",
    "tutorial": "ๆ•™็จ‹",
    "uncategorized": "ๆœชๅˆ†็ฑป"
  },
  "cacheTTL": 600, // cache ttl for chapters fetch
  "cacheTTLLong": 3600 // cache ttl for books and sections fetch
}

๐Ÿš€ Deployment

yarn build

yarn start

# or

NODE_ENV=production node nanako.js

Please refer to the Next.js documentations for anything that goes wrong with deployment.

nanako's People

Contributors

yinyanfr avatar

Stargazers

 avatar  avatar  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.