banner image

Halden's Internship Week 10

August 5, 2024 by Halden Kavanagh

internship

Week 10 (7/29/24-8/2/24)

Week ten included a lot of small advancements as well as refinement to the component system, author system, and blog system. I started this week off by adding in the rest of the author data. This included images, LinkedIn profiles, and descriptions. All authors are now on the website, and author pages are structurally good to go —- just some styling is needed.

On Tuesday, I had a meeting with Emily Norniella, the director of the Heidt of Media marketing group. We discussed some changes to components, and the overall direction of the site —- mainly the concept for a new component. It’s sort of a multipurpose component, including a CTA and a list where the user can select parameters to adjust how the list populates. For example, on the industries/fashion page, you may want links to any relevant blog posts, case studies, etc…

In concept, this logic is fairly straightforward to achieve in a partial. I will get all posts, case studies, and industry pages, and filter them by a specific key. For user experience, I will probably call this, ‘global-category’ or something comparable. The problem arose when I went to implement this logic into a bookshop component. For simplicity, I started by just creating a partial which would return the number of pages on the site. This partial worked as expected when I manually included it in a layout. However, when I attempted to call it from a bookshop component, all context was returned as null. When I modified the partial to return all context, the one I manually added returned all site data, while the one I called from the component only had the bookshop component name available as context.

I am still investigating exactly what is going on here and looking into alternate ways of passing site data into the components. I think there are certain limitations in Hugo regarding access to data, and I need to find a way to give access or work around it.

Other than that, I had a breakthrough in post organization! Previously, I was using a script to find all post files, extracting their data from front matter and organizing them accordingly. This isn’t ideal since it requires a developer to manually run the script to organize them. I added some custom configurations to the CloudCannon config file so that all posts are organized when they are created. Now, no script is required to get the posts in nice folders.

Screenshot of authors
Screenshot of post organization

Subscribe to our newsletter for regular community updates, case studies, and more.