00:00:00

SGVLUG Website Notes

http://www.sgvlug.org/

http://github.com/sgvlug/

James McDuffie

Notes

www.sgvlug.org

  • Hosted on Github
    • Source
    • HTML
  • Generated by a static web generator
    • A program that generates HTML pages from some sort of markup language and templates.

Notes

Why Github

  • Free
  • Version controlled
  • Anyone can edit the site
  • Solves problem of single point for access
  • Only failure point is having domain pointed at it
  • Need only a Python, a text editor and git to modify

Notes

We are Using Pelican

  • Python based static site generator
  • Write content with either Markdown, reStructuredText or AsciiDoc
  • Very active community - Freenode IRC #pelican
  • Many themes and plugins available
  • http://docs.getpelican.com/

Notes

Getting Started

Install Pelican and ghp-import

$ pip install pelican
$ pip install ghp-import

Checkout source (read only)

$ git clone https://github.com/sgvlug/website.git sgvlug_website

If you are added to access list you can clone this way:

$ git clone git@github.com:sgvlug/website.git sgvlug_website

Notes

Creating a New Post

Open an editor to create a new post:

$ vim content/posts/2014-02-13-lightning-talks.md

I am tending to name the file with the event date in the filename. The date in the post should be when it was written.

Notes

Creating a New Post

The contents of the post need at least the Title and Date meta data in the header. Contents of the post is regular Markdown below the header lines.

Title: Lightning Talks
Date: 2014-02-13 22:33

Paragraphs are separated by a blank line.

2nd paragraph. *Italic*, **bold**, `monospace`.
Itemized lists look like:

  * this one
  * that one
  * the other one

Notes

Testing Website

Pelican includes a small development server so you can see what the site will look like when you deploy it. Run the following:

$ make devserver

Then navigate to http://localhost:8000/

Notes

Deploying Website

Once you are satisfied with the changes, use git to save your changes and upload to Github:

$ git add content/posts/<your_new_file>.md
$ git commit -m "What I did here was add a new post"
$ git push origin master

Deploying to github is made easy using ghp-import and Pelican's Makefile:

$ make github

Notes

Easy Way to Make Posts

Since we are using the SGVTech Meetup Group, I made a script to easily convert the contents of the meetup events into Markdown for Pelican. It also adds some meta data about the event data and location.

Notes

Obtain meetup2md

Download meetup2md from Github and initialize it's submodules:

$ git clone https://github.com/omwah/meetup2md.git
$ git submodule init
$ git submodule update

Notes

Authorize meetup2md

We need to set up OAuth so the script can access Meetup. Create a new consumer key and secret here: http://meetup.com/meetup_api/oauth_consumers

Set up authentication with the program:

$ meetup2md.py --consumer <key> <secret>

Hit allow on the web page that is loaded by the script. Now pass the verification code to the script:

$ meetup2md.py --verifier 183742

Notes

Configure meetup2md for LUG

Edit the [events] section of app.cfg to allow us to easily to filter out SGVLUG events:

[events]
group_name = SGVTech
name_filter = SGV Linux Users Group Monthly Meeting
title_cleanup = ^SGV Linux Users Group Monthly Meeting -

Notes

Creating an Article from a Meetup Event

From the sgvtech_website directory you can create a post for the SGVLUG meetups scheduled within the next month:

$ meetup2md.py -t ,1m -o content/posts
  • -t indicates a time range
  • -o specifies where to output files

Notes

Creating an Article from a Meetup Event

You will see something like this:

Name: SGV Linux Users Group Monthly Meeting - Lightning Talks
Title: Lightning Talks
Time: Thursday February 13, 2014 07:00 PM
Venue: Burger Continental, 535 S Lake Ave, Pasadena, CA, 91101
 -> content/posts/2014-02-13-lightning-talks.md
----

Notes

Finishing Up

Load up the devserver to check the post, commit if everything looks fine.

For more details on arguments to meetup2md.py see the README on Github:

http://github.com/omwah/meetup2md/

Notes