Blogging about a blog

JavaScript file with the blog data.

Step 1: Create a file for your blog data. You can call it posts.js.

.js means the file will be JavaScript.

Step 2: You will want to create a variable (I don’t think I explained this content previously, so here is a link because I’m lazy)to store your blog data; this variable will contain multiple posts.

Examples of these are:
title: What you want to call your post
date: Whatever day you posted the blog
tags: If you are an Instagram addict you know what this is for

Step 3: You will need to copy your index.html file then rename it blog.html

Step 4: For both your index.html and blog.html you should add a link the blog page, as the first drop down item (line 34 ↑). You should also use _self as the target because you don’t want pages from your site to open in a new tab.

Step 5: You can now include the post’s data in your blog.html file. You do this using a <script> tag. This is similar to when you wrote JavaScript for the drop down. This time you need to reference the external file instead, (line 18).

Step 6: This step is more complicated than other tasks you have had to do before. Basically, for each blog post from the data, create a content row, then add the blog content (title, date etc.) After that add the row to the #content <div> on the page. Also, make sure you remove the stuff inside of <div id=”content”> that was copied when you made the file (lines 53 and 54).

Now, everyone can see how cool blogs and sushi are.
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.