-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
how to display the author and create time in every md page? #750
Comments
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 More in docs: https://github.com/docsifyjs/docsify/blob/master/docs/configuration.md#formatupdated |
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. |
@timaschew an example doing so with the |
Okay let's improve the documentation for that plugin. |
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 |
Yes that was also my initial question. But then after I saw the page about writing a plugin I've realized that the I guess you would need to write in your markdown something like content.replace(/{{(.*)}}/g, function(match, group) {
return vm.frontmatter[group]
}) 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
would go a long way and remove most of my concerns with this plugin 😄 |
see #758 |
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: window.$docsify = { frontMatter: true }
window.$docsify = { front-matter: true }
windows.$docsify = { front-matter: 'README.md' }
... With no success. Can anyone point me at basic usage? |
You can substitute variables with docsify-mustache plugin using mustache syntax |
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. |
No description provided.
The text was updated successfully, but these errors were encountered: