@mitjafelicijan/staticgen
Static site generator
Last updated 2 months ago by mitjafelicijan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mitjafelicijan/staticgen -g
SYNC missed versions from official npm registry.

Static site generator

Install

[sudo] npm install -g @mitjafelicijan/staticgen

Initialize new project

mkdir demo-project
cd demo-project
staticgen --init

This will create basic folder structure and staticgen.yml file that holds global configuration.

Folders

  • assets → Holds your images (get copied to public/assets)
  • static → Contains all the css etc files for your website (get copied to public/static)
  • content → Holds markdown content files that get converted into html
  • template → Twig templates (post.twig and index.twig)

Meta attributes in markdown file

~ title: Lorem ipsum dolor sit amet
~ description: Duis ornare ut mauris vel dignissim
~ date: 2020-02-29
~ slug: /lorem-ipsum-dolor-sit-amet.html
~ template: post
~ hide: false

Content goes here ...
  • If slug has sub-folders generator automatically creates sub-folders.
  • Template looks for "{post}.twig" in template folder.
  • Date is declared in YYYY-MM-DD format.
  • Attribute hide is responsible for showing post in index or not.

Generate static website

staticgen --generate

Preview changes

I recommend using Browser Sync [sudo] npm install -g browser-sync.

browser-sync ./public/ -w --no-notify --no-open

Host your website

The easiest way to get free reliable hosting is to use Firebase hosting.

  1. Go to Firebase console and create new project.
  2. Install Firebase tool with [sudo] npm install -g firebase-tools.
  3. Login to Firebase with firebase login.
  4. Initialize project firebase init and select hosting and then use existing project and find your newly created one and then just press enter through all the options.
  5. Deploy by executing firebase deploy.

You can also connect your own domain through web console. Firebase will take care of SSL for you.

Current Tags

  • 1.1.0                                ...           latest (2 months ago)

4 Versions

  • 1.1.0                                ...           2 months ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dev Dependencies (1)
  • np ^4.0.2
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |