Build your website with awestruct and publish it on the cloud with git

Post on 04-Jul-2015

884 views 1 download

Transcript of Build your website with awestruct and publish it on the cloud with git

Build your Websitewith Awestruct and

Publish it on the Cloudwith Git

Xavier Coulon, Red Hat @xcoulon

F*ck CMSDo you need a CMS to run your website ?

(hint: no)Push files to a Web Server

setup mod_phpCMS security patches

Database admin/backupsData migration hell

Part I. Let's Have Fun Againat Baking Websites

Content First !Write your Articles in

Markdown, Textile or AsciiDoc

Layout with HAML

Comparing HAML with HTMLHTML

HAML

<div> <strong>Hello, World!</strong></div>

%div %strong Hello, World!

Comparing HAML with HTMLHTML

HAML

<div id="wrapper" class="box"> <strong id="message" class="code">Hello, World!</strong></div>

%div{:id => "wrapper", :class => "box"} %strong{:id => "message", :class => "code"} Hello, World!

#wrapper.box %strong#message.code Hello, World!

Make it Sexy with CSS, SASS or LESS

Dynamise with JavaScript orCoffeeScript

Deploy on a Web Server with GitIt's just (text) files !

It's a Developer's Workflow !(think about it)

A developer codes and tests, then pushes to a remote git repo to share

An author writes and reviews, then pushes to a remote git repo to publish

and both can even have CI and Staging sites !

Part II. Let's Bake our Website

with Awestruct !

Getting Started gem install awestruct mkdir crazy-awesome-project-site awestruct --init --framework bootstrap|blueprint|960 awestruct -d

Awestruct Project Structure _config site.yml

_ext pipeline.rb

_layout base.html.haml

_site news 2013-01-19-some-article.md

index.html.haml

Properties/MetadataYAML

Engine context (_config/*.yml)Page context (front-matter)

Available within the pages and the extensions.

Managing Profiles_site/config.yml

specific "profiles" entry

... profiles: development: base_url: http://localhost:4242 disqus: super-crazy-project-dev disqus_developer: true production: base_url: http://xcoulon.github.com/sample-awestruct-site deploy: host: github_pages disqus: super-crazy-project google_analytics: UA-12345678-1

Awestruct Built-in Extensions andHelpers

IndexifierPostsTaggerAtomizerPaginatorDisqusGoogle Analyticsand more...

Site Deployment

GitHub Pages _config/site.yml

... profiles: ... production: base_url: http://xcoulon.github.com/sample-awestruct-site ... deploy: host: github_pages

git commit awestruct -P production --force awestruct -P production --deploy

OpenShift

Demo

fork the demo: github.com/xcoulon/sample-awestruct-site

BTW, this prezo was also baked withAwestruct ;-)

Thanks !

Q/A