You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• This template tries to follow conventional commits format https://www.conventionalcommits.org/en/v1.0.0/
6
+
• The template uses regex to filter commit types into their own headings (this is more than just fixes and features headings)
7
+
• It also uses the replaceText function in package.json to remove the commit type text from the message, because the headers are shown instead.
8
+
• The text 'Breaking:' or 'Breaking changes:' can be located anywhere in the commit.
9
+
• The types feat:, fix:, chore:, docs:, refactor:, test:, style:, perf: must be at the beginning of the commit subject with an : on end.
10
+
• They can optionally have a scope set to outline the module or component that is affected eg feat(bldAssess):
11
+
• There is a short hash on the end of every commit that is currently commented out so that change log did not grow too long (due to some system's file size limitations). You can uncomment if you wish [`{{shorthash}}`]({{href}})
12
+
13
+
Example Definitions
14
+
• feat: A new feature
15
+
• fix: A bug fix
16
+
• perf: A code change that improves performance
17
+
• refactor: A code change that neither fixes a bug nor adds a feature
18
+
• style: Changes that do not affect the meaning of the code (white-space, formatting, spelling mistakes, missing semi-colons, etc)
19
+
• test: Adding missing tests or correcting existing tests
20
+
• docs: Adding/updating documentation
21
+
• chore: Something like updating a library version, or moving files to be in a better location and updating all file refs
22
+
--}}
23
+
24
+
25
+
{{!-- In package.json need to add this to remove label text from the change log output (because the markdown headers are now used to group them).
26
+
NOTES • Individual brackets have been escaped twice to be Json compliant.
27
+
• For items that define a scope eg feat(bldAssess): We remove the 1st bracket and then re-add it so we can select the right piece of text
28
+
{
29
+
"name": "my-awesome-package",
30
+
"auto-changelog": {
31
+
"replaceText": {
32
+
"([bB]reaking:)": "",
33
+
"([bB]reaking change:)": "",
34
+
"(^[bB]uild:)": "",
35
+
"(^[bB]uild\\()": "\\(",
36
+
"(^[dD]eprecate:)": "",
37
+
"(^[dD]eprecate\\()": "\\(",
38
+
"(^[fF]eat:)": "",
39
+
"(^[fF]eat\\()": "\\(",
40
+
"(^[fF]ix:)": "",
41
+
"(^[fF]ix\\()": "\\(",
42
+
"(^[cC]hore:)": "",
43
+
"(^[cC]hore\\()": "\\(",
44
+
"(^[dD]ocs:)": "",
45
+
"(^[dD]ocs\\()": "\\(",
46
+
"(^[rR]efactor:)": "",
47
+
"(^[rR]efactor\\()": "\\(",
48
+
"(^[tT]est:)": "",
49
+
"(^[tT]est\\()": "\\(",
50
+
"(^[sS]tyle:)": "",
51
+
"(^[sS]tyle\\()": "\\(",
52
+
"(^[pP]erf:)": "",
53
+
"(^[pP]erf\\()": "\\("
54
+
}
55
+
}
56
+
}
57
+
--}}
58
+
59
+
{{!--
60
+
Regex reminders
61
+
^ = starts with
62
+
\( = ( character (otherwise it is interpreted as a regex lookup group)
{{#commit-listmergesheading='### Chores And Housekeeping'message='^[cC]hore:|^[cC]hore\('exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
{{#commit-listmergesheading='### Refactoring and Updates'message='^[rR]efactor:|^[rR]efactor\('exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
{{#commit-listmergesheading='### Changes to Test Assests'message='^[tT]est:|^[tT]est\('exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
{{#commit-listcommitsheading='### Chores And Housekeeping'message='^[cC]hore:|^[cC]hore\('exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
{{#commit-listcommitsheading='### Refactoring and Updates'message='^[rR]efactor:|^[rR]efactor\('exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
{{#commit-listcommitsheading='### Changes to Test Assests'message='^[tT]est:|^[tT]est\('exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
@@ -50,6 +51,18 @@ When you set the property to `false`, then app is rendered from the client side
50
51
51
52
> **Note:** For CSR mode, [stackSDK](#stacksdk) is required. Hence, we automatically switch mode to CSR when you pass this object. This config is provided to override the default behavior.
52
53
54
+
### `mode`
55
+
56
+
| type | default | optional |
57
+
| ------- | --------- | -------- |
58
+
| string |`preview`| Yes |
59
+
60
+
The `mode` property specifies whether the site is editable in the Live Preview or Visual Builder environment.
61
+
62
+
If set to `preview`, clicking the hovered edit button navigates to the Contentstack Live Preview panel.
63
+
64
+
If set to `builder`, clicking the Start Editing button navigates to the Contentstack Visual Builder. Note that the site will still function in the Live Preview panel even when set to 'builder'.
65
+
53
66
### `editButton`
54
67
The editButton object allows you to manage the "Edit" button both within and outside the Live Preview portal. It offers the following features:
55
68
- Enable/disable the "Edit" button
@@ -274,55 +287,29 @@ The `hash` property returns the live preview hash of the entry. It returns an em
The `setConfigFromParams` method allows you to set the configuration from the URL parameters. It accepts the URLSearchParams object as a parameter. This method is used in the SSR mode to set the live preview hash received from the URL.
Gatsby primarily fetches data using the [`gatsby-source-contentstack` plugin](https://www.gatsbyjs.com/plugins/gatsby-source-contentstack/). But, Live Preview currently works only on the [contentstack SDK](https://www.npmjs.com/package/contentstack).
290
+
## config
292
291
293
-
Hence, for Gatsby, we fetch the data from the contentstack SDK and store it in React state. Post that, we re-render the page using the `onEntryChange()` method. As the data format is different for the gatsby-source-contentstack plugin, it returns a prefix and the entry name in Camel case. Hence, we use `getGatsbyDataFormat()` to change the entry's name.
294
-
295
-
The `getGatsbyDataFormat()` method accepts the Contentstack `Stack` object as the first parameter and the prefix as the second. The prefix is set inside the `gatsby-config.js` file. The default value set for the prefix is `contentstack`.
292
+
The `config` property returns the following properties and their values:
0 commit comments