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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/bridgetown-sitemap/version.rb +1 -1
- data/lib/bridgetown/resource/base.rb +7 -1
- data/test/fixtures/src/_posts/2019-07-14-last-modified-at.md +3 -1
- data/test/test_sitemap.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f226e2e56bf64f42b6a99beb1746bb7f80978afd15d32184811d48407d49c748
|
4
|
+
data.tar.gz: 7f32c80706a3f471d5f06ebe160a08c98a42e2e454c58f07687b5f180b6fb026
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98a535901ad01db535da8c6f9edebdd77486ae18a02807ec888473d7eb70fe0d02bc9438ac5f23a4710a7c1e8bde768db0b37b37f2f83ac6cbff8c4d4b0ad118
|
7
|
+
data.tar.gz: f54dec2c2f477bd7f4ea88dce67564e01ea4b7d94df19ee7523fcc18c8ae96245029475a038240d617e049747df570d3f35212e7507a43cd056693c152acd882
|
data/CHANGELOG.md
ADDED
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
|
34
|
+
2. The modified date of the file as reported by the `git log`.
|
35
35
|
|
36
36
|
|
37
37
|
## Exclusions
|
@@ -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 ||
|
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
|
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>
|
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.
|
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-
|
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
|