From 1328befac90be12428eaf10f6937143367d1e6ec Mon Sep 17 00:00:00 2001 From: DylanLawless Date: Wed, 30 Jun 2021 13:15:42 +0200 Subject: [PATCH 1/2] README.md how to base URL for pre-built deployment Since GitHub Pages blocks plugins (like Jekyll-scholar), many Jekyll users pre-build their site before deploying to GitHub Pages. This is most commonly done using `bundle exec jekyll serve` on the _source branch_. However, this will fail to use the correct URL defined in the _config.yml and instead use "http://localhost". A two sentence description is added to `README.md` to show the required usage, which will prevent people from creating an invalid sitemap, or giving up if they notice their incorrect URL despite correct `_config.yml` settings. Similar to issue #190 https://github.com/jekyll/jekyll-sitemap/issues/190 but not included in that discussion. Thanks for making this pugin. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 0309c68..dbe2319 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,12 @@ defaults: 1. `script/bootstrap` 2. `script/cibuild` +## Base URL for pre-built deployment +For some Jekyll users, since plugins cannot be run on GitHub pages, they opt to build locally and push their pre-built +`_site` from the _source branch_ instead of `_root` on the _master branch_. +In this case, to build the sitemap using the base url defined in `_config.yml` instead of "local host", +you will first need to `build` rather than `serve` before pushing `_site` to Github, or do both consecutively; `bundle exec jekyll build & bundle exec jekyll serve` + ## Known Issues 1. If the `sitemap.xml` doesn't generate in the `_site` folder, ensure `_config.yml` doesn't have `safe: true`. That prevents all plugins from working. From 336678685785f7b1449ef7280b2b961d7abc6d7c Mon Sep 17 00:00:00 2001 From: DylanLawless Date: Wed, 30 Jun 2021 13:30:23 +0200 Subject: [PATCH 2/2] Update README.md Correction to pull request for REAME.md example usage on line 86: `bundle exec jekyll build & `bundle exec jekyll serve` to `bundle exec jekyll build`. `serve` should not be run after `build` to produce the correct sitemap URL for pre-built deployment. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbe2319..c1873f5 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ defaults: For some Jekyll users, since plugins cannot be run on GitHub pages, they opt to build locally and push their pre-built `_site` from the _source branch_ instead of `_root` on the _master branch_. In this case, to build the sitemap using the base url defined in `_config.yml` instead of "local host", -you will first need to `build` rather than `serve` before pushing `_site` to Github, or do both consecutively; `bundle exec jekyll build & bundle exec jekyll serve` +you will first need to `build` rather than `serve` before pushing `_site` to Github; `bundle exec jekyll build` ## Known Issues