aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMantas <11616378+mistermantas@users.noreply.github.com>2018-08-03 10:54:54 +0300
committerMantas <11616378+mistermantas@users.noreply.github.com>2018-08-03 10:54:54 +0300
commitbe3bcf16385e0f7baee0be00d09dbe436ad3bff1 (patch)
tree24f0be1a1e4f4d2216463023d4dec5400dfdd2a4
parent1f1d50cb4722c7064e7d3a66d91d8dfa0f610cac (diff)
Should be working now: #16, #15
-rw-r--r--README.md28
-rw-r--r--layouts/partials/js.html5
-rw-r--r--static/admin/config.yml35
-rw-r--r--static/admin/index.html2
4 files changed, 36 insertions, 34 deletions
diff --git a/README.md b/README.md
index 66adcf0..6fc85a5 100644
--- a/README.md
+++ b/README.md
@@ -73,28 +73,16 @@ git submodule add https://github.com/cstate/cstate
git clone https://github.com/cstate/cstate.git
```
-2. Go to the `exampleSite` folder, like so:
+2. Navigate to the theme directory:
```bash
-cd cstate-master/exampleSite
+cd cstate-master
```
-3. Uncomment this line in `config.yml`:
-
-```yml
-themesDir: ../..
-```
-
-4. Make sure that the folder name is the same as the `theme` value:d
-
-```yml
-theme: cstate-master
-```
-
-5. Then try out the site! A link to it will be shown on screen.
+3. Launch the development setup much like this:
```bash
-hugo serve
+hugo serve --baseUrl=/ --theme=cstate-master --themesDir=../..
```
The main directory is the theme itself (the cState guts, basically) and the `exampleSite` folder houses all content. Use this local setup to experiment before deploying to production!
@@ -115,7 +103,13 @@ More info on [Stack Overflow](https://stackoverflow.com/a/5828396).
## FAQ
-### Where do issues go? What is the frontmatter, how do I define metadata for issues?
+### Where do issues go?
+
+#### Using an admin panel (Netlify CMS)
+
+This takes a little more effort to set up but pays off in the long run — [see the wiki](https://github.com/cstate/cstate/wiki) for up to date information.
+
+#### Doing it from the Git repository
Create a file in `content/issues`. The name of the file will be the slug (what shows up in the URL bar). For example, this is what `major-outage-east-us.md` should look like:
diff --git a/layouts/partials/js.html b/layouts/partials/js.html
index 1896127..fb7b802 100644
--- a/layouts/partials/js.html
+++ b/layouts/partials/js.html
@@ -64,9 +64,8 @@
if (hasClass(document.querySelector('body'), 'status-homepage')) {
lastUpdated.innerHTML = 'Last checked ' + timeSince(lastUpdate) + ' ago';
- var lastUpdateTime = new Date() - lastUpdate;
- // Refresh every 4m 30s
- if (lastUpdateTime > 290000) {
+ // Refresh almost every 5m
+ if (lastUpdate > 290000) {
location.reload;
}
}
diff --git a/static/admin/config.yml b/static/admin/config.yml
index 2909785..16ff862 100644
--- a/static/admin/config.yml
+++ b/static/admin/config.yml
@@ -13,28 +13,37 @@ backend:
name: git-gateway
media_folder: "static/img"
public_folder: "/img"
+display_url: /
# Do not change this!
collections:
# Used in routes, e.g., /admin/collections/blog
- name: "issue"
# Used in the UI
- label: "Issues"
+ label: "Incident"
# The path to the folder where the documents are stored
folder: "content/issues"
# Allow users to create new documents in this collection
create: true
# Filename template, e.g., YYYY-MM-DD-title.md
- slug: "{{slug}}.md"
+ slug: "{{slug}}"
# The fields for each document, usually in front matter
fields:
- - {label: "Section", name: "Section", widget: "hidden", default: "issue"}
-
- - {label: "What is this issue about?", name: "Title", widget: "string"}
- - {label: "When did this issue begin?", name: "Date", widget: "datetime"}
-
- - {label: "Has it now been fully resolved?", name: "Resolved", widget: "boolean"}
- - {label: "When did downtime end (if it did)?", name: "ResolvedWhen", widget: "date"}
-
- - {label: "What is the severity?", name: "Severity", widget: "string", options: ['disrupted', 'down', 'notice']}
- - {label: "What is affected? Example: ['API', 'Media Proxy']", name: "Affected", widget: "string"}
- - {label: "Write any relevant notes here.", name: "body", widget: "markdown"}
+ # Hidden
+ - {label: "Mark as incident", name: "Section", widget: "hidden", default: "issue"}
+ # Very basic
+ - {label: "Title", name: "Title", widget: "string"}
+ - {label: "Start date & time", name: "Date", widget: "datetime"}
+ - {label: "Mark as resolved", name: "Resolved", widget: "boolean"}
+ - {label: "End date & time", name: "ResolvedWhen", widget: "datetime", required: false}
+ - label: "Severity"
+ name: "Severity"
+ widget: "select"
+ options:
+ - { label: "High (Down)", value: "down" }
+ - { label: "Medium (Disrupted)", value: "disrupted" }
+ - { label: "Low (Maintenance)", value: "notice" }
+ - label: "Affected systems (use exact name)"
+ name: "Affected"
+ widget: "list"
+ required: false
+ - {label: "Sequence of events", name: "body", widget: "markdown", default: "We are investigating a potential issue that might affect the uptime of one our of services."}
diff --git a/static/admin/index.html b/static/admin/index.html
index 5d0b4fe..f8ef914 100644
--- a/static/admin/index.html
+++ b/static/admin/index.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>{{ .Site.Title }} | cState Admin</title>
+ <title>cState Admin</title>
<link rel="stylesheet" href="https://unpkg.com/netlify-cms@~1.1/dist/cms.css" />
</head>
<body>