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

Welcome to the WonderCMS community. Anything goes, except for support requests.
Post Reply
User avatar
shoaiyb
Posts: 5
Joined: Sun Mar 14, 2021 11:14 am

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

Post 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.
Shoaiyb Sysa
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

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

Post 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.
Post Reply