A presentation at PyCon Malaysia 2015 on 23 August 2015 for beginners to get started publishing web pages using Pelican, a static site builder in Python.
2. 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.
3. 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
9. 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.
13. 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
19. # Generate HTML pages
pelican content
# Preview your site build
cd output && python -m pelican.server
# Open a browser and go to http://localhost:8000
23. Other Python static site generators
Nikola
https://getnikola.com/
Hyde
http://hyde.github.io/
24. 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
25. 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!
Why should you use a static site generator?
Because you are lazy!
Why not python 3.x? There is some support, but it’s unstable. Especially for the plugins.
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?
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.
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