5t111111 / middleman-blog-drops-template

A blog template for Middleman which lets you start blogging immediately. Supports GitHub Pages and S3 deployment, sitemap, Atom feed, Google Analytics, responsive layout and syntax highlighting.
Other
54 stars 8 forks source link

Sitemap.xml.gz is not generated #9

Closed it-praktyk closed 8 years ago

it-praktyk commented 8 years ago

Under building blog errors are displayed as below

[user@host blog-test]$ bundle exec middleman build
== Executing: `./node_modules/webpack/bin/webpack.js -p --bail`
== External: Hash: 84770d72249761ea48c8
== External: Version: webpack 1.13.1
== External: Time: 3847ms
== External:              Asset    Size  Chunks             Chunk Names
== External: javascripts/all.js  176 kB       0  [emitted]  all
== External:     + 6 hidden modules
== External: WARNING in javascripts/all.js from UglifyJs
== External: Condition always false [./~/style-loader/addStyles.js:24,0]
== External: Dropping unreachable code [./~/style-loader/addStyles.js:25,0]
== External: Condition always false [./~/style-loader!./~/css-loader?sourceMap!./~/sass-loader?sourceMap!./source/stylesheets/site.scss:10,0]
== External: Dropping unreachable code [./~/style-loader!./~/css-loader?sourceMap!./~/sass-loader?sourceMap!./source/stylesheets/site.scss:12,0]
== External: Side effects in initialization of unused variable update [./~/style-loader!./~/css-loader?sourceMap!./~/sass-loader?sourceMap!./source/stylesheets/site.scss:7,0]

I'm not sure if it impact that the sitemap.xml.gz is not build (is missed). The name of missed file I conducted based on the content of robot.txt file.

I did a clean installation of all required software today. Under an installation process I saw warnings like

[user@host blog-test]$ npm install
npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn no longer requires a build toolchain, use it instead!
npm WARN optional dep failed, continuing fsevents@1.0.12

I tried debug how a site map is generated but I don't found nothing special - some my checks are below.

[user@host blog-test]$ grep -r 'sitemap.rb' .
./config.rb:require 'extensions/sitemap.rb'

[user@host blog-test]$ grep -r 'GoogleSitemapGenerator' .
./extensions/sitemap.rb:class GoogleSitemapGenerator < Middleman::Extension
./extensions/sitemap.rb:::Middleman::Extensions.register(:sitemap_generator, GoogleSitemapGenerator)

[user@host blog-test]$ grep -r 'sitemap_generator' .
./Gemfile:gem 'sitemap_generator'
./Gemfile.lock:    sitemap_generator (5.1.0)
./Gemfile.lock:  sitemap_generator
./config.rb:activate :sitemap_generator
./extensions/sitemap.rb:require 'sitemap_generator'
./extensions/sitemap.rb:::Middleman::Extensions.register(:sitemap_generator, GoogleSitemapGenerator)

[user@host blog-test]$ grep -r 'sitemap.xml' .
./source/robots.txt.erb:Sitemap: <%= data.settings.site_url %>/sitemap.xml.gz
./config.rb:page '/sitemap.xml', layout: false
./build/robots.txt:Sitemap: http://blog.example.com/sitemap.xml.gz

[user@host blog-test]$ grep -r ':sitemap_generator' .
./config.rb:activate :sitemap_generator
./extensions/sitemap.rb:::Middleman::Extensions.register(:sitemap_generator, GoogleSitemapGenerator)

I checked also

[user@host blog-test]$ bundle exec middleman build --verbose
[...]
      create  build/2015/11/20/index.html.gz (952 Bytes smaller)
      create  build/2015/11/20/this-is-an-example-article/index.html.gz (2.7 KB smaller)
      create  build/archives/index.html.gz (925 Bytes smaller)
      create  build/javascripts/all-556aceca.js.gz (68.9 KB smaller)
        gzip  Total gzip savings: 81.9 KB
Project built successfully.
[user@host blog-test]$ 

and as you see any information from sitemap_generator is not displayed after build.

5t111111 commented 8 years ago

@it-praktyk Thanks for reporting the issue. Missing sitemap.xml.gz is the problem which related to upgrading to MM v4, so the warnings you encountered while processing webpack did not impact missing sitemap.xml.gz .

I have re-implemented the logic to generate a sitemap because the library I used to use to generate sitemap also has many breaking changes, so I've decided to generate sitemap in the simpler way, and now sitemap.xml.gz is no more generated, it generates uncompressedd sitemap.xml only (like feed.xml) .

Please check if the sitemap is generated on build as you expect.

If you want more configurable sitemap, you would better to consider something like middleman-search_engine_sitemap. It is pretty easy to use with this template. I don't include it out of the box because it requires you to set the site URL in config.rb that I want to avoid for the moment.

it-praktyk commented 8 years ago

Thank you for update :-)

5t111111 commented 8 years ago

No problem. Let me know if you still have some issues 😄