wvffle / static-waffle

MIT License
1 stars 0 forks source link

Add prerendering #17

Open wvffle opened 5 years ago

wvffle commented 5 years ago

Route structure

Routes are special type of components Each route is prerendered as .html file to support SEO and og/twitter tags

Structure

Example

Let's consider following example

routes/
+- index.pug
+- name/
|  +- template.pug
+- nested/
   +- meh.js
   +- template.pug
   +- template/
      +- template.pug

We have just defined following routes:

Component routes

Components routes are routes with extra data/lifecycle hooks on them route.js file of the route goes straight into vue-router

Markdown routes

Markdown routes are automatically parsed into HTML

Forbidden names

The only forbidden name is routes/index.md as it's global template

Templates

By default we're looking for the nearest template-md.pug and defaults to the nearest template.pug

RIP views, welcome routes

So I resigned from the views concept. Why? Because most likely I won't make many different views. Even if I want, I can still load different style for the route.

wvffle commented 5 years ago

Prerendering and generating all routes would be much better option.