-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom taxonomies #93
Open
sc0ttj
wants to merge
13
commits into
gh-pages
Choose a base branch
from
custom-taxonomies
base: gh-pages
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- new data: taxonomies.yml the authors, categories, tags stuff is now defined in this YAML file, so more can be added. They also get extra meta info here :) - new functions: In `.app/functions/generate_site_data.sh` `get_taxonomies` - return list of taxonomies defined in the data (returns the main "key" field) `get_taxonomy_items` - returns a list of taxonomies ("author", "tags", etc), and makes template data for them `get_pages_in_taxonomy` - lists the posts/pages in a specific category,tag etc. In `.app/updates_pages.sh`: `rebuild_index_pages` - goes through each taxonomy defined, then get each item defined in it, then gets each post/page for that item, then generates the index pages. NOTES: These functions will replace the ones in which taxonomies are hard-coded to "author", "category" and "tags". TO DO: - remove old stuff, hook in the new functions to `rebuild CLI` - create "page types" (steal idea from Hugos "Archetypes"): These will give pre-defined front-matter, including unique taxonomy selections per type. - update `new` command to work with all supported page types: Dont hard-code the front-matter choices, get it from the "page type" temples (not yet created).
…each taxonomy item
- allow overriding the list of taxonomies to update: will make it easier to support `rebuild tags:foo` (and other partial rebuild stuff) - fix `has_date` var, cleaned up (renamed) others.
- always use plural version of taxonomy name in URL - updated "tag" to "tags" in YAML: - matches field in existing front matter - all keys match plural (folder) names ..should fix URLs generated for each item in JSON-LD
- removed lots of older functions - create taxonomy data at end of `generate_site_data.bash` - updates to `rebuild_index_pages` As of this commit, index pages are now generated OK without the help of the pre-existing (now removed) author/category/tag hard-coded functions. There is still old stuff to remove and updates to the `rebuild` command to be done.
``` # rebuild authors:sc0ttj category:markdown,bash Updating: authors/sc0ttj.html Updating: categories/markdown.html Updating: categories/bash.html Minifying CSS.. Finished. ``` ^ the rebuild command now works as before for building specific index pages - except that it is the new `rebuild_index_pages` function that is doing the hard work. Also removed an un-needed function.
The following commands now work, using taxonomies: ``` .app/update_pages.sh path/to/file.mdsh ``` So, when creating new posts, any taxonomies it has defined in its front matter will be used to update the _relevant_ index pages, as before, but now its not hard-coded to authors/tags, etc. As of this commit, partial rebuilds should be fully working again - all using custom taxonomies, no legacy author/tag/category code used.
sc0ttj
force-pushed
the
custom-taxonomies
branch
from
November 1, 2019 00:58
7dbb7e4
to
4b99c31
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOT READY
Still to do:
page_types
branch is worth merging into this thisgh-pages
For more info about taxonomies, see Issue #92
To test out the new index page generation routines, based on YAML defined taxonomies:
source .site_config rebuild_index_pages
It is currently setup to build the same index pages which already exist - authors, categories, tags..
It should build identical index pages to the
rebuild authors
,rebuild tags
(etc) commands, with some small changes:posts.csv
(except post_count, see To do)Done
foo/index.html
)foo/bar.html
)rebuild
command re-implemented:rebuilds tags
, andrebuild tags:markdown,bash
To do
Page types
[in progress] See PR #94
new
command so it works out what front matter to create based on given page type.. Example:new page
<-- default front matter varsnew post
<-- prob same as abovenew product
<-- same as above but withprice
,shipping
,paypal_*
, etcnew event
<-- same as product but withstart_date
,end_date
,location
, etcNamespaces index pages
All index pages should be namespaced by type... Example:
Users should be able to symlink any index pages/folders they want to the root of their site. So, for example,
site.com/categories/
could link tosite.com/events/categories/
. Users will be able to choose.Pages of type
page
shouldn't appear on any index pages.