bridgetown-sitemap 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0baaab38ea6feb29653fec867f81a3cff27f8423497ebd91b5b43b786f4f3cc
4
- data.tar.gz: 1ee7250c217916417007949bc5238fffa139a7ecbe3e46b87e3dd289a61e813a
3
+ metadata.gz: f226e2e56bf64f42b6a99beb1746bb7f80978afd15d32184811d48407d49c748
4
+ data.tar.gz: 7f32c80706a3f471d5f06ebe160a08c98a42e2e454c58f07687b5f180b6fb026
5
5
  SHA512:
6
- metadata.gz: be2ff77fd2e15d1741fa8a57938059d0c475a44a226353b9be2fd12d8469a9c073b103794957390c95a5d157a64332d1196bdfb33e3f7a80407fef228d9ff9ac
7
- data.tar.gz: 2fcab96c2edaae32d3355328e8afec2d84878af173ec9d02c452b37aa75c3e4566a116b3cf5dc77aa2b9e989c1053e09dc8c9772a8fc4d0b2b2b5c1e6124465b
6
+ metadata.gz: 98a535901ad01db535da8c6f9edebdd77486ae18a02807ec888473d7eb70fe0d02bc9438ac5f23a4710a7c1e8bde768db0b37b37f2f83ac6cbff8c4d4b0ad118
7
+ data.tar.gz: f54dec2c2f477bd7f4ea88dce67564e01ea4b7d94df19ee7523fcc18c8ae96245029475a038240d617e049747df570d3f35212e7507a43cd056693c152acd882
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # main
2
+
3
+ # 1.1.0 / 07-05-2021
4
+
5
+ * Change `<lastmod>` behaviour to use time from `git log` rather than from the filesystem.
6
+
7
+ # 1.0.0 / 06-05-2021
8
+
9
+ * Initial release
data/README.md CHANGED
@@ -31,7 +31,7 @@ content_engine: "resource"
31
31
  The `<lastmod>` tag in the `sitemap.xml` will reflect by priority:
32
32
 
33
33
  1. A personalised date if you add the variable `last_modified_at:` with a date in the Front Matter. (*Dates need to be formatted as* `%Y-%m-%d %H:%M:%S %z`)
34
- 2. The modified date of the file as reported by the filesystem.
34
+ 2. The modified date of the file as reported by the `git log`.
35
35
 
36
36
 
37
37
  ## Exclusions
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownSitemap
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -4,7 +4,13 @@ module Bridgetown
4
4
  module Resource
5
5
  class Base
6
6
  def sitemap_last_modified_at
7
- data.last_modified_at || File.mtime(path) || date
7
+ data.last_modified_at || latest_git_commit_date || date
8
+ end
9
+
10
+ private
11
+
12
+ def latest_git_commit_date
13
+ Time.parse(`git log -1 --pretty="format:%cI" "#{path}"`)
8
14
  end
9
15
  end
10
16
  end
@@ -1,4 +1,6 @@
1
1
  ---
2
2
  ---
3
3
 
4
- Please don't modify this file. It's modified time is important.
4
+ This file was modified on the date England won the Cricket World Cup!
5
+
6
+ Please don't modify this file as that date is asserted in tests.
data/test/test_sitemap.rb CHANGED
@@ -46,7 +46,7 @@ class TestSitemap < BridgetownSitemap::Test
46
46
  assert_match %r!<lastmod>2021-05-06T00:00:00(-|\+)\d+:\d+</lastmod>!, @sitemap
47
47
  assert_match %r!<lastmod>2021-03-04T00:00:00(-|\+)\d+:\d+</lastmod>!, @sitemap
48
48
  assert_match %r!<lastmod>2021-03-02T00:00:00(-|\+)\d+:\d+</lastmod>!, @sitemap
49
- assert_match %r!<lastmod>2020-12-24T03:51:50\+00:00</lastmod>!, @sitemap
49
+ assert_match %r!<lastmod>2019-07-14T18:22:00\+00:00</lastmod>!, @sitemap
50
50
  end
51
51
 
52
52
  should "puts all the static HTML files in the sitemap.xml file" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ayush Newatia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-06 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -80,6 +80,7 @@ extra_rdoc_files: []
80
80
  files:
81
81
  - ".gitignore"
82
82
  - ".rubocop.yml"
83
+ - CHANGELOG.md
83
84
  - Gemfile
84
85
  - LICENSE.md
85
86
  - README.md