Start loading posts from Wordpress

This commit is contained in:
Lewis Dale 2023-02-16 08:34:36 +00:00
parent 2430b9f3eb
commit 09ac787260
2 changed files with 13 additions and 9 deletions

View File

@ -1,7 +1,5 @@
const wordpressPassword = process.env.WORDPRESS_PASSWORD;
module.exports = async () => {
const response = await fetch("https://lewisdale.dev/wp-json/wp/v2/posts?per_page=100", {
headers: {
@ -9,9 +7,8 @@ module.exports = async () => {
}
});
const responses = await response.json();
const posts = await response.json();
console.log(JSON.stringify(responses[0], null, 2));
return responses;
console.log(posts.map(post => Buffer.from(post.title.rendered).toString("utf-8")));
return posts;
};

View File

@ -1,4 +1,11 @@
article img {
margin-inline-start: auto;
margin-inline-end: auto;
article {
img {
margin-inline-start: auto;
margin-inline-end: auto;
}
ul, ol {
list-style: initial;
padding: 0 var(--space-size-m);
}
}