项目作者: jdedwards3

项目描述 :
Node.js Static Site Generator
高级语言: TypeScript
项目地址: git://github.com/jdedwards3/morphic.git
创建时间: 2020-12-30T20:43:57Z
项目社区:https://github.com/jdedwards3/morphic

开源协议:MIT License

下载


morphic

Node.js Static Site Generator

Usage

  1. mkdir morphic-site
  1. cd morphic-site
  1. git init
  1. echo 'node_modules' > .gitignore
  1. npm i @protolith/morphic@latest
  1. mkdir public
  1. mkdir content
  1. mkdir templates
  1. cd content
  1. echo '---
  2. title: Home
  3. ---
  4. # <%= model.title %>
  5. home page content' > index.md
  1. cd ../templates
  1. echo '<!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title><%= model.title %></title>
  5. </head>
  6. <body>
  7. <%- model.content %>
  8. </body>
  9. </html>' > index.ejs
  1. cd ..

With the default files created, from the morphic-site folder run the command:

  1. npx morphic --serve

This will create an output folder containing the generated html, and open a browser window to view.

Build

Clone repo and run:

  1. npm run build

or

  1. npm run build-typecheck

These commands will compile the typescript src directory to a new folder named dist, containing the javascript output.

Building without typechecking will not pass source files through the typescript compiler (only babel).

Notice

Morphic is very much still a work in progress and is not ready for production use.