Commit be3bcf16 authored by Mantas's avatar Mantas
Browse files

Should be working now: #16, #15

parent 1f1d50cb
......@@ -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:
......
......@@ -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;
}
}
......
......@@ -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."}
......@@ -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>
......
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