Skip to content
Nathan Farrington edited this page Jan 31, 2018 · 5 revisions

Runbook

Step 1. Setup the workspace for development

  1. Create a directory for your repos.

     mkdir ~/workspace
     cd ~/workspace
    
  2. Clone the repos. The nathanfarrington.com.git repo contains the source. The pelican-plugins.git repo is required to build the source. The nfarring.github.com.git repo contains the generated website that will be hosted by GitHub Pages.

     git clone [email protected]:nfarring/nathanfarrington.com.git
     git clone https://github.com/getpelican/pelican-plugins.git
     git clone [email protected]:nfarring/nfarring.github.com.git
    
  3. Create a Python virtual environment.

     cd ~/workspace/nathanfarrington.com
     python3 -m venv venv
     venv/bin/pip3 install -r requirements.txt
    

Step 2. Regenerate the website upon source file modification

  1. Create a new terminal window.

  2. Start the daemon.

     cd ~/workspace/nathanfarrington.com
     venv/bin/pelican -r content
    

Step 3. Preview the website locally

  1. Create a new terminal window. Start the daemon.

     cd ~/workspace/nathanfarrington.com/output
     ../venv/bin/python -m pelican.server
    
  2. Create a new terminal window. Launch a web browser.

     open "http://localhost:8000"
    

Step 4. Publish the website

  1. Stop all daemons created in previous steps.

  2. Generate the website.

     cd ~/workspace/nathanfarrington.com
     rm -rf ~/workspace/nathanfarrington.com/output
     venv/bin/pelican content
    
  3. Copy the generated website to the repo.

     rsync --verbose --archive --delete --exclude=.git --stats --human-readable output/ ../nfarring.github.com/
    
  4. Preview the website locally. Create a new terminal window.

     cd ~/workspace/nfarring.github.com
     ../nathanfarrington.com/venv/bin/python -m pelican.server
    
  5. Create a new terminal window. Launch a web browser.

     open "http://localhost:8000"
    
  6. Commit and push.

     git add .
     git commit -m "Generated by Pelican"
     git push