Get Hugo to Show Content from Multiple Sections
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. Depending on your current website structure, you may need to make additional changes for the changes to work properly.
Pack of Shortcodes for Hugo
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.
PHP - Check if Production or Sandbox
When developing a site, it’s usually best to work on it on a local sandbox (development) server. This will allow you to quickly test the site without having to upload the files. Also, when working on a sandbox server, you have full control of the software that is running. This lets you test the code on various platforms, servers, PHP versions, and all sorts of other stuff.
But there is a down side to working on a local server, it’s that when you are finished you usually have to modify the configuration file and maybe a few other files so that it will work on the production server. These are basic things like database settings, API tokens, and switching from uncompressed JS to the compress JS files. This can get very old often and you will stumble around trying to find a way to detect if you are on a sandbox server or not so this can all be handled in the website code. Below are a few methods I came across, the first one being my preferred method.
Start PHP Server using Context Menu - Windows
There is a reason why computers now have full Graphic User Interfaces (GUI’s) and no longer only have shells and terminals. But for some software, you still need to open up a terminal or command prompt to start the software. Or do you?
Today we are going to look at adding a Context Menu item inside of Windows 8.1, but it will work in other versions of windows such as XP, Vista, 7 and 8. A Context Menu, if you are unaware of what it is, is the menu that appears when you right click on a program, folder, desktop or other item on your computer. It’s provides optional features that you can use, such as opening a file in a different program or to archive a folder.
Website Contact Form without PHP
A few days ago I ran across an interesting question about a person who didn’t want to use PHP or didn’t have access to PHP and still wanted a contact form on their website. First off, if you have PHP and don’t mind using it, I suggest just using PHP for your contact forms.
But the method I came up with uses the mailto:
URI scheme that almost
every computer and phone knows. Sometimes users have it set to
Microsoft Outlook or other software that they did not configure so
their e-mails will not be sent. Also sometimes users don’t have the
mailto:
URI scheme specified so nothing will happen when they click
on the link. But with those issues out of the way, lets get coding.