From f5e7f886e79241f002cf28a1c8018d81fbd2ee57 Mon Sep 17 00:00:00 2001 From: Kevin Hamer Date: Sun, 11 Oct 2020 17:28:37 -0400 Subject: add .Site.Params.useRelativeTime --- exampleSite/config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'exampleSite') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 85665f6..967505f 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -124,7 +124,7 @@ params: - name: North Coast description: The main servers are located here. closed: true - - name: East Coast + - name: East Coast - name: Uncategorized untitled: true @@ -157,6 +157,11 @@ params: dateFormat: January 2, 2006 at 3:04 PM shortDateFormat: 15:04 — Jan 2 + # If enabled, will display relative times for incident history and summaries instead of using dateFormat. + # + # Default: true + useRelativeTime: true + # What header design should we use? # # Default: true @@ -277,7 +282,7 @@ params: # Default: `true` # BOOLEAN; `true`, `false` alwaysKeepBrandColor: true - + # Introduced in v4.0.1 for consistent # site title text color. # -- cgit v1.2.3-70-g09d2 From 49c081a97d8442a8267247a98d196fe05d7b3092 Mon Sep 17 00:00:00 2001 From: Kevin Hamer Date: Sun, 11 Oct 2020 17:35:30 -0400 Subject: add .Site.Params.skipSeconds --- exampleSite/config.yml | 5 +++++ layouts/partials/js.html | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'exampleSite') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 967505f..9060163 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -162,6 +162,11 @@ params: # Default: true useRelativeTime: true + # If enabled, doesn't show seconds on relative times. + # + # Default: false + skipSeconds: false + # What header design should we use? # # Default: true diff --git a/layouts/partials/js.html b/layouts/partials/js.html index c4c5a85..8465483 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -67,7 +67,11 @@ if (interval > 1) { return interval + ' {{ T "minsAgo" }}'; } - return Math.floor(seconds) + '{{ T "secondsAgo" }}'; + {{ if .Site.Params.skipSeconds }} + return '<1 {{ T "minsAgo" }}' + {{ else }} + return Math.floor(seconds) + '{{ T "secondsAgo" }}'; + {{ end }} } /** -- cgit v1.2.3-70-g09d2 From dfbbdfc9cf4f1fd4aecb6fad00dee686acd8b8e6 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Tue, 27 Oct 2020 21:36:19 +0200 Subject: uniform comment style --- exampleSite/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'exampleSite') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 9060163..3fe6e77 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -159,17 +159,17 @@ params: # If enabled, will display relative times for incident history and summaries instead of using dateFormat. # - # Default: true + # Default: `true` useRelativeTime: true # If enabled, doesn't show seconds on relative times. # - # Default: false + # Default: `false` skipSeconds: false # What header design should we use? # - # Default: true + # Default: `true` # BOOLEAN; `true`, `false` useLargeHeaderDesign: false @@ -212,7 +212,7 @@ params: # Should we show the logo or the title # of the status page? # - # Default: false + # Default: `false` # BOOLEAN; `true`, `false` useLogo: true @@ -249,7 +249,7 @@ params: # for average downtime on # systems ("/affected/") pages # - # Default: false + # Default: `false` # BOOLEAN; `true`, `false` disableComplexCalculations: false -- cgit v1.2.3-70-g09d2 From 68ac06cdd0a22422dbf502f92eace4ef12d86de3 Mon Sep 17 00:00:00 2001 From: anarcat Date: Thu, 21 Jan 2021 10:09:44 -0500 Subject: clarify what doesn't work as a baseURL I was confused when reading the sample config file, as explained in issue #164. "don't support /" could have meant a trailing slash, or subdirectories, or at least wasn't exactly clear to me. By adding an explicit example of a broken behavior, we make it clear what we're talking about here, and what to avoid. Closes: #164 --- exampleSite/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'exampleSite') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 3fe6e77..49faaee 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -89,7 +89,14 @@ defaultContentLanguage: en # version 3. If you are just testing, # localhost should automatically work. # -# Example: https://status.example.com/ +# Example: +# baseUrl: https://status.example.com/ +# +# For testing: +# baseUrl: http://localhost +# +# Broken example: +# baseUrl: / baseURL: https://cstate.mnts.lt ############################################################ -- cgit v1.2.3-70-g09d2 From 925027e85b74a77e06448be5baa6053f1222fb78 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Wed, 24 Feb 2021 13:48:14 +0200 Subject: Doc updates, bugfixes, add rel time to NCMS --- exampleSite/config.yml | 35 ++++- .../issues/2019-10-08-testing-new-pipeline.md | 2 +- .../issues/2020-06-13-maintenance-window.md | 13 -- .../issues/2021-02-13-maintenance-window.md | 14 ++ i18n/tl.yaml | 159 +++++++++++++++++++++ i18n/tl.yml | 159 --------------------- layouts/index.json | 4 +- layouts/issues/small.html | 9 +- layouts/partials/js.html | 18 ++- layouts/partials/meta.html | 2 +- static/admin/config.yml | 22 ++- static/admin/index.html | 2 +- 12 files changed, 239 insertions(+), 200 deletions(-) delete mode 100644 exampleSite/content/issues/2020-06-13-maintenance-window.md create mode 100644 exampleSite/content/issues/2021-02-13-maintenance-window.md create mode 100644 i18n/tl.yaml delete mode 100644 i18n/tl.yml (limited to 'exampleSite') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 49faaee..7dc5972 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -161,17 +161,44 @@ params: # # dateFormat Default: "January 2, 2006 at 3:04 PM" # shortDateFormat Default: "15:04 — Jan 2" - dateFormat: January 2, 2006 at 3:04 PM - shortDateFormat: 15:04 — Jan 2 + dateFormat: January 2, 2006 at 3:04 PM UTC + shortDateFormat: 15:04 UTC — Jan 2 - # If enabled, will display relative times for incident history and summaries instead of using dateFormat. + # Should relative time (x min ago) be used? + # + # IMPORTANT: In the frontmatter, the dates MUST be in + # the UTC time zone for this to work preperly. If you + # use Netlify CMS, all good — the CMS picks UTC time + # by default. Otherwise, there may be very inaccurate + # times if multiple time zones are in your issue files. + # + # FOR YOUR CONSIDERATION: This feature was introduced in + # v5. It may be a breaking change in the case when you + # wish to use relative time but old issues do not have + # UTC time (and therefore are out of sync by ±24 hours) + # + # Read the wiki for more: + # https://github.com/cstate/cstate/wiki/Customization#time + # + # If enabled, will display relative times in places like + # the incident history and summaries instead of using + # dateFormat and shortDateFormat (except for if you use + # the old shortcode). # # Default: `true` + # BOOLEAN; `true`, `false` useRelativeTime: true - + # If enabled, doesn't show seconds on relative times. # + # With option ON (true): + # "Last checked <1 min ago" + # + # With option OFF (false; default): + # "Last checked 20s ago" + # # Default: `false` + # BOOLEAN; `true`, `false` skipSeconds: false # What header design should we use? diff --git a/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md b/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md index 4f139de..4e9da4f 100644 --- a/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md +++ b/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md @@ -1,7 +1,7 @@ --- title: New Pipeline Rollout date: 2019-10-05 16:24:00 -resolved: false +resolved: true resolvedWhen: 2019-10-05 16:58:00 # Possible severity levels: down, disrupted, notice severity: disrupted diff --git a/exampleSite/content/issues/2020-06-13-maintenance-window.md b/exampleSite/content/issues/2020-06-13-maintenance-window.md deleted file mode 100644 index 404ccc4..0000000 --- a/exampleSite/content/issues/2020-06-13-maintenance-window.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Maintenance Window -date: 2020-06-13 15:54:00 -resolved: true -resolvedWhen: 2020-06-13 16:54:00 -# Possible severity levels: down, disrupted, notice -severity: disrupted -affected: - - API -section: issue ---- - -*Just began* - We're currently shutting down the network. {{< track "2018-06-13 15:54:00" >}} diff --git a/exampleSite/content/issues/2021-02-13-maintenance-window.md b/exampleSite/content/issues/2021-02-13-maintenance-window.md new file mode 100644 index 0000000..00b4765 --- /dev/null +++ b/exampleSite/content/issues/2021-02-13-maintenance-window.md @@ -0,0 +1,14 @@ +--- +title: Maintenance Window +#date: 24 Feb 21 12:35 +0200 +date: 2021-02-24 10:35:00 +resolved: false +resolvedWhen: 2021-02-24 12:10:00 +# Possible severity levels: down, disrupted, notice +severity: disrupted +affected: + - API +section: issue +--- + +*Just began* - We're currently shutting down the network. {{< track "2018-06-13 12:54:00" >}} diff --git a/i18n/tl.yaml b/i18n/tl.yaml new file mode 100644 index 0000000..1600abc --- /dev/null +++ b/i18n/tl.yaml @@ -0,0 +1,159 @@ +# Tagalog language file for cState +# Version 4.4 + +- id: languageCode + translation: tl +- id: languageName + translation: Tagalog +- id: languageNameShort + translation: TGL + +## +## INDEX.HTML +## + +# Summary status message +- id: isDown + translation: Nakakaranas ng malaking isyu +- id: isDisrupted + translation: Nakakaranas ng pagkagambala +- id: isNotice + translation: Pakiusap paki-basa ang anunsyo +- id: isOk + translation: Lahat ng sistema ay gumagana + +# No JS warning +- id: noScriptingIntro + translation: Ay! Mukhang naka-diseybol ang Javascript mo. Pakiusap +- id: noScriptingLink + translation: i-eneybol ang skripting +- id: noScriptingOutro + translation: para mas maganda ang iyong eksperyensha sa websayt na ito. +- id: thisIsDown + translation: Hindi gumagana +- id: thisIsDisrupted + translation: May pagkagambala +- id: thisIsNotice + translation: Pagpapanatili +- id: thisIsOk + translation: Gumagana + +# "Last checked" + "just now" +- id: lastChecked + translation: Huling na-chek +- id: justNow + translation: ngayon lamang +- id: someTimeAgo + translation: nakaraan + +# Example usage: `5` + `years` +# Final result: 'Last checked 5 years ago' +# Number goes before string +# Use short variants until months +- id: yearsAgo + translation: mga taon +- id: monthsAgo + translation: mga buwan +- id: daysAgo + translation: a +- id: hoursAgo + translation: o +- id: minsAgo + translation: min +- id: secondsAgo + translation: s + +- id: autoRefreshNotice + translation: Susubukan naming mag-refresh bawat 5 min + +# Incidents +- id: incidents + translation: Mga insidente +- id: incidentHistory + translation: Kasaysayan ng mga insidente + +- id: resolved + translation: Na-resolba # if it's less than a min +- id: inUnderAMinute + translation: sa ilalim ng isang minuto # continuing the last string +- id: resolvedAfter + translation: Na-resolba pagkatapos ng # + 19 min +- id: ofDowntime + translation: ng dawntaym + +- id: downtimeOngoing + translation: Ang isyung ito ay hindi pa na-reresolba + + +- id: calmBeforeTheStorm + translation: Ito ba ang katahimikan bago ang bagyo? +- id: noIncidentsDesc + translation: Ang status peyg na ito ay walang na-itala na insidente. This status page has no logged incidents. This may be because the status page owner (or owners) have recently set up their status page, have had no downtime, or have not logged any downtime. + + +- id: continueReading + translation: Ipagpatuloy ang pagbabasa +- id: prev + translation: Dati +- id: next + translation: Susunod + +## +## OTHER +## + +- id: goBack + translation: Bumalik sa +- id: backToTop + translation: Bumalik sa ibabaw +- id: poweredBy + translation: Pinapatakbo ng + +- id: notFound + translation: Walang dito. +- id: notFoundText + translation: Ito'y maaaring problema sa amin. Maaring may nilipat kami na resors at ngayon ay nawala na ito. Posible din na ang resors na nais mong makita ay walang laman. Pero, ayos lang ba sa iyo ang dobol-check sa link? + +- id: rss + translation: Mag-subskrayb sa pamamagitan ng RSS +- id: toAllUpdates + translation: sa lahat ng mga updeyt +- id: or + translation: o +- id: onlyThisFeed + translation: sa feed lamang na ito + +## +## v3 +## +- id: entries + translation: mga entri +- id: newestToOldest + translation: mula sa pinaka-bago hanggang sa pinaka-luma + +## +## v4 +## +- id: notFoundAffected + translation: Mukang ang sistemang ito ay hindi na nag-eesist o di kailan mang nagkaroon ng na-rekord na dawntaym. + +## +## v4.1 +## + +- id: averageSystemsDowntime + translation: Kamakailan, base sa iyong average na data, mukang ang sistemang ito ay nag-dawn ng mga +- id: averageSystemsDowntimeSecondPart + translation: minuto nang paisa-isa. + + +## +## v4.4 +## + +- id: in + translation: sa +- id: weeksAgo + translation: " l" +- id: yearAgo + translation: " taon" diff --git a/i18n/tl.yml b/i18n/tl.yml deleted file mode 100644 index 1600abc..0000000 --- a/i18n/tl.yml +++ /dev/null @@ -1,159 +0,0 @@ -# Tagalog language file for cState -# Version 4.4 - -- id: languageCode - translation: tl -- id: languageName - translation: Tagalog -- id: languageNameShort - translation: TGL - -## -## INDEX.HTML -## - -# Summary status message -- id: isDown - translation: Nakakaranas ng malaking isyu -- id: isDisrupted - translation: Nakakaranas ng pagkagambala -- id: isNotice - translation: Pakiusap paki-basa ang anunsyo -- id: isOk - translation: Lahat ng sistema ay gumagana - -# No JS warning -- id: noScriptingIntro - translation: Ay! Mukhang naka-diseybol ang Javascript mo. Pakiusap -- id: noScriptingLink - translation: i-eneybol ang skripting -- id: noScriptingOutro - translation: para mas maganda ang iyong eksperyensha sa websayt na ito. -- id: thisIsDown - translation: Hindi gumagana -- id: thisIsDisrupted - translation: May pagkagambala -- id: thisIsNotice - translation: Pagpapanatili -- id: thisIsOk - translation: Gumagana - -# "Last checked" + "just now" -- id: lastChecked - translation: Huling na-chek -- id: justNow - translation: ngayon lamang -- id: someTimeAgo - translation: nakaraan - -# Example usage: `5` + `years` -# Final result: 'Last checked 5 years ago' -# Number goes before string -# Use short variants until months -- id: yearsAgo - translation: mga taon -- id: monthsAgo - translation: mga buwan -- id: daysAgo - translation: a -- id: hoursAgo - translation: o -- id: minsAgo - translation: min -- id: secondsAgo - translation: s - -- id: autoRefreshNotice - translation: Susubukan naming mag-refresh bawat 5 min - -# Incidents -- id: incidents - translation: Mga insidente -- id: incidentHistory - translation: Kasaysayan ng mga insidente - -- id: resolved - translation: Na-resolba # if it's less than a min -- id: inUnderAMinute - translation: sa ilalim ng isang minuto # continuing the last string -- id: resolvedAfter - translation: Na-resolba pagkatapos ng # + 19 min -- id: ofDowntime - translation: ng dawntaym - -- id: downtimeOngoing - translation: Ang isyung ito ay hindi pa na-reresolba - - -- id: calmBeforeTheStorm - translation: Ito ba ang katahimikan bago ang bagyo? -- id: noIncidentsDesc - translation: Ang status peyg na ito ay walang na-itala na insidente. This status page has no logged incidents. This may be because the status page owner (or owners) have recently set up their status page, have had no downtime, or have not logged any downtime. - - -- id: continueReading - translation: Ipagpatuloy ang pagbabasa -- id: prev - translation: Dati -- id: next - translation: Susunod - -## -## OTHER -## - -- id: goBack - translation: Bumalik sa -- id: backToTop - translation: Bumalik sa ibabaw -- id: poweredBy - translation: Pinapatakbo ng - -- id: notFound - translation: Walang dito. -- id: notFoundText - translation: Ito'y maaaring problema sa amin. Maaring may nilipat kami na resors at ngayon ay nawala na ito. Posible din na ang resors na nais mong makita ay walang laman. Pero, ayos lang ba sa iyo ang dobol-check sa link? - -- id: rss - translation: Mag-subskrayb sa pamamagitan ng RSS -- id: toAllUpdates - translation: sa lahat ng mga updeyt -- id: or - translation: o -- id: onlyThisFeed - translation: sa feed lamang na ito - -## -## v3 -## -- id: entries - translation: mga entri -- id: newestToOldest - translation: mula sa pinaka-bago hanggang sa pinaka-luma - -## -## v4 -## -- id: notFoundAffected - translation: Mukang ang sistemang ito ay hindi na nag-eesist o di kailan mang nagkaroon ng na-rekord na dawntaym. - -## -## v4.1 -## - -- id: averageSystemsDowntime - translation: Kamakailan, base sa iyong average na data, mukang ang sistemang ito ay nag-dawn ng mga -- id: averageSystemsDowntimeSecondPart - translation: minuto nang paisa-isa. - - -## -## v4.4 -## - -- id: in - translation: sa -- id: weeksAgo - translation: " l" -- id: yearAgo - translation: " taon" diff --git a/layouts/index.json b/layouts/index.json index 5c47558..b37af7a 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -5,8 +5,8 @@ {{ $isDown := where $active "Params.severity" "=" "down" }} { "is": "index", - "cStateVersion": "4.4", - "apiVersion": "1.0.0", + "cStateVersion": "5.0", + "apiVersion": "2.0", "title": "{{ .Site.Title }}", "languageCodeHTML": "{{ .Site.LanguageCode }}", "languageCode": "{{ T "languageCode" }}", diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 79db524..531b47b 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -8,7 +8,7 @@ {{ if .Params.informational }} - + {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} @@ -23,7 +23,7 @@ {{ else if .Params.Resolved }} - + {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} @@ -65,9 +65,10 @@ {{ end }} {{ end }} - {{ else }} - + {{ else }} + + {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} diff --git a/layouts/partials/js.html b/layouts/partials/js.html index 8465483..d966643 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -3,11 +3,11 @@ * Dev toolset */ - console.log('cState v4.4 - https://github.com/cstate/cstate'); + console.log('cState v5 Dev - https://github.com/cstate/cstate'); document.getElementsByTagName('html')[0].className = 'js'; /** - * Make theme color pretty + * Change header color based on status */ if (document.body.className === 'change-header-color') { @@ -43,6 +43,7 @@ /** * Returns a relative date string for the given date. */ + function timeSince(date) { var seconds = Math.floor((new Date() - date) / 1000); @@ -78,6 +79,7 @@ * Changes elements with the class 'relative-time' into relative times and * moves the timestamp to a title attribute tooltip. */ + function updateRelativeTimes() { var elements = document.querySelectorAll('.relative-time'); for (var i = 0; i < elements.length; i++) { @@ -95,21 +97,17 @@ element.innerHTML = html.trim(); } } + updateRelativeTimes(); - setInterval(updateRelativeTimes, 5000); - /** - * Reload homepage after 290 seconds. - */ - if (document.querySelector('body.status-homepage')) { - setTimeout(location.reload, 290000) - } + // Update "time since" feature every 5s + setInterval(updateRelativeTimes, 5000); {{ if ne .Site.Params.googleAnalytics "UA-00000000-1" }} - + + - {{ range $categories }} -
+
{{ if not .untitled }}
@@ -42,6 +32,8 @@ {{ end }} + +
{{ else }} @@ -94,8 +86,54 @@ {{ end }}
{{ end }} -
+ + + + {{ end }} - + \ No newline at end of file diff --git a/layouts/partials/js.html b/layouts/partials/js.html index d966643..765e787 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -40,6 +40,18 @@ document.location.pathname = '/admin'; } + /** + * Category logic + */ + + function toggleCategoryHead(el) { + if (el.parentNode.className == 'category category--open category--titled') { + el.parentNode.className = 'category category--closed category--titled'; + } else { + el.parentNode.className = 'category category--open category--titled'; + } + } + /** * Returns a relative date string for the given date. */ diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 283e840..dfb5a98 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -319,14 +319,23 @@ .status-notice .announcement-box { border-top: 0; } /** - * Dynamically show individual component statuses + * Dynamically show component statuses */ - .component-status { float: right; } - .component[data-status="ok"] .component-status { color: {{ .Site.Params.ok }}; } - .component[data-status="disrupted"] .component-status { color: {{ .Site.Params.disrupted }}; } - .component[data-status="down"] .component-status { color: {{ .Site.Params.down }}; } - .component[data-status="notice"] .component-status { color: {{ .Site.Params.notice }}; } + .category--open .category-status { display: none; } + .component-status, .category-status { float: right; } + .component[data-status="ok"] .component-status, + .category__head[data-status="ok"] .category-status + { color: {{ .Site.Params.ok }}; } + .component[data-status="disrupted"] .component-status, + .category__head[data-status="disrupted"] .category-status + { color: {{ .Site.Params.disrupted }}; } + .component[data-status="notice"] .component-status, + .category__head[data-status="notice"] .category-status + { color: {{ .Site.Params.notice }}; } + .component[data-status="down"] .component-status, + .category__head[data-status="down"] .category-status + { color: {{ .Site.Params.down }}; } /** * Responsiveness @@ -386,15 +395,19 @@ .error { color: #ff4242; } .warning {color: #ffde7f; } .ok { color: #7fff7f; } - - .component[data-status="ok"] - .component-status { color: #7fff7f; } - .component[data-status="disrupted"] - .component-status { color: #ffde7f; } - .component[data-status="notice"] - .component-status { color: #83a4e8; } - .component[data-status="down"] - .component-status { color: #ff8181; } + + .component[data-status="ok"] .component-status, + .category__head[data-status="ok"] .category-status + { color: #7fff7f; } + .component[data-status="disrupted"] .component-status, + .category__head[data-status="disrupted"] .category-status + { color: #ffde7f; } + .component[data-status="notice"] .component-status, + .category__head[data-status="notice"] .category-status + { color: #83a4e8; } + .component[data-status="down"] .component-status, + .category__head[data-status="down"] .category-status + { color: #ff8181; } } {{ end }} -- cgit v1.2.3-70-g09d2 From 6cf928cf1122055a595dd24ec6a96e69ab62ae05 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sat, 6 Mar 2021 17:25:23 +0200 Subject: Improve Netlify.toml --- exampleSite/netlify.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'exampleSite') diff --git a/exampleSite/netlify.toml b/exampleSite/netlify.toml index 0645d58..5def631 100644 --- a/exampleSite/netlify.toml +++ b/exampleSite/netlify.toml @@ -14,4 +14,9 @@ command = "hugo -b $DEPLOY_PRIME_URL" [context.branch-deploy] - command = "hugo -b $DEPLOY_PRIME_URL" \ No newline at end of file + command = "hugo -b $DEPLOY_PRIME_URL" + +[[headers]] + for = "/*.json" + [headers.values] + Access-Control-Allow-Origin = "*" \ No newline at end of file -- cgit v1.2.3-70-g09d2 From a95d82dea49227feeefedf6a58a3593da307e128 Mon Sep 17 00:00:00 2001 From: Jacob Marshall <29145479+jacobhq@users.noreply.github.com> Date: Sun, 14 Mar 2021 08:15:20 +0000 Subject: Allow cross origin on Vercel deployments --- exampleSite/vercel.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 exampleSite/vercel.json (limited to 'exampleSite') diff --git a/exampleSite/vercel.json b/exampleSite/vercel.json new file mode 100644 index 0000000..53aef1d --- /dev/null +++ b/exampleSite/vercel.json @@ -0,0 +1,12 @@ +{ + "headers": [ + { + "source": "/(.*)", + "headers": [ + { "key": "Access-Control-Allow-Origin", "value": "*" }, + { "key": "Access-Control-Allow-Methods", "value": "GET,OPTIONS" }, + { "key": "Access-Control-Allow-Headers", "value": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" } + ] + } + ] +} -- cgit v1.2.3-70-g09d2