Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/VVelox/hugo-dusky-neon-potato.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZane C. Bowers-Hadley <vvelox@vvelox.net>2018-09-25 12:56:05 +0300
committerZane C. Bowers-Hadley <vvelox@vvelox.net>2018-09-25 12:56:05 +0300
commit87c8bbe208151e3e8b45020b3aee37749f8a1e7e (patch)
tree6d97462cefb0a2059cb0afa0445e639155c35c9a
parent8fb17935ffc9da54d9c71c1b447791adccbcea6b (diff)
add auto-refreshing support to pages
-rw-r--r--README.md22
-rw-r--r--layouts/partials/head.html3
2 files changed, 25 insertions, 0 deletions
diff --git a/README.md b/README.md
index 8e3cc60..f21e3ec 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,7 @@ Outrun with the power of a potato. Based on the Potato Dark theme with CSS bits
* Can turn off pagination.
* The ability to enable sorting of tables for pages.
* Graphing via [C3](https://c3js.org/).
+* Can set a page to refresh via Front Matter.
## Usage
@@ -232,6 +233,27 @@ defaults are shown below.
graph-text="#FF00FF"
```
+### Page Auto-Refresh
+
+Pages can be told to auto refresh via setting the Front Matter variable 'page_refresh'. This is
+number of seconds between page refreshes.
+
+The use case for this would be if you are using graphing and have data that updates periodically
+want to update the page every 5 minutes or so to pull in the changes.
+
+```
+---
+title: "Auto-Refreshing"
+date: 2018-09-02T22:41:40-05:00
+draft: false
+page_refresh: 300
+---
+
+This page will refresh every 5 minutes.
+
+```
+
+
## TODO
* Implement more settings for gauge graph type.
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index fa1c94d..488b7e3 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -59,5 +59,8 @@
<script type="text/javascript" src="{{ .Site.BaseURL }}/js/c3.min.js"></script>
<script type="text/javascript" src="{{ .Site.BaseURL }}/js/d3.min.js"></script>
{{ end }}
+ {{ with .Params.page_refresh }}
+ <meta http-equiv="refresh" content="{{.}}">
+ {{ end }}
{{ partial "head_custom.html" . }}
</head>