mkdocs-git-authors-plugin
mkdocs-git-authors-plugin copied to clipboard
Plain text output for HTML meta tag
I was wondering if there was a way to get a plain text list of authors, i.e.
Turbato Thomas, Elodeon Nick
instead of
<span class="git-page-authors git-authors"><a href="mailto:[email protected]">Turbato Thomas</a> (98.0%), <a href="mailto:[email protected]">Elodeon Nick</a> (2.0%)</span>
In this way one could set the page "author" meta tag without the need to specify authors manually in the markdown file, as MkDocs Material does here:
{% if page and page.meta and page.meta.author %}
<meta name="author" content="{{ page.meta.author }}">
{% elif config.site_author %}
<meta name="author" content="{{ config.site_author }}">
{% endif %}
Setting the tag would also make the website appear like this in Firefox reader view:
I was wondering if there was a way to get a plain text list of authors, i.e.
Yes, you could use the {{ git_info }}
object to achieve this when overriding a template block. See the docs for an example: https://timvink.github.io/mkdocs-git-authors-plugin/usage.html#in-theme-templates
In this way one could set the page "author" meta tag without the need to specify authors manually in the markdown file, as MkDocs Material does here:
I am not sure I understand your use case.
That said, adding an option to set plain_text: true
shouldn't be too much work, and I'd gladly accept a PR for this.
Note that you can now either:
- Set the option
show_email_address
tofalse
(https://timvink.github.io/mkdocs-git-authors-plugin/options.html#show_email_address) - Use theme customization and the
git_info
variable to customize your site