frost-gen

🚀 A static site generator.

Usage no npm install needed!

<script type="module">
  import frostGen from 'https://cdn.skypack.dev/frost-gen';
</script>

README

frost">

🚀 A static site generator.

Features

  • Super lightweight & I mean it.
  • Easy & simple configuration.
  • Custom, easy to understand and fast templating engine.
  • What else could you possibly want?

Installation

  • with npm (Preferred)
npm i -g frost-gen

Usage

  • Simple

    • Run it on your local machine
    $ frost --serve
    
    • Build the static site
      $ frost -- build
      

Configuration

To configure frost, by default you use frost.json as the configuration file in the root of your project. To overwrite the custom configuration file, you can use --config {file}.json as a CLI Option, while serving or building the website.

Here is the default schema used by frost


{
   "srcDir": "source",
   "buildDir": "build",
   "staticDir": "static",
   "HTMLcompressionLevel": 2
}

srcDir - It is the source directory of the project where all the templates/pages are stored. buildDir - Specifies the export directory on build. staticDir - Directory where the static files are stored. HTMLcompressionLevel - The amount of compression you want the build to incurr metadataFile - The file wher the metadata is stored.

Metadata

By default the metadata file for frost is frost.metadata.json, containing all the metadata/variables required in your project. It can be overwritten using the CLI at anytimes.

Example

Here's an example usage:

frost.metadata.json

{
    "author": "rhydderchc"
}

index.frost


<body>
    <p> The Author is:</p>
    <p>
        <frost>author</frost>
    </p>
</body>

output( on build )


<body>
    <p> The Author is:</p>
    <p>
        rhydderchc
    </p>
</body>

Templating with the frost engine

Frost has it's own built-in templating engine, using a html-like syntax with added features.

  • Rendering Markdown Yes, with the frost engine you can render markdown with ease.

<p>
    <frost markdown> # This is a template </frost>
</p>
  • Including an external markdown file

    
    <p>
        #include "./mark.md"
    </p>
    
  • Using TypeScript With frost's engine, using typescript is a piece of cake.

<p>
    <frost typescript> let a: string = "Hello World"</frost>
    <frost> a </frost>
</p>
  • Including Typescript Files
 <p>
     #include "./hello.ts"
 </p>

Extensions

  • Frost-vsc - A Visual studio code extention for frost.