From cfa93f1c46a76460bd429b08060304ec27a44af7 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 12 Mar 2017 00:09:25 +0100 Subject: [PATCH] Add before_build script --- blog/before_build.py | 21 +++++++++++++++++++++ blog/layouts/partials/recent-updates.html | 1 - layouts/partials/recent-updates.html | 1 - requirements.txt | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 blog/before_build.py delete mode 100644 layouts/partials/recent-updates.html diff --git a/blog/before_build.py b/blog/before_build.py new file mode 100644 index 00000000..52b7a5b9 --- /dev/null +++ b/blog/before_build.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import io +from github import Github + +g = Github("e62e298b2a46ca5cf474cb9a4c0c1bc950b09d46") + +with io.open("layouts/partials/recent-updates.html", 'w', encoding='utf8') as recent_updates: + recent_updates.truncate() + + recent_updates.write(u"") diff --git a/blog/layouts/partials/recent-updates.html b/blog/layouts/partials/recent-updates.html index 1e4e07e7..e69de29b 100644 --- a/blog/layouts/partials/recent-updates.html +++ b/blog/layouts/partials/recent-updates.html @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/recent-updates.html b/layouts/partials/recent-updates.html deleted file mode 100644 index 8b137891..00000000 --- a/layouts/partials/recent-updates.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/requirements.txt b/requirements.txt index 521459ea..67c329ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ pygments pygments-github-lexers +PyGithub