From 601a848dc71527d6a60afb081b43e464d39cae0d Mon Sep 17 00:00:00 2001
From: Micressor <micressor@secure.mailbox.org>
Date: Sat, 22 Dec 2018 13:17:52 +0100
Subject: [PATCH] Add build.py to generate pages and validate ATOM feed

---
 README.md |  2 +-
 build.py  | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100755 build.py

diff --git a/README.md b/README.md
index 4ed3fa0..c446d94 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ hugo server -D --enableGitInfo
 Generate static hugo pages:
 
 ```
-hugo --enableGitInfo
+./build.py
 ```
 
 ## Content Types
diff --git a/build.py b/build.py
new file mode 100755
index 0000000..ab1194d
--- /dev/null
+++ b/build.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+import os
+import sys
+import requests
+
+os.system('hugo --enableGitInfo --cleanDestinationDir')
+
+exit = 0
+url = 'https://validator.w3.org/feed/check.cgi'
+payload = {'url': 'https://briarproject.org/index.xml'}
+
+r = requests.get(url, params=payload)
+
+if "This is a valid Atom 1.0 feed" not in r.content:
+  print "ATOM feed is not valid."
+  exit = 1
+else:
+  print "-- This is a valid Atom 1.0 feed -- %s" % payload.get('url')
+
+#print r.content
+
+sys.exit(exit)
-- 
GitLab