Compare commits
17 Commits
1e23aa628c
...
main
Author | SHA1 | Date | |
---|---|---|---|
6f1c4dd841
|
|||
b7f6def94d
|
|||
df332d5b2b
|
|||
19f785af09
|
|||
e98ab33314
|
|||
04a9b99d05
|
|||
45fcc085ad
|
|||
06e57e6c93
|
|||
f457a7f8d2
|
|||
49a806203f
|
|||
6be49f3d75
|
|||
d656a40e82
|
|||
12273058f6
|
|||
0853782914
|
|||
2592e84d07
|
|||
c023d0e7e4
|
|||
1289031973
|
22
.drone.yml
Normal file
22
.drone.yml
Normal file
@ -0,0 +1,22 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: denoland/deno
|
||||
commands:
|
||||
- deno task build
|
||||
- name: publish
|
||||
image: walkah.dev/walkah/drone-ipfs-cluster
|
||||
settings:
|
||||
path: /drone/src/_site
|
||||
domain: walkah.blog
|
||||
cluster_host: /ip4/100.95.167.126/tcp/9094
|
||||
cluster_user: walkah
|
||||
cluster_password:
|
||||
from_secret: IPFS_CLUSTER_PASSWORD
|
||||
cluster_args: -f
|
||||
cf_email: walkah@walkah.net
|
||||
cf_apikey:
|
||||
from_secret: CLOUDFLARE_APIKEY
|
46
.eleventy.js
46
.eleventy.js
@ -1,46 +0,0 @@
|
||||
require("dotenv").config();
|
||||
|
||||
const GhostContentAPI = require("@tryghost/content-api");
|
||||
const pluginNavigation = require("@11ty/eleventy-navigation");
|
||||
const pluginRss = require("@11ty/eleventy-plugin-rss");
|
||||
|
||||
const api = new GhostContentAPI({
|
||||
url: process.env.GHOST_API_URL,
|
||||
key: process.env.GHOST_CONTENT_API_KEY,
|
||||
version: "v3.0"
|
||||
});
|
||||
|
||||
const stripDomain = url => {
|
||||
return url.replace(process.env.GHOST_API_URL, "");
|
||||
};
|
||||
|
||||
module.exports = function(eleventyConfig) {
|
||||
eleventyConfig.addPlugin(pluginNavigation);
|
||||
eleventyConfig.addPlugin(pluginRss);
|
||||
|
||||
eleventyConfig.addPassthroughCopy("css");
|
||||
|
||||
eleventyConfig.addCollection("posts", async function (collection) {
|
||||
collection = await api.posts
|
||||
.browse({
|
||||
include: "tags,authors",
|
||||
limit: "all",
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
collection.forEach((post) => {
|
||||
post.url = stripDomain(post.url);
|
||||
post.primary_author.url = stripDomain(post.primary_author.url);
|
||||
|
||||
// Convert publish date into a Date object
|
||||
post.date = new Date(post.published_at);
|
||||
});
|
||||
|
||||
// Bring featured post to the top of the list
|
||||
collection.sort((post, nextPost) => nextPost.featured - post.featured);
|
||||
|
||||
return collection;
|
||||
});
|
||||
}
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
_site
|
||||
_cache
|
||||
.DS_Store
|
||||
/node_modules
|
||||
/_site
|
||||
/.env
|
||||
/.direnv
|
23
_cms.ts
Normal file
23
_cms.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import lumeCMS from "lume/cms/mod.ts";
|
||||
|
||||
const cms = lumeCMS();
|
||||
|
||||
cms.collection(
|
||||
"posts: Blog posts",
|
||||
"src:posts/*.md",
|
||||
[
|
||||
"title: text",
|
||||
"date: datetime",
|
||||
"image: file",
|
||||
"image_alt: text",
|
||||
"image_caption: text",
|
||||
{
|
||||
name: "content",
|
||||
type: "markdown",
|
||||
label: "Content",
|
||||
},
|
||||
],
|
||||
);
|
||||
cms.upload("images", "src:images");
|
||||
|
||||
export default cms;
|
39
_config.ts
Normal file
39
_config.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import lume from "lume/mod.ts";
|
||||
import date from "lume/plugins/date.ts";
|
||||
import feed from "lume/plugins/feed.ts";
|
||||
import metas from "lume/plugins/metas.ts";
|
||||
import nunjucks from "lume/plugins/nunjucks.ts";
|
||||
import postcss from "lume/plugins/postcss.ts";
|
||||
import relativeUrls from "lume/plugins/relative_urls.ts";
|
||||
import tailwindcss from "lume/plugins/tailwindcss.ts";
|
||||
import terser from "lume/plugins/terser.ts";
|
||||
|
||||
import tailwindConfig from "./tailwind.config.js";
|
||||
|
||||
const site = lume();
|
||||
|
||||
site.copy("images");
|
||||
|
||||
site.use(date());
|
||||
site.use(feed({
|
||||
output: ["/feed.rss", "/feed.json"],
|
||||
info: {
|
||||
title: "=site.title",
|
||||
description: "=site.description",
|
||||
},
|
||||
items: {
|
||||
title: "=title",
|
||||
description: "=excerpt",
|
||||
},
|
||||
query: "type=post",
|
||||
}));
|
||||
site.use(metas());
|
||||
site.use(nunjucks());
|
||||
site.use(tailwindcss({
|
||||
options: tailwindConfig,
|
||||
}));
|
||||
site.use(postcss());
|
||||
site.use(relativeUrls());
|
||||
site.use(terser());
|
||||
|
||||
export default site;
|
6
_data.yml
Normal file
6
_data.yml
Normal file
@ -0,0 +1,6 @@
|
||||
metas:
|
||||
site: walkah.blog
|
||||
description: James Walker has a blog
|
||||
title: "=title"
|
||||
image: "=image"
|
||||
lang: en
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"title": "walkah",
|
||||
"url": "https://walkah.blog/",
|
||||
"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/"
|
||||
}
|
||||
}
|
@ -1,18 +1,25 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="{{ it.lang }}">
|
||||
<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 }}">
|
||||
<title>{{ title or metas.site }} - James Walker</title>
|
||||
<meta name="description" content="{{ description or metas.description }}">
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<link rel="alternate" href="https://walkah.blog/feed.rss" type="application/rss+xml">
|
||||
<link rel="alternate" href="https://walkah.blog/feed.json" type="application/json">
|
||||
</head>
|
||||
<body class="bg-white text-gray-900 dark:bg-gray-900 dark:text-gray-100">
|
||||
<div class="container max-w-2xl mb-24 mt-8 mx-auto">
|
||||
<div class="px-5 md:px-8">
|
||||
<main id="main">
|
||||
<header class="flex flex-row not-prose my-8">
|
||||
<div rel="author" class="p-author h-card basis-1/2">
|
||||
<a href="/">
|
||||
<img class="u-photo w-8 inline-block" src="/images/walkah-avatar.png"> walkah
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<main id="main" class="prose lg:prose-lg dark:prose-invert">
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</main>
|
||||
|
@ -1,25 +1,29 @@
|
||||
{% extends 'layouts/default.njk' %}
|
||||
|
||||
{% set title = post.title %}
|
||||
{% set codeinjection_head = post.codeinjection_head %}
|
||||
{% set codeinjection_foot = post.codeinjection_foot %}
|
||||
|
||||
{% block content %}
|
||||
<article class="h-entry prose lg:prose-lg dark:prose-invert" role="article">
|
||||
<header>
|
||||
<h1 class="p-name">{{ title }}</h1>
|
||||
<time class="dt-published" datetime={{ post.published_at }} pubdate><a class="u-url text-gray-500 text-sm" href={{ post.url }}>{{ post.published_at }}</a></time>
|
||||
</header>
|
||||
{% if post.feature_image %}
|
||||
<figure class="md:-mx-12">
|
||||
<img class="u-featured rounded-md shadow-md w-full" src="{{ post.feature_image }}" alt="{{ title }}">
|
||||
</figure>
|
||||
{% endif %}
|
||||
<section class="e-content load-external-scripts">
|
||||
{{ content | safe}}
|
||||
</section>
|
||||
<footer class="flex flex-row not-prose">
|
||||
|
||||
</footer>
|
||||
</article>
|
||||
<article class="h-entry prose lg:prose-lg dark:prose-invert" role="article">
|
||||
<header>
|
||||
<h1 class="p-name">{{ title }}</h1>
|
||||
</header>
|
||||
{% if image %}
|
||||
<figure class="md:-mx-12">
|
||||
<img class="u-featured rounded-md shadow-md w-full" src="{{ image }}" alt="{{ image_alt }}">
|
||||
{% if image_caption %}
|
||||
<figcaption>
|
||||
<cite>{{ image_caption }}</cite>
|
||||
</figcaption>
|
||||
{% endif %}
|
||||
</figure>
|
||||
{% endif %}
|
||||
<section class="e-content" load-external-scripts>
|
||||
{{ content | safe }}
|
||||
</section>
|
||||
<footer class="flex flex-row not-prose">
|
||||
<div class="basis-1/2">
|
||||
<time class="dt-published" datetime="{{ date | date('ATOM') }}" pubdate>
|
||||
<a class="u-url text-gray-500 text-sm" href="{{ post.url }}">{{ date | date }}</a>
|
||||
</time>
|
||||
</div>
|
||||
</footer>
|
||||
</article>
|
||||
{% endblock %}
|
16
deno.json
Normal file
16
deno.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"imports": {
|
||||
"lume/": "https://deno.land/x/lume@v2.2.0/",
|
||||
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/cms@0.4.1/"
|
||||
},
|
||||
"tasks": {
|
||||
"lume": "echo \"import 'lume/cli.ts'\" | deno run -A -",
|
||||
"build": "deno task lume",
|
||||
"serve": "LUME_DRAFTS=true deno task lume -s"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"types": [
|
||||
"lume/types.ts"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
version: "3"
|
||||
services:
|
||||
ghost:
|
||||
image: ghost:4-alpine
|
||||
ports:
|
||||
- 2368:2368
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ghost:/var/lib/ghost/content
|
||||
volumes:
|
||||
ghost:
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
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.title }}</title>
|
||||
<link href="{{ absolutePostUrl }}"/>
|
||||
<updated>{{ post.date | rssDate }}</updated>
|
||||
<id>{{ absolutePostUrl }}</id>
|
||||
<content type="html">{{ post.html | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
|
||||
</entry>
|
||||
{%- endfor %}
|
||||
</feed>
|
@ -1,30 +0,0 @@
|
||||
---
|
||||
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.title }}",
|
||||
"content_html": {% if post.html %}{{ post.html | dump | safe }}{% else %}""{% endif %},
|
||||
"date_published": "{{ post.date | rssDate }}"
|
||||
}
|
||||
{%- if not loop.last -%}
|
||||
,
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
]
|
||||
}
|
78
flake.lock
generated
Normal file
78
flake.lock
generated
Normal file
@ -0,0 +1,78 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1718089647,
|
||||
"narHash": "sha256-COO4Xk2EzlZ3x9KCiJildlAA6cYDSPlnY8ms7pKl2Iw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f7207adcc68d9cafa29e3cd252a18743ae512c6a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
26
flake.nix
Normal file
26
flake.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
description = "walkah's blog";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
flake-compat = {
|
||||
url = "github:edolstra/flake-compat";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, flake-utils, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
name = "blog";
|
||||
buildInputs = with pkgs; [ deno ];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
}
|
BIN
images/walkah-avatar.png
Normal file
BIN
images/walkah-avatar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 266 KiB |
10
index.njk
10
index.njk
@ -6,9 +6,8 @@ pagination:
|
||||
---
|
||||
{% extends 'layouts/default.njk' %}
|
||||
{% block content %}
|
||||
{% set postslist = collections.posts %}
|
||||
|
||||
<section class="h-feed prose">
|
||||
{% set postslist = search.pages("type=post") %}
|
||||
<section class="h-feed">
|
||||
{% for post in postslist %}
|
||||
<article class="h-entry">
|
||||
<h2 class="p-name">
|
||||
@ -17,7 +16,10 @@ pagination:
|
||||
<div class="e-content">
|
||||
{{ post.excerpt | safe }}
|
||||
</div>
|
||||
<time class="dt-published" datetime={{ post.date | date }} pubdate>
|
||||
<a class="u-url text-gray-500 text-sm" href={{ post.url }}>{{ post.date | date }}</a>
|
||||
</time>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</section>
|
||||
</section>
|
||||
{% endblock %}
|
8576
package-lock.json
generated
8576
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "walkah.blog",
|
||||
"version": "1.0.0",
|
||||
"description": "The new blog. Just like the old blog.",
|
||||
"scripts": {
|
||||
"build": "run-s clean prod css:prod",
|
||||
"clean": "rimraf ./_site",
|
||||
"css:prod": "tailwindcss -i ./css/style.css -o ./_site/css/style.css --minify",
|
||||
"css:dev": "tailwindcss -i ./css/style.css -o ./_site/css/style.css --watch",
|
||||
"dev": "eleventy --serve --watch",
|
||||
"prod": "eleventy",
|
||||
"start": "run-p clean css:dev dev"
|
||||
},
|
||||
"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",
|
||||
"@tailwindcss/typography": "^0.5.2",
|
||||
"@tryghost/content-api": "^1.9.4",
|
||||
"dotenv": "^16.0.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"rimraf": "^3.0.2",
|
||||
"tailwindcss": "^3.0.24"
|
||||
}
|
||||
}
|
5
posts/_data.yml
Normal file
5
posts/_data.yml
Normal file
@ -0,0 +1,5 @@
|
||||
layout: layouts/post.njk
|
||||
type: post
|
||||
|
||||
metas:
|
||||
title: "=title"
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
pagination:
|
||||
data: collections.posts
|
||||
size: 1
|
||||
alias: post
|
||||
addAllPagesToCollections: true
|
||||
layout: 'layouts/post.njk'
|
||||
permalink: '{{ post.url }}'
|
||||
---
|
||||
|
||||
{{ post.html | safe if post.html else "Post content not found" }}
|
@ -1,11 +1,11 @@
|
||||
module.exports = {
|
||||
import typography from "npm:@tailwindcss/typography";
|
||||
|
||||
export default {
|
||||
mode: "jit",
|
||||
darkMode: "media",
|
||||
content: ["./**/*.{html,md,njk}"],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [
|
||||
require('@tailwindcss/typography'),
|
||||
],
|
||||
}
|
||||
plugins: [typography],
|
||||
};
|
||||
|
Reference in New Issue
Block a user