Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

A question about the design of themes customization #30

Closed
chawyehsu opened this issue Aug 6, 2018 · 1 comment
Closed

A question about the design of themes customization #30

chawyehsu opened this issue Aug 6, 2018 · 1 comment

Comments

@chawyehsu
Copy link

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
Copy link
Contributor

egoist commented Aug 7, 2018

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 😅

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants