add an easy way to define the "default" page type, which:
has its index pages at root of site (site.com/<taxonomy>/index.html)
has its taxonomies listed in site_navigation, etc
test creation of various page types:
create a new page of type page, ensure it has no indexes
DONE: create pages of other types, ensure they have working index pages
fix: do clean up of cvs file for each page type (top of update_pages.sh)
Done
renamed create_post.sh to create.sh
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:
page (dont get listed in any index pages)
post
product
event
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:
Index pages have moved! They are now namespaced by page type.
So, this page:
site.com/authors/index.html
Has moved to:
site.com/posts/authors/index.html
And you now can have:
site.com/<page-type>/<taxonomy>/index.html
Such as:
site.com/events/locations/index.html
And so, you also have:
site.com/events/locations/<some-item>.html
Example:
site.com/events/locations/london.html
Other changes
New site structure:
Index page item arrays are now namespaced by page type, and
called things like "$posts_tags", and "$events_categories",
instead of "site_tags", "site_categories", etc.
Index pages no longer use unique templates called "_authors",
"_tags", etc, as we cannot be sure what these taxonomies will
be called anymore. Instead they use the "_list" template by
default, defined in taxonomies.yaml.
Implementation:
new files: .app/template/page_types/<page_type>.sh.
These files contains the page type specific front matter fields needed
for that page type. These files are sourced by .app/create.sh
when the user create a new page.
new file: assets/data/page_types.yml.
This file lists each page type and their meta info, and the taxonomies associated with
each one.
The unique taxonomy arrays are temporarily written to the
ITEMS array just before processing the index page template
defined by "layout".
The site-wide templates like "_site_navigation" are using "posts"
taxonomy data by default (i.e, the site navigation is set to list
the blog posts categories and tags by default. Just change the
"post_tags" array name to "page_tags" (etc) to change the default
taxonomies listed on the site navigation.
NOT READY
To do
site.com/<taxonomy>/index.html
)page
, ensure it has no indexesfix: do clean up of cvs file for each page type (top of
update_pages.sh
)Done
create_post.sh
tocreate.sh
Every page created (via the
new
command) now has a page type: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:The
date_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.
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 asrebuild
.Examples:
Index pages have moved! They are now namespaced by page type.
So, this page:
Has moved to:
And you now can have:
<page-type>
/<taxonomy>
/index.htmlSuch as:
And so, you also have:
<some-item>
.htmlExample:
New site structure:
Index page item arrays are now namespaced by page type, and called things like "$posts_tags", and "$events_categories", instead of "site_tags", "site_categories", etc.
Index pages no longer use unique templates called "_authors", "_tags", etc, as we cannot be sure what these taxonomies will be called anymore. Instead they use the "_list" template by default, defined in taxonomies.yaml.
Implementation:
new files:
.app/template/page_types/<page_type>.sh
. These files contains the page type specific front matter fields needed for that page type. These files are sourced by.app/create.sh
when the user create a new page.new file:
assets/data/page_types.yml
. This file lists each page type and their meta info, and the taxonomies associated with each one.The unique taxonomy arrays are temporarily written to the ITEMS array just before processing the index page template defined by "layout".
The site-wide templates like "_site_navigation" are using "posts" taxonomy data by default (i.e, the site navigation is set to list the blog posts categories and tags by default. Just change the "post_tags" array name to "page_tags" (etc) to change the default taxonomies listed on the site navigation.