You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thoughts on extracting my weird dynamic markdown system. Because sometimes thinking out loud helps one figure out a problem.
It will probably happen as a part of this PR where I started trying to apply the dynamic markdown concept to the projects section of my site (initially it was just for my blog).
The need for generated JSON files
So, for hooks:build:before we are doing a bunch of stuff:
It uses library/blog.js which looks in contents/blog/posts and also does a ton of stuff:
Figures out the categories (a category is a directory).
Attaches the category metadata to the categories (_meta.md within a category folder).
Scrapes the tags from the YAML frontmatter for all the articles.
etc. etc.
The generated JSON is loaded by the setup-store.js plugin and ultimately ends up in the Vuex store.
All of this is necessary because there's no way for asyncData to get the data it needs.
For instance, blog tags are literally an array inside YAML front matter inside an article markdown file inside a "category" (directory). That is all a blog tag is and the only place it exists.
It's simply not possible to get e.g. "all articles that correspond to a given tag" without a bunch of pre-processing.
Now that we've extended this idea of dynamic markdown to the projects of the site it's time to try to generalise this whole concept.
Issues
Categories have articles, Projects have ... nothing.
Thoughts on extracting my weird dynamic markdown system. Because sometimes thinking out loud helps one figure out a problem.
It will probably happen as a part of this PR where I started trying to apply the dynamic markdown concept to the projects section of my site (initially it was just for my blog).
The need for generated JSON files
So, for
hooks:build:before
we are doing a bunch of stuff:library/blog.js
which looks incontents/blog/posts
and also does a ton of stuff:_meta.md
within a category folder).setup-store.js
plugin and ultimately ends up in the Vuex store.All of this is necessary because there's no way for
asyncData
to get the data it needs.For instance, blog tags are literally an array inside YAML front matter inside an article markdown file inside a "category" (directory). That is all a blog tag is and the only place it exists.
It's simply not possible to get e.g. "all articles that correspond to a given tag" without a bunch of pre-processing.
Now that we've extended this idea of dynamic markdown to the projects of the site it's time to try to generalise this whole concept.
Issues
Categories have articles, Projects have ... nothing.
Consider:
There is this whole issue where we need to attach metadata to a category using a special file but that isn't necessary for a project. That is to say:
How can we deal with this issue?
Tags, keywords, technologies, ...
A blog post has many tags.
A tag has many blog posts.
A project has many keywords AND
A project has many languages AND
A project has many technologies AND
... + the opposite relationships.
I want people to be able to search for e.g.:
... so we need some kind of concept of relationships, right?
Ideally we could pass the system this data:
... and that would be it. It would generate everything for us:
And it would dump it all in the store for us to use however we wish.
More to come later probably but that's enough for now...
The text was updated successfully, but these errors were encountered: