Skip to content

Commit

Permalink
[sitemap] Fixes #334
Browse files Browse the repository at this point in the history
This creates a custom sitemap for us.
- No asset files
- Links to the API
- Includes /docs/api
- Last Modified is okay-okay
- Decided not to index alternate_urls based on guidance from Google
  https://twitter.com/JohnMu/status/1509051100372078592 that sitemaps
  should not include redirect URLs
  • Loading branch information
captn3m0 committed Apr 8, 2022
1 parent 4a1b516 commit b29d921
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 24 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ group :jekyll_plugins do
gem "just-the-docs"
gem 'jekyll-seo-tag'
gem 'jekyll-last-modified-at'
gem 'jekyll-sitemap'
gem 'jemoji'
end

Expand Down
41 changes: 19 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.2.2)
activesupport (7.0.2.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.9)
concurrent-ruby (1.1.10)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
faraday (1.9.3)
faraday (1.10.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand All @@ -39,7 +39,7 @@ GEM
faraday-retry (1.0.3)
ffi (1.15.5)
forwardable-extended (2.6.0)
gapic-common (0.7.0)
gapic-common (0.8.0)
faraday (~> 1.3)
google-protobuf (~> 3.14)
googleapis-common-protos (>= 1.3.11, < 2.a)
Expand All @@ -51,36 +51,36 @@ GEM
google-cloud-container-v1 (>= 0.0, < 2.a)
google-cloud-container-v1beta1 (>= 0.0, < 2.a)
google-cloud-core (~> 1.6)
google-cloud-container-v1 (0.7.3)
google-cloud-container-v1 (0.8.0)
gapic-common (>= 0.7, < 2.a)
google-cloud-errors (~> 1.0)
google-cloud-container-v1beta1 (0.8.3)
google-cloud-container-v1beta1 (0.9.0)
gapic-common (>= 0.7, < 2.a)
google-cloud-errors (~> 1.0)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.2.0)
google-protobuf (3.19.3)
google-protobuf (3.20.0)
googleapis-common-protos (1.3.12)
google-protobuf (~> 3.14)
googleapis-common-protos-types (~> 1.2)
grpc (~> 1.27)
googleapis-common-protos-types (1.3.0)
googleapis-common-protos-types (1.3.1)
google-protobuf (~> 3.14)
googleauth (1.1.0)
faraday (>= 0.17.3, < 2.0)
googleauth (1.1.2)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.42.0)
google-protobuf (~> 3.18)
grpc (1.45.0)
google-protobuf (~> 3.19)
googleapis-common-protos-types (~> 1.0)
html-pipeline (2.14.0)
html-pipeline (2.14.1)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
Expand Down Expand Up @@ -110,8 +110,6 @@ GEM
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-timeago (0.14.0)
mini_i18n (>= 0.8.0)
jekyll-watch (2.2.1)
Expand All @@ -125,7 +123,7 @@ GEM
jekyll-seo-tag (~> 2.0)
rake (>= 12.3.1, < 13.1.0)
jwt (2.3.0)
kramdown (2.3.1)
kramdown (2.3.2)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
Expand Down Expand Up @@ -159,9 +157,9 @@ GEM
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
signet (0.16.0)
signet (0.16.1)
addressable (~> 2.8)
faraday (>= 0.17.3, < 2.0)
faraday (>= 0.17.5, < 3.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
terminal-table (2.0.0)
Expand All @@ -180,12 +178,11 @@ DEPENDENCIES
jekyll-feed (~> 0.16)
jekyll-last-modified-at
jekyll-seo-tag
jekyll-sitemap
jekyll-timeago
jemoji
just-the-docs
tzinfo-data
webrick (~> 1.7)

BUNDLED WITH
2.2.26
2.3.10
1 change: 0 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins:
- jekyll-timeago
- jekyll-seo-tag
- jekyll-last-modified-at
- jekyll-sitemap
- jemoji
exclude:
- Gemfile
Expand Down
25 changes: 25 additions & 0 deletions sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' | where_exp:'doc','doc.url != "/404.html"' %}
{% for page in pages %}
{% capture last_modified_at %}
{% if page.last_modified_at %}
<lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
{% endif %}
{% endcapture %}
<url>
<loc>{{ page.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
{{last_modified_at}}
</url>
{% if page.releases %}
<url>
<loc>{{ page.url | replace:'/index.html','/' | prepend: "/api" | append:'.json' | absolute_url | xml_escape }}</loc>
{{last_modified_at}}
</url>
{% endif %}
{% endfor %}
</urlset>

0 comments on commit b29d921

Please sign in to comment.