sunwei
February 23, 2024, 1:18am
1
I want to use Hugo help me to build a online book service, which should have features like:
Create book with name
Create menu
Create preface
Create Chapter
Create Section
…
Based on the Hugo domain knowledge discussed in this thread Difference between Page Bundles and Sections? .
The API provided by Hugo will looks like:
Create book with name
POST /site/name
POST /site/page/home
Create menu
POST /site/page
Create preface
POST /site/page
Create Chapter
POST /site/page/section
Create Section
POST /site/page/section?parent
…
Any suggestion?
Hugo creates your website and then the website is static. You can’t let Hugo “create” content on your live site while it’s online somewhere. “Creating” is locally creating your MD file that Hugo then uses to render the page.
What you could do is use a web service like Strapi where your content lives. Then, create your content via “webhooks” and Javascript that talk to Strapi (or any comparable service) and let Hugo create the pages for existing content on update.
There might be other services than Strapi; that is just what comes to mind when I see your feature list.
You may also use Staticman to create POST requests which can be used to create markdown files for Hugo procesing.
sunwei
February 26, 2024, 7:32am
4
Content Management Web Service → MD files → use Hugo to generate static website.
Thanks for suggestion. What I’m trying to do is to extend Hugo to other two steps:
Hugo online service powered by MD/Text editor online → generate Hugo project with content → publish Hugo Static Website.
Actually, Hugo is a really powerful content management system.
Take book service for example: we can use it to create a online book writing service and publish to public market automatically.
And there are so many possibilities for Hugo. I just want to start a POC for it.
sunwei
February 26, 2024, 7:33am
5
I want to try this process by using Hugo ecosystems. So that I want to extend Hugo a little bit.
1 Like
Bin951
February 26, 2024, 9:39am
6
Sounds great and looking forward to the first version of your work.
1 Like
sunwei
February 26, 2024, 1:15pm
7
Thanks.
Quick update for the API design:
Create book with name
POST /site/name
POST /site/name/page/home
Create menu
POST /site/name/page
Create preface
POST /site/name/page
Create Chapter
POST /site/name/page/section/name
Create Section
POST /site/name/page/section/name/page | /site/name/page/section/name/subsection/subsectionname
Generate Static Website
POST /site/name/gss
Website, home - index.html, 404.html
Deploy Website
POST /site/name/deploy
Any suggestion?