jekyll / jekyll-sitemap

Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site
http://rubygems.org/gems/jekyll-sitemap
MIT License
961 stars 135 forks source link

sitemap.xml does not generate on Github Pages #178

Closed johnpitchko closed 7 years ago

johnpitchko commented 7 years ago

Added this gem to my Gemfile. Sitemap generates successfully on local machine upon booting Jekyll, but is not generated when site is pushed to Github Pages (404 is generated).

_config.yml:

# top level stuff you probably don't need to touch
highlighter: rouge
markdown: kramdown
rdiscount:
  extensions: [smart]
permalink: /:title.html
# paginate: 5
# gems:
  # - jekyll-paginate
  # - jekyll-sitemap

port: 4001
# safe: true

# edit here to achieve your personal greatness
url: "https://www.johnpitchko.com" # the base hostname & protocol for your site; THIS IS REQUIRED FOR JEKYLL-SITEMAP TO WORK
baseurl: "

Gemfile:

source "https://rubygems.org"
ruby RUBY_VERSION

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "3.4.3"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
   gem "jekyll-feed", "~> 0.6"
   gem "terminal-notifier"
   gem "jekyll-build-notifier", path: "_plugins/jekyll-build-notifier"
   gem "jekyll-sitemap"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
pathawks commented 7 years ago
# gems:
  # - jekyll-paginate
  # - jekyll-sitemap

It looks like you need to uncomment these lines :+1:

wkhayrattee commented 7 years ago

also, in _config.yml, the usage of gems is deprecated. Use plugins (or plugins_dir see #6195)

pathawks commented 7 years ago

@7php But not on GitHub Pages yet.

wkhayrattee commented 7 years ago

why all these discrepancy.. gems apparently deprecated even on v3.4.5 and we are already on v3.5.0

DirtyF commented 7 years ago

@7php We display a warning message for deprecation, but the gems option will be supported until next major version. Sorry if this is confusing.

johnpitchko commented 7 years ago

Wow ok thanks @pathawks that solved the issue. Odd though that even with those lines commented out the sitemap still generated on my local machine.

So my confusion stemmed from the instructions on the Jekyll homepage that lead me to believe that either the gems: ... line in _config.yml OR adding the plugin gems to the Gemfile was required, but not both. Is this a special requirement for Github Pages?

pathawks commented 7 years ago

GitHub Pages ignores Gemfile completely, so any plugins must be enabled in _config.yml.

I wonder how we could more effectively communicate this.

johnpitchko commented 7 years ago

Thanks @pathawks. I'm happy to improve the README in the repo with some more details.

pathawks commented 7 years ago

@johnpitchko That would be much appreciated. ❤️

I'm going to close this issue, but let me know if you have any questions about opening a PR to improve the documentation.

johnpitchko commented 7 years ago

@pathawks I have many questions as I have never done it before :) Assume I create a private fork, make changes, then do a pull request?

pathawks commented 7 years ago

@johnpitchko Yessir, that is the process 👍🏼