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
{{ message }}
Repository navigation
how to display the author and create time in every md page? #750
Yes that was also my initial question. But then after I saw the page about writing a plugin I've realized that the vm is passed to the plugin function.
I guess you would need to write in your markdown something like {{author}} and then in the beforeHook you can do something like
But I think it makes sense to setup a convention for variables in general in docsify and provide to replace them by frontmatter attributes and implement it into the docsify core.
Ah okay, a working example people could look at would go a long way here. I fear many people would overlook using docsify because front matter does not work as people would expect.
I do agree that
a convention for variables in general in docsify and provide to replace them by frontmatter attributes and implement it into the docsify core
would go a long way and remove most of my concerns with this plugin 😄
You can substitute variables with docsify-mustache plugin using mustache syntax {{variable}}. Variables can be defined in front matter, external JSON|XML files or in docsify configuration.
If you use front-matter plugin, then the front matter variables will be available. Here is a demo using front matter: https://docsify-mustache.github.io/#/?id=front-matter
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
Edgar-Spiir commentedon Jan 21, 2019
Not sure about the author, but you can add the date when the file was modified, by adding date format to the docsify config
and then using
{docsify-updated}inside the markdown page.More in docs: https://github.com/docsifyjs/docsify/blob/master/docs/configuration.md#formatupdated
timaschew commentedon Jan 23, 2019
You can define the author via front matter and then use a docsify plugin to access the author property and render it where you want.
jthegedus commentedon Jan 23, 2019
@timaschew an example doing so with the
front-matterplugin would go a long way as it's not clear how that plugin is to be used.timaschew commentedon Jan 24, 2019
Okay let's improve the documentation for that plugin.
Do you have some concrete questions?
jthegedus commentedon Jan 24, 2019
I used it briefly and looked through the code and it strips the front-matter successfully, but it's not clear where the attributes end up.
docsify/lib/plugins/front-matter.js
Line 488 in c3345ba
how to we get this
vm.frontmatterdata in further plugins or our pages?timaschew commentedon Jan 24, 2019
Yes that was also my initial question. But then after I saw the page about writing a plugin I've realized that the
vmis passed to the plugin function.I guess you would need to write in your markdown something like
{{author}}and then in the beforeHook you can do something likeBut I think it makes sense to setup a convention for variables in general in docsify and provide to replace them by frontmatter attributes and implement it into the docsify core.
jthegedus commentedon Jan 24, 2019
Ah okay, a working example people could look at would go a long way here. I fear many people would overlook using docsify because front matter does not work as people would expect.
I do agree that
would go a long way and remove most of my concerns with this plugin 😄
timaschew commentedon Jan 29, 2019
see #758
BinaryPaean commentedon Dec 6, 2019
I can't even figure out how to activate front-matter to simply prevent YAML frontmatter in my 'README.md' from polluting the docsify site.
I've tried variations of:
With no success. Can anyone point me at basic usage?
szkiba commentedon Feb 4, 2020
You can substitute variables with docsify-mustache plugin using mustache syntax
{{variable}}. Variables can be defined in front matter, external JSON|XML files or in docsify configuration.If you use front-matter plugin, then the front matter variables will be available. Here is a demo using front matter:
https://docsify-mustache.github.io/#/?id=front-matter
stale commentedon Apr 4, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.