summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gulpfile.js38
-rw-r--r--package.json2
-rw-r--r--src/posts/big-tent.html73
-rw-r--r--src/templates/post.hbs66
4 files changed, 110 insertions, 69 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 612ebee..3f63fa6 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -10,6 +10,8 @@
10 var git = require('gulp-git'); 10 var git = require('gulp-git');
11 var filter = require('gulp-filter'); 11 var filter = require('gulp-filter');
12 var less = require('gulp-less'); 12 var less = require('gulp-less');
13 var data = require('gulp-data');
14 var change = require('gulp-change');
13 var rsync = require('gulp-rsync'); 15 var rsync = require('gulp-rsync');
14 var webserver = require('gulp-webserver'); 16 var webserver = require('gulp-webserver');
15 var streamqueue = require('streamqueue'); 17 var streamqueue = require('streamqueue');
@@ -101,6 +103,8 @@
101 var $ = cheerio.load(fs.readFileSync(file)); 103 var $ = cheerio.load(fs.readFileSync(file));
102 posts.push({ 104 posts.push({
103 'title': $("head title").text(), 105 'title': $("head title").text(),
106 'description': $("head meta[name='description']").attr('content'),
107 'body': $("body").text(),
104 'mtime': stat.mtime, 108 'mtime': stat.mtime,
105 'path': 'posts/' + files[i] 109 'path': 'posts/' + files[i]
106 }); 110 });
@@ -114,6 +118,12 @@
114 return posts; 118 return posts;
115 } 119 }
116 120
121 function performTemplateChange(content) {
122 var file = dir.src + '/templates/post.hbs';
123 var stat = fs.statSync(file);
124 return fs.readFileSync(file, {'encoding': 'utf-8'});
125 }
126
117 /** 127 /**
118 * Clean the output directory. 128 * Clean the output directory.
119 * 129 *
@@ -211,7 +221,7 @@
211 /** 221 /**
212 * Package the handlebars files. 222 * Package the handlebars files.
213 */ 223 */
214 gulp.task('package:posts', function () { 224 gulp.task('package:postindex', function () {
215 225
216 var templateData = { 226 var templateData = {
217 'posts': buildPostManifest(), 227 'posts': buildPostManifest(),
@@ -227,6 +237,30 @@
227 .pipe(gulp.dest(dir.dist)); 237 .pipe(gulp.dest(dir.dist));
228 }); 238 });
229 239
240 gulp.task('package:posts', function () {
241
242 var templateData = {
243 'author': packageJson.author
244 };
245
246 // Automatically build the site list.
247 return gulp.src(dir.src + '/posts/*.html', {'base': dir.src})
248 .pipe(data(function(path) {
249 var stat = fs.statSync(path);
250 var $ = cheerio.load(fs.readFileSync(path));
251 return {
252 'title': $("head title").text(),
253 'description': $("head meta[name='description']").attr('content'),
254 'body': $("body").text(),
255 }}))
256 .pipe(change(performTemplateChange))
257 .pipe(handlebars(templateData, handlebarsConfig))
258 .pipe(rename(function (path) {
259 path.extname = ".html";
260 }))
261 .pipe(gulp.dest(dir.dist));
262 });
263
230 /** 264 /**
231 * Copy the HTML files into the dist folder. 265 * Copy the HTML files into the dist folder.
232 */ 266 */
@@ -296,7 +330,7 @@
296 * Package the entire site into the dist folder. 330 * Package the entire site into the dist folder.
297 */ 331 */
298 gulp.task('package', ['package:html', 'package:talks', 'package:posts', 332 gulp.task('package', ['package:html', 'package:talks', 'package:posts',
299 'package:libs', 333 'package:postindex', 'package:libs',
300 'package:images', 'package:css', 'package:js']); 334 'package:images', 'package:css', 'package:js']);
301 335
302 gulp.task('rsync', function () { 336 gulp.task('rsync', function () {
diff --git a/package.json b/package.json
index de762dc..8346b66 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,9 @@
22 "bower": "^1.4.1", 22 "bower": "^1.4.1",
23 "cheerio": "^0.19.0", 23 "cheerio": "^0.19.0",
24 "gulp": "^3.9.0", 24 "gulp": "^3.9.0",
25 "gulp-change": "^1.0.0",
25 "gulp-compile-handlebars": "^0.5.0", 26 "gulp-compile-handlebars": "^0.5.0",
27 "gulp-data": "^1.2.0",
26 "gulp-filter": "^3.0.0", 28 "gulp-filter": "^3.0.0",
27 "gulp-git": "^1.2.4", 29 "gulp-git": "^1.2.4",
28 "gulp-ignore": "^1.2.1", 30 "gulp-ignore": "^1.2.1",
diff --git a/src/posts/big-tent.html b/src/posts/big-tent.html
index 8b71e0c..981913a 100644
--- a/src/posts/big-tent.html
+++ b/src/posts/big-tent.html
@@ -1,47 +1,9 @@
1<!doctype html> 1<html>
2<html class="no-js"> 2<head>
3 <head> 3 <meta description="OpenStack as Layers but also tents but also cats" />
4 <meta charset="utf-8"> 4 <title> The Big Tent </title>
5 <title>The Big Tent</title> 5</head>
6 <link rel="stylesheet" 6<body>
7 href="/css/bootstrap.css">
8 <link rel="stylesheet"
9 href="/css/mordred.css">
10 <meta name="author" content="{{author.name}}">
11 <meta name="viewport"
12 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
13 <meta name="description" content="OpenStack as Layers but also tents but also cats">
14 <meta name="viewport" content="width=device-width">
15 <link rel="shortcut icon" href="/favicon.ico">
16
17 </head>
18 <body>
19 <!--[if lt IE 10]>
20 <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
21 <![endif]-->
22
23<nav class="navbar navbar-default navbar-fixed-top">
24 <div class="container-fluid"><a href="/">
25 <span class="navbar-brand">
26 Things you may or may not care or not care about.</a></span>
27 </div>
28</nav>
29
30 <!-- Main jumbotron for a primary marketing message or call to action -->
31 <div class="jumbotron">
32 <div class="container-fluid">
33 <h1>
34 <span xmlns:dct="http://purl.org/dc/terms/"
35 href="http://purl.org/dc/dcmitype/InteractiveResource"
36 property="dct:title"
37 rel="dct:type">
38 The Big Tent
39 </h1>
40 <p class="lead">OpenStack as Layers but also tents but also cats</p>
41 </div>
42 </div>
43
44 <div class="container-fluid">
45 <p>I'd like to build on the ideas in <a href="https://dague.net/2014/08/26/openstack-as-layers/">Sean's Layers</a>. I've been noodling on it for a while and have had a several interesting conversations with people. Before I tell you how I've taxonomied things in my head, I want to spend a second on why.</p> 7 <p>I'd like to build on the ideas in <a href="https://dague.net/2014/08/26/openstack-as-layers/">Sean's Layers</a>. I've been noodling on it for a while and have had a several interesting conversations with people. Before I tell you how I've taxonomied things in my head, I want to spend a second on why.</p>
46 <h3 id="why-do-we-care">Why do we care?</h3> 8 <h3 id="why-do-we-care">Why do we care?</h3>
47 <p>Our choices in organizing our work effect a few different unrelated things:</p> 9 <p>Our choices in organizing our work effect a few different unrelated things:</p>
@@ -223,28 +185,5 @@ designate call-that-ip &#39;blog.inaugust.com&#39; --also-reverse-dns-kthxbai #
223 <p>We can actually let the market decided more on the relative importance of things without us needing to predecide that.</p> 185 <p>We can actually let the market decided more on the relative importance of things without us needing to predecide that.</p>
224 <p>We can take a much stronger position on some of the topics, such as &quot;Compute instances need IP Addresses&quot; without having to put ourselves in the position to take such a strong stance on everything else.</p> 186 <p>We can take a much stronger position on some of the topics, such as &quot;Compute instances need IP Addresses&quot; without having to put ourselves in the position to take such a strong stance on everything else.</p>
225 <p>Who's with me?</p> 187 <p>Who's with me?</p>
226
227 </div>
228
229<nav class="navbar navbar-default navbar-fixed-bottom">
230 <div class="container-fluid">
231 <p class="navbar-text">
232 <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">
233 <img alt="Creative Commons License"
234 src="https://i.creativecommons.org/l/by/4.0/88x31.png"/>
235 </a>
236 <a xmlns:cc="http://creativecommons.org/ns#"
237 rel="cc:attributionURL"
238 href='http://inaugust.com'>http://inaugust.com</a>
239 by <span xmlns:cc="http://creativecommons.org/ns#"
240 property="cc:attributionName">{{author.name}}</span>
241 is licensed under a <a rel="license"
242 href="http://creativecommons.org/licenses/by/4.0/">Creative
243 Commons Attribution 4.0 International License</a>.
244 Source code available at <a href='http://git.inaugust.com/cgit/inaugust.com'>http://git.inaugust.com/cgit/inaugust.com</a>
245 </p>
246 </div>
247</nav>
248
249</body> 188</body>
250</html> 189</html>
diff --git a/src/templates/post.hbs b/src/templates/post.hbs
new file mode 100644
index 0000000..dd2187e
--- /dev/null
+++ b/src/templates/post.hbs
@@ -0,0 +1,66 @@
1<!doctype html>
2<html class="no-js">
3<head>
4 <meta charset="utf-8">
5 <title>{{ title }}</title>
6 <link rel="stylesheet" href="/css/bootstrap.css">
7 <link rel="stylesheet" href="/css/mordred.css">
8 <meta name="author" content="{{author.name}}">
9 <meta name="viewport"
10 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
11 <meta name="description" content="{{ description }}">
12 <meta name="viewport" content="width=device-width">
13 <link rel="shortcut icon" href="/favicon.ico">
14</head>
15
16<body>
17 <!--[if lt IE 10]>
18 <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
19 <![endif]-->
20
21 <nav class="navbar navbar-default navbar-fixed-top">
22 <div class="container-fluid"><a href="/">
23 <span class="navbar-brand">
24 Things you may or may not care or not care about.</a></span>
25 </div>
26 </nav>
27
28 <div class="jumbotron">
29 <div class="container-fluid">
30 <h1>
31 <span xmlns:dct="http://purl.org/dc/terms/"
32 href="http://purl.org/dc/dcmitype/InteractiveResource"
33 property="dct:title"
34 rel="dct:type">
35 {{ title }}
36 </h1>
37 <p class="lead">{{ description }}</p>
38 </div>
39 </div>
40
41 <div class="container-fluid">
42 {{{ body }}}
43 </div>
44
45 <nav class="navbar navbar-default navbar-fixed-bottom">
46 <div class="container-fluid">
47 <p class="navbar-text">
48 <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">
49 <img alt="Creative Commons License"
50 src="https://i.creativecommons.org/l/by/4.0/88x31.png"/>
51 </a>
52 <a xmlns:cc="http://creativecommons.org/ns#"
53 rel="cc:attributionURL"
54 href='http://inaugust.com'>http://inaugust.com</a>
55 by <span xmlns:cc="http://creativecommons.org/ns#"
56 property="cc:attributionName">{{author.name}}</span>
57 is licensed under a <a rel="license"
58 href="http://creativecommons.org/licenses/by/4.0/">Creative
59 Commons Attribution 4.0 International License</a>.
60 Source code available at <a href='http://git.inaugust.com/cgit/inaugust.com'>http://git.inaugust.com/cgit/inaugust.com</a>
61 </p>
62 </div>
63 </nav>
64
65</body>
66</html>