Static Websites - The Final Frontier

23
Static Websites The Final Frontier Juho Vepsäläinen

description

In this presentation I show how to use GitHub and Jekyll (static website generator) to create sites. Mainly based on case studies even though there is some theory at the beginning.

Transcript of Static Websites - The Final Frontier

Page 1: Static Websites - The Final Frontier

Static WebsitesThe Final Frontier

Juho Vepsäläinen

Page 2: Static Websites - The Final Frontier

● GH Pages● Case - koodilehto.fi● Case - jswiki.org● Case - geekcollision.org● Conclusions

Structure

Page 3: Static Websites - The Final Frontier

GH Pages

Page 4: Static Websites - The Final Frontier

● http://pages.github.com/● Mainly sites for geeks and projects● Provides a designer● Supports Jekyll● Possible to use good ol' HTML too● http://oli.jp/2011/github-pages-workflow/

GH Pages - Awesome Hosting

Page 5: Static Websites - The Final Frontier

● https://github.com/mojombo/jekyll● Blog-aware, based on Ruby● Templating (http://liquidmarkup.org/)● Quite powerful though has limitations

Jekyll - Static Site Generator

Page 6: Static Websites - The Final Frontier

● _includes/● _layouts/● _posts/● css/● images/● js/● CNAME● README.md● _config.yml● index.html● robots.txt

Basic Structure of a Project

Page 7: Static Websites - The Final Frontier

Context (ie. site.name, page.title)

Template

---title: Jobslayout: post--- <p>Geek Collision gathers...</p><h2>Sponsored by {{ site.sponsor }}</h2>{% include job_ad.md %}

Page 8: Static Websites - The Final Frontier

Context (ie. site.name, page.title)

Base Template

<!DOCTYPE HTML><html lang="en"> <head> <title>{{ site.name }} - {{ page.title }}</title> ... </head> <body> {{ content }} </body></html>

Page 9: Static Websites - The Final Frontier

Case - koodilehto.fi

Page 10: Static Websites - The Final Frontier

● Traditional website with some social features

● Theme based on Bootstrap● JavaScript (jQuery, RequireJS + custom)● https://github.com/bebraw/codegrove-site

koodilehto.fi - Overview

Page 11: Static Websites - The Final Frontier

● It's actually feasible to use GH Pages as a hosting platform for something like this

● Dealing with nested navigation is hard (required JS hack)

● jsbin.com rocks for quick prototyping (study jsbin.com/utalev/<number> to see how it progressed)

koodilehto.fi - Lessons Learned

Page 12: Static Websites - The Final Frontier

● Move to one page layout (more dynamic content?)

● Could use cron to get rid of some JS -> faster page load, nicer for mobile

● Figure out better ways to share JS (RequireJS constrains this)

koodilehto.fi - To Improve

Page 13: Static Websites - The Final Frontier

Case - jswiki.org

Page 14: Static Websites - The Final Frontier

● Largest JS related index at GitHub● Decided to write a nicer UI for it● Ended up developing ghw (converts GH

wiki to GH pages)● Used Skeleton for theming● jQuery+various plugins in use

jswiki.org - Overview

Page 15: Static Websites - The Final Frontier

● Skeleton is cool and a lot lighter than Bootstrap

● Node works well for writing this type of tools

● Projects tend to escalate (ended up writing suite.js, generators.js, funkit etc. too)

jswiki.org - Lessons Learned

Page 16: Static Websites - The Final Frontier

● More, better content (crawling?)● Search UI (just a filtering big-ass table)● You name it

jswiki.org - To Improve

Page 17: Static Websites - The Final Frontier

Case - geekcollision.org

Page 18: Static Websites - The Final Frontier

● Decided to reskin the newly reskinned site just for kicks

● Gave Jekyll's blogging capabilities a go while at it

● Used Skeleton here as well● jQuery+RequireJS+custom hacks for JS

geekcollision.org - Overview

Page 19: Static Websites - The Final Frontier

● I'm getting better at this stuff● Skeleton seems like a good fit for small

projects such as this● A decent background makes a world of a

difference

geekcollision.org - Lessons Learned

Page 20: Static Websites - The Final Frontier

● Might want to style dates better (consistent style)

● You name it

geekcollision.org - To Improve

Page 21: Static Websites - The Final Frontier

Conclusions

Page 22: Static Websites - The Final Frontier

● GH Pages + Jekyll works well for simple sites

● Easy to relocate if needed● Fast and easy to develop● Less overhead vs. Django and co.

Conclusions