chipping away at partials. Rendering date for each post. Need to sort out pagination so not all posts are on front page. Need to add sass rendering and compiling like other project I started

This commit is contained in:
Robert McGovern 2023-01-23 04:50:27 +00:00
parent 3d3b18411f
commit 148fa78c0c
18 changed files with 1749 additions and 132 deletions

View File

@ -15,12 +15,16 @@ const pluginRss = require("@11ty/eleventy-plugin-rss");
const UpgradeHelper = require("@11ty/eleventy-upgrade-help");
const xmlFiltersPlugin = require("eleventy-xml-plugin");
const inspect = require("node:util").inspect;
// relativeURL
const path = require("path");
const urlFilter = require("@11ty/eleventy/src/Filters/Url");
const indexify = (url) => url.replace(/(\/[^.]*)$/, "$1index.html");
module.exports = function (eleventyConfig) {
let pathPrefix = "/";
eleventyConfig.addPlugin(pluginRss);
//Blog excerpts
eleventyConfig.addPlugin(description);
@ -67,7 +71,7 @@ module.exports = function (eleventyConfig) {
);
// eleventyConfig.addCollection("posts", function (collectionApi) {
// return collectionApi.getFilteredByGlob("./src/posts/**/*.md");
// return collectionApi.getFilteredByGlob("./src/_posts/**/*.md");
// });
eleventyConfig.addCollection("tags", (collection) => {
@ -119,7 +123,7 @@ module.exports = function (eleventyConfig) {
require("moment")(date).format(format)
);
eleventyConfig.addFilter("relative_url", relativeURL);
// eleventyConfig.addFilter("absolute_url", relativeURL);
eleventyConfig.addLiquidFilter("toUTCString", (date) => {
const utc = date.toUTCString();
return moment.utc(utc).format("MMMM Do YYYY");
@ -138,6 +142,10 @@ module.exports = function (eleventyConfig) {
return value.hidden != true;
});
eleventyConfig.addFilter("inspect", function (obj = {}) {
return inspect(obj, {sorted: true});
});
eleventyConfig.addLayoutAlias(
"archive-taxonomy",
"layouts/archive-taxonomy.html"
@ -294,10 +302,13 @@ module.exports = function (eleventyConfig) {
// }
// );
return {
templateFormats: ["html", "liquid", "md"],
eleventyConfig.addFilter("relative_url", relativeURLALT);
eleventyConfig.addFilter("absolute_url", relativeURLALT);
pathPrefix: "/",
return {
templateFormats: ["html", "liquid", "md", "njk"],
pathPrefix,
passthroughFileCopy: true,
@ -351,3 +362,53 @@ function relativeURL(url, pathPrefix = undefined) {
}`;
return relativePath;
}
/**
* Just `{{ '/something' | url }}` will return the relative path to
* `/something/index.html`.
*
* `{{ '/something.with.dots' | url }}` will return the relative path to
* `/something.with.dots`.
*
* @param {string} url the URL to transform
* @param {string} [pathPrefix] optional path prefix to force an absolute URL
* @returns {string} resulting URL
*/
function relativeURLALT(url, pathPrefix = undefined) {
pathPrefix = "/";
// console.log(url);
// console.log(pathPrefix);
// console.log(this.page);
if (pathPrefix !== undefined) {
// Fall back on original url filter if pathPrefix is set.
return urlFilter(url, pathPrefix);
}
if (pathPrefix == undefined && this.page == undefined) {
// console.log("dropping out");
return urlFilter(url, "");
}
// Look up the url of the current rendering page, which is accessible via
// `this`.
console.log(this);
const currentDir = this.page.url;
const filteredUrl = urlFilter(url, "/");
// Make sure the index.html is expressed.
const indexUrl = indexify(filteredUrl);
// Check that the url doesn't specify a protocol.
const u = new URL(indexUrl, "make-relative://");
if (u.protocol !== "make-relative:") {
// It has a protocol, so just return the filtered URL output.
return filteredUrl;
}
// Return the relative path, or `index.html` if it's the same as the current
// page's directory.
const relativePath = `${
path.relative(currentDir, u.pathname) || "index.html"
}`;
return relativePath;
}

742
diff-index Normal file
View File

@ -0,0 +1,742 @@
0a1
>
13d13
<
19a20,21
> <meta property="article:author" content="Robert McGovern">
>
22c24
< <meta property="og:type" content="website">
---
> <meta property="og:type" content="article">
26c28
< <meta property="og:url" content="http://localhost:4000/">
---
> <meta property="og:url" content="index.html">
33c35
< <meta property="og:image" content="http://localhost:4000/assets/images/bio-photo.jpg">
---
> <meta property="og:image" content="index.html">
40c42
< <meta name="twitter:url" content="http://localhost:4000/">
---
> <meta name="twitter:url" content="index.html">
43,46c45,46
< <meta name="twitter:card" content="summary">
<
< <meta name="twitter:image" content="http://localhost:4000/assets/images/bio-photo.jpg">
<
---
> <meta name="twitter:card" content="summary_large_image">
> <meta name="twitter:image" content="index.html">
52a53
> <meta property="article:published_time" content="2020-03-05T11:10:24+00:00">
56a58
>
62c64
< <link rel="canonical" href="http://localhost:4000/">
---
> <link rel="canonical" href="index.html">
66d67
< <link rel="next" href="http://localhost:4000/page2/">
68d68
<
75c75
< "url": "http://localhost:4000/"
---
> "url": "index.html"
90c90
< <link href="/feed.xml" type="application/atom+xml" rel="alternate" title="TDN: RMCG Feed">
---
> <link href="feed.xml" type="application/atom+xml" rel="alternate" title="TDN: RMCG Feed">
101c101
< <link rel="stylesheet" href="/assets/css/main.css">
---
> <link rel="stylesheet" href="assets/css/main.css">
107c107
< <script src="/assets/js/progress.js"></script>
---
> <script src="assets/js/progress.js"></script>
109c109
< <script src="/assets/js/scroll-to-top.js"></script>
---
> <script src="assets/js/scroll-to-top.js"></script>
118c118
< <body class="layout--home">
---
> <body class="layout--">
138c138
< <a class="site-logo" href="/"><img src="/assets/images/apple-touch-icon.png" alt="TDN: RMCG"></a>
---
> <a class="site-logo" href="index.html"><img src="assets/images/apple-touch-icon.png" alt="TDN: RMCG"></a>
140c140
< <a class="site-title" href="/">
---
> <a class="site-title" href="index.html">
144,152c144
< <ul class="visible-links"><li class="masthead__menu-item">
< <a href="/year-archive/">Posts</a>
< </li><li class="masthead__menu-item">
< <a href="/tags/">Tags</a>
< </li><li class="masthead__menu-item">
< <a href="/categories/">Categories</a>
< </li><li class="masthead__menu-item">
< <a href="/about/">About</a>
< </li></ul>
---
> <ul class="visible-links"></ul>
174a167
>
177,178d169
< <div class="sidebar sticky">
<
181,331d171
< <div itemscope itemtype="https://schema.org/Person">
<
<
< <div class="author__avatar">
<
< <img src="/assets/images/bio-photo.jpg" alt="Robert McGovern" itemprop="image">
<
< </div>
<
<
< <div class="author__content">
<
< <h3 class="author__name" itemprop="name">Robert McGovern</h3>
<
<
< <div class="author__bio" itemprop="description">
< <p>Wannabe field researcher for the Hitchhikers Guide to the Galaxy</p>
<
< </div>
<
< </div>
<
< <div class="author__urls-wrapper">
< <button class="btn btn--inverse">Follow</button>
< <ul class="author__urls social-icons">
<
< <li itemprop="homeLocation" itemscope itemtype="https://schema.org/Place">
< <i class="fas fa-fw fa-map-marker-alt" aria-hidden="true"></i> <span itemprop="name">ZZ9 Plural Z Alpha</span>
< </li>
<
<
<
<
<
< <li><a href="https://tarasis.net" rel="nofollow noopener noreferrer"><i class="fas fa-fw fa-link" aria-hidden="true"></i><span class="label">Website</span></a></li>
<
<
<
< <li><a href="mailto:rob@tarasis.net" rel="nofollow noopener noreferrer"><i class="fas fa-fw fa-envelope-square" aria-hidden="true"></i><span class="label">Email</span></a></li>
<
<
<
< <li><a href="https://www.linkedin.com/in/robertmcgovern/" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-linkedin" aria-hidden="true"></i><span class="label">Linkedin</span></a></li>
<
<
<
< <li><a href="https://github.com/tarasis" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i><span class="label">Github</span></a></li>
<
<
<
< <li><a href="https://twitter.com/tarasis" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-twitter-square" aria-hidden="true"></i><span class="label">Twitter</span></a></li>
<
<
<
< <li><a href="https://www.facebook.com/tarasis" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-facebook" aria-hidden="true"></i><span class="label">Facebook</span></a></li>
<
<
<
< <li><a href="https://instagram.com/tarasis" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-instagram" aria-hidden="true"></i><span class="label">Instagram</span></a></li>
<
<
<
< <li><a href="https://www.flickr.com/photos/tarasis/" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-flickr" aria-hidden="true"></i><span class="label">Flickr</span></a></li>
<
<
<
< <li><a href="https://www.youtube.com/user/tarasis" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-youtube" aria-hidden="true"></i><span class="label">Youtube</span></a></li>
<
<
<
< <li><a href="https://soundcloud.com/tarasis" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-soundcloud" aria-hidden="true"></i><span class="label">Soundcloud</span></a></li>
<
<
<
< <li><a href="https://www.last.fm/user/tarasis" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-lastfm" aria-hidden="true"></i><span class="label">Last.FM</span></a></li>
<
<
<
< <li><a href="https://www.reddit.com/user/tarasis" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-reddit" aria-hidden="true"></i><span class="label">Reddit</span></a></li>
<
<
<
< <li><a href="https://www.pinterest.com/tarasis/" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-pinterest" aria-hidden="true"></i><span class="label">Pinterest</span></a></li>
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
< <!--
< <li>
< <a href="http://link-to-whatever-social-network.com/user/" itemprop="sameAs" rel="nofollow noopener noreferrer">
< <i class="fas fa-fw" aria-hidden="true"></i> Custom Social Profile Link
< </a>
< </li>
< -->
< </ul>
< </div>
< </div>
<
<
< </div>
<
<
<
338d177
< <h3 class="archive__subtitle">Recent posts</h3>
340a180
> <h3 class="archive__subtitle">Recent Posts</h3>
343d182
< <div class="entries-list">
345d183
<
349,384c187
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2022/10/15/frontend-mentor-challenge-deployment/" rel="permalink">What happens when I finish a Frontend Mentor Challenge (or how I build and deploy an 11ty site)
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 4 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">Ive been doing challenges from Frontend Mentor as a means to practice frontend web development. Specifically working with plain HTML, CSS and JavaScript.
<
< R...</p>
< </article>
< </div>
<
---
> <div class="entries-list">
386,421d188
<
<
<
<
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2020/05/27/camino-de-santiago/" rel="permalink">A short look back on my Camino de Santiago journey
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 3 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">A year ago tomorrow I began the most gruelling, yet immensely satisfying, journey of my life. I set off from my home in Buchholz in der Nordheide Germany, to...</p>
< </article>
424,425d190
<
<
429,812d193
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2020/04/21/learning-web-development/" rel="permalink">Learning Web Development
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 2 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">I mentioned in the goals post, one of the things I am aiming to do is to start learning web development.
<
< I was well aware that what falls under the banner o...</p>
< </article>
< </div>
<
<
<
<
<
<
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2020/04/20/swift-coding-challenge-2/" rel="permalink">Swift Coding Challenges: Challenge 2
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 1 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">Second one within 13 hours, good lord, that would never do.
<
< So this challenge was to test if a string matched against the reverse of itself. Basically a pal...</p>
< </article>
< </div>
<
<
<
<
<
<
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2020/04/20/swift-coding-challenges/" rel="permalink">Swift Coding Challenges: Challenge 1
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< less than 1 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">As an effort to improve and challenge myself I got a copy of Paul Hudsons Swift Coding Challenges book and Im going to work through it and post my thoughts...</p>
< </article>
< </div>
<
<
<
<
<
<
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2020/04/17/goals/" rel="permalink">Goals
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 6 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">Long time, no write.
<
< A lot has changed in my life, not least of which is that I am no longer a stay at home dad or living in Germany. For now I am back home...</p>
< </article>
< </div>
<
<
<
<
<
<
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2019/06/17/Day21/" rel="permalink">Day 21
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 2 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">Day 21 of trip
<
< Day Frómista to Carrión de los Condes. 18.88km according to app. 19.18km with Phone GPS (minor detour). Was walking quickly. Which Fitbit doe...</p>
< </article>
< </div>
<
<
<
<
<
<
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2019/06/15/Day19/" rel="permalink">Day 19
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 3 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">Day 19 of trip
<
< Day 16 of walk.
<
< Today was Hornillos del Camino to Castrojeriz (19.47km)
<
< Weather: cool, grey and minimal sun (nice to walk in)
<
< Terrain: lig...</p>
< </article>
< </div>
<
<
<
<
<
<
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2019/06/14/Day-2018/" rel="permalink">Day 18 - drawn to stop
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 4 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">Day 18
<
< Burgos to Hornillos del Camino ~22km
<
< Weather was pleasant but cool
<
< Terrain most flat, gravel &amp; roads
<
< Woke up at 3am freezing and no blanket to...</p>
< </article>
< </div>
<
<
<
<
<
<
< <div class="list__item">
< <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<
< <h2 class="archive__item-title no_toc" itemprop="headline">
<
< <a href="/2019/06/13/Day-2017/" rel="permalink">Day 17
< </a>
<
< </h2>
<
<
< <p class="page__meta">
<
<
<
<
<
<
<
<
< <span class="page__meta-readtime">
< <i class="far fa-clock" aria-hidden="true"></i>
<
< 3 minute read
<
< </span>
<
< </p>
<
<
< <p class="archive__item-excerpt" itemprop="description">Day 17
<
< So its day 17 of the trip and day 14 of the Camino (day 12 if you take out 2 rest days)
<
< Woke at 6 pretty impressed that I didnt hear the 2 women i...</p>
< </article>
< </div>
<
<
< </div>
<
<
< <nav class="pagination">
<
< <ul>
<
<
< <li><a href="#" class="disabled"><span aria-hidden="true">Previous</span></a></li>
<
<
<
<
< <li><a href="#" class="disabled current">1</a></li>
<
<
<
<
<
<
<
<
<
<
<
<
<
<
< <li><a href="/page2/">2</a></li>
<
<
<
<
<
<
<
< <li><a href="/page3/">3</a></li>
<
<
<
<
< <li><a href="/page2/">Next</a></li>
<
< </ul>
< </nav>
<
<
<
841,842d221
< <li><strong>Follow:</strong></li>
<
869c248
< <li><a href="/feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li>
---
> <li><a href="feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li>
874c253
< <div class="page__footer-copyright">&copy; 2023 Robert McGovern. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
---
> <div class="page__footer-copyright">&copy; %2023 Robert McGovern. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
880c259
< <script src="/assets/js/main.min.js"></script>
---
> <script src="assets/js/main.min.js"></script>
884a264
>
886,889c266,268
< <script src="/assets/js/lunr/lunr.min.js"></script>
< <script src="/assets/js/lunr/lunr-store.js"></script>
< <script src="/assets/js/lunr/lunr-en.js"></script>
<
---
> <script src="assets/js/lunr/lunr.min.js"></script>
> <script src="assets/js/lunr/lunr-store.js"></script>
> <script src="assets/js/lunr/lunr-en.js"></script>

76
inspect.output Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,4 +8,10 @@ Removed from site.json
"post_template": "post",
"page_template": "page",
"draft_template": "draft"
```
```
hacked pathPrefix into relativeURLAlt function because for some reason it isn't being picked up from the above return.
author_profile.html for adding mastodon
invalid date format https://github.com/11ty/eleventy/issues/413

788
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,10 +34,16 @@
"@11ty/eleventy-plugin-syntaxhighlight": "^4.2.0",
"@11ty/eleventy-upgrade-help": "^2.0.5",
"autoprefixer": "^10.4.13",
"eleventy-load": "^0.3.1",
"eleventy-load-css": "^0.3.0",
"eleventy-load-file": "^0.1.0",
"eleventy-load-html": "^0.1.1",
"eleventy-load-sass": "^0.1.2",
"eleventy-plugin-description": "^0.1.5",
"eleventy-plugin-toc": "^1.1.5",
"eleventy-xml-plugin": "^0.1.0",
"fs-extra": "^11.1.0",
"markdown-it": "^13.0.1",
"markdown-it-anchor": "^8.6.6",
"markdown-it-attrs": "^4.1.6",
"markdown-it-container": "^3.0.0",
@ -47,6 +53,7 @@
"moment": "^2.29.4",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.21",
"sass": "^1.57.1"
"sass": "^1.57.1",
"slugify": "^1.6.5"
}
}
}

View File

@ -318,44 +318,34 @@
"permalink": "/:collection/:path/"
}
},
"defaults": [
{
"scope": {
"path": "",
"type": "posts"
},
"values": {
"defaults": {
"posts": {
"path": "_posts",
"type": "posts",
"layout": "single",
"classes": "wide",
"author_profile": true,
"read_time": true,
"share": true,
"related": true,
"comments": true
}
"comments": true,
"sidebar":true,
"show_date": true
},
{
"scope": {
"pages": {
"path": "_pages",
"type": "pages"
},
"values": {
"type": "pages",
"layout": "single",
"author_profile": true
}
},
{
"scope": {
"recipies": {
"path": "",
"type": "recipes"
},
"values": {
"type": "recipes",
"layout": "single",
"author_profile": true,
"share": true
}
}
],
},
"post_ext": "markdown",
"page_ext": "html",
"post_layout": "single",

View File

@ -1,5 +1,5 @@
{% assign author = page.author | default: page.authors[0] | default: site.author %}
{% assign author = site.data.authors[author] | default: author %}
{% assign author = authors[author] | default: author %}
<div itemscope itemtype="https://schema.org/Person">

View File

@ -1,42 +0,0 @@
---
---
<!doctype html>
<!--
Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose
Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
-->
<html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js">
<head>
{% include head.html %}
{% include head/custom.html %}
</head>
<body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}">
{% include_cached skip-links.html %}
{% include_cached browser-upgrade.html %}
{% include_cached masthead.html %}
<div class="initial-content">
{{ content }}
</div>
{% if site.search == true %}
<div class="search-content">
{% include_cached search/search_form.html %}
</div>
{% endif %}
<div id="footer" class="page__footer">
<footer>
{% include footer/custom.html %}
{% include_cached footer.html %}
</footer>
</div>
{% include scripts.html %}
</body>
</html>

View File

@ -15,9 +15,9 @@
</head>
<body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}">
{% include_cached skip-links.html %}
{% include_cached browser-upgrade.html %}
{% include_cached masthead.html %}
{% include skip-links.html %}
{% include browser-upgrade.html %}
{% include masthead.html %}
<div class="initial-content">
{{ content }}
@ -25,14 +25,14 @@
{% if site.search == true %}
<div class="search-content">
{% include_cached search/search_form.html %}
{% include search/search_form.html %}
</div>
{% endif %}
<div id="footer" class="page__footer">
<footer>
{% include footer/custom.html %}
{% include_cached footer.html %}
{% include footer.html %}
</footer>
</div>

View File

@ -1,13 +1,16 @@
---
layout: archive
---
{{ content }}
paginator:
data: collections.posts
size: 2
---
<h3 class="archive__subtitle">{{ site.data.ui-text[site.locale].recent_posts | default: "Recent Posts" }}</h3>
{% if paginator %}
{% assign posts = paginator.posts %}
{% assign posts = collections.posts %}
{% else %}
{% assign posts = site.posts %}
{% endif %}

View File

@ -4,6 +4,7 @@ layout: archive
{{ content }}
{% comment %}
<ul class="taxonomy__index">
{% assign postsInYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
{% for year in postsInYear %}
@ -28,3 +29,4 @@ layout: archive
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
</section>
{% endfor %}
{% endcomment %}

View File

@ -1,18 +1,25 @@
{% assign document = post | default: page %}
{% if document.read_time or document.show_date %}
{% assign document = document.data.page %}
{{document | inspect}}
{{site.defaults.posts.show_date | json}}
{{document.date | json}}
{% if document.read_time or document.show_date or site.defaults.posts.show_date %}
<p class="page__meta">
{% if document.show_date and document.date %}
{% if document.show_date or site.defaults.posts.show_date and document.date %}
{% assign date = document.date %}
<span class="page__meta-date">
<i class="far {% if include.type == 'grid' and document.read_time and document.show_date %}fa-fw {% endif %}fa-calendar-alt" aria-hidden="true"></i>
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
{% assign date_format = site.date_format | default: "LLLL" %}
<time datetime="{{ date | date_to_xmlschema }}">{{ date | date: date_format }}</time>
</span>
{% endif %}
{% if document.read_time and document.show_date %}<span class="page__meta-sep"></span>{% endif %}
{% if document.read_time or site.defaults.posts.read_time and document.show_date or site.defaults.posts.show_date %}<span class="page__meta-sep"></span>{% endif %}
{% if document.read_time %}
{% if document.read_time or site.defaults.posts.read_time %}
{% assign words_per_minute = document.words_per_minute | default: site.words_per_minute | default: 200 %}
{% assign words = document.content | strip_html | number_of_words %}

View File

@ -1,30 +0,0 @@
---
layout: archive
---
{{ content }}
<ul class="taxonomy__index">
{% assign postsInYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
{% for year in postsInYear %}
<li>
<a href="#{{ year.name }}">
<strong>{{ year.name }}</strong> <span class="taxonomy__count">{{ year.items | size }}</span>
</a>
</li>
{% endfor %}
</ul>
{% assign entries_layout = page.entries_layout | default: 'list' %}
{% assign postsByYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
{% for year in postsByYear %}
<section id="{{ year.name }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ year.name }}</h2>
<div class="entries-{{ entries_layout }}">
{% for post in year.items %}
{% include archive-single.html type=entries_layout %}
{% endfor %}
</div>
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
</section>
{% endfor %}

View File

@ -10,16 +10,16 @@
{%- assign search_provider = site.search_provider | default: "lunr" -%}
{%- case search_provider -%}
{%- when "lunr" -%}
{% include_cached search/lunr-search-scripts.html %}
{% include search/lunr-search-scripts.html %}
{%- when "google" -%}
{% include_cached search/google-search-scripts.html %}
{% include search/google-search-scripts.html %}
{%- when "algolia" -%}
{% include_cached search/algolia-search-scripts.html %}
{% include search/algolia-search-scripts.html %}
{%- endcase -%}
{% endif %}
{% include analytics.html %}
{% include /comments-providers/scripts.html %}
{% include comments-providers/scripts.html %}
{% if site.after_footer_scripts %}
{% for script in site.after_footer_scripts %}

View File

@ -1,8 +1,11 @@
{% if page.author_profile or layout.author_profile or page.sidebar %}
<div class="sidebar sticky">
{% if page.author_profile or layout.author_profile %}{% include author-profile.html %}{% endif %}
{% if page.sidebar %}
{% for s in page.sidebar %}
{% if author_profile or layout.author_profile or site.defaults.posts.author_profile or site.defaults.pages.author_profile or sidebar or site.defaults.posts.sidebar %}
{% assign sidebar = sidebar | default: site.defaults.posts.sidebar | default: false %}
<div class="sidebar sticky">
{% if page.author_profile or layout.author_profile or site.defaults.posts.author_profile or site.defaults.pages.author_profile %}{% include author-profile.html %}{% endif %}
{% if sidebar %}
{% for s in sidebar %}
{% if s.image %}
<img src="{{ s.image | relative_url }}"
alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}">
@ -11,8 +14,8 @@
{% if s.text %}{{ s.text | markdownify }}{% endif %}
{% if s.nav %}{% include nav_list nav=s.nav %}{% endif %}
{% endfor %}
{% if page.sidebar.nav %}
{% include nav_list nav=page.sidebar.nav %}
{% if sidebar.nav %}
{% include nav_list nav=sidebar.nav %}
{% endif %}
{% endif %}
</div>

4
src/_posts/_posts.json Normal file
View File

@ -0,0 +1,4 @@
{
"layout": "single",
"permalink": "/{{ page.date | date: 'Y/M/D' }}/{{ page.fileSlug }}/"
}

View File

@ -0,0 +1,10 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"editor.formatOnSave": false
}
}