This commit is contained in:
Canux 2017-11-24 18:42:48 +00:00 committed by GitHub
commit 8e8995b29a
2 changed files with 16 additions and 2 deletions

View file

@ -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,
@ -321,6 +322,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, '')
else:
CONF['github_pages_branch'] = \
_GITHUB_PAGES_BRANCHES['project']

View file

@ -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