From d521e0234d326fd2be53d7fc8ef69d930651354a Mon Sep 17 00:00:00 2001 From: Joao Moreira Date: Wed, 4 Jan 2017 14:19:03 -0600 Subject: [PATCH] Add current date when publishing to GitHub Pages The current gh_pages Fabric task publishes the build website with the default "Update documentation" commit message. That is not very informative. This change adds the current date upon publishing so we can better track the build history. --- pelican/tools/templates/fabfile.py.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pelican/tools/templates/fabfile.py.in b/pelican/tools/templates/fabfile.py.in index 18131d5f..48a1b0d9 100644 --- a/pelican/tools/templates/fabfile.py.in +++ b/pelican/tools/templates/fabfile.py.in @@ -1,4 +1,5 @@ from fabric.api import * +import datetime import fabric.contrib.project as project import os import shutil @@ -22,6 +23,7 @@ env.cloudfiles_container = '$cloudfiles_container' # Github Pages configuration env.github_pages_branch = "$github_pages_branch" +env.commit_message = "'Publish site on {}'".format(datetime.date.today().isoformat()) # Port for `serve` PORT = 8000 @@ -89,4 +91,6 @@ def publish(): def gh_pages(): """Publish to GitHub Pages""" rebuild() - local("ghp-import -b {github_pages_branch} {deploy_path} -p".format(**env)) + local('ghp-import -b {github_pages_branch} ' + '-m {commit_message} ' + '{deploy_path} -p'.format(**env))