There are times that your imagination stretches beyond markdown’s capabilities. When this happens it can be easiest to use HTML with your post, but Hugo doesn’t always like this. If we create a shortcode though we can switch between markdown and html easily. As shown below.
File: /layouts/shortcodes/rawhtml.html
1
2
<!-- raw html -->{{.Inner}}
Example Usage
1
2
3
{{<rawhtml>}}
<p>Welcome to <strong>MakeWithHugo</strong></p>{{</rawhtml>}}
Edd is a PHP and Go developer who enjoys blogging about his experiences, mostly about creating and coding new things he's working on and is a big beliver in open-source and Linux.
Add Adsense Ads to Your Posts
–
This post sets out how you can add your Google Adsense code to your blog posts. As this is MakeWithHugo, we’ll be adding them to our Hugo site.
You’ll need a few things before starting, an Adsense account, the snippet of code from Adsense and knowing where you want to put them (or auto ads for the easy option).
There’s a few different ways to achieve this, based on where you want them.
Markdown for Hugo: Cheatsheet
–
This is designed to be a ‘cheatsheet’ to help you find the syntax you need quickly for creating markdown content on Hugo sites.
Code Block 1 2 3 4 5 ```css body { background: red; } ``` To define a code block, wrap the code in backticks like: `
Three of them, and you can define the code language after the first set, like we’ve said the above code is css.
Migrate Wordpress to Hugo
–
Wordpress is a fantastically popular blogging platform, but judging by the fact you are here, you’re looking to move to Hugo (great choice!)
The software we’ve used in the past to do this for us is called wordpress-to-hugo-exporter (does as it’s name suggests). This will essentially convert the database posts saved into markdown files which you can use in Hugo and with your theme of choice.
View on Github How to It’s important to note this works as a Wordpress plugin, so if you can’t install plugins it may not work for you.