1 Create a list of posts
For now, we are going to store our blog posts in an object.
The keys will be used as the unique identifier of each blog post.
Each nested object will have 3 keys:
- a title
- an excerpt
- a block of content which can contain HTML
// Create a list of blog posts formatted
// in a way that's usable in our templates
var blogPosts = {
"my-first-webpage": {
"title": "My first webpage",
"excerpt": "I've taken a course at Code at Uni and created my own personal website with HTML and CSS.",
"content": "\
<p>My first paragraph as well!</p>\
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vehicula ante nec neque lobortis, fringilla convallis elit dignissim.</p>\
"
},
"hello-world": {
"title": "Hello World",
"excerpt": "This is the start of my online journal. I will take about my journey in learning how to code!",
"content": "\
<p>Hello World this is a paragraph.</p>\
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vehicula ante nec neque lobortis, fringilla convallis elit dignissim.</p>\
"
},
};