README.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Use Mercurial commit to determine page date
  2. ===========================================
  3. If your blog content is versioned via Mercurial, this plugin will set
  4. articles' and pages' ``metadata['date']`` to correspond to that of the
  5. hg commit. This plugin depends on the ``hglib`` python package,
  6. which can be installed via::
  7. sudo apt-get install python-hglib
  8. or::
  9. pip install hglib
  10. The date is determined via the following logic:
  11. * if a file is not tracked by hg, or a file is added but never committed
  12. - metadata['date'] = filesystem time
  13. - metadata['modified'] = filesystem time
  14. * if a file is tracked, but no changes in working directory
  15. - metadata['date'] = first commit time
  16. - metadata['modified'] = last commit time
  17. * if a file is tracked, and has changes in working directory
  18. - metadata['date'] = first commit time
  19. - metadata['modified'] = filesystem time
  20. When this module is enabled, ``date`` and ``modified`` will be determined
  21. by hg status; no need to manually set in article/page metadata. And
  22. operations like copy and move will not affect the generated results.
  23. If you don't want a given article or page to use the hg time, set the
  24. metadata to ``hgtime: off`` to disable it.
  25. You can also set ``HG_FILETIME_FOLLOW`` to ``True`` in your settings to
  26. make the plugin follow file renames — i.e., ensure the creation date matches
  27. the original file creation date, not the date it was renamed.
  28. Credits
  29. =======
  30. This plugin is based on filetime_from_git.