Skip to content

Commit

Permalink
#28 add archive with all posts and limit homepage post count
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMit committed Sep 1, 2019
1 parent cfa5a4a commit 6efdd8d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addFilter("jsmin", require("./src/_filters/clean-js.js") );
eleventyConfig.addFilter("dateDisplay", require("./src/_filters/dates.js") );
eleventyConfig.addFilter("contentTags", tags => tags.filter(t=> t !== "post"));
eleventyConfig.addFilter("take", (array, n) => array.slice(0,n));


return {
Expand Down
4 changes: 2 additions & 2 deletions src/404.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ summary: "Sorry, we couldn't find that page for some reason"
<h1 class="page-title">{{title}}</h1>

<p>
Sorry, we couldn't find the page you were looking for, but you can <a href="/">explore all pages</a> or try our search below:
Sorry, we couldn't find the page you were looking for, but you can <a href="/archive/">explore all pages</a> or try our search below:
</p>

{% include "_partials/search.njk" %}
Expand All @@ -32,7 +32,7 @@ Sorry, we couldn't find the page you were looking for, but you can <a href="/">e
<script type="text/javascript">
// prefill search box with path text
var path = window.location.pathname;
var text = path.replace("/posts/","").replace(/[/-]/g," ");
var text = path.replace("/posts/","").replace("index.html","").replace(".html","").replace(/[/-]/g," ").trim();
var search = document.getElementById("input-search");
search.value = text;
</script>
12 changes: 10 additions & 2 deletions src/_includes/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ s {
color: #7f7a75;
}

small {
font-size: .8em;
}

blockquote {
background: #ffffd7;
margin: 0;
Expand Down Expand Up @@ -98,6 +102,10 @@ hr {
margin-top: 1.7rem;
}

/* spacing */
.mt-2 {
margin-top: 2em;
}

/* links */
.content a,
Expand Down Expand Up @@ -388,9 +396,9 @@ form.search {
}

form.search input {
height: 32px;
height: 43px;
width: 100%;
padding: 5px 8px;
padding: 7px 9px;
border-radius: 4px;
box-shadow: none;
border: 1px solid #d0d0d0;
Expand Down
16 changes: 16 additions & 0 deletions src/archive.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: default.njk
title_word: "Archive"
title: "Complete Post Archives"
date: 2019-08-22
summary: "A complete listing of all posts and pages"
---


<h1 >
{{title}}
</h1>

{% set postList = collections.post | reverse %}
{% include "_partials/postList.njk" %}

6 changes: 5 additions & 1 deletion src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ A Collection of Overviews, Guidelines, Strategies, Standards, Technologies, and

{% include "_partials/search.njk" %}

{% set postList = collections.post | reverse %}
<h1 class="mt-2">
Recent posts <small><a href="/archive/">(view all)</a></small>
</h1>

{% set postList = collections.post | reverse | take(10) %}
{% include "_partials/postList.njk" %}

0 comments on commit 6efdd8d

Please sign in to comment.