This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"new_version":"1.0.0", | |
"url":"http://www.domain.com/theme-name/changelog", | |
"package":"http://www.domain.com/theme-name/themes.zip" | |
} |