Skip to content

Commit

Permalink
Merge p14n article branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars de Ridder committed Feb 21, 2014
2 parents 91dc07d + 7a0153e commit df17eb6
Show file tree
Hide file tree
Showing 8 changed files with 547 additions and 21 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,9 @@
output/
*.pid
*.pyc
/bin
/lib
/include
/.env
/env
.Python
25 changes: 17 additions & 8 deletions Makefile
Expand Up @@ -13,6 +13,9 @@ INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
PATH := $(BASEDIR)/.env/bin:$(PATH)

DEVSERVER_PORT=8000

help:
@echo 'Makefile for the Paylogic developer portal'
Expand All @@ -36,22 +39,24 @@ $(OUTPUTDIR)/%.html:

clean:
[ ! -d $(OUTPUTDIR) ] || find $(OUTPUTDIR) -mindepth 1 -delete
rm -rf .env

regenerate: clean
regenerate: clean .env
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)

serve:
serve: .env
cd $(OUTPUTDIR) && $(PY) -m pelican.server

devserver:
$(BASEDIR)/develop_server.sh restart
devserver: .env
export
$(BASEDIR)/develop_server.sh restart $(DEVSERVER_PORT)

stopserver:
kill -9 `cat pelican.pid`
kill -9 `cat srv.pid`
stopserver: .env
export
$(BASEDIR)/develop_server.sh stop $(DEVSERVER_PORT)
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'

publish:
publish: .env
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)

github: publish
Expand All @@ -68,4 +73,8 @@ github: publish
# Publish the updated site to GitHub.
git push origin master gh-pages

.env:
virtualenv .env
.env/bin/pip install -r requirements.txt

.PHONY: html help clean regenerate serve devserver publish github
12 changes: 5 additions & 7 deletions README.rst
Expand Up @@ -8,6 +8,7 @@ generate the web pages from content written in the reStructuredText_ format.
The git repository is hosted on our GitHub_ account and we use `GitHub Pages`_
with a custom DNS name for hosting.


Running it locally
------------------

Expand All @@ -17,15 +18,11 @@ following steps should help you get started::
# Clone the git repository.
git clone git@github.com:paylogic/dev-portal.git

# Create, activate and initialize the virtual environment.
virtualenv ~/.virtualenvs/dev-portal
source ~/.virtualenvs/dev-portal/bin/activate
pip install -r dev-portal/requirements.txt

# Run Pelican and view the result in a web browser.
cd dev-portal
make devserver
gnome-open http://127.0.0.1:8000
make devserver [DEVSERVER_PORT=<port>]
gnome-open http://127.0.0.1:8000 # DEVSERVER_PORT is 8000 by default


Publishing changes
------------------
Expand All @@ -35,6 +32,7 @@ and 3) have activated the virtual environment, then all you need to publish the
latest changes to the live website is to run the command ``make github``. This
will publish your changes using `GitHub Pages`_.


License
-------

Expand Down

0 comments on commit df17eb6

Please sign in to comment.