commit a9e7b9b3936a8ee9a7d491a4ff58f7cbe919091d Author: J David Smith Date: Thu Nov 12 16:52:36 2015 -0500 First commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1957698 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +TAGS +node_modules diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs new file mode 100644 index 0000000..e792ec5 --- /dev/null +++ b/layout/_partial/header.ejs @@ -0,0 +1,3 @@ +
+ Home · Blog · Atom Feed +
diff --git a/layout/_partial/post.ejs b/layout/_partial/post.ejs new file mode 100644 index 0000000..288994f --- /dev/null +++ b/layout/_partial/post.ejs @@ -0,0 +1,17 @@ +
+
+ <% if(link_title) { %> + + <% } %> +

<%- post.title %>

+ <% if(link_title) { %> +
+ <% } %> +

+ Written by <%- post.author %> +
+ Published on <%= post.date.format("DD MMMM YYYY") %> +

+
+ <%- post.content %> +
diff --git a/layout/_partial/root.ejs b/layout/_partial/root.ejs new file mode 100644 index 0000000..f693cff --- /dev/null +++ b/layout/_partial/root.ejs @@ -0,0 +1,24 @@ + + + + <%= title %> + + + + + + + + + + + <%- partial('_partial/header') %> + <%- body %> + + + diff --git a/layout/index.ejs b/layout/index.ejs new file mode 100644 index 0000000..af95fe6 --- /dev/null +++ b/layout/index.ejs @@ -0,0 +1,6 @@ +<%- partial('_partial/root', { + title: "Record of Motion", + body: page.posts.map(function(post) { + return partial('_partial/post', {post: post, link_title: true}); + }).join("") +}) %> diff --git a/layout/post.ejs b/layout/post.ejs new file mode 100644 index 0000000..c76f457 --- /dev/null +++ b/layout/post.ejs @@ -0,0 +1,4 @@ +<%- partial('_partial/root', { + title: page.title, + body: partial('_partial/post', {post: page, link_title: false}) +}) %> diff --git a/package.json b/package.json new file mode 100644 index 0000000..ab027c7 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "hexo-theme-tufte", + "version": "0.1.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "highlight.js": "^8.8.0", + "jsdom": "^3.1.2" + } +} diff --git a/scripts/aside.js b/scripts/aside.js new file mode 100644 index 0000000..062e4d7 --- /dev/null +++ b/scripts/aside.js @@ -0,0 +1,12 @@ +var jsdom = require('jsdom'), + crypto = require('crypto'), + util = require('util'); + +hexo.extend.filter.register('after_post_render', function(data) { + data.content = data.content.replace(/