From 09ac7872602c85930a00e4034fb773a01227562a Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Thu, 16 Feb 2023 08:34:36 +0000 Subject: [PATCH] Start loading posts from Wordpress --- src/_data/posts.js | 9 +++------ src/css/exceptions/article.css | 13 ++++++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/_data/posts.js b/src/_data/posts.js index 25037a5..3eef4a8 100644 --- a/src/_data/posts.js +++ b/src/_data/posts.js @@ -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; }; \ No newline at end of file diff --git a/src/css/exceptions/article.css b/src/css/exceptions/article.css index 01e709e..5228f02 100644 --- a/src/css/exceptions/article.css +++ b/src/css/exceptions/article.css @@ -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); + } } \ No newline at end of file