6 INPUTDIR=$(BASEDIR)/content
7 OUTPUTDIR=$(BASEDIR)/output
8 CONFFILE=$(BASEDIR)/pelicanconf.py
9 PUBLISHCONF=$(BASEDIR)/publishconf.py
15 SSH_HOST=unremediatedgender.space
18 SSH_TARGET_DIR=/var/www/html
20 S3_BUCKET=my_s3_bucket
22 CLOUDFILES_USERNAME=my_rackspace_username
23 CLOUDFILES_API_KEY=my_rackspace_api_key
24 CLOUDFILES_CONTAINER=my_cloudfiles_container
26 DROPBOX_DIR=~/Dropbox/Public/
28 GITHUB_PAGES_BRANCH=gh-pages
37 PELICANOPTS += --relative-urls
41 @echo 'Makefile for a pelican Web site '
44 @echo ' make html (re)generate the web site '
45 @echo ' make clean remove the generated files '
46 @echo ' make regenerate regenerate files upon modification '
47 @echo ' make publish generate using production settings '
48 @echo ' make serve [PORT=8000] serve site at http://localhost:8000'
49 @echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
50 @echo ' make devserver [PORT=8000] start/restart develop_server.sh '
51 @echo ' make stopserver stop local server '
52 @echo ' make ssh_upload upload the web site via SSH '
53 @echo ' make rsync_upload upload the web site via rsync+ssh '
54 @echo ' make dropbox_upload upload the web site via Dropbox '
55 @echo ' make ftp_upload upload the web site via FTP '
56 @echo ' make s3_upload upload the web site via S3 '
57 @echo ' make cf_upload upload the web site via Cloud Files'
58 @echo ' make github upload the web site via gh-pages '
60 @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
61 @echo 'Set the RELATIVE variable to 1 to enable relative urls '
65 $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
68 [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
71 $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
75 cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
77 cd $(OUTPUTDIR) && $(PY) -m pelican.server
82 cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 $(SERVER)
84 cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 0.0.0.0
90 $(BASEDIR)/develop_server.sh restart $(PORT)
92 $(BASEDIR)/develop_server.sh restart
96 $(BASEDIR)/develop_server.sh stop
97 @echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
100 $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
103 scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
105 rsync_upload: publish
106 rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
108 dropbox_upload: publish
109 cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
112 lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUTDIR) $(FTP_TARGET_DIR) ; quit"
115 s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type
118 cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) .
121 ghp-import -m "Generate Pelican site" -b $(GITHUB_PAGES_BRANCH) $(OUTPUTDIR)
122 git push origin $(GITHUB_PAGES_BRANCH)
124 .PHONY: html help clean regenerate serve serve-global devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github