Per default the application looks for a file named config.yaml
in current directory to set up the pipeline. If for any reason your config file shall be named differently, use the --config
parameter as follows to run the application: /jstatic/bin/jstatic --config=config-file-name.yaml
.
All directory and file paths defined in the config file are relative to current working directory.
Config file consists of two major parts:
plugins
tagTo see a full list of shipped plugins and their documentation, check this package under javadocs.
This tag is normally the first one in the config file and contains the list of plugins which should be activated for each phase. For example:
plugins:
LOAD_DATA_TREE:
- com.mohamnag.jstatic.plugins.front_matter_loader.MarkdownFrontMatterLoaderTask
PROCESS_ASSETS:
- com.mohamnag.jstatic.plugins.sass_compiler.SassCompilerTask
- com.mohamnag.jstatic.plugins.assets_copier.AssetsCopierTask
COMPILE_TEMPLATES:
- com.mohamnag.jstatic.plugins.markdown_compiler.MarkdownCompilerTask
DUMP_TREE:
- com.mohamnag.jstatic.plugins.html_file_dumper.FileDumperTask
This configuration:
PROCESS_ASSETS
which has two plugins enabledTo see an almost complete example of all possible configurations, check the config file under tests.
Second part of a config file is the plugin configurations. It starts with a plugin's name and then contains keys that plugin has defined for its adjustments. For the shipped plugins, you can find the necessary information on the Javadocs. For example checking com.mohamnag.jstatic.plugins.handlebars_template_compiler.HandlebarsTemplateCompilerTask
, you will find its config class called HandlebarsTemplateCompilerConfig. This class gives a short introduction to what keys are available to configure the functionality of plugin, whereas the task itself HandlebarsTemplateCompilerTask gives a more detailed description of the functionality. Same pattern could be used to discover information about other shipped plugins.
JStatic uses logback for formatting and outputting the logs. Default config packaged with app uses standard output and does some job of formatting. However, the packaged application is also configured to use a file named logback.xml
from current directory where it is being run from. One can just tweak the output by creating such a file following the configuration details of logback (can be found here)[http://logback.qos.ch/manual/jmxConfig.html]. Here is a simple example of such file:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%highlight([%-5level]) %d{HH:mm:ss.SSS} - %msg%n%ex{0}</pattern>
</encoder>
</appender>
<logger name="com.mohamnag.jstatic" level="DEBUG"/>
<root level="WARN">
<appender-ref ref="STDOUT"/>
</root>
</configuration>