Commit 548fcb9e authored by Mantas Vilčinskas's avatar Mantas Vilčinskas
Browse files

API updates, lastmod, NCMS/default config changes, version to 0.80

parent 96477340
......@@ -99,6 +99,19 @@ defaultContentLanguage: en
# baseUrl: /
baseURL: https://cstate.mnts.lt
# For features like Last modified, you
# need to use a Git repository. If you
# are using Netlify, you are already
# using Git (with GitHub, GitLab, etc)
#
# So, should Git information be used
# for this website?
#
# We recommend to keep this at `true`.
# BOOLEAN; `true`, `false`
enableGitInfo: true
############################################################
# +------------------------------------------------------+ #
# | Preferences | #
......@@ -201,6 +214,13 @@ params:
# BOOLEAN; `true`, `false`
skipSeconds: false
# Should there be an automatic "Last updated"
# text shown below issues?
#
# Default: `true`
# BOOLEAN; `true`, `false`
enableLastMod: true
# What header design should we use?
#
# Default: `true`
......@@ -374,6 +394,10 @@ outputs:
- json
- rss
- svg
term:
- html
- json
- rss
outputFormats:
svg:
......
......@@ -4,7 +4,7 @@
functions = "functions"
[build.environment]
HUGO_VERSION = "0.48"
HUGO_VERSION = "0.80"
[context.production.environment]
HUGO_ENV = "production"
......
......@@ -42,7 +42,7 @@
# "Last checked" + "just now"
- id: lastChecked
translation: Last checked
translation: Last updated
- id: justNow
translation: just now
- id: someTimeAgo
......
{
"is" : "404",
"title" : "Error - Not Found"
}
\ No newline at end of file
{{ $incidents := where .Site.RegularPages "Params.section" "issue" }}{{ $active := where $incidents "Params.resolved" "=" false }}{{ $isNotice := where $active "Params.severity" "=" "notice" }}{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}{{ $isDown := where $active "Params.severity" "=" "down" }}{
"is": "{{ .Section }}",
"title": "{{ .Title }}",
"baseURL": "{{ .Site.BaseURL }}",
"description": "{{ if .Params.Description }}{{ .Params.description }}{{ else }}{{ end }}",
"pages": [{{ range $i, $e := .Pages }}{{ if $i }},{{ end }}{{ if eq .Section "issues" }}
{
"is": "issue",
"title": "{{ .Title }}",
"createdAt": "{{ .Date }}",
"lastMod": "{{ .Lastmod }}",
"permalink": "{{ .Permalink }}",
"severity": "{{ .Params.severity }}",
"resolved": {{ if .Params.resolved }}true{{ else }}false{{ end }},
"informational": {{ if .Params.informational }}true{{ else }}false{{ end }},
"resolvedAt": "{{ .Params.resolvedWhen }}",
"affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}],
"filename": "{{ .File.LogicalName }}"
}
{{ else }}
{
"is": "page",
"title": "{{ .Title }}",
"createdAt": "{{ .Date }}",
"lastMod": "{{ .Lastmod }}",
"permalink": "{{ .Permalink }}",
"filename": "{{ .File.LogicalName }}",
"summary": {{ jsonify .Summary }}
}
{{ end }}{{ end }}
],
}
{{ $incidents := .Pages }}{{ $active := where $incidents "Params.resolved" "=" false }}{{ $isNotice := where $active "Params.severity" "=" "notice" }}{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}{{ $isDown := where $active "Params.severity" "=" "down" }}{
"is": "system",
"title": "{{ .Title }}",
"permalink": "{{ .Permalink }}",
"status": {{ if $isDown }}"down",{{ else }}{{ if $isDisrupted }}"disrupted",{{ else }}{{ if $isNotice }}"notice",{{ else }}"ok",{{ end }}{{ end }}{{ end }}
"pages": [{{ range $i, $e := .Pages }}{{ if $i }},{{ end }}{{ if eq .Section "issues" }}
{
"is": "issue",
"title": "{{ .Title }}",
"createdAt": "{{ .Date }}",
"lastMod": "{{ .Lastmod }}",
"permalink": "{{ .Permalink }}",
"severity": "{{ .Params.severity }}",
"resolved": {{ if .Params.resolved }}true{{ else }}false{{ end }},
"informational": {{ if .Params.informational }}true{{ else }}false{{ end }},
"resolvedAt": "{{ .Params.resolvedWhen }}",
"affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}],
"filename": "{{ .File.LogicalName }}"
}
{{ else }}
{
"is": "page",
"title": "{{ .Title }}",
"createdAt": "{{ .Date }}",
"lastMod": "{{ .Lastmod }}",
"permalink": "{{ .Permalink }}",
"filename": "{{ .File.LogicalName }}",
"summary": {{ jsonify .Summary }}
}
{{ end }}{{ end }}
],
}
......@@ -7,7 +7,7 @@
"languageCode": "{{ T "languageCode" }}",
"baseURL": "{{ .Site.BaseURL }}",
"description": "{{ .Site.Params.Description }}",
"summaryStatus":{{ if $isDown }}"down",{{ else }}{{ if $isDisrupted }}"disrupted",{{ else }}{{ if $isNotice }}"notice",{{ else }}"ok",{{ end }}{{ end }}{{ end }}
"summaryStatus": {{ if $isDown }}"down",{{ else }}{{ if $isDisrupted }}"disrupted",{{ else }}{{ if $isNotice }}"notice",{{ else }}"ok",{{ end }}{{ end }}{{ end }}
"categories": [{{ range $i, $e := .Site.Params.categories }}{{ if $i }},{{ end }}
{
"name": "{{ .name }}",{{ if .description }}
......
......@@ -13,9 +13,24 @@
</div>
<div class="contain">
{{ .Render "issue" }}
{{ .Render "issue" }}
</div>
{{ if .Site.Params.enableLastMod }}
<div class="contain center">
<p>{{ T "lastChecked" }}:
{{ if .Site.Params.dateFormat }}
{{ .Lastmod.UTC.Format .Site.Params.dateFormat }}
{{ else }}
{{ .Lastmod.Format "January 2, 2006 at 3:04 PM" }}
{{ end }}
</p>
</div>
{{ end }}
{{ partial "js" . }}
{{ partial "footer" . }}
......
......@@ -2,12 +2,12 @@
"is": "issue",
"title": "{{ .Title }}",
"createdAt": "{{ .Date }}",
"lastMod": "{{ .Lastmod }}",
"permalink": "{{ .Permalink }}",
"severity": "{{ .Params.severity }}",
"resolved": "{{ .Params.resolved }}",
"informational": "{{ .Params.informational }}",
"resolved": {{ if .Params.resolved }}true{{ else }}false{{ end }},
"informational": {{ if .Params.informational }}true{{ else }}false{{ end }},
"resolvedAt": "{{ .Params.resolvedWhen }}",
"affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}],
"filename": "{{ .File.LogicalName }}",
"body": {{ jsonify .Content }}
"filename": "{{ .File.LogicalName }}"
}
\ No newline at end of file
......@@ -110,18 +110,6 @@ collections:
hint: 'What is your status page called? Shows up in the browser bar and meta.'
name: 'title'
widget: 'string'
- label: 'Use relative time (issue began x min ago)'
name: 'useRelativeTime'
widget: 'boolean'
hint: 'IMPORTANT: In the frontmatter, the dates MUST be in the UTC time zone. If you use Netlify CMS, the CMS picks UTC time by default, so no need to worry. However, there may be very inaccurate times, if you manually define non-UTC time in your issues. Read the wiki for more: https://github.com/cstate/cstate/wiki/Customization#time'
required: false
default: true
- label: 'Skip seconds in relative time calculations?'
name: 'skipSeconds'
widget: 'boolean'
hint: 'For users of relative time. With option ON (true): "Last checked <1 min ago". With option OFF (false; default): "Last checked 20s ago". Read the wiki for more: https://github.com/cstate/cstate/wiki/Customization#skip-seconds-v50'
required: false
default: false
- label: 'Build future posts'
name: 'buildFuture'
widget: 'boolean'
......@@ -189,19 +177,37 @@ collections:
- {label: "Name", name: "name", widget: string}
- {label: "Link", name: "link", widget: string}
# Dates
- label: 'Show last modified date at bottom of issues'
name: 'enableLastMod'
widget: 'boolean'
hint: 'Experimental feature shows when changes occured based on Git info. Read the wiki for more: https://github.com/cstate/cstate/wiki/Customization#time'
required: false
default: false
- label: 'Use relative time (issue began x min ago)'
name: 'useRelativeTime'
widget: 'boolean'
hint: 'IMPORTANT: In the frontmatter, the dates MUST be in the UTC time zone. If you use Netlify CMS, the CMS picks UTC time by default, so no need to worry. However, there may be very inaccurate times, if you manually define non-UTC time in your issues. Read the wiki for more: https://github.com/cstate/cstate/wiki/Customization#time'
required: false
default: true
- label: 'Skip seconds in relative time calculations?'
name: 'skipSeconds'
widget: 'boolean'
hint: 'For users of relative time. With option ON (true): "Last checked <1 min ago". With option OFF (false; default): "Last checked 20s ago". Read the wiki for more: https://github.com/cstate/cstate/wiki/Customization#skip-seconds-v50'
required: false
default: false
- label: 'Long date format'
name: 'dateFormat'
widget: 'string'
hint: 'Default: January 2, 2006 at 3:04 PM UTC. Ddocs: https://github.com/cstate/cstate/wiki/Customization#changing-date-formats-v30'
hint: 'Default: January 2, 2006 at 3:04 PM UTC. Docs: https://github.com/cstate/cstate/wiki/Customization#changing-date-formats-v30'
default: 'January 2, 2006 at 3:04 PM UTC'
- label: 'Short date format'
name: 'shortDateFormat'
widget: 'string'
hint: 'Default: 15:04 UTC Jan 2. Hugo formatting docs: https://github.com/cstate/cstate/wiki/Customization#changing-date-formats-v30'
hint: 'Default: 15:04 UTC Jan 2. Docs: https://github.com/cstate/cstate/wiki/Customization#changing-date-formats-v30'
default: '15:04 UTC Jan 2'
# Design site title color toggle in v4.0.1
- label: 'Site title text color'
hint: 'This is irrelevant, if you use a logo in your header. Docs: https://github.com/cstate/cstate/wiki/Customization#changing-date-formats-v30'
hint: 'This is irrelevant, if you use a logo in your header.'
name: 'headerTextColor'
widget: 'select'
default: 'white'
......@@ -303,36 +309,61 @@ collections:
name: 'enableCustomHTML'
widget: 'boolean'
default: 'false'
# REQUIRED BUT HIDDEN
- label: 'theme'
name: 'theme'
widget: 'hidden'
default: 'cstate'
- label: 'preserveTaxonomyNames'
name: 'preserveTaxonomyNames'
widget: 'hidden'
default: 'true'
- label: "taxonomies"
name: taxonomies
widget: "hidden"
fields:
- {label: "affected", name: "affected", widget: "hidden", default: "affected"}
- label: "outputs (Do not touch!)"
name: outputs
widget: "hidden"
fields:
- label: "page"
name: page
widget: "list"
allow_add: false
default: ['html', 'json']
- label: "section"
name: section
widget: "list"
allow_add: false
default: ['html', 'json', 'rss']
- label: "home"
name: home
widget: "list"
allow_add: false
default: ['html', 'json', 'rss']
# REQUIRED BUT HIDDEN
- label: 'theme'
name: 'theme'
widget: 'hidden'
default: 'cstate'
- label: 'preserveTaxonomyNames'
name: 'preserveTaxonomyNames'
widget: 'hidden'
default: 'true'
- label: "taxonomies"
name: taxonomies
widget: "hidden"
fields:
- {label: "affected", name: "affected", widget: "hidden", default: "affected"}
- label: "Outputs (Do not touch!)"
name: outputs
widget: "hidden"
fields:
- label: "page"
name: page
widget: "list"
allow_add: false
default: ['html', 'json']
- label: "section"
name: section
widget: "list"
allow_add: false
default: ['html', 'json', 'rss']
- label: "home"
name: home
widget: "list"
allow_add: false
default: ['html', 'json', 'rss', 'svg']
- label: "term"
name: term
widget: "list"
allow_add: false
default: ['html', 'json', 'rss']
- label: "Output formats (Do not touch!)"
name: outputFormats
widget: "hidden"
fields:
- label: "svg"
name: svg
fields:
- label: "isPlainText"
name: isPlainText
widget: "boolean"
default: true
- label: "mediaType"
name: mediaType
default: "image/svg+xml"
- label: 'Enable Git info'
name: 'enableGitInfo'
widget: 'hidden'
hint: 'Docs: https://github.com/cstate/cstate/wiki/Customization#time'
required: false
default: true
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment