-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #132 by moving all config keys into a constant interface.
It's not yet optimal (as there is not yet any separation between the various rendering engines), but at least it's a good start, no ?
- Loading branch information
Riduidel
committed
Sep 1, 2014
1 parent
7aaaaaa
commit 19b119b
Showing
18 changed files
with
184 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,114 @@ | |
* @author Jonathan Bullock <[email protected]> | ||
*/ | ||
public class ConfigUtil { | ||
/** | ||
* Set of config keys used by JBake | ||
* @author ndx | ||
* | ||
*/ | ||
public static interface Keys { | ||
|
||
public final static String DATE_FORMAT = "date.format"; | ||
/** | ||
* Path of archived file. Should only be used when {@link #RENDER_ARCHIVE} is true. | ||
*/ | ||
static final String ARCHIVE_FILE = "archive.file"; | ||
static final String ASCIIDOCTOR_ATTRIBUTES = "asciidoctor.attributes"; | ||
static final String ASCIIDOCTOR_ATTRIBUTES_EXPORT = "asciidoctor.attributes.export"; | ||
static final String ASCIIDOCTOR_ATTRIBUTES_EXPORT_PREFIX = "asciidoctor.attributes.export.prefix"; | ||
static final String ASCIIDOCTOR_OPTION = "asciidoctor.option"; | ||
/** | ||
* Folder where assets are stored. Assets are copied directly in output folder and not processed by JBake. | ||
*/ | ||
static final String ASSET_FOLDER = "asset.folder"; | ||
/** | ||
* Timestamp that will be output when generation start. | ||
*/ | ||
static final String BUILD_TIMESTAMP = "build.timestamp"; | ||
/** | ||
* Folder where content (that's to say files to be transformed) resides in | ||
*/ | ||
static final String CONTENT_FOLDER = "content.folder"; | ||
/** | ||
* How date is formated | ||
*/ | ||
final static String DATE_FORMAT = "date.format"; | ||
static final String DB_PATH = "db.path"; | ||
static final String DB_STORE = "db.store"; | ||
/** | ||
* Default status to use (in roder to avoid putting it in all files | ||
*/ | ||
static final String DEFAULT_STATUS = "default.status"; | ||
/** | ||
* Path where html files are generated in. | ||
*/ | ||
static final String DESTINATION_FOLDER = "destination.folder"; | ||
/** | ||
* Suffix used to identify draft files | ||
*/ | ||
static final String DRAFT_SUFFIX = "draft.suffix"; | ||
/** | ||
* Feed template file. IS required only when {@link #RENDER_FEED} is set to true | ||
*/ | ||
static final String FEED_FILE = "feed.file"; | ||
/** | ||
* Index template file. Required only when {@link #RENDER_INDEX} is set to true | ||
*/ | ||
static final String INDEX_FILE = "index.file"; | ||
/** | ||
* Common extension for all output files | ||
*/ | ||
static final String OUTPUT_EXTENSION = "output.extension"; | ||
/** | ||
* Flag indicating if archive file should be generated. | ||
*/ | ||
static final String RENDER_ARCHIVE = "render.archive"; | ||
/** | ||
* Encoding used to render files. | ||
*/ | ||
static final String RENDER_ENCODING = "render.encoding"; | ||
/** | ||
* Flag indicating if feed file should be generated. | ||
*/ | ||
static final String RENDER_FEED = "render.feed"; | ||
/** | ||
* Flag indicating if index file should be generated. | ||
*/ | ||
static final String RENDER_INDEX = "render.index"; | ||
/** | ||
* Flag indicating if sitemap file should be generated. | ||
*/ | ||
static final String RENDER_SITEMAP = "render.sitemap"; | ||
/** | ||
* Flag indicating if tags file should be generated. | ||
*/ | ||
static final String RENDER_TAGS = "render.tags"; | ||
/** | ||
* Port used when running Jetty server | ||
*/ | ||
static final String SERVER_PORT = "server.port"; | ||
/** | ||
* Sitemap template file name. Used only when {@link #RENDER_SITEMAP} is set to true | ||
*/ | ||
static final String SITEMAP_FILE = "sitemap.file"; | ||
/** | ||
* tags template file name. Used only when {@link #RENDER_TAGS} is set to true | ||
*/ | ||
static final String TAG_PATH = "tag.path"; | ||
/** | ||
* Ecoding for template files | ||
*/ | ||
static final String TEMPLATE_ENCODING = "template.encoding"; | ||
/** | ||
* Folder where template files are looked for | ||
*/ | ||
static final String TEMPLATE_FOLDER = "template.folder"; | ||
/** | ||
* Locale used for thymeleaf template rendering | ||
*/ | ||
public static final String THYMELEAF_LOCALE = "thymeleaf.locale"; | ||
static final String VERSION = "version"; | ||
|
||
} | ||
|
||
public static CompositeConfiguration load(File source) throws ConfigurationException { | ||
CompositeConfiguration config = new CompositeConfiguration(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.