aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile9
-rw-r--r--cmd/site/main.go5
-rwxr-xr-xstatic/js/sw.js55
-rw-r--r--static/manifest.json17
-rw-r--r--templates/base.html10
-rw-r--r--vendor/github.com/Xe/gopreload/.gitignore1
-rw-r--r--vendor/github.com/Xe/gopreload/LICENSE19
-rw-r--r--vendor/github.com/Xe/gopreload/README.md51
-rw-r--r--vendor/github.com/Xe/gopreload/doc.go7
-rw-r--r--vendor/github.com/Xe/gopreload/preload.go26
-rw-r--r--vendor/github.com/Xe/jsonfeed/.travis.yml17
-rw-r--r--vendor/github.com/Xe/jsonfeed/LICENSE363
-rw-r--r--vendor/github.com/Xe/jsonfeed/README.md8
-rw-r--r--vendor/github.com/Xe/jsonfeed/jsonfeed.go73
-rw-r--r--vendor/github.com/Xe/ln/LICENSE25
-rw-r--r--vendor/github.com/Xe/ln/README.md29
-rw-r--r--vendor/github.com/Xe/ln/action.go11
-rw-r--r--vendor/github.com/Xe/ln/context.go38
-rw-r--r--vendor/github.com/Xe/ln/doc.go25
-rw-r--r--vendor/github.com/Xe/ln/filter.go67
-rw-r--r--vendor/github.com/Xe/ln/formatter.go111
-rw-r--r--vendor/github.com/Xe/ln/logger.go180
-rw-r--r--vendor/github.com/Xe/ln/stack.go44
-rw-r--r--vendor/github.com/google/gops/LICENSE27
-rw-r--r--vendor/github.com/google/gops/agent/agent.go237
-rw-r--r--vendor/github.com/google/gops/internal/internal.go52
-rw-r--r--vendor/github.com/google/gops/signal/signal.go35
-rw-r--r--vendor/github.com/gorilla/feeds/.travis.yml15
-rw-r--r--vendor/github.com/gorilla/feeds/LICENSE22
-rw-r--r--vendor/github.com/gorilla/feeds/README.md184
-rw-r--r--vendor/github.com/gorilla/feeds/atom.go164
-rw-r--r--vendor/github.com/gorilla/feeds/doc.go73
-rw-r--r--vendor/github.com/gorilla/feeds/feed.go135
-rw-r--r--vendor/github.com/gorilla/feeds/json.go181
-rw-r--r--vendor/github.com/gorilla/feeds/rss.go154
-rw-r--r--vendor/github.com/gorilla/feeds/to-implement.md20
-rw-r--r--vendor/github.com/gorilla/feeds/uuid.go27
-rw-r--r--vendor/github.com/kardianos/osext/LICENSE27
-rw-r--r--vendor/github.com/kardianos/osext/README.md21
-rw-r--r--vendor/github.com/kardianos/osext/osext.go33
-rw-r--r--vendor/github.com/kardianos/osext/osext_go18.go9
-rw-r--r--vendor/github.com/kardianos/osext/osext_plan9.go22
-rw-r--r--vendor/github.com/kardianos/osext/osext_procfs.go36
-rw-r--r--vendor/github.com/kardianos/osext/osext_sysctl.go126
-rw-r--r--vendor/github.com/kardianos/osext/osext_windows.go36
-rw-r--r--vendor/github.com/pkg/errors/.gitignore24
-rw-r--r--vendor/github.com/pkg/errors/.travis.yml11
-rw-r--r--vendor/github.com/pkg/errors/LICENSE23
-rw-r--r--vendor/github.com/pkg/errors/README.md52
-rw-r--r--vendor/github.com/pkg/errors/appveyor.yml32
-rw-r--r--vendor/github.com/pkg/errors/errors.go269
-rw-r--r--vendor/github.com/pkg/errors/stack.go178
-rw-r--r--vendor/github.com/russross/blackfriday/.gitignore8
-rw-r--r--vendor/github.com/russross/blackfriday/.travis.yml18
-rw-r--r--vendor/github.com/russross/blackfriday/LICENSE.txt29
-rw-r--r--vendor/github.com/russross/blackfriday/README.md283
-rw-r--r--vendor/github.com/russross/blackfriday/block.go1549
-rw-r--r--vendor/github.com/russross/blackfriday/doc.go18
-rw-r--r--vendor/github.com/russross/blackfriday/esc.go34
-rw-r--r--vendor/github.com/russross/blackfriday/html.go940
-rw-r--r--vendor/github.com/russross/blackfriday/inline.go1214
-rw-r--r--vendor/github.com/russross/blackfriday/markdown.go940
-rw-r--r--vendor/github.com/russross/blackfriday/node.go354
-rw-r--r--vendor/github.com/russross/blackfriday/smartypants.go457
-rw-r--r--vendor/github.com/segmentio/backo-go/.gitmodules3
-rw-r--r--vendor/github.com/segmentio/backo-go/README.md80
-rw-r--r--vendor/github.com/segmentio/backo-go/backo.go83
-rw-r--r--vendor/github.com/shurcooL/sanitized_anchor_name/.travis.yml16
-rw-r--r--vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE21
-rw-r--r--vendor/github.com/shurcooL/sanitized_anchor_name/README.md36
-rw-r--r--vendor/github.com/shurcooL/sanitized_anchor_name/main.go29
-rw-r--r--vendor/github.com/tj/front/Readme.md16
-rw-r--r--vendor/github.com/tj/front/front.go24
-rw-r--r--vendor/github.com/xtgo/uuid/AUTHORS5
-rw-r--r--vendor/github.com/xtgo/uuid/LICENSE27
-rw-r--r--vendor/github.com/xtgo/uuid/uuid.go204
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/.gitignore32
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/.gitmodules6
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/History.md70
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/License.md21
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/Makefile26
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/Readme.md55
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/alias.go38
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/analytics.go388
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/config.go173
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/context.go148
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/error.go60
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/executor.go53
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/group.go40
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/identify.go31
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/integrations.go44
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/json.go87
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/logger.go47
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/message.go128
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/page.go32
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/properties.go117
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/screen.go32
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/timeout_15.go16
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/timeout_16.go10
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/track.go40
-rw-r--r--vendor/gopkg.in/segmentio/analytics-go.v3/traits.go89
-rw-r--r--vendor/gopkg.in/yaml.v1/LICENSE188
-rw-r--r--vendor/gopkg.in/yaml.v1/LICENSE.libyaml31
-rw-r--r--vendor/gopkg.in/yaml.v1/README.md128
-rw-r--r--vendor/gopkg.in/yaml.v1/apic.go742
-rw-r--r--vendor/gopkg.in/yaml.v1/decode.go566
-rw-r--r--vendor/gopkg.in/yaml.v1/emitterc.go1685
-rw-r--r--vendor/gopkg.in/yaml.v1/encode.go265
-rw-r--r--vendor/gopkg.in/yaml.v1/parserc.go1096
-rw-r--r--vendor/gopkg.in/yaml.v1/readerc.go391
-rw-r--r--vendor/gopkg.in/yaml.v1/resolve.go190
-rw-r--r--vendor/gopkg.in/yaml.v1/scannerc.go2710
-rw-r--r--vendor/gopkg.in/yaml.v1/sorter.go104
-rw-r--r--vendor/gopkg.in/yaml.v1/writerc.go89
-rw-r--r--vendor/gopkg.in/yaml.v1/yaml.go301
-rw-r--r--vendor/gopkg.in/yaml.v1/yamlh.go716
-rw-r--r--vendor/gopkg.in/yaml.v1/yamlprivateh.go173
-rw-r--r--vendor/modules.txt30
118 files changed, 91 insertions, 20901 deletions
diff --git a/Dockerfile b/Dockerfile
index 32c4993..2c6ee52 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,8 @@
-FROM xena/go:1.11 AS build
-COPY . /root/go/src/github.com/Xe/site
-WORKDIR /root/go/src/github.com/Xe/site
-RUN GO111MODULE=on CGO_ENABLED=0 GOBIN=/root go install -v -mod=vendor ./cmd/site
+FROM xena/go:1.11.1 AS build
+ENV GOPROXY https://cache.greedo.xeserv.us
+COPY . /site
+WORKDIR /site
+RUN CGO_ENABLED=0 GOBIN=/root go install -v ./cmd/site
FROM xena/alpine
EXPOSE 5000
diff --git a/cmd/site/main.go b/cmd/site/main.go
index 4295e8a..e9b4d21 100644
--- a/cmd/site/main.go
+++ b/cmd/site/main.go
@@ -17,7 +17,7 @@ import (
"github.com/gorilla/feeds"
blackfriday "github.com/russross/blackfriday"
"github.com/tj/front"
- "gopkg.in/segmentio/analytics-go.v3"
+ analytics "gopkg.in/segmentio/analytics-go.v3"
)
var port = os.Getenv("PORT")
@@ -191,6 +191,9 @@ func Build() (*Site, error) {
s.mux.HandleFunc("/blog/", s.showPost)
s.mux.Handle("/css/", http.FileServer(http.Dir(".")))
s.mux.Handle("/static/", http.FileServer(http.Dir(".")))
+ s.mux.HandleFunc("/sw.js", func(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "./static/js/sw.js")
+ })
return s, nil
}
diff --git a/static/js/sw.js b/static/js/sw.js
new file mode 100755
index 0000000..4b3b1e2
--- /dev/null
+++ b/static/js/sw.js
@@ -0,0 +1,55 @@
+//This is the service worker with the combined offline experience (Offline page + Offline copy of pages)
+
+//Install stage sets up the offline page in the cache and opens a new cache
+self.addEventListener('install', function(event) {
+ event.waitUntil(preLoad());
+});
+
+var preLoad = function(){
+ console.log('[PWA Builder] Install Event processing');
+ return caches.open('pwabuilder-offline').then(function(cache) {
+ console.log('[PWA Builder] Cached index and offline page during Install');
+ return cache.addAll(['/offline.html', '/index.html']);
+ });
+}
+
+self.addEventListener('fetch', function(event) {
+ console.log('[PWA Builder] The service worker is serving the asset.');
+ event.respondWith(checkResponse(event.request).catch(function() {
+ return returnFromCache(event.request)}
+ ));
+ event.waitUntil(addToCache(event.request));
+});
+
+var checkResponse = function(request){
+ return new Promise(function(fulfill, reject) {
+ fetch(request).then(function(response){
+ if(response.status !== 404) {
+ fulfill(response)
+ } else {
+ reject()
+ }
+ }, reject)
+ });
+};
+
+var addToCache = function(request){
+ return caches.open('pwabuilder-offline').then(function (cache) {
+ return fetch(request).then(function (response) {
+ console.log('[PWA Builder] add page to offline'+response.url)
+ return cache.put(request, response);
+ });
+ });
+};
+
+var returnFromCache = function(request){
+ return caches.open('pwabuilder-offline').then(function (cache) {
+ return cache.match(request).then(function (matching) {