From a9e7b9b3936a8ee9a7d491a4ff58f7cbe919091d Mon Sep 17 00:00:00 2001 From: J David Smith Date: Thu, 12 Nov 2015 16:52:36 -0500 Subject: [PATCH] First commit --- .gitignore | 2 + layout/_partial/header.ejs | 3 + layout/_partial/post.ejs | 17 ++ layout/_partial/root.ejs | 24 +++ layout/index.ejs | 6 + layout/post.ejs | 4 + package.json | 15 ++ scripts/aside.js | 12 ++ scripts/highlight.js | 18 ++ source/css/ETBembo-DisplayItalic.ttf | Bin 0 -> 44744 bytes source/css/ETBembo-RomanLF.ttf | Bin 0 -> 47512 bytes source/css/solarized_light.css | 107 ++++++++++++ source/css/tufte.css | 252 +++++++++++++++++++++++++++ source/css/tufte_ext.css | 18 ++ 14 files changed, 478 insertions(+) create mode 100644 .gitignore create mode 100644 layout/_partial/header.ejs create mode 100644 layout/_partial/post.ejs create mode 100644 layout/_partial/root.ejs create mode 100644 layout/index.ejs create mode 100644 layout/post.ejs create mode 100644 package.json create mode 100644 scripts/aside.js create mode 100644 scripts/highlight.js create mode 100644 source/css/ETBembo-DisplayItalic.ttf create mode 100644 source/css/ETBembo-RomanLF.ttf create mode 100644 source/css/solarized_light.css create mode 100644 source/css/tufte.css create mode 100644 source/css/tufte_ext.css 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(/