Repository navigation
Expand file tree
/
Copy pathconfig.example.js
More file actions
67 lines (58 loc) · 1.77 KB
/
Copy pathconfig.example.js
File metadata and controls
67 lines (58 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Configuration for CMS when operating in client-only mode
*
* THIS IS NOT REQUIRED WHEN USING THE SERVER!
*
*/
let config = {
// The URL that will be the default view that will initially load
// Examples:
// 'posts' -- Set default view to /posts.html
// 'pages/home' -- Set default view to /pages/home.html
defaultView: 'pages/home',
// Set to true to enable debug logging, (will enable logging events to the console)
debug: false,
// Set this to the web path to use for the URL.
// for example, if your site is located in https://domain.tld/cms/
// your webpath should be '/cms/'
// NOTE, a trailing slash is REQUIRED.
webpath: '/',
// The name of the layouts directory.
layoutDirectory: 'layouts',
// These are the types of content to load. Each type name is a directory or
// folder where the files, pages or posts are located. Each type has a list
// and single layout template that will determine how the file will be rendered.
// Each type expects the following format:
// {
// name: 'posts', // Key name for this content type
// layout: {
// list: 'post-list', // Template file to use for listing this content type
// single: 'post', // Template file to use for rendering a single page
// title: 'Posts' // Page title set automatically when browsing the listing page
// },
// },
types: [
{
name: 'posts',
layout: {
list: 'posts',
single: 'post',
sort: 'datetime-r',
title: 'Posts'
},
},
{
name: 'pages',
layout: {
list: 'pages',
single: 'page',
sort: 'title',
title: 'Pages'
},
},
],
// ID of element to attach CMS.js to
elementId: 'cms',
};
// Inform the CMS that the configuration is ready.
document.dispatchEvent(new CustomEvent('cms:config', { detail: config }));