for a school project I am making a webshop with the Hugo static website generator. And I have the products of the shop in .md files. I also have a database with a table called product with name, price, description etc with an admin page so the admin can add new products to the database. The problem now is that I somehow need to generate a .md file for the new product using the database information. My idea was to use an already existing .md file for a product and via search and replace, insert the information for the new product. But I have no clue how to realize that. I would appreciate any help. Thanks! Heres an example for an already exisiting product .md file
---
title: "Baklava"
date: 2019-10-17T11:22:16+06:00
draft: false
# meta description
description : ""
# product Price
price: "22.00"
beforeprice: ""
# Product Short Description
shortDescription: ""
#product ID
productID: "4"
#Gramm
name: "Wie viel Gramm?"
amount: "400g|700g[+6.00]|1000g[+10.00]"
# type must be "products"
type: "products"
# product Images
# first image will be shown in the product page
images:
- image: "images/products/Produkt 5/Unbenannt.png"
---
Eine Mischung an Baklava von bester Qualität. Sie haben die Möglichkeit die verschiedenen Spezialitäten vorort zu probieren und sich selbst zu überzeugen. Lassen Sie sich von einer Mischung an feinsten Baklavasorten überraschen.