-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from theNewDynamic/1-cms-version-config
NetlifyCMS version settings
- Loading branch information
Showing
4 changed files
with
63 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{{/* | ||
GetCMSVersion retrieves the version as set in the tnd_netlifycms settings. | ||
|
||
@author @regisphilibert | ||
|
||
@context Any (.) | ||
|
||
@access public | ||
|
||
@return String (default: ^2.0.0) | ||
|
||
@example - Go Template | ||
{{ partial "path" context }} | ||
{{ partialCached "path" context "variant" }} | ||
*/}} | ||
|
||
{{/* Default is `^2.0.0` for now */}} | ||
{{ $version := `^2.0.0` }} | ||
|
||
{{ with partialCached "tnd-netlifycms/private/GetModuleConfig" . "tnd-netlifycms/private/GetModuleConfig" }} | ||
{{ with .cms_version }} | ||
{{ $version = . }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
|
||
{{ return $version }} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{/* | ||
GetModuleConfig returns the config as set in data/netlifycms/config.yaml's tnd_netlifycms map. | ||
|
||
@author @regisphilibert | ||
|
||
@context Any | ||
|
||
@return Map | ||
|
||
@access private | ||
|
||
@example - Go Template | ||
{{ with partial "tnd-netlifycms/private/GetModuleConfig" . }} | ||
{{ $config = . }} | ||
{{ end }} | ||
*/}} | ||
{{ $return := dict }} | ||
{{ with site.Data.netlifycms.config }} | ||
{{ with .tnd_netlifycms }} | ||
{{ $return = . }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ return $return }} |
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