diff options
-rw-r--r-- | exampleSite/config.yml | 5 | ||||
-rw-r--r-- | layouts/partials/js.html | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 967505f..9060163 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -162,6 +162,11 @@ params: # Default: true useRelativeTime: true + # If enabled, doesn't show seconds on relative times. + # + # Default: false + skipSeconds: false + # What header design should we use? # # Default: true diff --git a/layouts/partials/js.html b/layouts/partials/js.html index c4c5a85..8465483 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -67,7 +67,11 @@ if (interval > 1) { return interval + ' {{ T "minsAgo" }}'; } - return Math.floor(seconds) + '{{ T "secondsAgo" }}'; + {{ if .Site.Params.skipSeconds }} + return '<1 {{ T "minsAgo" }}' + {{ else }} + return Math.floor(seconds) + '{{ T "secondsAgo" }}'; + {{ end }} } /** |