Page 1 of 1

How did WonderCMS read and create a slug for each post?

Posted: Sun Mar 14, 2021 11:24 am
by shoaiyb
I'm wondering how WonderCMS works
I wanna know how it read the database.js, find every available post, create a unique slug and make the post accessible through the slug.

Re: How did WonderCMS read and create a slug for each post?

Posted: Fri Mar 26, 2021 6:30 am
by wiz
By default, WonderCMS includes a couple of pages like Home and Example.

1. Those pages are generated to database.js, once your WonderCMS website is first visited.
2. When you create a new page, for example via the menu
- we slugify the name and do a simple urlencode, and save the item to the database.js file.
3. All of the menu pages/slugs along with the content resides in database.js file.
4. If the page exists and your visitor requests that page, it will be served from the same database file.