How to delete a post the correct way?


#1

I am still a newbie in hugo obviously. I learned that hugo new posts/post1.md creates a new post, but I can’t find anywhere how I can delete a post through the hugo binary?? Or should I just go to ~content/posts/post1.md and delete it?

Help much appreaciated.

Regards,
Arto


#2

Hey, @tobleron - Yeah, you just delete it.


#3

If your website doesn’t make heavy use of cross references (linking other content) it should be fine to just delete the content file.


#4

Thank you all for your support.

digitalcraftsman Do you mean there is a way to delete the posts through the hugo binary? If anyone knows please… be my guest :slight_smile:


#5

The Hugo binary doesn’t provide a command to do that. As Bud already said just delete the file.

With the cross references I was referring to the relref, ref shortcode that allows you to link (headlines in) other content files. But Hugo would warn you anyway if the link is broken due to the absence of the given content file.


#6

Each operating system has its own commands to delete files, these commands work well, and it makes no sense to duplicate them in Hugo.


#7

Thanks,


#8

This explains why there is no delete functions.