An SSG built with Deno (meant for personal use). Sort of like a more opinionated version of Metalsmith.js
- Install the turto CLI:
deno install --allow-env --allow-read --allow-run --allow-net https://deno.land/x/turto/cli.ts
. - Create a new turto project using the default template:
turto init
. - Build your site:
turto build
.
Use the --help
flag to get more details for each command.
init
- create a new turto projectbuild
- build your site- essentially runs
deno run -A mod.ts
- essentially runs
dev
- (not complete) build your application in development mode (file watcher server, etc.)
Each file in your source directory is either a page, asset, or layout.
- contents of your website.
- any file with the extensions
.md
,.html
,.njk
are recognized as pages. - files can contain markdown to specify data about the page.
- any file that is not a page or a layout
- by default, turto will not read the contents of an asset file into memory and you will need to specify which files to read using the
readAssetContent
option
- all layouts live in a special directory specified in the options.
- pages can specify a layout to use by specifiying the
layout
field in its markdown.
Each turto project should have a mod.ts
file which will build your site when run. Here is the most basic structure:
import { turto } from "https://deno.land/x/turto/mod.ts";
const site = turto();
site.build();
Returns a Site
object initialized with options
.
SiteOptions
src
- source directory where all files are located (default: ".")dest
- directory relative tosrc
where site will be generated (default: "_site")layouts
- directory relative tosrc
where layouts are located (default: "_layouts")renderer
- options for renderer, currently only uses nunjucks options (default: {})prettyPaths
- convert "dir/hello.html" to "dir/hello/index.html" (default: false)ignore
- ignore files when usingload
, usesmicromatch
(default: [])readAssetContent
- specifies which assets to read the content for (default: [])micromatch
- options for whenmicromatch
is used (default: {})
build()
- builds your site- reads in all the pages, assets, and layouts in the source directory
- render the page contents if the page has a specified layout
- runs through all of the plugins (plugins will execute in the order they are added)
- writes the contents into the source directory
use(fn: Plugin)
- add a plugin