Posts that have been written in HTML

Hello I have files that have been written in HTML

Unfortunately Hugo has not recognised the XML metadata, so it does not use the date the note was created on (or updated on), instead it defaults to “Mon, jan 1, 0001”. However the contents of the post seem to have displayed fine.

Also the post file itself is entitled “Untitled Note” however this is not recognised by Hugo and subsequently the note does not have a title when view on the built site (and is therefore not accessible). (In the Public/post folder there doesnt seem to be a HTML file which i presume is not necessary because it is already a HTML file?)

How can I make Hugo work so that it uses the XML metadata in the HTML head??
And also how to give the post the title of “Untitled Note”??

thanks.

Curious: The XML metadata you are talking about, is that some kind of standard?

In your content/post/file.md, set the title:

title = "Untitled Note"

I have a large number of files that i want to turn into posts so this is problematic. Is there not a way of the title defaulting to whatever the file name is?

I have exported the posts as HTML, and in the ‘head’ of these files there is metadata.

That’s not how Hugo works…

Hugo converts Markdown to HTML. You would need to pull that meta information out yourself. It seems like a lot of work to do that. Hugo is really more for allowing you to easily create content than for managing existing HTML.

Google “how to convert html to markdown”.

Hugo also supports HTML along with markdown. It doesn’t support XML meta data though.

Steve Franciaspf13.com@spf13

Welcome to my world!

I’ve just completed wrangling my third blog away from [in this case Tumblr] into Hugo –all 158 posts of it! One of the other blogs I ‘Hugo-ified’ had over 300 posts, when I moved that from Tumblr. I still wake up screaming some nights, thinking about the horror that entailed!

Unfortunately, there doesn’t seem to be an easy way to do it. Depending on where your original posts are coming from, you might have some joy with using one of the various Jekyll Importers to export the existing site into a format not-completely-unlike Hugo expects, and then rely on your RegEx-fu from there to tidy things up.

@michael_henderson Hugo is really more for allowing you to easily create content than for managing existing HTML

…and much though I love Hugo, that’s one of its biggest drawbacks.

Usually I wouldn’t give any piece of software which has the arrogance to assume that all my existing work is so valueless, I should just abandon it in favour of <shiny new thing> a second glance. And the fact that the Hugo docs pretty much just tell you to try someone else’s importer, if you want to bring your existing ‘stuff’ into Hugo is not very welcoming to potential switchers.

There are some really smart people involved in this project and it would be nice if someone would knock up a series of ‘official’ input scripts. The subset of folks who are interested in ‘hacking’ away in a terminal and code editor, to build a static-generated blog –and who don’t already have some content they’d like to import– must be vanishingly small.