sc0ttj / mdsh

A simple static site generator, using Markdown and Bash
https://sc0ttj.github.io/mdsh/
10 stars 0 forks source link

Page types #94

Open sc0ttj opened 4 years ago

sc0ttj commented 4 years ago

NOT READY

To do

Done

  1. Creating pages of a particular type:

Every page created (via the new command) now has a page type:

new <page-type> [-all]  # create a new page of type "post"

The page types defined (in assets/data/page_types.yml) are:

Any pages of type "product" will be listed in "products.csv", "event" in "events.csv", etc - just as posts are listed in "posts.csv".

When creating a page, You will be asked to fill in different fields, depending on the taxonomies defined for the chosen page type, (look in assets/data/taxonomies.yml or in .app/templates/page_type/<page_type>.yml to see the data defined for each page type.

Taxonomies are now associated with page_types, not the site as a whole, e.g - taxonomies arrays are divided up into "posts_tags" and "events_tags" etc, not "site_tags" as before.

Page types are defined in assets/data/page_types.yml. Each page type has some options and meta info attached, for example:

product:
  name: product
  plural: products
  taxonomies: brand, category, tags
  layout: simple
  stylesheet: main
  date_in_path: false

Thedate_in_path option affects the page URL.

If true, pages will be at <type>/<year>/<month>/<day>/<name>.html, if false, they will be at <type>/<name>.html.

Pages of type "post" have a date in the path by default to avoid any breaking changes.

  1. Rebuilding pages:

The rebuild command is no longer used to rebuild index pages.

The reindex command is now used to rebuild index pages. It takes the same options/synax as rebuild.

Examples:

rebuild products:brands:nike,reebok  # rebuild relevant pages

reindex products:brands:nike,reebok  # rebuild relevant index pages
  1. About index page URLs:

Index pages have moved! They are now namespaced by page type.

So, this page:

Has moved to:

And you now can have:

Such as:

And so, you also have:

Example:

  1. Other changes