Code Monkey home page Code Monkey logo

sitegen's Introduction

sitegen

Generate static website content

There are many like it, but this one is mine

Usage

Usage: sitegen [OPTIONS] <COMMAND>

Arguments:
  <COMMAND>
          Possible values:
          - build: Build the site
          - clean: Remove previously built artifacts
          - serve: Start a development server and host the site locally

Options:
  -m, --mode <MODE>
          The mode to build the site in

          [default: development]

          Possible values:
          - development: Non-optimized build with devtools support
          - release:     Optimized build without any extra functionality

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Toolchain

This generator uses a pre-defined group of libraries to build content:

JavaScript isn't currently supported.

Configuration

Most options are controlled via a configuration file. Create a file named config.toml in the root directory of your static site. The full config file is documented here. All options are required unless specified otherwise. Globbing is done by the glob crate; see there for options.

[build]
# The directory where built files should be placed
out_dir = "dist"
# Where to search for page definitions
page_pattern = "pages/**/*.handlebars"
# Where to search for post content
post_pattern = "posts/**/*.md"
# Where to search for Handlebar partial files
partials_pattern = "partials/**/*.handlebars"
# Where to search for scss files
style_pattern = "styles/**/*.scss"
# Optional. Additional patterns to copy into the output directory
copy = [ "images/*.png", "fonts" ]

[http]
# The command to use for starting a static web server
command = "http-server"
# Optional. Arguments to pass to `command`.
args = [ "--cwd", "dist", "--port", "8080" ]

[watch]
# Paths to watch for changes when running `serve`
paths = [ "posts", "templates" ]

CI/CD

This tool can built your site in either development or release mode. This can be helpful for skipping drafts when publishing, or enabling extra features for local development builds that you don't want published.

Since the same build.out_dir is used regardless of build mode, an extra file is output named sitegen_meta.toml. It includes a mode key which will either be set to development or release. You can use this in your deployment scripts to avoid accidentally publishing a dev build.

sitegen's People

Contributors

delta62 avatar

Watchers

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