Constructor
new Config(optionsopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
Object |
<optional> |
null | Pass an Object to autoload site-specific options |
- Source:
Members
dateParser :RegExp
Parsing regular expression for parsing a date from a File URL
Type:
- RegExp
- Source:
debug :boolean
Set to true to enable debug logging, (will enable logging events to the console)
Type:
- boolean
- Source:
defaultView :string
The URL that will be the default view that will initially load (sans the .html extension)
For example, to use '/posts.html' as the homepage, set to 'posts'. To use '/pages/home.html', set as 'pages/home'.
Type:
- string
- Source:
elementId :string
ID of element to attach MarkdownMaster CMS to
Type:
- string
- Source:
extension :string
Extension to match Files with
Type:
- string
- Source:
frontMatterSeperator :string
Separator for FrontMatter content in Markdown files
Type:
- string
- Source:
layoutDirectory :string
Name of the layouts directory on the filesystem
Type:
- string
- Source:
markdownEngine :function|null
Markdown engine to use for parsing into HTML
Type:
- function | null
- Source:
messageClassName :string
Class to add to system messages (when in debug mode)
Type:
- string
- Source:
titleSearchResults :string
Page title to set when searching for content
Type:
- string
- Source:
types :Array.<ConfigType>
Types of file collections available on the CMS
Type:
- Array.<ConfigType>
- Source:
webpath :string
This is set to the web path to use for URLs. For example, if your site is located in https://domain.tld/cms/ your web path should be '/cms/'
Type:
- string
- Source:
Methods
addType(name, layout)
Add a new file type to the CMS
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | Name of the type, must match directory name |
|||||||||||||||
layout |
Object | Layout configuration and defaults Properties
|
- Source:
dateFormat(date)
Function to call when rendering dates to the page, useful for modifying how dates display
Parameters:
Name | Type | Description |
---|---|---|
date |
Date | Common option parameters:
For more information about date options, refer to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options |
- Source:
extra(name, key, defaultValue) → {mixed}
Get a plugin / extra configuration value
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the plugin |
key |
string | Key to fetch from the plugin |
defaultValue |
mixed | Default value if not set |
- Source:
Returns:
- Type
- mixed
load(options)
Load a user-defined dictionary of configuration values to override the defaults (usually set from the site config.js)
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
- Source: