Skip to content

Instantly share code, notes, and snippets.

View kloh-fr's full-sized avatar
🦄

Luc Poupard kloh-fr

🦄
View GitHub Profile
@kloh-fr
kloh-fr / wordpress.js
Created December 21, 2020 18:59
Convert WordPress posts to 11ty (from json export)
/**
* Convert WordPress posts to 11ty from json export
* https://heydonworks.com/article/wordpress-to-eleventy/
*/
const transformAndWriteToFile = require("json-to-frontmatter-markdown").default;
const wordpressData = require(__dirname + "/wordpress.json");
const posts = wordpressData.posts;
Object.keys(posts).forEach((p, i) => {
let post = posts[p];
@kloh-fr
kloh-fr / wordpress-posts-via-api.html
Last active December 21, 2020 18:59
Get WordPress posts via API
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Get WordPress posts via API</title>
</head>
<body>
<pre id="state">Loading posts…</pre>
@kloh-fr
kloh-fr / update.json
Last active September 7, 2022 03:07
Update notifier function for a custom WordPress Theme
{
"new_version":"1.0.0",
"url":"http://www.domain.com/theme-name/changelog",
"package":"http://www.domain.com/theme-name/themes.zip"
}