Markdown files -> Umbraco CMS / Azure SQL: request for opinions on proposed method
j
Hello! I'm working on a migration from a Hugo static site to Umbraco CMS. The "database" for the Hugo site is a large collection (~1000) of Markdown files. My current approach is: - parse Markdown files using [MarkDig](https://github.com/xoofx/markdig) - create content using [Content Service](https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/reference/management/services/contentservice/create-content-programmatically) Would anyone have any suggestions of whether this approach will work, or whether I'm reinventing the wheel, or if another approach would work better? TIA! Rich
s
Assuming the content will just be a rich text editor, this sounds about right. 👍 Umbraco also has a markdown editor, so if they like writing markdown you could stick with that and skip markdig.
j
I should clarify - the reason for the "parse with Markdig" phase is because the metadata for the article ("author", "title", "description" etc.) is in the file like this:
Copy code
---
title: Umbraco is great
date: 2023-08-27T09:30:46.000Z
resources:
  - src: umbraco-1920-1080.png
    title: Umbraco Image
    name: umbracoimage
---
Here is the body of the blog article about why Umbraco is great. In this essay I will [...]
So, in my mind, the parsing needs to be done to correctly identify these metadata fields before using Content Service to create the article a fresh. Does that sounds correct?
s
Cool, sounds exactly right!
It's probably a little messy but here's the parser for the old docs on Our Umbraco, might help for inspiration: https://github.com/umbraco/OurUmbraco/blob/main/OurUmbraco/Documentation/Busineslogic/MarkdownLogic.cs
j
OH cool, that's really interesting - thank you!
3 Views