This post will cover how you can write a user interface in Go. I’ll go over the different methods to code a UI, the available modules, and if you should even use Go for these types of applications. Go isn’t usually thought of when creating a GUI application, but it is possible and I have written a few GUI applications myself with Go. The reason for it was that with Go I could quickly code all of my business logic and the GUI that was required for the problem was simple.
Nearly every website implements some sort of pagination of data. Pagination is the process of splitting large sets of information into multiple pages (i.e. search results, emails, etc). In most cases for pagination to work, the total number of items for the dataset must be calculated to know total number of pages. This is commonly done by performing two SQL queries, one to receive the data for the current page and another to count the total number of rows to later calculate the total number of pages.
When a user leaves your website through a link or HTTP redirect, a HTTP header of the current page the user is coming from is attached to the new request. In most cases, this isn’t harmful, but there are situations where the URL should be hidden. In this tutorial, you will learn of a few different methods to obscure or remove the HTTP Referer header from the request. Keep in mind that some of these options may not always work.
In this tutorial, you will learn how to grab pages from multiple sections on your Hugo site and display them in a single list. There are many reasons why this may be used. For instance, if you have a section called “tutorial” and another section called “news”, you may want to combine both sections together on your homepage to display all of the recent combined posts. There are a few ways to go about displaying multiple sections in a single list in Hugo, but I will go over the two that I use frequently.
Today I’m releasing a pack of custom shortcodes for Hugo. A shortcode is a special tag added to a post that will embedded content or add HTML to a post instead of having to manually add the HTML. A few examples of shortcodes include YouTube, Vimeo, and GitHub Gists. The pack I created adds the ability to embed Google Maps, Box Document Preview, Pastebin, Twitch videos, Twitch livestreams, and JSFiddle. I’m going to keep adding new shortcodes in the future as I come across new sites that will work well with shortcodes.