myst729 / Vuelog

A backend-free blog system built on top of Vue.js
https://vuelog.js.org/
MIT License
266 stars 39 forks source link

Is there a way to auto-detect posts and pages? #33

Open vampirefan opened 5 years ago

vampirefan commented 5 years ago

Hi, I love this vuelog project very much! It's doing the dream way for generating blog & posts. I wander if there is a way to auto-detect posts and pages and no need to manually modify the database.js file. That would be more convenient for add a post or page. Only add a .md file and nothing else to care about. Besides, I think vuelog is better than vuepress.

myst729 commented 5 years ago

@vampirefan

There’s no way for Vuelog to auto-detect posts in the file system, because Vuelog doesn’t have a build process in the first place, and secondly it’s backend-free. So do other tools conform to the two features. Then there are two approaches to obtain the sitemap: by configuration, or by convention.

Most tools choose the latter, following the convention over configuration rule, such as docsify. The convention here is simple: path to the MD file is computable from the URL, check out https://docsify.js.org/configuration.md and https://docsify.js.org/#/configuration.

This looks amazing right? But think about the darker side: check out this and (be careful) this. What do you see? I see vulnerability of XSS.

Vuelog chooses an alternative way, which looks dumber.