Click here to code!

How to get PyBites up and running on your machine

Posted by Pybites on Tue 20 December 2016 in Tools • 1 min read

This is also a useful reference for future collaborators ...

We're open source right? ;)

Out of Date: Pelican now allows us to have a single repo for the source files and the generated HTML/output files. There's no longer a need to have two separate repos. This will need to be confirmed with the PyBites use case before updaitng the steps in this document.

PyBites install guide

# we have a src, output and theme (Flex) repo, use --recursive to get all
$ git clone --recursive pybites
$ cd pybites

# set up env and install dependencies
$ virtualenv venv (might need: virtualenv -p python3 venv)
$ source venv/bin/activate
$ pip install -r requirements.txtadd some content
$ cd content
$ vi ; wq!check changes on localhost
$ cd ..
$ make html && make serve

# push this new content to the parent -src repo
$ git add . 
$ git commit -m "my new blog post"
$ git push

# push the static blog change to the child -io repo
# wait: this is a duplicate step, I don't like duplication!
# ...

As we have 2 repos: -src for code, -io for generated static content, ideally we want to automate the publishing to -io, so we can just focus on the main repo (-src).

We abandonded this hook, because it led to some conflicts / unnecessary work, not worth automating this step. We push manually to -src / -io these days.

Here is where git hooks come into play. cd into .git/hooks and add below script, name it "pre-push", update your WORKING_DIR and chmod 755 it ...

See an error in this post? Please submit a pull request on Github.