27
Kaleeswaran @kaleeswaran14 http://jugchennai.in

JBake on JUGChennai

Embed Size (px)

DESCRIPTION

JBake presentation on JUG Chennai java submit '13

Citation preview

Page 1: JBake on JUGChennai

Kaleeswaran@kaleeswaran14

http://jugchennai.in

Page 2: JBake on JUGChennai

Bake your web site with JBake

JBake

Page 3: JBake on JUGChennai

What is static site generator?

Page 4: JBake on JUGChennai

Static site generator ...

Blog or Site generationCoding HTML pages with duplicated markupToo cumbersome

Approaching with language (Ruby on Rails/ PHP)Learn the languageStore content in a database

Page 5: JBake on JUGChennai

Static site generator ...

Is a program, that generates an HTML websiteSeparates out the layout, content and styles

Page 6: JBake on JUGChennai

Advantages of a Static Site Generator?

No database layerLess memory - to serve your websiteCopy of your contentEasily choose website hostingWebsite Hosting is cheaper

Page 7: JBake on JUGChennai

Disadvantages of a Static Site Generator?

Static site generator software neededCan’t have local commentsContact us forms (without some dynamic code etc)

Page 8: JBake on JUGChennai

Existing Static site generators?

JekyllawestructstaticmaticWebby……..

Page 9: JBake on JUGChennai

Selection Criteria?

Don’t force to learn languageseasy to understand layoutsexample websites to learn fromserver that provides me a development environmentGood documentation

Page 10: JBake on JUGChennai

Jbake!!!

Page 11: JBake on JUGChennai

What is baking?

Page 12: JBake on JUGChennai

Building a static web site from just plain old text files...

... an alternative to frying a web site using a database.

Page 13: JBake on JUGChennai

Why bake?

Performance Platform independence Content can be version controlled More importantly... ...help improve the life span of content URLs!

Page 14: JBake on JUGChennai

Introducing Jbake

Open sourceJava (JVM goodness!)Content structure freedomSupported content formats...Raw HTMLMarkdownAsciiDoc...more to come!

Page 15: JBake on JUGChennai

Flexible and configurableTemplate scripting supportBlog awareDraft publishing supportUse any front end framework... BootstrapFoundation

Page 16: JBake on JUGChennai

What the oven looks like...

|-- assets| |-- favicon.gif| |-- robots.txt| |-- css| |-- style.css|-- content| |-- about.html| |-- 2013| |-- 02 | |-- weekly-links-1.html| |-- weekly-links-2.md|-- templates| |-- index.ftl| |-- page.ftl| |-- post.ftl| |-- feed.ftl|-- jbake.properties

Page 17: JBake on JUGChennai

JBake Properties

template.folder=templatescontent.folder=contentasset.folder=assetsrender.index=trueindex.file=index.htmlrender.feed=truefeed.file=feed.xmlrender.archive=falsearchive.file=archive.htmlrender.tags=falsesite.host=http://jbake.org

Page 18: JBake on JUGChennai

Baking

Content will be "mixed" with the templates.Folder structure will be maintained

Page 19: JBake on JUGChennai

Content file

Status & Type fields, the rest are optional

Page 20: JBake on JUGChennai

Page Types

type=post will use post.ftltype=page will use page.ftl

status=publishedstatus=draft

Page 21: JBake on JUGChennai

Data Variables

This data is available to all templates regardless.${version} = version of JBake${posts} = collection of all posts (files that don’t have type=page)${pages} = collection of all pages (files that have type=page)${config.[options]} = map of configuration data

Page 22: JBake on JUGChennai

Data Variables

Expandable HeaderInclude extra meta data in the header - exposed to the templates:summary=This is a summary of the larger post

And access it from the template like so:<p>${content.summary}</p>

Page 23: JBake on JUGChennai

Commands

jbake -h (Help)jbake -i (Intialize)jbake (Baking)jbake -s (View)

Page 24: JBake on JUGChennai

Roadmap

Plugin support (JBake 3.0)Disqus (Facebook, G+ comments)FTP uploadSitemapTag cloudGithub commit for gitpagesPaging for posts...........!

Page 25: JBake on JUGChennai

Now for the Demo...

Page 26: JBake on JUGChennai

Jbake Plugins support Implementation...

Page 27: JBake on JUGChennai

http://jbake.org

http://jugchennai.in