Pelican for n00bs
Static Site Generator Powered by Python
Who am i?
@nazroll
Software Engineer, Sparkline.com
Organizer, Google Developer Groups Kuala Lumpur
Previously: Media Prima Digital (Digital Media & Online Services),
Chalkboard (Hyperlocal Ad Network) & a long list of adventures.
Building software for the World Wide Web since 1999.
Today, we’re going to learn (hopefully)
Why use a static site generator?
Setting up Pelican
Generate your site
Deploy to the World Wide Web
Why?
Warning: Bad Jokes Ahead
Which one is the best?
Complex plugins to maintain
BLOAT LIKE ME
CMS + Plugins = BLOATED!
Security vulnerabilities
I am too lazy!
Maintain server-side scripting software (PHP,
etc)
Maintain a database and it’s software (MySQL,
etc)
Read other people's code to patch that security
leak.
How?
Let’s all pray to the Demo Gods
Setting up Pelican
Requirements
python. REQUIRED. At least version 2.7.x
pip. REQUIRED. At least version 7.1.x
virtualenv. RECOMMENDED. At least version 13.x
To maintain sanity, install pelican within a
virtual environment!
# Install Pelican
pip install --no-cache-dir pelican
# feedgenerator
# RSS/XML feed generator.
# unidecode
# Translate Unicode string to ASCII string
# MarkupSafe
# Escape Unicode characters/strings safely for HTML templates.
# docutils
# Process text documentation into useable formats like HTML, XML, etc.
# blinker
# Object to object broadcasting and signaling
# Markdown
pip install --no-cache-dir Markdown
Demo
Setting up Pelican
Demo
Generate your site
pelican-quickstart
content/
<empty>
output/
<empty>
develop_server.py
fabfile.py
Makefile
pelicanconf.py
publishconf.py
# Generate HTML pages
pelican content
# Preview your site build
cd output && python -m pelican.server
# Open a browser and go to http://localhost:8000
Demo
Deploy to the World Wide Web
Deploy to the World Wide Web
FTP
SSH
Deploy to the World Wide Web
Other Python static site generators
Nikola
https://getnikola.com/
Hyde
http://hyde.github.io/
I recommend you to read these!
Pelican documentation (like duh!)
http://docs.getpelican.com/
Static site with Pelican, Grunt, Travis & Github Pages
http://goo.gl/B7evGr
Install and deploy a Pelican blog using Fabric - Part 1, 2, 3 & 4
http://goo.gl/ACVS1B
Pelican Guide Moving from Wordpress and Initial Setup
http://goo.gl/QEiOiN
Bonus read!
Host a Static Website on Google Cloud Storage
https://goo.gl/9HN75X
Google Developer Launchpad
https://developers.google.com/startups/
Get FREE credits & loads of other stuff!
Keep in touch
nazroll@gmail.com / nazroll.com

Getting Started with Pelican

Editor's Notes

  • #10 Why should you use a static site generator? Because you are lazy!
  • #14 Why not python 3.x? There is some support, but it’s unstable. Especially for the plugins.
  • #17 When I was preparing the slides for this presentation, I found out that using pip install --no-cache-dir works well (with no errors) for new installation on OSX 10.10 (Yosemite). pip install --no-cache-dir pelican Bunch of stuff is being installed when you run this command. feedgenerator unidecode MarkupSafe docutils blinker Optional, but totally recommended is to install Markdown pip install --no-cache-dir Markdown Explain what each software installed is all about?
  • #18 Run pelican-quickstart Explain what is being generated? Create your first content. Copy from an existing file (no time waster) Run pelican content Run cd output && python -m pelican.server Open a browser and go to http://localhost:8000 Show example on theming.
  • #23 Show google cloud console Create app.yaml file Show the structure of the app.yaml file Create main.py file Show the structure of the main.py file Run through the code. Run local development Deploy