sitemap_generator 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGES.md +250 -0
  3. data/README.md +156 -125
  4. data/VERSION +1 -1
  5. data/lib/capistrano/tasks/sitemap_generator.cap +21 -23
  6. data/lib/sitemap_generator.rb +1 -2
  7. data/lib/sitemap_generator/adapters/s3_adapter.rb +5 -0
  8. data/lib/sitemap_generator/application.rb +1 -1
  9. data/lib/sitemap_generator/builder/sitemap_file.rb +7 -3
  10. data/lib/sitemap_generator/builder/sitemap_url.rb +1 -10
  11. data/lib/sitemap_generator/link_set.rb +16 -10
  12. data/lib/sitemap_generator/{sitemap_namer.rb → simple_namer.rb} +1 -1
  13. data/lib/sitemap_generator/sitemap_location.rb +13 -1
  14. data/lib/sitemap_generator/tasks.rb +2 -2
  15. metadata +51 -123
  16. data/Gemfile +0 -13
  17. data/Gemfile.lock +0 -38
  18. data/Rakefile +0 -43
  19. data/spec/blueprint.rb +0 -15
  20. data/spec/files/sitemap.create.rb +0 -12
  21. data/spec/files/sitemap.groups.rb +0 -49
  22. data/spec/sitemap_generator/adapters/s3_adapter_spec.rb +0 -23
  23. data/spec/sitemap_generator/alternate_sitemap_spec.rb +0 -100
  24. data/spec/sitemap_generator/application_spec.rb +0 -69
  25. data/spec/sitemap_generator/builder/sitemap_file_spec.rb +0 -110
  26. data/spec/sitemap_generator/builder/sitemap_index_file_spec.rb +0 -124
  27. data/spec/sitemap_generator/builder/sitemap_index_url_spec.rb +0 -28
  28. data/spec/sitemap_generator/builder/sitemap_url_spec.rb +0 -192
  29. data/spec/sitemap_generator/core_ext/bigdecimal_spec.rb +0 -20
  30. data/spec/sitemap_generator/core_ext/numeric_spec.rb +0 -43
  31. data/spec/sitemap_generator/file_adaptor_spec.rb +0 -20
  32. data/spec/sitemap_generator/geo_sitemap_spec.rb +0 -30
  33. data/spec/sitemap_generator/helpers/number_helper_spec.rb +0 -196
  34. data/spec/sitemap_generator/interpreter_spec.rb +0 -90
  35. data/spec/sitemap_generator/link_set_spec.rb +0 -864
  36. data/spec/sitemap_generator/mobile_sitemap_spec.rb +0 -27
  37. data/spec/sitemap_generator/news_sitemap_spec.rb +0 -42
  38. data/spec/sitemap_generator/pagemap_sitemap_spec.rb +0 -57
  39. data/spec/sitemap_generator/sitemap_generator_spec.rb +0 -591
  40. data/spec/sitemap_generator/sitemap_groups_spec.rb +0 -144
  41. data/spec/sitemap_generator/sitemap_location_spec.rb +0 -210
  42. data/spec/sitemap_generator/sitemap_namer_spec.rb +0 -96
  43. data/spec/sitemap_generator/templates_spec.rb +0 -24
  44. data/spec/sitemap_generator/utilities/existence_spec.rb +0 -26
  45. data/spec/sitemap_generator/utilities/hash_spec.rb +0 -57
  46. data/spec/sitemap_generator/utilities/rounding_spec.rb +0 -31
  47. data/spec/sitemap_generator/utilities_spec.rb +0 -101
  48. data/spec/sitemap_generator/video_sitemap_spec.rb +0 -117
  49. data/spec/spec_helper.rb +0 -24
  50. data/spec/support/file_macros.rb +0 -39
  51. data/spec/support/schemas/siteindex.xsd +0 -73
  52. data/spec/support/schemas/sitemap-geo.xsd +0 -41
  53. data/spec/support/schemas/sitemap-mobile.xsd +0 -32
  54. data/spec/support/schemas/sitemap-news.xsd +0 -159
  55. data/spec/support/schemas/sitemap-pagemap.xsd +0 -97
  56. data/spec/support/schemas/sitemap-video.xsd +0 -643
  57. data/spec/support/schemas/sitemap.xsd +0 -115
  58. data/spec/support/xml_macros.rb +0 -67
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDE5YzhmMzI3Mzk0ZDIxNGExNjk5OTE5MTMxMTZiYzQ1NjY2NzA5NQ==
4
+ N2IwNTliN2E5Y2EwMzhlNzk3NzU5MTE5MzUwYzcwODA1OTU2N2VhOA==
5
5
  data.tar.gz: !binary |-
6
- MTY1OTNhMWE4ZWNiN2JjMzU0ZTUzYzAyZjJhNmE5ZTQ4NjM1MDVkYw==
6
+ NjBmN2FmZGIwYWRjMmQ4Mzc1NDlmZTc0Njg0ZTFiNTY1ZmRlZjdlNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2NhNmU1OWUwMWM3NTMyMDhmZmU3MmI4NDJjMWYyOWZmOGMzNTkxZTBmMzA0
10
- Nzk1M2VjZWU2YzdhZmNkOWYwNDZmY2Q5OWQ0MzAxM2MyYTBhMjhkNjczYTZk
11
- NzczMzVkNDhmY2I5OTU2MTFlNTNmN2JlYzRiNmJiOTkzOTc4ZWM=
9
+ M2IzOGIxMDQ0MjM0NWI4ZDA5MDNiNTgwMzA0MWQ5NTFiMGI0NmVkNzNhZGY1
10
+ M2FkYzYxZDY4YjgzMzIzYmY2YTliMThlNzY2ZTFkZmM4MDI3ZTA2NzI4MTZm
11
+ OTQzNGQ5ZDhhMWM0ZDliOTVjMGEyZDIyNTlkZjUyM2E5NDM3ZGQ=
12
12
  data.tar.gz: !binary |-
