mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1181 from jculpon/ghpages-config
Support publishing to personal GitHub Pages sites in quickstart
This commit is contained in:
commit
e10fe42928
2 changed files with 15 additions and 2 deletions
|
|
@ -15,6 +15,11 @@ from pelican import __version__
|
||||||
_TEMPLATES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
_TEMPLATES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||||
"templates")
|
"templates")
|
||||||
|
|
||||||
|
_GITHUB_PAGES_BRANCHES = {
|
||||||
|
'personal': 'master',
|
||||||
|
'project': 'gh-pages'
|
||||||
|
}
|
||||||
|
|
||||||
CONF = {
|
CONF = {
|
||||||
'pelican': 'pelican',
|
'pelican': 'pelican',
|
||||||
'pelicanopts': '',
|
'pelicanopts': '',
|
||||||
|
|
@ -31,6 +36,7 @@ CONF = {
|
||||||
'cloudfiles_api_key': 'my_rackspace_api_key',
|
'cloudfiles_api_key': 'my_rackspace_api_key',
|
||||||
'cloudfiles_container': 'my_cloudfiles_container',
|
'cloudfiles_container': 'my_cloudfiles_container',
|
||||||
'dropbox_dir': '~/Dropbox/Public/',
|
'dropbox_dir': '~/Dropbox/Public/',
|
||||||
|
'github_pages_branch': _GITHUB_PAGES_BRANCHES['project'],
|
||||||
'default_pagination': 10,
|
'default_pagination': 10,
|
||||||
'siteurl': '',
|
'siteurl': '',
|
||||||
'lang': 'en'
|
'lang': 'en'
|
||||||
|
|
@ -217,6 +223,11 @@ needed by Pelican.
|
||||||
CONF['cloudfiles_username'] = ask('What is your Rackspace Cloud username?', str_compat, CONF['cloudfiles_username'])
|
CONF['cloudfiles_username'] = ask('What is your Rackspace Cloud username?', str_compat, CONF['cloudfiles_username'])
|
||||||
CONF['cloudfiles_api_key'] = ask('What is your Rackspace Cloud API key?', str_compat, CONF['cloudfiles_api_key'])
|
CONF['cloudfiles_api_key'] = ask('What is your Rackspace Cloud API key?', str_compat, CONF['cloudfiles_api_key'])
|
||||||
CONF['cloudfiles_container'] = ask('What is the name of your Cloud Files container?', str_compat, CONF['cloudfiles_container'])
|
CONF['cloudfiles_container'] = ask('What is the name of your Cloud Files container?', str_compat, CONF['cloudfiles_container'])
|
||||||
|
if ask('Do you want to upload your website using GitHub Pages?', answer=bool, default=False):
|
||||||
|
if ask('Is this your personal page (username.github.io)?', answer=bool, default=False):
|
||||||
|
CONF['github_pages_branch'] = _GITHUB_PAGES_BRANCHES['personal']
|
||||||
|
else:
|
||||||
|
CONF['github_pages_branch'] = _GITHUB_PAGES_BRANCHES['project']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.makedirs(os.path.join(CONF['basedir'], 'content'))
|
os.makedirs(os.path.join(CONF['basedir'], 'content'))
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ CLOUDFILES_CONTAINER=$cloudfiles_container
|
||||||
|
|
||||||
DROPBOX_DIR=$dropbox_dir
|
DROPBOX_DIR=$dropbox_dir
|
||||||
|
|
||||||
|
GITHUB_PAGES_BRANCH=$github_pages_branch
|
||||||
|
|
||||||
DEBUG ?= 0
|
DEBUG ?= 0
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
PELICANOPTS += -D
|
PELICANOPTS += -D
|
||||||
|
|
@ -101,7 +103,7 @@ 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) .
|
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
|
github: publish
|
||||||
ghp-import $$(OUTPUTDIR)
|
ghp-import -b $(GITHUB_PAGES_BRANCH) $$(OUTPUTDIR)
|
||||||
git push origin gh-pages
|
git push origin $(GITHUB_PAGES_BRANCH)
|
||||||
|
|
||||||
.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github
|
.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue