Slide 1

Slide 1 text

Alexander Reelsen @spinscale alexander.reelsen@elasticsearch.com Introduction into harp

Slide 2

Slide 2 text

About me Developer at Elasticsearch Interested in all things scale, search & a bit web No clue about web design likes tech meetups...

Slide 3

Slide 3 text

More search... Check out the Search Meetup Munich (15th Dec) http://www.meetup.com/Search-Meetup-Munich/events/218856224/

Slide 4

Slide 4 text

Devcamp anyone? Like a barcamp, but for developers only! Location for 150 people One big room 5 small conference rooms Sponsors wanted as well Contact me!

Slide 5

Slide 5 text

Introduction

Slide 6

Slide 6 text

Static site generators There are a few out there... 388 https://staticsitegenerators.net/ Known ones Jekyll, Octopress, Pelican, Middleman

Slide 7

Slide 7 text

Use-Cases Prototyping Documentation Small websites Blogs Potentially replacing misused CMS

Slide 8

Slide 8 text

harp static web server with built-in preprocessing HTML: EJS, Jade, Markdown CSS: LESS, Stylus, SASS JS: Coffeescript

Slide 9

Slide 9 text

Installation npm install -g harp harp init myproject harp server myproject

Slide 10

Slide 10 text

Features

Slide 11

Slide 11 text

Command line options harp compile creates compiled HTML/CSS/JS for static hosting harp multihost allows to develop multiple projects in parallel

Slide 12

Slide 12 text

Features - Partials Home Product Services <%= partial("_nav") %>

Services

Slide 13

Slide 13 text

Features - Metadata { "team": { "title": "Team page", "members": ["Rob", “Brock", "Jorge"] } } h1= title ul each member in members li= member _data.json team.jade

Slide 14

Slide 14 text

Integration - express.js var express = require("express"); var harp = require("harp"); var app = express(); app.configure(function(){ app.use(express.static(__dirname + "/public")); app.use(harp.mount(__dirname + "/public")); });

Slide 15

Slide 15 text

Features - Boilerplates harp init -b harp-boilerplates/hb-blog Blog, Bootstrap, Presentations... https://github.com/harp-boilerplates

Slide 16

Slide 16 text

Features - Environment Act different depending on your environment production || development Display drafts etc.. Different caching strategy (LRU vs. none) harp compile is production as well!

Slide 17

Slide 17 text

Features - Deployment GitHub Pages Heroku Azure harp.io

Slide 18

Slide 18 text

Features... Support for globals.json current object for application state Basic Auth Custom 404, 200 (for client apps) More help through recipes http://harpjs.com/recipes/

Slide 19

Slide 19 text

Not (yet) implemented... browser-sync https://github.com/sintaxi/harp/pull/360 terraform needs to be updated more regularly lots of pending PRs with support for other languages Big picture: Harp editor https://github.com/silentrob/harp-editor

Slide 20

Slide 20 text

DEMO

Slide 21

Slide 21 text

Resources Harp http://harpjs.com/ https://github.com/sintaxi/harp Harp Platform https://www.harp.io/ Note: No affiliation with harp just stole the design!

Slide 22

Slide 22 text

Thanks for listening! Alexander Reelsen @spinscale alexander.reelsen@elasticsearch.com