#+title: Tests for org-hugo-suppress-lastmod-period set to 2 days

#+hugo_base_dir: ../

#+filetags: suppress lastmod nonzero

#+author:

* Common
:PROPERTIES:
:CUSTOM_ID: common
:END:
~org-hugo-suppress-lastmod-period~ is set to *172800.0* seconds (2
days) in Local Variables.

/For tests, the "current date" is always Dec 21, 2100./
* Auto set lastmod                                                  :autoset:
:PROPERTIES:
:EXPORT_HUGO_AUTO_SET_LASTMOD: t
:END:
** Suppress lastmod with auto-set-lastmod
:PROPERTIES:
:EXPORT_DATE: 2100-12-21
:EXPORT_FILE_NAME: suppress-lastmod-in-subtree-with-auto-lastmod
:END:
#+begin_description
~lastmod~ front-matter parameter is suppressed in this post.
#+end_description

#+include: "./suppress-lastmod-period-non-zero.org::#common" :only-contents t

The export date is set to be the same as the "current date" (so the
delta is 0).
** Suppress lastmod non-zero, but date unset                     :date:unset:
:PROPERTIES:
:EXPORT_FILE_NAME: suppress-lastmod-non-zero-but-date-unset
:END:
#+begin_description
Ensure that nil value of parsed DATE is also handled in the "suppress
lastmod" logic.
#+end_description
Test for the bug-fix when ~date-str~ (internal variable) could be
/nil/.

[[https://github.com/kaushalmodi/ox-hugo/pull/197#issuecomment-421533876][Ref]]
** Unsuppress lastmod
:PROPERTIES:
:EXPORT_DATE: 2100-12-10
:EXPORT_FILE_NAME: unsuppress-lastmod-in-subtree
:END:
#+begin_description
~lastmod~ front-matter parameter is *not* suppressed in this post.
#+end_description

#+include: "./suppress-lastmod-period-non-zero.org::#common" :only-contents t

The export date is set to be 11 days prior to the "current date". This
is more than the suppress period of 2 days. So this post will export
=lastmod=.
* Manually set lastmod                                               :manual:
:PROPERTIES:
:EXPORT_HUGO_AUTO_SET_LASTMOD: nil
:END:
** Don't suppress lastmod as it is not set automatically
:PROPERTIES:
:EXPORT_FILE_NAME: lastmod-set-manually-dont-suppress
:EXPORT_DATE: 2100-12-21
:EXPORT_HUGO_LASTMOD: 2100-12-21
:END:
#+begin_description
~lastmod~ front-matter parameter is *not* suppressed in this post
because its value is set *manually*.
#+end_description

#+include: "./suppress-lastmod-period-non-zero.org::#common" :only-contents t

The value of ~org-hugo-suppress-lastmod-period~ is ignored in this
case as auto-setting of ~lastmod~ is disabled.
* Local Variables                                                   :ARCHIVE:
# Local Variables:
# org-hugo-suppress-lastmod-period: 172800.0
# End:
