Posted In: Reflections
This week, our focus was metadata and we learned about how this code, inserted before the body of the article, can be important in implementing different tools for our blogs. The example we did in class was adding a list of categories for our blog post and then linking that list to our new menu.
Lots of different code went into creating this. First, we added metadata to each of our posts. This didn’t only assign the post a category, but it also assigned other information, including title, author name, and URL.
Once that was done, we added code to our layout default file. We told the website to start each page (only if it was for a blog post) with “Posted In:” followed by the categories assigned to that specific post.
Finally, we created a new file containing a list of each blog post ordered by the categories assigned to it. This file was attached to our menu, now containing three items (Home, About and Categories).
While creating these categories and their associated code, I was most reminded of creating these categories for my own blog itself. Because I used a pre-made platform (wordpress), I didn’t have to actually write any HTML myself. But the process of assigning categories and placing them on my menu was similar.
While writing each post (or editing it later), you can assign new or existing categories to it. Now that I have a substantial amount of blog posts on my website, I have started assigning each post two categories: a parent and a sub.
My menu, located along the top of each page, consists of only the parent categories at first. But if you hover over each one, it will reveal the subcategories of that particular parent. If you choose to click the parent category, a list of all blog posts in that category (of every subcategory) will appear. But if you choose to click the subcategory itself, you will only see a list of blog posts in that subcategory.
The process of implementing these into my menu was also similar. Instead of having a file with code for “navigation,” which in our case is a menu, I have a tool that allows me to create a menu myself. I have the option to add any specific posts, portfolios, links, or categories to that menu.
In my case, I have chosen to add seven parent items to my menu. My Home link sends you back to my home page, with a snippet about me and links to different parts of my site. My Start Here link explains how my site works and offers different suggested links. My about link is just like on our Jekyll blog; it contains a blog post of information about myself along with images.
Then I have three categories of blog posts, each link sending you to the corresponding list of posts. Finally, I have a contact link that sends you to a page describing different social media platforms I am on and how to contact me.