diff --git a/index.html b/index.html index 93129f47..fa70e896 100644 --- a/index.html +++ b/index.html @@ -151,7 +151,7 @@ speak multiple languages and allow you to easily create localized websites.
Version: 0.1.post1
+Version: 1.0.0
Author: Jeff Dairiki @@ -131,7 +122,8 @@
+ +This Lektor plugin implements a new datetime-like type,
gittimestamp
, which gets it's default value from git timestamps.
This can be used to implement auto-updating pub_date
and last_mod
@@ -150,7 +142,7 @@ list of timestamps. That list of timestamps is filtered based on the
ignore_commits
and skip_first_commit
options (see below); then,
finally, a timestamp is selected from those that remain based on the
setting of the strategy
option.
The gittimestamp
type supports the following options.
ignore_commits
This can be set to a string, which is interpreted as a regular
@@ -188,6 +180,34 @@ result at first
, but if the timestamps in the git log are not monot
this will select the minimum of all the timestamps remaining after any filtering.
The following global configuration options are supported.
+These values are specified by way of the plugins' configuration file:
+configs/git-timestamp.ini
under the project site directory.
By default, the --follow
option is passed to git log
when
+computing timestamps. This behavior may be adjusted on a global basis by way of the plugins' configuration file (configs/git-timestamp.ini
under the project site directory) via the following settings:
follow_renames
This is a boolean setting that specifies whether the
+--follow
option should be passed to git log
when
+querying git for timestamps. This options causes git
to attempt to
+follow file renames.
Currently, the follow_renames
is not supported when Lektor
+Alternatives are enabled.
If unspecified, follow_renames
defaults to false.
++Changed in version 1.0.0b3: The default value for +
+follow_renames
was changed from true to false.
++Note Since we currently run
+git log
on a per-record basis, when--follow
+is specified, copied files may be detected as “renamed”. This may not be ideal.
follow_rename_threshold
Set the similarity index threshold (passed to git log
via its
+-M
option) used when detecting renames. This should be
+specified as a (floating point) number between 0 and 100,
+inclusive. Setting follow_rename_threshold = 100
will limit
+detection to exact renames only. The default value is 50.
Here is a simple example excerpt from a datamodel file:
<...>
@@ -226,26 +246,80 @@ most recent commit for the file, except that:
If there has only been one commit of the source file, last_mod
will not have
a default value. (It will evaluate to a jinja2 Undefined instance.)
-Warning: On sorting by gittimestamp
in Lektor <= 3.2
+Warning: On sorting by gittimestamp
in Lektor < 3.3
A common use case for timestamps is for sorting records.
E.g. in a blog one generally wants to display posts in reverse
chronological order by post date. This generally won't work using
-gittimestamp
timestamps under any currently released version of Lektor.
+gittimestamp
timestamps with version of Lektor before 3.3.
The gittimestamp
type is implemented using a field
descriptor. (This is required in order to defer computation of the
field value until after the record for the page is available.) In
-lektor<=3.2
, field descriptors are supported for most usages, the
+lektor<3.3
, field descriptors are supported for most usages, the
one glaring exception being when sorting records.
This was fixed in Lektor PR
#789 which was merged to
-the master branch on February 6, 2021.
-Unfortunately, the last released version of Lektor (as of August 12,
-2021) is version 3.2, released August 20, 2020. For now, you'll have
-to install Lektor from git if you want to be able to sort records by
-gittimestamp
.
+the master branch on February 6, 2021, but didn't make it into a release
+until Lektor 3.3, released on December 13 2021.
Author
Jeff Dairiki dairiki@dairiki.org
Changelog
+Release 1.0.0 (2024-02-06)
+No code changes from 1.0.0b3
+Release 1.0.0b3 (2024-01-23)
+Breaking Changes
+
follow_renames
global config setting has
+changed from true to false.follow_renames
global option is not supported.black
, reorder-python-imports
, and flake8
.pkg_resources
.git log
output. (This was
+erroneously removing trailing newlines from the final commit
+message.)Test under python 3.10 and 3.11. (#2)
+Test that lektor.db.Record.get_sort_key
works with
+descriptor-valued fields. (This requires lektor>=3.3
.)
No code changes.
Add warning to README about lektor > 3.2
(not yet released) being