From 100d94cd12a9ddd06b060cf6e6a362f6a632b536 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 19 Aug 2011 23:01:01 +0200 Subject: [PATCH] add ghp-import features to push to github pages easily --- docs/index.rst | 1 + docs/tips.rst | 33 +++++++++++++++++++++++++++++++++ tools/pelican-quickstart | 6 +++++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 docs/tips.rst diff --git a/docs/index.rst b/docs/index.rst index 1e0a56f8..c2b4577d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -63,4 +63,5 @@ A french version of the documentation is available at :doc:`fr/index`. pelican-themes importer faq + tips contribute diff --git a/docs/tips.rst b/docs/tips.rst new file mode 100644 index 00000000..9ff7f9ce --- /dev/null +++ b/docs/tips.rst @@ -0,0 +1,33 @@ +Tips +#### + +Here are some tips about pelican, which you might find useful. + +Publishing to github +==================== + +Github comes with an interesting "pages" feature: you can upload things there +and it will be available directly from their servers. As pelican is a static +file generator, we can take advantage of this. + +The excellent `ghp-import `_ makes this +eally easy. You would have to install it:: + + $ pip install ghp-import + +Then, considering a repository containing your articles, you would simply have +to run pelican and upload the output to github:: + + $ pelican -s pelican.conf.py . + $ ghp-import output + $ git push origin gh-pages + +And that's it. + +If you want you can put that directly into a post commit hook, so each time you +commit, your blog is up to date on github! + +Put the following into `.git/hooks/post-commit`:: + + pelican -s pelican.conf.py . && ghp-import output && git push origin + gh-pages diff --git a/tools/pelican-quickstart b/tools/pelican-quickstart index e1fb4eff..5d708038 100755 --- a/tools/pelican-quickstart +++ b/tools/pelican-quickstart @@ -55,7 +55,11 @@ ssh_upload: $$(OUTPUTDIR)/index.html ftp_upload: $$(OUTPUTDIR)/index.html \tlftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUT_DIR)/* $$(FTP_TARGET_DIR) ; quit" -.PHONY: html help clean ftp_upload ssh_upload dropbox_upload +github: $$(OUTPUTDIR)/index.html +\tghp-import $$(OUTPUTDIR) +\tgit push origin gh-pages + +.PHONY: html help clean ftp_upload ssh_upload dropbox_upload github ''', 'pelican.conf.py': '''#!/usr/bin/env python