JS230 Side Project: Website Redesign
Using what I learned in Launch School’s JS230 course to redesign my website
This article was originally published at my personal website, wayneo.co.
For years I had been using the publishing platform Ghost to power some version of a blog and personal website. However, I had never been in a position to customize it to any meaningful extent; I simply picked a theme and then stumbled my way through making basic CSS edits via Ghost’s ‘code injection’ feature. This feature gives you a setting (by way of a text box) that allows you to override your theme’s CSS by ‘injecting’ your custom edits into your website’s
Designing a Custom Theme
Well, to say that I designed a theme from scratch isn’t entirely true. I used a bare bones starter template, Undefined, which provides the essential structure of a theme for developers but without any styling. Think of it like plain HTML documents that give you just enough markup to get a minimal website up and running. The difference is that these are
.hbs (Handlebars) files that allow you to write Handlebars template expressions inside what would otherwise be plain HTML documents.
Now that I had experience with Handlebars I was able to make sense of both the structure and functionality of templates in Ghost, in addition to implementing the more sophisticated CSS I had been learning. In particular I was able to understand how partial templates work, create my own templates, and use and create helpers to add functionality to the design. These are all critical elements for piecing together a well-structured, highly functional Ghost theme.
And three to four days later I had created more or less the design you see now.
Switching to Gatsby, Learning React and GraphQL, and Just in Time Learning
It turned out that redesigning the Ghost frontend was rather painless. Launch School’s coursework is both rigorous and thorough, and I had recently been doing a lot of frontend work as part of JS230, so I was well prepared to tackle designing Handlebars-based templates. I won’t say it was too easy, but it was easy enough that I wanted to push myself a bit further with the redesign.
So what could I do?
Out of the box, Ghost gives you both the backend CMS and the frontend design, just as other CMSs like Wordpress. But it also has a solid API that enables you to decouple the CMS and use a different framework for the frontend (using the CMS as what is often called a headless CMS). In other words, you could host an independent frontend and then source content from your Ghost installation to that frontend via the Ghost API, limiting use of Ghost purely to content management.
There are lots of ways to run a headless CMS. Years ago I had come across Gatsby, and while it was intriguing because of all of the benefits that come with JAMstack architecture and static site generators, at the time I just didn’t know enough to build a frontend using it. That intrigue was reignited earlier this year after watching a presentation about Gatsby from a Launch School alumnus who’s an engineer at Gatsby. It also turned out that Gatsby has hired a lot of Launch School graduates over the years, so I thought it would be an interesting project to learn Gatsby and see if I could implement it as the frontend of a headless Ghost installation.
To make it a little easier, Ghost has a Gatsby starter template that I used as a starting point. However, as you can see in the demo, the starter template is quite different from the design you see now.
In order to reimplement my design using Gatsby I had to learn React and GraphQL, neither of which I had any previous experience with. But that’s the beauty of Launch School: you don’t just learn languages and syntax; you learn how to learn. Because of Launch School’s pedagogical approach, which focuses on mastery of fundamental concepts in software engineering as well as how to learn those concepts, it unlocks a skill called ‘Just in time’ (JIT) learning, which enables one to learn a new language to a productive level in a very short period of time.
Of course, that doesn’t mean I became an expert in React and GraphQL overnight, nor is that the intent of JIT learning. What it did though was enable me to learn enough React and GraphQL to, in a relatively short period of time, redesign my website with a Gatsby frontend. Using the starter template as a guide, along with a combination of Gatsby, React and GraphQL documentation, this process took about a week and a half.
Nothing earth-shattering, but it demonstrates on a practical level some of what I’ve learned in JS230. The key thing is that I went from knowing essentially nothing about frontend design to having full control over my website using rather sophisticated technologies.
For now I’ll leave my website as is, as I need to start preparing for the JS239 assessments — one written and one project-based. However, at some point I’d like to add some additional features such as:
- Dark mode
- Algolia powered search
- A ‘Projects’ directory
Of course, that last item assumes I have projects to showcase. I’ll spend this fall engaged in Capstone prep work, and I plan to include some projects as part of that work to display here.
Thanks for reading, and if you have any feedback or questions about the new design, don’t hesitate to leave a comment below or drop me a note here.
- I’ll be entering the Winter ’23 Capstone cohort, which starts in January.