Changed some code structure, added some elements + styling to blog views
This commit is contained in:
parent
b7cca7b303
commit
91c316a3da
12
docpad.js
12
docpad.js
@ -7,12 +7,18 @@ var docpadConfig = {
|
|||||||
return this.getCollection("html").findAllLive({relativeOutDirPath: "."}, [{order: 1}]);
|
return this.getCollection("html").findAllLive({relativeOutDirPath: "."}, [{order: 1}]);
|
||||||
},
|
},
|
||||||
posts: function(){
|
posts: function(){
|
||||||
return this.getCollection("html").findAll({relativeOutDirPath: "blog"});
|
var posts = this.getCollection("html").findAllLive({relativeOutDirPath: "blog"});
|
||||||
|
posts.on("add", function(post){
|
||||||
|
post.setMetaDefaults({
|
||||||
|
layout: "blogpost"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return posts;
|
||||||
},
|
},
|
||||||
projects: function(){
|
projects: function(){
|
||||||
var projects = this.getCollection("html").findAllLive({relativeOutDirPath: "projects"});
|
var projects = this.getCollection("html").findAllLive({relativeOutDirPath: "projects"});
|
||||||
projects.on("add", function(model){
|
projects.on("add", function(project){
|
||||||
model.setMetaDefaults({
|
project.setMetaDefaults({
|
||||||
layout: "contentpage"
|
layout: "contentpage"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -8,10 +8,12 @@ referencesOthers: true
|
|||||||
<% var posts = getCollection("posts").toJSON() %>
|
<% var posts = getCollection("posts").toJSON() %>
|
||||||
<% posts.forEach(function(post){ %>
|
<% posts.forEach(function(post){ %>
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<h2><a href="<%- post.url %>"><%= post.title %></a></h2>
|
<h2 class="title"><a href="<%- post.url %>"><%= post.title %></a></h2>
|
||||||
<div class="date"><%- post.formattedDate %></div>
|
<h3 class="subtitle"><%- post.subtitle %></h3>
|
||||||
<div class="firstcontent blogpost">
|
<h4 class="date"><%- post.formattedDate %></h4>
|
||||||
<%- post.contentRenderedWithoutLayouts.split("-split-")[0] %>
|
<div class="firstcontent blogpost">
|
||||||
</div>
|
<%- post.contentRenderedWithoutLayouts.split("-split-")[0] %>
|
||||||
|
</div>
|
||||||
|
<a class="morelink" href="<%- post.url %>">Read More...</a>
|
||||||
</div>
|
</div>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
layout: "blogpost"
|
|
||||||
title: "Running TVheadend in a VM"
|
title: "Running TVheadend in a VM"
|
||||||
date: 2016-04-11
|
date: 2016-04-11
|
||||||
subtitle: "Or how I went from trying to watch HD TV to changing hypervisor..."
|
subtitle: "Or how I went from trying to watch HD TV to changing hypervisor..."
|
||||||
|
@ -87,12 +87,9 @@ body{
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
h1, h2, h3.date{
|
h1, h2, h3{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
h3.date{
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
h1{
|
h1{
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
@ -439,14 +436,31 @@ body{
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
h2, .date{
|
|
||||||
|
h2.title a{
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
h2.title, h3.subtitle, h4.date{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
h3.subtitle, h4.date{
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.blogpost{
|
#content[data-slug^="blog-"]{
|
||||||
|
h1#title{
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
h2#subtitle, h3#date{
|
||||||
|
margin: 0;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#content[data-slug^="blog"] .blogpost{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
layout: contentpage
|
layout: contentpage
|
||||||
---
|
---
|
||||||
|
|
||||||
<h3 class="date"><%- document.formattedDate %></h3>
|
|
||||||
<% if(document.subtitle){ %>
|
<% if(document.subtitle){ %>
|
||||||
<h2><%- document.subtitle %></h2>
|
<h2 id="subtitle"><%- document.subtitle %></h2>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<h3 id="date"><%- document.formattedDate %></h3>
|
||||||
<div class="blogpost">
|
<div class="blogpost">
|
||||||
<%- content %>
|
<%- content %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,7 @@ layout: core.html
|
|||||||
|
|
||||||
<div id="lightcontent" class="animated">
|
<div id="lightcontent" class="animated">
|
||||||
<div>
|
<div>
|
||||||
<h1><%- document.title %></h1>
|
<h1 id="title"><%- document.title %></h1>
|
||||||
<%- content %>
|
<%- content %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,18 +18,18 @@
|
|||||||
<% var pages = getCollection("pages").toJSON() %>
|
<% var pages = getCollection("pages").toJSON() %>
|
||||||
<% pages.forEach(function(page){ %>
|
<% pages.forEach(function(page){ %>
|
||||||
<% if(!page.hidden){ %>
|
<% if(!page.hidden){ %>
|
||||||
<a class="fa fa-<%= page.icon %> <% if(page.url.split("/")[1] == document.url.split("/")[1]){ %>active<% } %>" href="<%= page.url %>" data-rooturl="<%= page.url.split("/")[1] %>"></a>
|
<a class="fa fa-<%= page.icon %> <% if(page.url.split("/")[1] == document.url.split("/")[1]){ %>active<% } %>" href="<%= page.url %>" data-rooturl="<%= page.url.split("/")[1] %>"></a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="content" class="animations" data-slug="<%- document.slug %>">
|
<div id="content" class="animations<% if(document.addclass){ %> <%= document.addclass %><% } %>" data-slug="<%- document.slug %>">
|
||||||
<meta data-menu="<%= document.url.split("/")[1] %>" data-slug="<%- document.slug %>" />
|
<meta data-menu="<%= document.url.split("/")[1] %>" data-slug="<%- document.slug %>" />
|
||||||
<%- content.replace("-split-", "") %>
|
<%- content.replace("-split-", "") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<h3>© Tim Stallard 2015</h3>
|
<h3>© Tim Stallard <%- new Date().getFullYear() %></h3>
|
||||||
Hand crafted in the UK with DocPad, SmoothState.js, and lots of other magic<% /* - see the code <a href="https://github.com/TimStallard/timstallard.me.uk">on GitHub</a> */ %>
|
Hand crafted in the UK with DocPad, SmoothState.js, and lots of other magic<% /* - see the code <a href="https://github.com/TimStallard/timstallard.me.uk">on GitHub</a> */ %>
|
||||||
<br>
|
<br>
|
||||||
Mugshot by the awesome <a href="http://lws.io/">Kevin Lewis</a> at <a href="http://rebelmakers.co.uk/">Rebel Makers</a>
|
Mugshot by the awesome <a href="http://lws.io/">Kevin Lewis</a> at <a href="http://rebelmakers.co.uk/">Rebel Makers</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user