🎉 new blog
This commit is contained in:
commit
6d1028fd03
9
.eleventy.js
Normal file
9
.eleventy.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
const pluginNavigation = require("@11ty/eleventy-navigation");
|
||||||
|
const pluginRss = require("@11ty/eleventy-plugin-rss");
|
||||||
|
|
||||||
|
module.exports = function(eleventyConfig) {
|
||||||
|
eleventyConfig.addPlugin(pluginNavigation);
|
||||||
|
eleventyConfig.addPlugin(pluginRss);
|
||||||
|
|
||||||
|
eleventyConfig.addPassthroughCopy("css");
|
||||||
|
}
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/node_modules
|
||||||
|
/_site
|
19
_data/metadata.json
Normal file
19
_data/metadata.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"title": "walkah",
|
||||||
|
"url": "https://walkah.net/",
|
||||||
|
"description": "It's a new blog, just like the old blog.",
|
||||||
|
"feed": {
|
||||||
|
"filename": "feed.xml",
|
||||||
|
"path": "/feed.xml",
|
||||||
|
"id": "https://walkah.blog/"
|
||||||
|
},
|
||||||
|
"jsonfeed": {
|
||||||
|
"path": "/feed.json",
|
||||||
|
"url": "https://walkah.blog/feed.json"
|
||||||
|
},
|
||||||
|
"author": {
|
||||||
|
"name": "James Walker",
|
||||||
|
"email": "walkah@walkah.net",
|
||||||
|
"url": "https://walkah.net/"
|
||||||
|
}
|
||||||
|
}
|
34
_includes/layouts/base.njk
Normal file
34
_includes/layouts/base.njk
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>{{ title or metadata.title }}</title>
|
||||||
|
<meta name="description" content="{{ description or metadata.description }}">
|
||||||
|
<link rel="stylesheet" href="{{ '/css/style.css' | url }}">
|
||||||
|
<link rel="alternate" href="{{ metadata.feed.path | url }}" type="application/atom+xml" title="{{ metadata.title }}">
|
||||||
|
<link rel="alternate" href="{{ metadata.jsonfeed.path | url }}" type="application/json" title="{{ metadata.title }}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1 class="home"><a href="{{ '/' | url }}">{{ metadata.title }}</a></h1>
|
||||||
|
<nav>
|
||||||
|
<ul class="nav">
|
||||||
|
{%- for entry in collections.all | eleventyNavigation %}
|
||||||
|
<li class="nav-item{% if entry.url == page.url %} nav-item-active{% endif %}">
|
||||||
|
<a href="{{ entry.url | url }}">{{ entry.title }}</a>
|
||||||
|
</li>
|
||||||
|
{%- endfor %}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
{{ content | safe }}
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
©
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
32
css/style.css
Normal file
32
css/style.css
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
:root {
|
||||||
|
--white: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
color: var(--darkgray);
|
||||||
|
background-color: var(--white);
|
||||||
|
}
|
||||||
|
|
||||||
|
body>header,
|
||||||
|
body>main,
|
||||||
|
body>footer {
|
||||||
|
padding: 1rem;
|
||||||
|
margin: auto;
|
||||||
|
max-width: 1024px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2 {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
28
feed/feed.njk
Normal file
28
feed/feed.njk
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
permalink: "{{ metadata.feed.path | url }}"
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
|
---
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||||
|
<title>{{ metadata.title }}</title>
|
||||||
|
<subtitle>{{ metadata.feed.subtitle }}</subtitle>
|
||||||
|
{% set absoluteUrl %}{{ metadata.feed.path | url | absoluteUrl(metadata.url) }}{% endset %}
|
||||||
|
<link href="{{ absoluteUrl }}" rel="self"/>
|
||||||
|
<link href="{{ metadata.url }}"/>
|
||||||
|
<updated>{{ collections.posts | rssLastUpdatedDate }}</updated>
|
||||||
|
<id>{{ metadata.feed.id }}</id>
|
||||||
|
<author>
|
||||||
|
<name>{{ metadata.author.name }}</name>
|
||||||
|
<email>{{ metadata.author.email }}</email>
|
||||||
|
</author>
|
||||||
|
{%- for post in collections.posts | reverse %}
|
||||||
|
{% set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset %}
|
||||||
|
<entry>
|
||||||
|
<title>{{ post.data.title }}</title>
|
||||||
|
<link href="{{ absolutePostUrl }}"/>
|
||||||
|
<updated>{{ post.date | rssDate }}</updated>
|
||||||
|
<id>{{ absolutePostUrl }}</id>
|
||||||
|
<content type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
|
||||||
|
</entry>
|
||||||
|
{%- endfor %}
|
||||||
|
</feed>
|
30
feed/json.njk
Normal file
30
feed/json.njk
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
permalink: "{{ metadata.jsonfeed.path | url }}"
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
|
---
|
||||||
|
{
|
||||||
|
"version": "https://jsonfeed.org/version/1",
|
||||||
|
"title": "{{ metadata.title }}",
|
||||||
|
"home_page_url": "{{ metadata.url }}",
|
||||||
|
"feed_url": "{{ metadata.jsonfeed.url }}",
|
||||||
|
"description": "{{ metadata.description }}",
|
||||||
|
"author": {
|
||||||
|
"name": "{{ metadata.author.name }}",
|
||||||
|
"url": "{{ metadata.author.url }}"
|
||||||
|
},
|
||||||
|
"items": [
|
||||||
|
{%- for post in collections.posts | reverse %}
|
||||||
|
{%- set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset -%}
|
||||||
|
{
|
||||||
|
"id": "{{ absolutePostUrl }}",
|
||||||
|
"url": "{{ absolutePostUrl }}",
|
||||||
|
"title": "{{ post.data.title }}",
|
||||||
|
"content_html": {% if post.templateContent %}{{ post.templateContent | dump | safe }}{% else %}""{% endif %},
|
||||||
|
"date_published": "{{ post.date | rssDate }}"
|
||||||
|
}
|
||||||
|
{%- if not loop.last -%}
|
||||||
|
,
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor %}
|
||||||
|
]
|
||||||
|
}
|
16
index.njk
Normal file
16
index.njk
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
layout: layouts/base.njk
|
||||||
|
---
|
||||||
|
|
||||||
|
{% set postslist = collections.posts %}
|
||||||
|
|
||||||
|
{% for post in postslist | reverse %}
|
||||||
|
<article class="h-entry">
|
||||||
|
<h2 class="p-name">
|
||||||
|
<a href="{{ post.url }}">{{ post.data.title }}</a>
|
||||||
|
</h2>
|
||||||
|
<div class="e-content">
|
||||||
|
{{ post.templateContent | safe }}
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
{% endfor %}
|
6440
package-lock.json
generated
Normal file
6440
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
20
package.json
Normal file
20
package.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "walkah.blog",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "The new blog. Just like the old blog.",
|
||||||
|
"scripts": {
|
||||||
|
"build": "eleventy",
|
||||||
|
"start": "eleventy --serve --watch"
|
||||||
|
},
|
||||||
|
"author": {
|
||||||
|
"name": "James Walker",
|
||||||
|
"email": "walkah@walkah.net",
|
||||||
|
"url": "https://walkah.net/"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"@11ty/eleventy": "^1.0.1",
|
||||||
|
"@11ty/eleventy-navigation": "^0.3.3",
|
||||||
|
"@11ty/eleventy-plugin-rss": "^1.0.9"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user