Coder Social home page Coder Social logo

Comments (6)

timvink avatar timvink commented on May 27, 2024

Hi @michalzobec. Good to hear it's useful for you!

So if I understand correctly, you would like the revision date to be based off of a page meta variable like PublishedDate, instead of the last git commit on a file?

The date would have to be in ISO8601 format, and the variable name to look for should be configurable in the config.

Could be useful, but not sure if it fits in the scope of the plugin (which is revision-date based on git). I'll think about it, and also wait and see if some users upvote the issue.

from mkdocs-git-revision-date-localized-plugin.

michalzobec avatar michalzobec commented on May 27, 2024

Hello @timvink

thank you for your fast reply :)

So if I understand correctly, you would like the revision date to be based off of a page meta variable like PublishedDate, instead of the last git commit on a file?

sorry, no. I need use both, your information, and my information (variable).

your plugin inserts information about last update. my variable inserts the date of first publish of same article.

for examle:

Published: <some date here>
Last update: <some date here>

Last update is your information from your plugin.
Published is my information from my variable in same article.

Here is real example: https://pomoc2.zobecdev.cz/testpage/

2021-02-28 22_45_09-Test Page - Pomoc a podpora

you will found on begin of page:

Vydáno: 01.12.2020 14:00:00
Změněno: 27. února 2021 22:38:39

It is clear for you now? :)

The date would have to be in ISO8601 format, and the variable name to look for should be configurable in the config.

yes, I understand that. :)

Have nice day.

Michal

from mkdocs-git-revision-date-localized-plugin.

timvink avatar timvink commented on May 27, 2024

Oh I see. The {{ page.meta.git_revision_date_localized }} tag has been embedded into mkdocs-material (see https://github.com/squidfunk/mkdocs-material/blob/master/material/partials/source-date.html), which is why you don't need an override for that one.

Using overrides is the preferred way to go. You can improve your setup by overriding the source-date.html instead of main.html, which will make your customization much more stable (as mkdocs-material's main.html is updated much more frequently, meaning you will have to update your override more often).

from mkdocs-git-revision-date-localized-plugin.

michalzobec avatar michalzobec commented on May 27, 2024

yeah, but if you add you support for custom meta variable (to your plugin), I do not must use override. and that's why I asked you, for exactly the reasons you're giving. so that I don't have to deal with customizations at all and have problems with upgrades.

from mkdocs-git-revision-date-localized-plugin.

timvink avatar timvink commented on May 27, 2024

Initially to use this plugin's {{ page.meta.git_revision_date_localized }} with mkdocs-material theme, you also needed to use an override. Because so many people use this plugin, I was able to convince the author of mkdocs-material to update his template to include it.

If you want support for your PublishedDate variable inside mkdocs-material, you will have to open an issue in that repository. Overriding partials is the preferred way of extending a theme, and mkdocs-material providing the very specific partials/source-date.html makes it really easy already. But if you can make a strong case in an issue to mkdocs-material perhaps you will be able to convince the author.

from mkdocs-git-revision-date-localized-plugin.

michalzobec avatar michalzobec commented on May 27, 2024

ahh, okay, thanks :)

from mkdocs-git-revision-date-localized-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.