Start loading posts from Wordpress
This commit is contained in:
parent
2430b9f3eb
commit
09ac787260
@ -1,7 +1,5 @@
|
|||||||
const wordpressPassword = process.env.WORDPRESS_PASSWORD;
|
const wordpressPassword = process.env.WORDPRESS_PASSWORD;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
const response = await fetch("https://lewisdale.dev/wp-json/wp/v2/posts?per_page=100", {
|
const response = await fetch("https://lewisdale.dev/wp-json/wp/v2/posts?per_page=100", {
|
||||||
headers: {
|
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));
|
console.log(posts.map(post => Buffer.from(post.title.rendered).toString("utf-8")));
|
||||||
|
return posts;
|
||||||
return responses;
|
|
||||||
};
|
};
|
@ -1,4 +1,11 @@
|
|||||||
article img {
|
article {
|
||||||
margin-inline-start: auto;
|
img {
|
||||||
margin-inline-end: auto;
|
margin-inline-start: auto;
|
||||||
|
margin-inline-end: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul, ol {
|
||||||
|
list-style: initial;
|
||||||
|
padding: 0 var(--space-size-m);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user