From 0c0253660556cd40a003349e2a7d615b7d7d4741 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 5 Aug 2012 17:25:39 -0700 Subject: [PATCH] Give devserver its own make target Restore "make serve" to a non-backgrounded SimpleHTTPServer process and give the develop_server.sh its own make target at "make devserver". Add a few missing make targets to the help list and re-order targets for consistency. Add note to docs regarding how to stop the devserver. --- docs/getting_started.rst | 14 ++++++++++++-- pelican/tools/templates/Makefile.in | 20 +++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 3733812b..1ab7c642 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -107,11 +107,21 @@ instead:: $ make regenerate -To serve the site so it can be previewed in your browser:: +To serve the site so it can be previewed in your browser at +http://localhost:8000:: $ make serve -Visit http://localhost:8000 in your browser to see your site. +Normally you would need to run ``make regenerate`` and ``make serve`` in two +separate terminal sessions, but you can run both at once via:: + + $ make devserver + +The above command will simultaneously run Pelican in regeneration mode as well +as serve the output at http://localhost:8000. Once you are done testing your +changes, you should stop the development server via:: + + $ ./develop_server stop When you're ready to publish your site, you can upload it via the method(s) you chose during the ``pelican-quickstart`` questionnaire. For this example, we'll diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index df00ffbf..9a26e315 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -24,12 +24,15 @@ help: @echo 'Usage: ' @echo ' make html (re)generate the web site ' @echo ' make clean remove the generated files ' + @echo ' make regenerate regenerate files upon modification ' @echo ' make publish generate using production settings ' - @echo ' make serve run develop_server.sh restart ' - @echo ' ftp_upload upload the web site via FTP ' + @echo ' make serve serve site at http://localhost:8000' + @echo ' make devserver start/restart develop_server.sh ' @echo ' ssh_upload upload the web site via SSH ' + @echo ' rsync_upload upload the web site via rsync+ssh ' @echo ' dropbox_upload upload the web site via Dropbox ' - @echo ' rsync_upload upload the web site via rsync/ssh ' + @echo ' ftp_upload upload the web site via FTP ' + @echo ' github upload the web site via gh-pages ' @echo ' ' @@ -46,20 +49,23 @@ regenerate: clean $$(PELICAN) -r $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(CONFFILE) $$(PELICANOPTS) serve: + cd $$(OUTPUTDIR) && python -m SimpleHTTPServer + +devserver: $$(BASEDIR)/develop_server.sh restart publish: $$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(PUBLISHCONF) $$(PELICANOPTS) -dropbox_upload: publish - cp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) - ssh_upload: publish scp -P $$(SSH_PORT) -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) rsync_upload: publish rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) +dropbox_upload: publish + cp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) + ftp_upload: publish lftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" @@ -67,4 +73,4 @@ github: publish ghp-import $$(OUTPUTDIR) git push origin gh-pages -.PHONY: html help clean regenerate serve publish ftp_upload ssh_upload rsync_upload dropbox_upload github +.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload github