Module 1 - Introduction
1. Welcome to the course2. Why Go3. Why start and build a blog?4. What about React/Vue/Angular?5. Getting setup and source filesModule 2 - Tech Stack Walkthrough
1. Introduction to Golang Part 12. Introduction to Golang Part 23. Introduction to Golang Part 34. Structuring Golang Applications5. Templating with Templ6. Just enough interactivity with HTMX7. Getting started with postgres8. Servers, routers and endpointsModule 3 - Creating the MVP
1. What are the minimal requirements?2. Doing some initial plumbing3. Embedding static assets4. Creating our first views5. Tailwind & Utility-first CSS6. Styling the Landing Page7. Styling the Article PageModule 4 - Managing Content
1. Choose your own adventure2. Writing in Markdown3. Parsing Markdown to HTML4. Frontmatter and Meta Information5. Making our code examples look nice6. Adding error pagesModule 5 - Adding the Database
1. What is a Migration?2. Our first migration: articles table3. Creating the Database Layer4. Showing the Latest Posts5. Slugs and Human Readable URLsModule 6 - Managing the Blog
1. What are the minimum requirements?2. A new layout approaches3. Creating a rough outline4. Our second migration: Users Table5. Introduction to authentication6. Storing passwords securely7. Authenticating users8. Remember me9. Managing posts using a hypermedia API10. Our third migration: Altering Posts Table11. Only show posts marked readyModule 7 - Adding Subscribers
1. What are the minimum requirements?2. Our fourth migration: Subscribers Table3. Creating the subscription form4. Adding some interactivity with HTMX5. Saving new subscribers in the database6. Verifying subscriber emails7. Our fifth migration: Tokens Table8. Email validation view9. Email validation tokens10. Sending validation emails with SES11. Making it all come togetherManaging Content
Making our code examples look nice
Summary
In this video, I demonstrate how to add syntax highlighting to a blog using the Goldmark highlighting package, which relies on Chroma - a pure Go syntax highlighter. I show how Chroma supports numerous programming languages out of the box and offers various style options through its style gallery. I walk through the installation process, configuring the highlighting options with features like line numbers, and demonstrate the result using different programming languages (Go, Rust, and JavaScript) and themes like Groovebox and Nord. I conclude by mentioning that in the next video, we'll add error pages before the blog is ready for deployment.
Transcript
Adding syntax highlighting is really straightforward. We basically just need to get this goldmark highlighting package that you see right here And this package relies on another Go package called Chroma If you go in here, you can see Chroma is a general-purpose syntax highlighter in pure Go And it has support for all of these languages. So whatever you want to write in if it's Erlang, PHP, Rust, Kotlin Java, you know, SIG, you can do it So all of these languages are supported out-of-the-box and what is also really convenient is if you jump into this Chroma style Gallery, you can see all the different styles and color schemes that you can add to your code examples on your blog So Cappuccino is a really popular one. We're gonna use the one called Groovebox But all of these you can just add and pick and choose the one you like the most So this is exactly what we need. So go back into goldmark highlighting and grab this installation line right here Jump into editor Let's go get And this one also adds Chroma, so basically we just need to add this to our extensions in our articles package Go in here You see on the new and then we just add more to the With extensions options and I'm just gonna format it so it's a little bit easier to read right and I want to just quickly Put this in so we can refer to them as high highlighting new Highlighting there we go And this one didn't take again Highlighting with style and you use groove Box, there we go And again, I misspelled this Yes This is correct. Let me just jump up and get it from here Go and there we go And final thing we need to say highlighting with format options And then say chroma HTML With line numbers set to true Give that a save Put a comma not an M and new highlighting And that is all there is to it So now if you go back into our browser and jump into our blog give this a refresh Go into read article and go down to our code example, you can see now we have line numbers We have syntax highlighting. We have groove box the groove box theme Being applied. So this is looking really really good and just to show you that if we were to jump into our content here and let's say article two and Instead of only having a go example. We will also have it's just that maybe Rust example and JavaScript example And we don't want to use let's say we don't want to use groove box anymore we want to use that was one called Nord So we just changed it here Update our development server, so I pick up the the file changes Go in here Refresh now this example is in the Nord color scheme But if we go into our second article here, you can see that we have first the Golang one then the Rust one and then the JavaScript one all being properly highlighted with With line numbers. So so now we have all the core components, right? The final thing I want to do is to add error pages so that we just show Something went wrong and and please go back to the home page or whatever. So with that in place We're gonna fix that in the next video and then basically our blog is ready to deploy if we wanted to