From c5f45acef4f60c7f77515cf8101d52875cf0e1fe Mon Sep 17 00:00:00 2001
From: Myron Marston
Date: Thu, 24 Oct 2024 18:01:36 -0700
Subject: [PATCH] Fix github pages site to use proper relative links.
It's hosted at https://block.github.io/elasticgraph/ and the links were
all broken because they assume it's served from a domain root.
---
config/site/Rakefile | 12 ++++++++++--
config/site/src/_includes/navbar.html | 12 ++++++------
config/site/src/_includes/subpages.html | 2 +-
config/site/src/index.html | 2 +-
4 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/config/site/Rakefile b/config/site/Rakefile
index a6579273..79a8bbf1 100644
--- a/config/site/Rakefile
+++ b/config/site/Rakefile
@@ -126,9 +126,17 @@ module ElasticGraph
end
end
+ common_jekyll_args = [
+ "--source #{SITE_SOURCE_DIR}",
+ "--destination #{JEKYLL_SITE_DIR}",
+ "--baseUrl /elasticgraph",
+ "--strict-front-matter",
+ "--trace"
+ ].join(" ")
+
desc "Build Jekyll site with freshly generated YARD documentation"
task build: [:build_docs, :build_css, "examples:compile_queries"] do
- sh "bundle exec jekyll build --source #{SITE_SOURCE_DIR} --destination #{JEKYLL_SITE_DIR}"
+ sh "bundle exec jekyll build #{common_jekyll_args}"
end
desc "Serve Jekyll site locally"
@@ -170,7 +178,7 @@ module ElasticGraph
end
end
- sh "bundle exec jekyll serve --source #{SITE_SOURCE_DIR} --destination #{JEKYLL_SITE_DIR} --trace"
+ sh "bundle exec jekyll serve #{common_jekyll_args}"
end
desc "Perform validations of the website, including doc tests and doc coverage"
diff --git a/config/site/src/_includes/navbar.html b/config/site/src/_includes/navbar.html
index 5005c9e1..73bc51ee 100644
--- a/config/site/src/_includes/navbar.html
+++ b/config/site/src/_includes/navbar.html
@@ -2,14 +2,14 @@
-
Documentation