If you are anything like me and blog about code a lot, you will sometimes want to start with a short paragraph, then straight into some code. Like this:
1
echo"Hello World"
Problem: But if you do this, then the .Summary data on your list will look like this (notice the line number and code in it):
When perhaps you would like it to look like this (free of code):
Solution 1) The More Comment
When you are all finished, add a more html comment to signify where the summary should end. This is similar to in other CMS, like Wordpress.
Note: This must not contain spaces
1
2
3
4
5
6
7
8
---
title: Example Post
type: post
date: 1970-01-01T00:00:00+00:00
url: /example-post/
---
My Summary<!--more-->
More content
Summary Output:
1
My Summary
Solution 2) Manual Summary (To Override)
The second option takes matters into your own hands, we can specify our own summary. To do this, within the header of our post we can make a “Summary” and enter text there.
1
2
3
4
5
6
7
8
---
title: Example Post
type: post
date: 1970-01-01T00:00:00+00:00
url: /example-post/
summary: Completely different summary text.
---
How I start my post
Summary Output:
1
Completely different summary text.
Hopefully you found what you were after by reading this post. Let us know in the comments if you have any issues.
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.
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.
Hide a Page in Hugo
–
Option 1: Draft The simplest way to hide a page when using Hugo is probably to set the post as a draft. This way, you still have the content ready to go for when you need it.
To hide a page by setting it as draft, so our drafts page:
Set Post as Draft Tutorial Option 2: Hide from Posts List You still want the page to be visible, but you don’t want to show it your blog posts list?
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.