Skip to content

Commit ac83849

Browse files
Improve README and comments
1 parent a559d07 commit ac83849

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

Diff for: README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# TND Netlify CMS Hugo Module
22

3-
This module, in its phase 1, tends to simplify the construct of Netlify CMS lone config file and set up the Netlify CMS page wherever on the project.
3+
This module try to simplify the construct of Netlify CMS lone config file. It also sets up the Netlify CMS page wherever on the project with minimal user intervention.
44

5-
By using Hugo's Data files system to store and maintain reusable data objects which can be imported in the Netlify CMS configuration file as collections or fields, the module ease up on maintaining this wall of glyph that can quickly become your favorite CMS' `config.yml`
5+
In order to be able to reuse data objects inside the lone NetlifyCMS `config.yaml` file, this module makes use of Hugo's data file to store said data objects and allow them to be recursively imported in the configuration file.
66

77
## The Import statement
88
```
@@ -11,6 +11,13 @@ import collection posts
1111
```
1212
## Adding to your project
1313

14+
15+
1. Add this module's path to your `module.imports` config array
16+
```
17+
module:
18+
imports:
19+
- path: github.com/theNewDynamic/hugo-module-tnd-netlify-cms
20+
```
1421
1. Create a page where your Netlify CMS dasboard should live.
1522
2. Add the `netlifycms` layout to it through Front Matter.
1623
3. Add the `netlifycms_config` output format to it through Front Matter (alongside HTML):
@@ -77,4 +84,4 @@ fields:
7784
label: "Title"
7885
name: "title"
7986
widget: "string"
80-
```
87+
```

Diff for: func/private/GetConfig.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
@context Any
77

8-
@access public
8+
@return Map
9+
10+
@access private
911

1012
@example - Go Template
1113
{{ with partial "tnd-netlifycms/private/GetConfig" . }}

Diff for: func/private/go.html

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
@access private
99

10+
@use
11+
- private/GetConfig
12+
1013
@example - Go Template
1114
{{- with partial "tnd-netlifycms/private/go" . -}}
1215
{{ . }}

Diff for: func/private/import.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{{/*
22
import
3-
Reads a data object, look for an import statement and returns the correspondig data if present in data files. If not import found
4-
returns the context data as is.
3+
Reads a data object, look for an import statement and returns the correspondig data if present in data files.
4+
If no import found returns the context data as is.
55

66
@author @regisphilibert
77

88
@context Any (.)
99

1010
@return Any (.)
1111

12-
@access public
12+
@access private
1313

1414
@example - Go Template
15-
{{ partial "path" context }}
16-
{{ partialCached "path" context "variant" }}
15+
{{ with partialCached "tnd-netlifycms/private/import" . . }}
16+
{{ end }}
1717
*/}}
1818
{{/* regex101.com > https://regex101.com/r/TFA6WQ/1 */}}
1919
{{ $pattern := "^import ([a-zA-Z]*) ([a-zA-Z/_-]*)$" }}

0 commit comments

Comments
 (0)