middleman-sitemap 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f8f539efe5586eba219cffefa34d05936988698
4
- data.tar.gz: 38c2ee30b0f4609f9c99c64e653e1760c70dd057
3
+ metadata.gz: 24dbc7c8a3e896ef6aeb91d166768eb80eebf3cd
4
+ data.tar.gz: 61ce79c73426e9fb72cb1c9526e31920c273fa79
5
5
  SHA512:
6
- metadata.gz: 7423df9fc0816b610fd75046ed0eb0d2810d10e65a683f832b521ccba0e93190fdf0a3645afacee2a0464186fd6e030f725511ab2c25456d9324c2562f6db76d
7
- data.tar.gz: 676b2db45e38175c1a048dc7034d8475c3cc3335d903b60d4ae2d2d5c427a56b7090da2fc281c0d60f43ae7b50dca5340c9f4cfab1eabfa6514cbadda817e404
6
+ metadata.gz: 83b25335585010f4d72c6b484f39376167a2df0b0cadcc19cbd53dda8d6d3d1238f0e0b6dc64a578560983278e0d544ce78143e4074fe11f1014bafa526ea88b
7
+ data.tar.gz: 4dc0fb1eab1df6754925616064b5bb3d8cad0d8e05cc9cda516d5757dc01fda5d3530222642ba8ed8558c8a086b599358defbe757fc710ea45a8ab456661f537
@@ -1,8 +1,6 @@
1
1
  # Require core library
2
2
  require 'middleman-core'
3
3
 
4
- require 'middleman-sitemap/commands'
5
-
6
4
  ::Middleman::Extensions.register(:sitemap) do
7
5
  require 'middleman-sitemap/extension'
8
6
  Sitemap
@@ -0,0 +1,44 @@
1
+ require 'middleman-core/cli'
2
+ require 'middleman-sitemap/extension'
3
+
4
+ module Middleman
5
+ module Cli
6
+ class Sitemap < Thor
7
+ include Thor::Actions
8
+
9
+ check_unknown_options!
10
+
11
+ namespace "sitemap"
12
+
13
+ def self.source_root
14
+ ENV['MM_ROOT']
15
+ end
16
+
17
+ def self.exit_on_failure?
18
+ true
19
+ end
20
+
21
+ desc "sitemap:build", "Builds a sitemap outside of the build process"
22
+ option :gzip, type: :boolean,
23
+ desc: "GZIP sitemap after build",
24
+ aliases: :g
25
+ option :hostname, type: :string,
26
+ desc: "The hostname that you want to use in your sitemap",
27
+ aliases: :b
28
+
29
+ def build
30
+ shared_instance = ::Middleman::Application.server.inst
31
+
32
+ if shared_instance.respond_to? :sitemap
33
+ # Override options based on what was passed on the command line
34
+ shared_instance.options.gzip = options[:gzip] if options[:gzip]
35
+ shared_instance.options.hostname = options[:hostname] if options[:hostname]
36
+
37
+ shared_instance.generate_sitemap
38
+ else
39
+ raise Thor::Error.new "You need to activate the sitemap extension in config.rb"
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
Binary file
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "middleman-sitemap"
6
- s.version = "0.0.6"
6
+ s.version = "0.0.7"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Larry Staton Jr."]
9
9
  s.email = ["larry@larrystaton.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Staton Jr.
@@ -51053,8 +51053,10 @@ files:
51053
51053
  - fixtures/weird-urls-app/source/stylesheets/test.css
51054
51054
  - fixtures/weird-urls-app/source/this-&-that.html
51055
51055
  - lib/middleman-sitemap.rb
51056
+ - lib/middleman-sitemap/commands.rb
51056
51057
  - lib/middleman-sitemap/extension.rb
51057
51058
  - lib/middleman_extension.rb
51059
+ - middleman-sitemap-0.0.6.gem
51058
51060
  - middleman-sitemap.gemspec
51059
51061
  - templates/sitemap.xml.erb
51060
51062
  - templates/sitemapindex.xml.erb