From c5840525835bd2aad28c3088b1ed918c8e86fcc8 Mon Sep 17 00:00:00 2001 From: Canux CHENG Date: Wed, 8 Feb 2017 01:48:56 -0500 Subject: [PATCH 1/2] [20170208]update makefile for github. --- pelican/tools/pelican_quickstart.py | 2 ++ pelican/tools/templates/Makefile.in | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 39e58f6f..9af56670 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -53,6 +53,7 @@ CONF = { 'cloudfiles_container': 'my_cloudfiles_container', 'dropbox_dir': '~/Dropbox/Public/', 'github_pages_branch': _GITHUB_PAGES_BRANCHES['project'], + 'github_user': '', 'default_pagination': 10, 'siteurl': '', 'lang': _DEFAULT_LANGUAGE, @@ -319,6 +320,7 @@ needed by Pelican. answer=bool, default=False): CONF['github_pages_branch'] = \ _GITHUB_PAGES_BRANCHES['personal'] + CONF['github_user'] = ask("What's your github user name?", str_compat, '') else: CONF['github_pages_branch'] = \ _GITHUB_PAGES_BRANCHES['project'] diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index 079b2844..64e32076 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -26,6 +26,10 @@ DROPBOX_DIR=$dropbox_dir GITHUB_PAGES_BRANCH=$github_pages_branch +GITHUB_USER=$github_user +GITHUB_BRANCH=$github_pages_branch +GITHUB_URL=https://github.com/$(GITHUB_USER)/$(GITHUB_USER).github.io.git + DEBUG ?= 0 ifeq ($(DEBUG), 1) PELICANOPTS += -D @@ -54,7 +58,8 @@ help: @echo ' make ftp_upload upload the web site via FTP ' @echo ' make s3_upload upload the web site via S3 ' @echo ' make cf_upload upload the web site via Cloud Files' - @echo ' make github upload the web site via gh-pages ' + @echo ' make gh_pages upload the web site via gh-pages ' + @echo ' make github upload the web site via github ' @echo ' ' @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html ' @echo 'Set the RELATIVE variable to 1 to enable relative urls ' @@ -116,8 +121,14 @@ s3_upload: publish cf_upload: publish cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) . -github: publish +gh_pages: publish ghp-import -m "Generate Pelican site" -b $(GITHUB_PAGES_BRANCH) $$(OUTPUTDIR) git push origin $(GITHUB_PAGES_BRANCH) +github: publish + cd $(OUTPUTDIR); git init + git remote add origin $(GITHUB_URL) + git add -A; git commit -m "[$(shell date +%Y%m%d)]update" + git push -f -u origin $(GITHUB_BRANCH) + .PHONY: html help clean regenerate serve serve-global devserver stopserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github From 2b6f820f7713fd90242ea01d3951b8e75079b529 Mon Sep 17 00:00:00 2001 From: Canux CHENG Date: Wed, 8 Feb 2017 02:00:51 -0500 Subject: [PATCH 2/2] [20170208]fix travis-ci check error --- pelican/tools/pelican_quickstart.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 9af56670..6a18d5ac 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -320,7 +320,8 @@ needed by Pelican. answer=bool, default=False): CONF['github_pages_branch'] = \ _GITHUB_PAGES_BRANCHES['personal'] - CONF['github_user'] = ask("What's your github user name?", str_compat, '') + CONF['github_user'] = \ + ask("What's your github user name?", str_compat, '') else: CONF['github_pages_branch'] = \ _GITHUB_PAGES_BRANCHES['project']