upash / peco

nothing here, move on..
MIT License
209 stars 12 forks source link

A question about the design of themes customization #30

Closed chawyehsu closed 5 years ago

chawyehsu commented 6 years ago

I was considering to migrate my Hexo blog to Gatsby, then I found this. It looks neat to me, and is similar to Hexo in some way. I haven't tried it yet, but here I want to ask a question (or like feature request?).

I saw the docs of customization of themes, it seems that we at least have to contain an index and a page templates/layouts, for a theme.

./theme
├── layouts
│   ├── 404.vue      # optional
│   ├── index.vue
│   ├── category.vue # optional
│   ├── tag.vue      # optional
│   ├── post.vue     # optional
│   └── page.vue
└── package.json     # optional
Files Default Layout Fallback Layout
homepage index
source/_posts/*.md post page
source/*.md page
(categories page) category index
(tags page) tag index

I'm just considering that why not making the page layout to be optional too, which likes Hexo.

Template Page Fallback
index Home page
post Posts index
page Pages index
archive Archives index
category Category archives archive
tag Tag archives archive

Then at the very least, the theme(in most cases: a theme prototype) can just contain an index template/layout.

Just filing a question here, peco looks delicious, keep working! 👍

egoist commented 6 years ago

In fact you can already, if there's theme/layout.js or theme/layout.vue, it will leave the layout management to you. The docs are still work in progress, sorry about that 😅