upash / peco

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

[Proposal] Site Structure #17

Open imsus opened 6 years ago

imsus commented 6 years ago

Current Structure

root
├── components
│   └── component.vue
├── source
│   ├── index.md                     // www.example.com
│   ├── _draft-section
│   │   └── some-markdown.md
│   └── published-section
│       ├── index.md                 // www.example.com/published-section
│       ├── published-markdown.md    // www.example.com/published-section/published-markdown
│       └── _draft-markdown.md
├── static
│   └── some-static-asset.jpg
├── peco.config.js
├── node_modules
│   └── some-package
│       └── index.js
└── package.json

Proposed Structure

root
├── components
│   ├── Layout                       // Page theme / layout
│   │   ├── Homepage.vue             // Built in Homepage Layout
│   │   ├── Single.vue               // Built in Page Layout
│   │   ├── Single-Custom.vue        // Custom Page Layout "Selectable via markdown frontmatter using "layout" key
│   │   ├── RSS.vue                  // Built in RSS Layout
│   │   └── Sitemap.vue              // Built in Sitemap Layout
│   ├── Shortcode                    // Vue component for markdown content
│   └── Plugin                       // Other Vue component
├── source
│   ├── index.md                     // www.example.com
│   ├── _draft-section
│   │   └── some-markdown.md
│   └── published-section
│       ├── index.md                 // www.example.com/published-section
│       ├── published-markdown.md    // www.example.com/published-section/published-markdown
│       ├── _draft-markdown.md
│       └── some-image.jpg           // This will be part of "published-section" content rather than put to static
│                                    // Accessible via www.example.com/published-section/some-image.jpg
├── taxonomy                         // First class taxonomy support
│   └── tags
│       ├── diy.md                   // www.example.com/tags/diy
│       └── food.md                  // www.example.com/tags/food
├── static
│   └── some-static-asset.jpg
├── peco.config.js
├── node_modules
│   └── some-package
│       └── index.js
└── package.json

Just some idea by mixing structure from Jekyll/Hugo/Hexo architecture

egoist commented 6 years ago

Not sure if we need the components folder, you can simply use a theme for this:

theme: ./components

Then you can put layout components in ./components/layouts/.

Peco will also load ./components/index.js which can be used to register global components, e.g. https://github.com/egoist/blog/blob/master/themes/luna/index.js


For drafts, maybe we can use front-matter: draft: true for this? We don't build draft posts in production mode but only in dev mode.

egoist commented 6 years ago

Oh I actually forgot that Peco ignores all files/folders starting with an underscore _ (except _posts), so _drafts directory is already excluded by default 😅