all repos — hastysite @ a10b7341d7a2f0167ef5b03f4b56b4ea0f169d70

A high-performance static site generator.

site/contents/getting-started.md

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
-----
id: getting-started
title: "Getting Started"
content-type: page
-----

{{version => 0.2.0}}

## Download

You can download one of the following pre-built HastySite binaries:

> %unstyled%
> * {#release||{{version}}||macosx||macOS||x64||apple#}
> * {#release||{{version}}||windows||Windows||x64||windows#}
> * {#release||{{version}}||linux||Linux||x64||linux#}
> * {#release||{{version}}||linux||Linux||x86||linux#}
> * {#release||{{version}}||linux||Linux||arm||linux#}

{#release -> [](class:$5)[hastysite v$1 for $3 ($4)](https://github.com/h3rald/hastysite/releases/download/v$1/hastysite\_v$1\_$2\_$4.zip) #}

## Building from Source

Alternatively, you can build HastySite from source as follows:

1. Download and install [nim](https://nim-lang.org).
2. Download and build [Nifty](https://github.com/h3rald/nifty), and put the nifty executable somewhere in your [$PATH](class:kwd).
3. Clone the HastySite [repository](https://github.com/h3rald/hastysite).
4. Navigate to the HastySite repository local folder.
5. Run the following command to download HastySite's dependencies.
   > %terminal%
   > nifty install
7. Run the following command to compile HastySite:
   > %terminal%
   > nim c -d:release hastysite.nim

> %tip%
> Tip
> 
> You should put the compiled HastySite executable somewhere in yout [$PATH](class:kwd).

## Running HastySite

To create a new site, run the following command in an empty directory:

> %terminal%
> hastysite init

This will create the following default directory structure:


* assets/ — _Your site assets_
  * fonts/
  * styles/
* contents/ — _Your site contents._
* output/ — _Your static web site._
* rules.min — _Rules to process your contents and assets._
* scripts/ — _Scripts to manage your site._
* settings.json — _Your site configuration._
* temp/ — _Temporary files and folders will be placed here._
* templates/ — _Mustache templates._


> %tip%
> Tip
> 
> Default folder paths can be configured in your [settings.json](class:file) file.

Then, create your first page by running the following command and specifying the page ID and Title:

> %terminal%
> hastysite page
> ID: home
> Title: Home Page
> \-\-\-\-\-
> id: home
> title: "Home Page"
> content-type: page
> \-\-\-\-\-
> Create page? [yes/no]: y

Finally, run the following command to generate your site contents (just an empty home page for now) and copy the default assets.

> %terminal%
> hastysite build
>    Preprocessing\.\.\.
>    Processing rules\.\.\.
>     - Writing file: output/index.html
>     - Copying: assets/fonts/SourceSansPro-Regular.woff -> output/fonts/SourceSansPro-Regular.woff
>     - Copying: assets/fonts/SourceSansPro-It.woff -> output/fonts/SourceSansPro-It.woff
>     - Copying: assets/fonts/fontawesome-webfont.woff -> output/fonts/fontawesome-webfont.woff
>     - Copying: assets/fonts/SourceCodePro-Regular.woff -> output/fonts/SourceCodePro-Regular.woff
>     - Copying: assets/fonts/SourceSansPro-Bold.woff -> output/fonts/SourceSansPro-Bold.woff
>     - Copying: assets/fonts/SourceSansPro-BoldIt.woff -> output/fonts/SourceSansPro-BoldIt.woff
>     - Writing file: output/styles/hastysite.css
>     - Writing file: output/styles/site.css
>     - Writing file: output/styles/luxbar.css
>     - Writing file: output/styles/hastyscribe.css
>     - Writing file: output/styles/fonts.css
>    Postprocessing\.\.\.
>    All done.

That's it! You can view the result by serving the [output](class:dir) directory from any web server.