This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
NOTES.txt
81 lines (54 loc) · 2.28 KB
/
NOTES.txt
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Content and layout models:
==========================
In the content, the following values are present in the template:
- resource : the FileResource currently processed, an instance of FileResource
- metadata : the metadata of the resource currently processed, it's equivalent of resource.getMetadata(). An instance of FileMetadata
- root : the root directory, an instance of RootResource
- configuration : the configuration, an instance of StampoGlobalConfiguration
- locale : the current locale, an instance of java.util.Locale
- static : the content of the static directory, an instance of RootResource. This is not always present!
For the layout, an additional value is present:
- content : the processed content, a String.
Templates:
==========
For pebble template:
- _all_ the path of imported pebble templates must always be relative to
the root of the directories.
- a fromMap function has been exposed, as pebble does not permit to have dynamic lookup for map key: e.g.:
{{fromMap(myMap, value)}}
Localization:
=============
For pebble template:
- use the custom message function, e.g.
{{message('hello', header, header2)}}
the first parameter is the property name and the others are the optional
parameters
For freemarker template:
- use the message function, e.g. ${message('hello', 'param1')}
the first parameter is the property name and the others are the optional
parameters
Content extension:
==================
- example for single language:
- no processor involved:
- /content/test.txt will generate a file in /output/test.txt
- markdown processor involved: (mapping from .md to .html is present)
- /content/test-markdown.md will generate a file in /output/test-markdown.html
- pebble processor involved: (no mapping .peb to * is present)
- /content/test-pebble.peb will generate a file /output/test-pebble.peb
- /content/test-pebble-html.html.peb will generate a file /output/test-pebble-html.html
Configuration file:
===================
Supported keys:
- locales
- default-locale
- use-ugly-url
File metadata:
==============
Supported keys:
- date
- only-for-locales
- override-output-to-path
- override-locale
- override-layout
- override-use-ugly-url