Usage
HastySite is a simple command-line program that supports some default commands and options, described in the following sections.
Syntax
hastysite command [ options ]
Default Commands
The following sections define the default commands provided by HastySite. All of them except for init can be modified, and you can also configure your own commands by creating your own min scripts and placing them in the scripts directory.
build
Builds the site by preprocessing contents and assets, processing rules defined in the rules.min file, and creating a temporary file containing the checksums of all newly-generated files. By doing so, the next time this command is executed, only the files that have actually been modified will be copied to the output directory.
The rules.min file processed by this command:
- Ignores contents and assets starting with . or _.
- Pre-processes CSS variables in all .css files.
- Processes text as HastyScribe-compatible Markdown in all .md content files.
- Associates contents to mustache templates based on the value of the content-type metadata property.
- Copies each asset file “as-is” to the output directory, respecting the source directory structure in the asset directory.
- Copies each content file to a directory within the output named after the source content ID, in an index.html file (to easily obtain “pretty URLs” ending with no extension).
Note
This command can be customized by modifying the scripts/build.min file within your site directory.
clean
Deletes all files and directories in the output and temp directories.
Note
This command can be customized by modifying the scripts/clean.min file within your site directory.
init
Initializes a new HastySite site directory, by creating the following 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
Default folder paths can be configured in your settings.json file.
page
Generates an empty page content file containing initial metadata. This command asks the user for the following information:
- A valid ID composed only by letters, numbers, and dashes that has not yet been used for another page.
- The title of the page.
After information has been provided, a new content will be created in the contents directory containing the following metadata properties:
- id
- title
- content-type (set to page)
Note
This command can be customized by modifying the scripts/page.min file within your site directory.
post
Generates an empty post content file containing initial metadata. This command asks the user for the following information:
- A valid ID composed only by letters, numbers, and dashes that has not yet been used for another post.
- The title of the post.
After information has been provided, a new content will be created in the contents/posts directory containing the following metadata properties:
- id
- title
- content-type (set to post)
- timestamp (set to the Unix timestamp of the creation of the content)
- data (set to a date string corresponding to the creation of the content)
Note
This command can be customized by modifying the scripts/post.min file within your site directory.
Options
By default, HastySite provides the following options to display information about the program or alter its behavior.
-h, --help
Displays the description of all HastySite commands and options.
-l=level, --loglevel=level
Sets the log level to one the following values:
- debug
- info
- notice (default)
- warn
- error
- fatal
-v, --version
Displays the HastySite version string.