Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Generates a static site from template files with YAML and Liquid. Stack supports template transformation through Markdown, Textile and Less CSS.
Within template files, stack allows you to use bi-directional YAML variables and include files.
Available through Gemcutter.
gem install stack
cd /path/to/my/site
stack [command] [options]
generate
Generate runs through the source and transforms the templates, if no source is specified the current directory will be used.
gen
Alias of generate
.
server
Runs a web server serving the output of the transformed source, by default when running stack in server mode your templates will be automatically transformed when changed (this can be disabled).
watch
Watches a directory and re-builds whenever theres file changes.
--source [DIR]
Directory to use as the source for generating a site with stack, by default the current directory will be used.
--target [DIR]
Directory to use as the target directory, if none is specified the target will be a folder called _stack
in the source directory.
--port [PORT]
Specifies the port number the server should use when serving content through the server
command.
--disable-watch
Disables automatic transformation when serving content through the server
command.
require 'stack'
Stack::Generator.new("/path/to/source", "/path/to/target")
Template files can contain YAML block's that are processed by stack and can be used to define Liquid variables for use in your templates. A YAML block can be something like;
---
layout: application
title: Page Title
---
layout
This specifies the layout file to use around the content, theres no need to specify the extension. The layout must be defined in a file inside a _layout
folder that is within the current template scope, if you have templates defined in a sub-folder you can have a _layout
folder that only templates in the sub-folder can access.
generator
This variable holds the current hash used to transform the current template. You should not override this from the YAML block.
generator.time
The current Time from when the stack processed and transformed the templates.
generator.processed_at
The current Time the generator
processed the templates.
generator.transformed_at
The current Time the generator
transformed the templates.
Its out of the scope of this project's README file to describe how Liquid templating can be used, for more information see the Liquid Wiki.
{{ generator.time | date_to_xmlschema }} #=> 2009-10-31T21:16:06+00:00
Transforms a Time into a XML schema format string.
{{ generator.time | date_to_string }} #=> 31 Oct 2009
Transforms a Time into a formatted string.
{{ title | xml_escape }} #=>
Escapes the specified string for use in XML.
Copyright (c) 2009 Adam Livesley (sixones). See LICENSE for details.
FAQs
Unknown package
We found that stack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.