diff --git a/harp.json b/harp.json index ae90585..3bc6d2e 100644 --- a/harp.json +++ b/harp.json @@ -3,8 +3,6 @@ "site": "samhuri.net", "author": "Sami Samhuri", "email": "sami@samhuri.net", - "url": "http://samhuri.net", - "styles": [], - "scripts": [] + "url": "http://samhuri.net" } } \ No newline at end of file diff --git a/public/_data.json b/public/_data.json index 1e83ea8..e9e69a9 100644 --- a/public/_data.json +++ b/public/_data.json @@ -2,6 +2,12 @@ "title": "samhuri.net", "subtitle": "words mean things", "url": "http://samhuri.net", + "styles": [ + "/css/style.css" + ], + "scripts": [ + + ], "latest": { "title": "Structure of an Ember app", "date": "February 3, 2014", diff --git a/public/_layout.ejs b/public/_layout.ejs index 1f52204..7ea22e8 100644 --- a/public/_layout.ejs +++ b/public/_layout.ejs @@ -1,22 +1,61 @@ +<% allScripts = [] -%> +<% allStyles = [] -%> +<% var ctx = public -%> +<% var n = current.path.length -%> +<% for (var i in current.path) { -%> +<% var path = current.path[i] -%> +<% if (ctx._data) { -%> +<% if (ctx._data.scripts || ctx._data._scripts) { -%> +<% allScripts = allScripts.concat(ctx._data.scripts || ctx._data._scripts) -%> +<% } -%> +<% if (ctx._data.styles || ctx._data._styles) { -%> +<% allStyles = allStyles.concat(ctx._data.styles || ctx._data._styles) -%> +<% } -%> +<% if (ctx._data[path] && ctx._data[path].scripts) { -%> +<% allScripts = allScripts.concat(ctx._data[path].scripts) -%> +<% } -%> +<% if (ctx._data[path] && ctx._data[path].styles) { -%> +<% allStyles = allStyles.concat(ctx._data[path].styles) -%> +<% } -%> +<% } -%> +<% ctx = ctx[path] -%> +<% } -%> +
- <% if (typeof title != 'undefined') { %> -
@@ -60,31 +44,23 @@
-
-