13
- ZGNiZjJkMzI0ZmViZmM3OTk4MTFmYWQ4YTA5OWY4ODIzMWQyYWMxMzQ3ZmYw
14
- OGY2NTdkNzY5YWJkZGJiNTc1MTVkOWFhYTM1MDZjMjczZjI3MWU1ODIwNjZm
15
- MjUyNjc4OTRkMWIwMDZjNDBmOGYzZDAzZTgzYjE2NGU3M2E0ZmY=
13
+ MGYxNTM3NTNhMzI3MjFlZGRjOTg2NmJlYWMyMjg5YmRkNTg0OGI3Y2IyNzBk
14
+ MDUyZWEzZjE3NWIwZjdmMjBmMWNmZmEwMDBmMDU5ODMzMGY2ODE5ZDc3NWQ3
15
+ YzQ1Zjg3MThmMjJiMzg2ODQ1Yjk5ODQ2YzJjMzRlMjUyNGNhZTU=
@@ -0,0 +1,250 @@
1
+ ### 5.3.0
2
+
3
+ * Add `max_sitemap_links` option support for limiting how many links each sitemap can hold. Issue [#188](https://github.com/kjvarga/sitemap_generator/issues/188) PR [#262](https://github.com/kjvarga/sitemap_generator/pull/262)
4
+ * Upgrade development dependencies
5
+ * Modernize Gemfile & gemspec
6
+ * Bring specs up to RSpec 3.5
7
+ * Remove Geo sitemap support. Google no longer supports them. Issue [#246](https://github.com/kjvarga/sitemap_generator/issues/246)
8
+ * Use `sitemap` namespace for Capistrano tasks (rather than `deploy`). PR [#241](https://github.com/kjvarga/sitemap_generator/pull/241)
9
+ * Use presence of `Rails::VERSION` to detect when running under Rails, rather than just `Rails` constant. PR [#221](https://github.com/kjvarga/sitemap_generator/pull/221)
10
+ * Remove gem post-install message warning about incompatible changes in version 4
11
+
12
+ ### 5.2.0
13
+
14
+ * New `SitemapGenerator::AwsSdkAdapter` adapter using the bare aws-sdk gem.
15
+ * Fix Bing ping url.
16
+ * Support string option keys passed to `add`.
17
+ * In Railtie, Load the rake task instead of requiring them.
18
+
19
+ ### 5.1.0
20
+
21
+ * Require only `fog-aws` instead of `fog` for the `S3Adapter` and support using IAM profile instead of setting access key & secret directly.
22
+ * Implement `respond_to?` on the `SitemapGenerator::Sitemap` pseudo class.
23
+ * Make `:lang` optional on alternate links so they can be used for [AppIndexing](https://developers.google.com/app-indexing/reference/deeplinks).
24
+ * Documented Mobile Sitemaps `:mobile` option.
25
+
26
+ ### 5.0.5
27
+
28
+ * Use MIT licence.
29
+ * Fix deploys with Capistrano 3 ([#163](https://github.com/kjvarga/sitemap_generator/issues/163)).
30
+ * Allow any Fog storage options for S3 adapter ([#167](https://github.com/kjvarga/sitemap_generator/pull/167)).
31
+
32
+ ### 5.0.4
33
+
34
+ * Don't include the `media` attribute on alternate links unless it's given
35
+
36
+ ### 5.0.3
37
+
38
+ * Add support for Video sitemaps options `:live` and ':requires_subscription'
39
+
40
+ ### 5.0.2
41
+
42
+ * Set maximum filesize to 10,000,000 bytes rather than 10,485,760 bytes.
43
+
44
+ ### 5.0.1
45
+
46
+ * Include new `SitemapGenerator::FogAdapter` ([#138](https://github.com/kjvarga/sitemap_generator/pull/138)).
47
+ * Fix usage of attr_* methods in `LinkSet`
48
+ * Don't override custom getters/setters ([#144](https://github.com/kjvarga/sitemap_generator/pull/144)).
49
+ * Fix breaking spec in Ruby 2 ([#142](https://github.com/kjvarga/sitemap_generator/pull/142)).
50
+ * Include Capistrano 3.x tasks ([#141](https://github.com/kjvarga/sitemap_generator/pull/141)).
51
+
52
+ ### 5.0.0
53
+
54
+ * Support new `:compress` option for customizing which files get compressed.
55
+ * Remove old deprecated methods:
56
+ * Removed options to `LinkSet::add()`: `:sitemaps_namer` and `:sitemap_index_namer` (use `:namer` option)
57
+ * Removed `LinkSet::sitemaps_namer=`, `LinkSet::sitemaps_namer` (use `LinkSet::namer=` and `LinkSet::namer`)
58
+ * Removed `LinkSet::sitemaps_index_namer=`, `LinkSet::sitemaps_index_namer` (use `LinkSet::namer=` and `LinkSet::namer`)
59
+ * Removed the `SitemapGenerator::SitemapNamer` class (use `SitemapGenerator::SimpleNamer`)
60
+ * Removed `LinkSet::add_links()` (use `LinkSet::create()`)
61
+ * Support `fog_path_style` option in the `SitemapGenerator::S3Adapter` so buckets with dots in the name work over HTTPS without SSL certificate problems.
62
+
63
+ ### 4.3.1
64
+
65
+ * Support integer timestamps.
66
+ * Update README for new features added in last release.
67
+
68
+ ### 4.3.0
69
+
70
+ * Support `media` attibute on alternate links ([#125](https://github.com/kjvarga/sitemap_generator/issues/125)).
71
+ * Changed `SitemapGenerator::S3Adapter` to write files in a single operation, avoiding potential permissions errors when listing a directory prior to writing ([#130](https://github.com/kjvarga/sitemap_generator/issues/130)).
72
+ * Remove Sitemap Writer from ping task ([#129](https://github.com/kjvarga/sitemap_generator/issues/129)).
73
+ * Support `url:expires` element ([#126](https://github.com/kjvarga/sitemap_generator/issues/126)).
74
+
75
+ ### 4.2.0
76
+
77
+ * Update Google ping URL.
78
+ * Quote the ping URL in the output.
79
+ * Support Video `video:price` element ([#117](https://github.com/kjvarga/sitemap_generator/issues/117)).
80
+ * Support symbols as well as strings for most arguments to `add()` ([#113](https://github.com/kjvarga/sitemap_generator/issues/113)).
81
+ * Ensure that `public_path` and `sitemaps_path` end with a slash (`/`) ([#113](https://github.com/kjvarga/sitemap_generator/issues/118)).
82
+
83
+ ### 4.1.1
84
+
85
+ * Support setting the S3 region.
86
+ * Fixed bug where incorrect URL was being used in the ping to search engines - only affected sites with a single sitemap file and no index file.
87
+ * Output the URL being pinged in the verbose output.
88
+ * Test in Rails 4.
89
+
90
+ ### 4.1.0
91
+
92
+ * [PageMap sitemap][using_pagemaps] support.
93
+ * Tested with Rails 4 pre-release.
94
+
95
+ ### 4.0.1
96
+
97
+ * Add a post install message regarding the naming convention change.
98
+
99
+ ### 4.0
100
+
101
+ * **NEW, NON-BACKWARDS COMPATIBLE CHANGES.**
102
+ * `create_index` defaults to `:auto`.
103
+ * Define `SitemapGenerator::SimpleNamer` class for simpler custom namers compatible with the new naming conventions.
104
+ * Deprecate `sitemaps_namer`, `sitemap_index_namer` and their respective namer classes.
105
+ * Support `nofollow` option on alternate links.
106
+ * Fix formatting of `publication_date` in News sitemaps.
107
+
108
+ ### 3.4
109
+
110
+ * Support [alternate links][alternate_links] for urls
111
+ * Support configurable options in the `SitemapGenerator::S3Adapter`
112
+
113
+ ### 3.3
114
+
115
+ * Support creating sitemaps with no index file
116
+
117
+ ### 3.2.1
118
+
119
+ * Fix syntax error in `SitemapGenerator::S3Adapter`
120
+
121
+ ### 3.2
122
+
123
+ * Support mobile tags
124
+ * Add `SitemapGenerator::S3Adapter`, a simple S3 adapter which uses Fog and doesn't require CarrierWave
125
+ * Remove Ask from the sitemap ping because the service has been shutdown
126
+ * [Turn off `include_index`][include_index_change] by default
127
+ * Fix the news XML namespace
128
+ * Only include `autoplay` attribute if present
129
+
130
+ ### 3.1.1
131
+
132
+ * Bugfix
133
+ * Groups inherit current adapter
134
+
135
+ ### 3.1.0
136
+
137
+ * Add `add_to_index` method to add links to the sitemap index.
138
+ * Add `sitemap` method for accessing the `LinkSet instance from within `create()`.
139
+ * Don't modify options hashes passed to methods. Fix and improve `yield_sitemap` option handling.
140
+
141
+ ### 3.0.0
142
+
143
+ * **Framework agnostic!**
144
+ * Fix alignment in output
145
+ * Show directory sitemaps are being generated into
146
+ * Only show sitemap compressed file size
147
+ * Toggle output using VERBOSE environment variable
148
+ * Remove tasks/ directory because it's deprecated in Rails 2
149
+ * Simplify dependencies.
150
+
151
+ ### 2.2.1
152
+
153
+ * Support adding new search engines to ping and modifying the default search engines.
154
+ * Allow the URL of the sitemap index to be passed as an argument to `ping_search_engines`. See Pinging Search Engines in README.
155
+
156
+ ### 2.1.8
157
+
158
+ * Extend and improve Video Sitemap support.
159
+ * Include sitemap docs in the README, support all element attributes, properly format values.
160
+
161
+ ### 2.1.7
162
+
163
+ * Improve format of float priorities
164
+ * Remove Yahoo from ping - the Yahoo service has been shut down.
165
+
166
+ ### 2.1.6
167
+
168
+ * Fix the `lastmod` value on sitemap file links
169
+
170
+ ### 2.1.5
171
+
172
+ * Fix verbose setting in the rake task, it should default to true
173
+
174
+ ### 2.1.4
175
+
176
+ * Allow special characters in URLs (don't use `URI.join` to construct URLs)
177
+
178
+ ### 2.1.3
179
+
180
+ * Fix calling `create` with both `filename` and `sitemaps_namer` options
181
+
182
+ ### 2.1.2
183
+
184
+ * Support multiple videos per url using the new `videos` option to `add()`.
185
+
186
+ ### 2.1.1
187
+
188
+ * Support calling `create()` multiple times in a sitemap config
189
+ * Support host names with path segments so you can use a `default_host` like `'http://mysite.com/subdirectory/'`
190
+ * Turn off `include_index` when the `sitemaps_host` differs from `default_host`
191
+ * Add docs about how to upload to remote hosts.
192
+
193
+ ### 2.1.0
194
+
195
+ * [News sitemap][sitemap_news] support
196
+
197
+ ### 2.0.1.pre2
198
+
199
+ * Fix uploading to the (bucket) root on a remote server
200
+
201
+ ### 2.0.1.pre1
202
+
203
+ * Support read-only filesystems like Heroku by supporting uploading to remote host
204
+
205
+ ### 2.0.1
206
+
207
+ * Minor improvements to verbose handlig
208
+ * Prevent missing `Timeout` issue
209
+
210
+ ### v2.0.0
211
+
212
+ * Introducing a new simpler API, Sitemap Groups, Sitemap Namers and more!
213
+
214
+ ### 1.5.0
215
+
216
+ * New options `include_root`, `include_index`
217
+ * Major testing & refactoring
218
+
219
+ ### 1.4.0
220
+
221
+ * [Geo sitemap][geo_tags] support
222
+ * Multiple sitemap support via CONFIG_FILE rake option
223
+
224
+ ### 1.3.0
225
+
226
+ * Support setting the sitemaps path
227
+
228
+ ### 1.2.0
229
+
230
+ * Verified working with Rails 3 stable release
231
+
232
+ ### 1.1.0
233
+
234
+ * [Video sitemap][sitemap_video] support
235
+
236
+ ### 0.2.6
237
+
238
+ * [Image Sitemap][sitemap_images] support
239
+
240
+ ### 0.2.5
241
+
242
+ * Rails 3 prerelease support (beta)
243
+
244
+ [geo_tags]:http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=94555
245
+ [sitemap_images]:http://www.google.com/support/webmasters/bin/answer.py?answer=178636
246
+ [sitemap_video]:https://support.google.com/webmasters/answer/80471?hl=en&ref_topic=4581190
247
+ [sitemap_news]:https://support.google.com/news/publisher/topic/2527688?hl=en&ref_topic=4359874
248
+ [include_index_change]:https://github.com/kjvarga/sitemap_generator/issues/70
249
+ [alternate_links]:http://support.google.com/webmasters/bin/answer.py?hl=en&answer=2620865
250
+ [using_pagemaps]:https://developers.google.com/custom-search/docs/structured_data#pagemaps
data/README.md CHANGED
@@ -7,9 +7,9 @@ Sitemaps adhere to the [Sitemap 0.9 protocol][sitemap_protocol] specification.
7
7
  ## Features
8
8
 
9
9
  * Framework agnostic
10
- * Supports [News sitemaps][sitemap_news], [Video sitemaps][sitemap_video], [Image sitemaps][sitemap_images], [Geo sitemaps][sitemap_geo], [Mobile sitemaps][sitemap_mobile], [PageMap sitemaps][sitemap_pagemap] and [Alternate Links][alternate_links]
10
+ * Supports [News sitemaps][sitemap_news], [Video sitemaps][sitemap_video], [Image sitemaps][sitemap_images], [Mobile sitemaps][sitemap_mobile], [PageMap sitemaps][sitemap_pagemap] and [Alternate Links][alternate_links]
11
11
  * Supports read-only filesystems like Heroku via uploading to a remote host like Amazon S3
12
- * Compatible with Rails 2, 3 & 4 and tested with Ruby REE, 1.9.2 & 1.9.3
12
+ * Compatible with Rails 2, 3 & 4 and tested with Ruby REE, 1.9.2, 1.9.3, 2.1.3
13
13
  * Adheres to the [Sitemap 0.9 protocol][sitemap_protocol]
14
14
  * Handles millions of links
15
15
  * Customizable sitemap compression
@@ -59,6 +59,69 @@ Successful ping of Google
59
59
  Successful ping of Bing
60
60
  ```
61
61
 
62
+ ## Index
63
+
64
+ * [SitemapGenerator](#sitemapgenerator)
65
+ * [Features](#features)
66
+ * [Show Me](#show-me)
67
+ * [Contribute](#contribute)
68
+ * [Foreword](#foreword)
69
+ * [Install](#install)
70
+ * [Ruby](#ruby)
71
+ * [Rails](#rails)
72
+ * [Getting Started](#getting-started)
73
+ * [Preventing Output](#preventing-output)
74
+ * [Rake Tasks](#rake-tasks)
75
+ * [Pinging Search Engines](#pinging-search-engines)
76
+ * [Crontab](#crontab)
77
+ * [Robots.txt](#robotstxt)
78
+ * [Ruby Modules](#ruby-modules)
79
+ * [Deployments & Capistrano](#deployments--capistrano)
80
+ * [Sitemaps with no Index File](#sitemaps-with-no-index-file)
81
+ * [Upload Sitemaps to a Remote Host using Adapters](#upload-sitemaps-to-a-remote-host-using-adapters)
82
+ * [Supported Adapters](#supported-adapters)
83
+ * [Generating Multiple Sitemaps](#generating-multiple-sitemaps)
84
+ * [Sitemap Configuration](#sitemap-configuration)
85
+ * [A Simple Example](#a-simple-example)
86
+ * [Adding Links](#adding-links)
87
+ * [Supported Options to add](#supported-options-to-add)
88
+ * [Adding Links to the Sitemap Index](#adding-links-to-the-sitemap-index)
89
+ * [Accessing the LinkSet instance](#accessing-the-linkset-instance)
90
+ * [Speeding Things Up](#speeding-things-up)
91
+ * [Customizing your Sitemaps](#customizing-your-sitemaps)
92
+ * [Sitemap Options](#sitemap-options)
93
+ * [Sitemap Groups](#sitemap-groups)
94
+ * [A Groups Example](#a-groups-example)
95
+ * [Using `group` without a block](#using-group-without-a-block)
96
+ * [Sitemap Extensions](#sitemap-extensions)
97
+ * [News Sitemaps](#news-sitemaps)
98
+ * [Example](#example)
99
+ * [Supported options](#supported-options)
100
+ * [Image Sitemaps](#image-sitemaps)
101
+ * [Example](#example-1)
102
+ * [Supported options](#supported-options-1)
103
+ * [Video Sitemaps](#video-sitemaps)
104
+ * [Example](#example-2)
105
+ * [Supported options](#supported-options-2)
106
+ * [PageMap Sitemaps](#pagemap-sitemaps)
107
+ * [Supported options](#supported-options-4)
108
+ * [Example:](#example-4)
109
+ * [Alternate Links](#alternate-links)
110
+ * [Example](#example-5)
111
+ * [Supported options](#supported-options-5)
112
+ * [<a name="user-content-internal_mobile"></a> Mobile Sitemaps](#-mobile-sitemaps)
113
+ * [Example](#example-6)
114
+ * [Supported options](#supported-options-6)
115
+ * [Raison d'être](#raison-dêtre)
116
+ * [Compatibility](#compatibility)
117
+ * [Known Bugs](#known-bugs)
118
+ * [Deprecation Notices and Non-Backwards Compatible Changes](#deprecation-notices-and-non-backwards-compatible-changes)
119
+ * [Version 5.0.0](#version-500)
120
+ * [Version 4.0.0](#version-400)
121
+ * [So what has changed?](#so-what-has-changed)
122
+ * [I don't want it! How can I keep everything as it was?](#i-dont-want-it--how-can-i-keep-everything-as-it-was)
123
+ * [I want it! What do I need to do?](#i-want-it--what-do-i-need-to-do)
124
+ * [Thanks (in no particular order)](#thanks-in-no-particular-order)
62
125
 
63
126
  ## Contribute
64
127
 
@@ -66,103 +129,6 @@ Does your website use SitemapGenerator to generate Sitemaps? Where would you be
66
129
 
67
130
  <a href='http://www.pledgie.com/campaigns/15267'><img alt='Click here to lend your support to: SitemapGenerator and make a donation at www.pledgie.com !' src='http://pledgie.com/campaigns/15267.png?skin_name=chrome' border='0' /></a>
68
131
 
69
- ## Deprecation Notices and Non-Backwards Compatible Changes
70
-
71
- ### Version 5.0.0
72
-
73
- In version 5.0.0 I've removed a few deprecated methods that have been deprecated for a long time. The reason being that they would have made some new features more difficult and complex to implement. I never actually ouput deprecation notices from these methods, so I understand it you're a little annoyed that your config has suddenly broken. Apologies.
74
-
75
- Here's a list of the methods that have been removed:
76
- * Removed options to `LinkSet::add()`: `:sitemaps_namer` and `:sitemap_index_namer` (use `:namer` option)
77
- * Removed `LinkSet::sitemaps_namer=`, `LinkSet::sitemaps_namer` (use `LinkSet::namer=` and `LinkSet::namer`)
78
- * Removed `LinkSet::sitemaps_index_namer=`, `LinkSet::sitemaps_index_namer` (use `LinkSet::namer=` and `LinkSet::namer`)
79
- * Removed the `SitemapGenerator::SitemapNamer` class (use `SitemapGenerator::SimpleNamer`)
80
- * Removed `LinkSet::add_links()` (use `LinkSet::create()`)
81
-
82
- ### Version 4.0.0
83
-
84
- Version 4.0 introduces a new **non-backwards compatible** naming scheme. **If you are running version 3 or earlier and you upgrade to version 4, you need to make a couple small changes to ensure that search engines can still find your sitemaps!** Your sitemaps will still work fine, but the name of the index file has changed.
85
-
86
- #### So what has changed?
87
-
88
- * **The index is generated intelligently**. SitemapGenerator now detects whether you need an index or not, and only generates one if you need it or have requested it. So small sites (less than 50,000 links) won't have one, large sites will. You don't have to worry about anything. And with the `create_index` option, it's easier than ever to control index creation to suit your needs.
89
-
90
- * **The default index file name has changed** from `sitemap_index.xml.gz` to just `sitemap.xml.gz`. So the `_index` part has been removed. This is a more standard naming scheme for the sitemaps. Any further sitemaps are named `sitemap1.xml.gz`, `sitemap2.xml.gz`, `sitemap3.xml.gz` etc, just as before.
91
-
92
- * **Everyone now points search engines to the `sitemap.xml.gz` file**. It doesn't matter whether your site has 10 links or a million links, just point to `sitemap.xml.gz`. If your site needs an index, that is the index. If it doesn't, then that's your sitemap. Simple.
93
-
94
- * **It's easier to write custom namers** because the index and the sitemaps share the same namer instance (which is now a `SitemapGenerator::SimpleNamer` instance).
95
-
96
- * **Groups share the new naming convention**. So the files in your `geo` group will be named `geo.xml.gz`, `geo1.xml.gz`, `geo2.xml.gz` etc. Pre-version 4 these files would have been named `geo1.xml.gz`, `geo2.xml.gz`, `geo3.xml.gz` etc.
97
-
98
- #### I don't want it! How can I keep everything as it was?
99
-
100
- You don't care, you just want to get on with your day. To resort to pre-version 4 behaviour add the following to your sitemap config:
101
-
102
- ```ruby
103
- SitemapGenerator::Sitemap.create_index = true
104
- SitemapGenerator::Sitemap.namer = SitemapGenerator::SimpleNamer.new(:sitemap, :zero => '_index')
105
- ```
106
-
107
- This tells SitemapGenerator to always create an index file and to name it `sitemap_index.xml.gz`. If you are already using custom namers, you don't need to set `namer`; your old namers should still work as before. If you are using named groups, setting the sitemap namer in this way won't affect your groups, which will still be using the new naming scheme. If this is an issue for you, you may have to create namers for your groups.
108
-
109
- #### I want it! What do I need to do?
110
-
111
- 1. Update your `robots.txt` file and make sure it points to `sitemap.xml.gz`.
112
- 2. Generate your sitemaps to create the new `sitemap.xml.gz` file.
113
- 3. Optionally remove the old `sitemap_index.xml.gz` file (or link it to the new file if you want to make sure that search engines can find it while you update them.)
114
- 4. Go to your Google Webmaster tools and other places where you've pointed search engines to your sitemaps and point them to your new `sitemap.xml.gz` file.
115
-
116
- That's it! Welcome to the future!
117
-
118
- ## Changelog
119
-
120
- * v5.2.0: New `SitemapGenerator::AwsSdkAdapter` adapter using the bare aws-sdk gem. Fix Bing ping url. Support string option keys passed to `add`. In Railtie, Load the rake task instead of requiring them.
121
- * v5.1.0: Require only `fog-aws` instead of `fog` for the `S3Adapter` and support using IAM profile instead of setting access key & secret directly. Implement `respond_to?` on the `SitemapGenerator::Sitemap` pseudo class. Make `:lang` optional on alternate links so they can be used for [AppIndexing](https://developers.google.com/app-indexing/reference/deeplinks). Documented [Mobile Sitemaps](#internal_mobile) `:mobile` option.
122
- * v5.0.5: Use MIT licence. Fix deploys with Capistrano 3 ([#163](https://github.com/kjvarga/sitemap_generator/issues/163)). Allow any Fog storage options for S3 adapter ([#167](https://github.com/kjvarga/sitemap_generator/pull/167)).
123
- * v5.0.4: Don't include the `media` attribute on alternate links unless it's given
124
- * v5.0.3: Add support for Video sitemaps options `:live` and ':requires_subscription'
125
- * v5.0.2: Set maximum filesize to 10,000,000 bytes rather than 10,485,760 bytes.
126
- * v5.0.1: Include new `SitemapGenerator::FogAdapter` ([#138](https://github.com/kjvarga/sitemap_generator/pull/138)). Fix usage of attr_* methods in LinkSet; don't override custom getters/setters ([#144](https://github.com/kjvarga/sitemap_generator/pull/144)). Fix breaking spec in Ruby 2 ([#142](https://github.com/kjvarga/sitemap_generator/pull/142)). Include Capistrano 3.x tasks ([#141](https://github.com/kjvarga/sitemap_generator/pull/141)).
127
- * v5.0.0: Support new `:compress` option for customizing which files get compressed. Remove old deprecated methods (see deprecation notices above). Support `fog_path_style` option in the `SitemapGenerator::S3Adapter` so buckets with dots in the name work over HTTPS without SSL certificate problems.
128
- * v4.3.1: Support integer timestamps. Update README for new features added in last release.
129
- * v4.3.0: Support `media` attibute on alternate links ([#125](https://github.com/kjvarga/sitemap_generator/issues/125)). Changed `SitemapGenerator::S3Adapter` to write files in a single operation, avoiding potential permissions errors when listing a directory prior to writing ([#130](https://github.com/kjvarga/sitemap_generator/issues/130)). Remove Sitemap Writer from ping task ([#129](https://github.com/kjvarga/sitemap_generator/issues/129)). Support `url:expires` element ([#126](https://github.com/kjvarga/sitemap_generator/issues/126)).
130
- * v4.2.0: Update Google ping URL. Quote the ping URL in the output. Support Video `video:price` element ([#117](https://github.com/kjvarga/sitemap_generator/issues/117)). Support symbols as well as strings for most arguments to `add()` ([#113](https://github.com/kjvarga/sitemap_generator/issues/113)). Ensure that `public_path` and `sitemaps_path` end with a slash (`/`) ([#113](https://github.com/kjvarga/sitemap_generator/issues/118)).
131
- * v4.1.1: Support setting the S3 region. Fixed bug where incorrect URL was being used in the ping to search engines - only affected sites with a single sitemap file and no index file. Output the URL being pinged in the verbose output. Test in Rails 4.
132
- * v4.1.0: [PageMap sitemap][using_pagemaps] support. Tested with Rails 4 pre-release.
133
- * v4.0.1: Add a post install message regarding the naming convention change.
134
- * **v4.0: NEW, NON-BACKWARDS COMPATIBLE CHANGES.** See above for more info. `create_index` defaults to `:auto`. Define `SitemapGenerator::SimpleNamer` class for simpler custom namers compatible with the new naming conventions. Deprecate `sitemaps_namer`, `sitemap_index_namer` and their respective namer classes. It's more just that their usage is discouraged. Support `nofollow` option on alternate links. Fix formatting of `publication_date` in News sitemaps.
135
- * v3.4: Support [alternate links][alternate_links] for urls; Support configurable options in the `SitemapGenerator::S3Adapter`
136
- * v3.3: **Support creating sitemaps with no index file**. A big thank-you to [Eric Hochberger][ehoch] for generously paying for this feature.
137
- * v3.2.1: Fix syntax error in SitemapGenerator::S3Adapter
138
- * v3.2: **Support mobile tags**, **SitemapGenerator::S3Adapter** a simple S3 adapter which uses Fog and doesn't require CarrierWave; Remove Ask from the sitemap ping because the service has been shutdown; [Turn off `include_index`][include_index_change] by default; Fix the news XML namespace; Only include autoplay attribute if present
139
- * v3.1.1: Bugfix: Groups inherit current adapter
140
- * v3.1.0: Add `add_to_index` method to add links to the sitemap index. Add `sitemap` method for accessing the LinkSet instance from within `create()`. Don't modify options hashes passed to methods. Fix and improve `yield_sitemap` option handling.
141
- * **v3.0.0: Framework agnostic**; fix alignment in output, show directory sitemaps are being generated into, only show sitemap compressed file size; toggle output using VERBOSE environment variable; remove tasks/ directory because it's deprecated in Rails 2; Simplify dependencies.
142
- * v2.2.1: Support adding new search engines to ping and modifying the default search engines.
143
- Allow the URL of the sitemap index to be passed as an argument to `ping_search_engines`. See **Pinging Search Engines**.
144
- * v2.1.8: Extend and improve Video Sitemap support. Include sitemap docs in the README, support all element attributes, properly format values.
145
- * v2.1.7: Improve format of float priorities; Remove Yahoo from ping - the Yahoo
146
- service has been shut down.
147
- * v2.1.6: Fix the lastmod value on sitemap file links
148
- * v2.1.5: Fix verbose setting in the rake tasks; should default to true
149
- * v2.1.4: Allow special characters in URLs (don't use URI.join to construct URLs)
150
- * v2.1.3: Fix calling create with both `filename` and `sitemaps_namer` options
151
- * v2.1.2: Support multiple videos per url using the new `videos` option to `add()`.
152
- * v2.1.1: Support calling `create()` multiple times in a sitemap config. Support host names with path segments so you can use a `default_host` like `'http://mysite.com/subdirectory/'`. Turn off `include_index` when the `sitemaps_host` differs from `default_host`. Add docs about how to upload to remote hosts.
153
- * v2.1.0: [News sitemap][sitemap_news] support
154
- * v2.0.1.pre2: Fix uploading to the (bucket) root on a remote server
155
- * v2.0.1.pre1: Support read-only filesystems like Heroku by supporting uploading to remote host
156
- * v2.0.1: Minor improvements to verbose handling; prevent missing Timeout issue
157
- * **v2.0.0: Introducing a new simpler API, Sitemap Groups, Sitemap Namers and more!**
158
- * v1.5.0: New options `include_root`, `include_index`; Major testing & refactoring
159
- * v1.4.0: [Geo sitemap][geo_tags] support, multiple sitemap support via CONFIG_FILE rake option
160
- * v1.3.0: Support setting the sitemaps path
161
- * v1.2.0: Verified working with Rails 3 stable release
162
- * v1.1.0: [Video sitemap][sitemap_video] support
163
- * v0.2.6: [Image Sitemap][sitemap_images] support
164
- * v0.2.5: Rails 3 prerelease support (beta)
165
-
166
132
 
167
133
  ## Foreword
168
134
 
@@ -170,7 +136,7 @@ Adam Salter first created SitemapGenerator while we were working together in Syd
170
136
 
171
137
  Those who knew him know what an amazing guy he was, and what an excellent Rails programmer he was. His passing is a great loss to the Rails community.
172
138
 
173
- The canonical repository is now: [http://github.com/kjvarga/sitemap_generator][canonical_repo]
139
+ The canonical repository is: [http://github.com/kjvarga/sitemap_generator][canonical_repo]
174
140
 
175
141
 
176
142
  ## Install
@@ -311,9 +277,9 @@ require 'capistrano/sitemap_generator'
311
277
  Available capistrano tasks:
312
278
 
313
279
  ```ruby
314
- deploy:sitemap:create #Create sitemaps without pinging search engines
315
- deploy:sitemap:refresh #Create sitemaps and ping search engines
316
- deploy:sitemap:clean #Clean up sitemaps in the sitemap path
280
+ sitemap:create #Create sitemaps without pinging search engines
281
+ sitemap:refresh #Create sitemaps and ping search engines
282
+ sitemap:clean #Clean up sitemaps in the sitemap path
317
283
  ```
318
284
 
319
285
  **Generate sitemaps into a directory which is shared by all deployments.**
@@ -537,7 +503,7 @@ Now let's take a look at the file that was created. After uncompressing and XML
537
503
 
538
504
  ```xml
539
505
  <?xml version="1.0" encoding="UTF-8"?>
540
- <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:geo="http://www.google.com/geo/schemas/sitemap/1.0" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
506
+ <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
541
507
  <url>
542
508
  <loc>http://www.example.com/</loc>
543
509
  <lastmod>2011-05-21T00:03:38+00:00</lastmod>
@@ -806,6 +772,8 @@ Because the link to the sitemap index file that would otherwise be added would p
806
772
 
807
773
  The compression setting applies to groups too. So `:all_but_first` will have the same effect (the first file in the group will not be compressed, the rest will). So if you require different behaviour for your groups, pass in a `:compress` option e.g. `group(:compress => false) { add('/link') }`
808
774
 
775
+ * `:max_sitemap_links` - Integer. The maximum number of links to put in each sitemap. Default is `SitemapGenerator::MAX_SITEMAPS_LINKS`, or 50,000.
776
+
809
777
  ## Sitemap Groups
810
778
 
811
779
  Sitemap Groups is a powerful feature that is also very simple to use.
@@ -860,6 +828,43 @@ The options you use when creating your groups will determine which and how many
860
828
 
861
829
  If you have changed your sitemaps physical location in a group, then the default sitemap will not be used and it will be unaffected by the group. **Group sitemaps are finalized as they get full and at the end of each group.**
862
830
 
831
+ ### Using `group` without a block
832
+
833
+ In some circumstances you may need to conditionally add records to a group or perform some other more complicated logic. In these cases you can instantiate a group instance, add links to it and finalize it manually.
834
+
835
+ When called with a block, any partial sitemaps are automatically written out for you when the block terminates. Because this does not happen when instantiating manually, you must call `finalize!` on your group to ensure that it is written out and gets included in the sitemap index file. Note that group sitemaps will still automatically be finalized (written out) as they become full; calling `finalize!` is to handle the case when a sitemap is not full.
836
+
837
+ An example:
838
+
839
+ ```ruby
840
+ SitemapGenerator::Sitemap.verbose = true
841
+ SitemapGenerator::Sitemap.default_host = "http://www.example.com"
842
+ SitemapGenerator::Sitemap.create do
843
+ odds = group(:filename => :odds)
844
+ evens = group(:filename => :evens)
845
+
846
+ (1..20).each do |i|
847
+ if (i % 2) == 0
848
+ evens.add i.to_s
849
+ else
850
+ odds.add i.to_s
851
+ end
852
+ end
853
+
854
+ odds.finalize!
855
+ evens.finalize!
856
+ end
857
+ ```
858
+
859
+ And the output from running the above:
860
+
861
+ ```
862
+ In '/Users/kvarga/Projects/sitemap_generator-test/public/':
863
+ + odds.xml.gz 10 links / 371 Bytes
864
+ + evens.xml.gz 10 links / 371 Bytes
865
+ + sitemap.xml.gz 2 sitemaps / 240 Bytes
866
+ Sitemap stats: 20 links / 2 sitemaps / 0m00s
867
+ ```
863
868
 
864
869
  ## Sitemap Extensions
865
870
 
@@ -973,24 +978,6 @@ end
973
978
  * `:live` - Optional. Boolean.
974
979
  * `:requires_subscription` - Optional. Boolean.
975
980
 
976
- ### Geo Sitemaps
977
-
978
- Pages with geo data can be added by passing a `:geo` Hash to `add`. The Hash only supports one tag of `:format`. Google provides an [example of a geo sitemap link here][geo_tags]. Note that the sitemap does not actually contain your KML or GeoRSS. It merely links to a page that has this content.
979
-
980
- #### Example:
981
-
982
- ```ruby
983
- SitemapGenerator::Sitemap.default_host = "http://www.example.com"
984
- SitemapGenerator::Sitemap.create do
985
- add('/stores/1234.xml', :geo => { :format => 'kml' })
986
- end
987
- ```
988
-
989
- #### Supported options
990
-
991
- * `:geo` - Hash
992
- * `:format` - Required, string, either `'kml'` or `'georss'`
993
-
994
981
  ### PageMap Sitemaps
995
982
 
996
983
  Pagemaps can be added by passing a `:pagemap` hash to `add`. The hash must contain a `:dataobjects` key with an array of dataobject hashes. Each dataobject hash contains a `:type` and `:id`, and an optional array of `:attributes`. Each attribute hash can contain two keys: `:name` and `:value`, with string values. For more information consult the [official documentation on PageMaps][using_pagemaps].
@@ -1114,8 +1101,54 @@ Tested and working on:
1114
1101
  * Currently only supports one Sitemap Index file, which can contain 50,000 Sitemap files which can each contain 50,000 urls, so it _only_ supports up to 2,500,000,000 (2.5 billion) urls.
1115
1102
 
1116
1103
 
1117
- ## Wishlist & Coming Soon
1104
+ ## Deprecation Notices and Non-Backwards Compatible Changes
1105
+
1106
+ ### Version 5.0.0
1107
+
1108
+ In version 5.0.0 I've removed a few deprecated methods that have been deprecated for a long time. The reason being that they would have made some new features more difficult and complex to implement. I never actually ouput deprecation notices from these methods, so I understand it you're a little annoyed that your config has suddenly broken. Apologies.
1109
+
1110
+ Here's a list of the methods that have been removed:
1111
+ * Removed options to `LinkSet::add()`: `:sitemaps_namer` and `:sitemap_index_namer` (use `:namer` option)
1112
+ * Removed `LinkSet::sitemaps_namer=`, `LinkSet::sitemaps_namer` (use `LinkSet::namer=` and `LinkSet::namer`)
1113
+ * Removed `LinkSet::sitemaps_index_namer=`, `LinkSet::sitemaps_index_namer` (use `LinkSet::namer=` and `LinkSet::namer`)
1114
+ * Removed the `SitemapGenerator::SitemapNamer` class (use `SitemapGenerator::SimpleNamer`)
1115
+ * Removed `LinkSet::add_links()` (use `LinkSet::create()`)
1116
+
1117
+ ### Version 4.0.0
1118
+
1119
+ Version 4.0 introduces a new **non-backwards compatible** naming scheme. **If you are running version 3 or earlier and you upgrade to version 4, you need to make a couple small changes to ensure that search engines can still find your sitemaps!** Your sitemaps will still work fine, but the name of the index file has changed.
1120
+
1121
+ #### So what has changed?
1122
+
1123
+ * **The index is generated intelligently**. SitemapGenerator now detects whether you need an index or not, and only generates one if you need it or have requested it. So small sites (less than 50,000 links) won't have one, large sites will. You don't have to worry about anything. And with the `create_index` option, it's easier than ever to control index creation to suit your needs.
1124
+
1125
+ * **The default index file name has changed** from `sitemap_index.xml.gz` to just `sitemap.xml.gz`. So the `_index` part has been removed. This is a more standard naming scheme for the sitemaps. Any further sitemaps are named `sitemap1.xml.gz`, `sitemap2.xml.gz`, `sitemap3.xml.gz` etc, just as before.
1126
+
1127
+ * **Everyone now points search engines to the `sitemap.xml.gz` file**. It doesn't matter whether your site has 10 links or a million links, just point to `sitemap.xml.gz`. If your site needs an index, that is the index. If it doesn't, then that's your sitemap. Simple.
1128
+
1129
+ * **It's easier to write custom namers** because the index and the sitemaps share the same namer instance (which is now a `SitemapGenerator::SimpleNamer` instance).
1130
+
1131
+ * **Groups share the new naming convention**. So the files in your `geo` group will be named `geo.xml.gz`, `geo1.xml.gz`, `geo2.xml.gz` etc. Pre-version 4 these files would have been named `geo1.xml.gz`, `geo2.xml.gz`, `geo3.xml.gz` etc.
1132
+
1133
+ #### I don't want it! How can I keep everything as it was?
1134
+
1135
+ You don't care, you just want to get on with your day. To resort to pre-version 4 behaviour add the following to your sitemap config:
1136
+
1137
+ ```ruby
1138
+ SitemapGenerator::Sitemap.create_index = true
1139
+ SitemapGenerator::Sitemap.namer = SitemapGenerator::SimpleNamer.new(:sitemap, :zero => '_index')
1140
+ ```
1141
+
1142
+ This tells SitemapGenerator to always create an index file and to name it `sitemap_index.xml.gz`. If you are already using custom namers, you don't need to set `namer`; your old namers should still work as before. If you are using named groups, setting the sitemap namer in this way won't affect your groups, which will still be using the new naming scheme. If this is an issue for you, you may have to create namers for your groups.
1143
+
1144
+ #### I want it! What do I need to do?
1145
+
1146
+ 1. Update your `robots.txt` file and make sure it points to `sitemap.xml.gz`.
1147
+ 2. Generate your sitemaps to create the new `sitemap.xml.gz` file.
1148
+ 3. Optionally remove the old `sitemap_index.xml.gz` file (or link it to the new file if you want to make sure that search engines can find it while you update them.)
1149
+ 4. Go to your Google Webmaster tools and other places where you've pointed search engines to your sitemaps and point them to your new `sitemap.xml.gz` file.
1118
1150
 
1151
+ That's it! Welcome to the future!
1119
1152
 
1120
1153
  ## Thanks (in no particular order)
1121
1154
 
@@ -1145,13 +1178,11 @@ Copyright (c) 2009 Karl Varga released under the MIT license
1145
1178
  [sitemap_images]:http://www.google.com/support/webmasters/bin/answer.py?answer=178636
1146
1179
  [sitemap_video]:https://support.google.com/webmasters/answer/80471?hl=en&ref_topic=4581190
1147
1180
  [sitemap_news]:https://support.google.com/news/publisher/topic/2527688?hl=en&ref_topic=4359874
1148
- [sitemap_geo]:#
1149
1181
  [sitemap_mobile]:http://support.google.com/webmasters/bin/answer.py?hl=en&answer=34648
1150
1182
  [sitemap_pagemap]:https://developers.google.com/custom-search/docs/structured_data#addtositemap
1151
1183
  [sitemap_protocol]:http://www.sitemaps.org/protocol.html
1152
1184
  [video_tags]:http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=80472#4
1153
1185
  [image_tags]:http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=178636
1154
- [geo_tags]:http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=94555
1155
1186
  [news_tags]:http://www.google.com/support/news_pub/bin/answer.py?answer=74288
1156
1187
  [remote_hosts]:https://github.com/kjvarga/sitemap_generator/wiki/Generate-Sitemaps-on-read-only-filesystems-like-Heroku
1157
1188
  [include_index_change]:https://github.com/kjvarga/sitemap_generator/issues/70