Create Custom Hugo Shortcodes

Shortcodes in Hugo are basically chunks of HTML code that can be used in our content files. You can use built-in shortcodes like youtube or create your own. Create custom shortcode Here are the basic steps to create your own custom shortcode: Create a file layouts/shortcodes/shortcode_name.html Add your HTML code to the shortcode_name.html file Call your shortcode with {{< shortcode_name >}} Shortcode example Let's create a simple Hugo shortcode that displays the temperature:...

April 17, 2023 · 2 min · 419 words · Altynbek Usenbekov

Deploying a Hugo Website with Firebase Hosting: A Step-by-Step Guide

Hugo is a fast and modern static site generator written in Go, and designed to make website creation fun again. Hugo is a general-purpose website framework. Once we are ready to publish we can run the hugo command and it generates a static site that we can deploy. All the files needed for deployment will be located in the public directory and consists of various files such as HTML, CSS, JavaScript, and more....

April 17, 2023 · 4 min · 773 words · Altynbek Usenbekov

Hugo YouTube Shortcode

Shortcodes in Hugo are basically chunks of HTML code that can be used in our content files. We can create our shortcode or use existing built-in shortcodes. For instance, to embed a YouTube video, we can use the built-in shortcode called youtube. Here is how to use the youtube shortcode: {{< youtube VIDEO-ID >}} or {{< youtube id="VIDEO-ID" >}} This will embed a responsive video player for the given YouTube video....

April 16, 2023 · 3 min · 520 words · Altynbek Usenbekov