Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix github pages site to use proper relative links. #1

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions config/site/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions config/site/src/_includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<nav class="w-full py-4 bg-gray-200 dark:bg-gray-800 shadow">
<div class="container mx-auto flex justify-between items-center px-4">
<div class="text-xl flex items-center space-x-4">
<a href="/" class="font-bold hover:underline">ElasticGraph</a>
<a href="/docs/main" class="{{ site.style.link }}">Docs</a>
<a href="/query-api" class="{{ site.style.link }}">Query API</a>
<a href="{{ '/' | relative_url }}" class="font-bold hover:underline">ElasticGraph</a>
<a href="{{ '/docs/main' | relative_url }}" class="{{ site.style.link }}">Docs</a>
<a href="{{ '/query-api' | relative_url }}" class="{{ site.style.link }}">Query API</a>
</div>
<div>
<a href="{{ site.github_url }}" target="_blank"
class="{{ site.style.link }} mr-2">GitHub</a>
<a href="/about" class="{{ site.style.link }}">About</a>
<a href="{{ '/about' | relative_url }}" class="{{ site.style.link }}">About</a>
</div>
</div>

Expand All @@ -19,7 +19,7 @@
<ol class="list-reset flex">
{% if page.url != "/" %}
<li>
<a href="/" class="hover:underline">Home</a>
<a href="{{ '/' | relative_url }}" class="hover:underline">Home</a>
</li>
{% endif %}

Expand All @@ -39,7 +39,7 @@
{% if page.url == link %}
{{ page_title }}
{% else %}
<a href="{{ link }}" class="hover:underline capitalize">
<a href="{{ link | relative_url }}" class="hover:underline capitalize">
{{ page_title }}
</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion config/site/src/_includes/subpages.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="text-2xl font-bold text-gray-800 dark:text-gray-200 mb-4">Subpages</h
{% assign subpage_url_parts = subpage.url | split: '/' | size %}
{% if subpage_url_parts == needed_subpage_part_count %}
<li>
<a href="{{ subpage.url }}" class="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-600 transition-colors duration-300">
<a href="{{ subpage.url | relative_url }}" class="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-600 transition-colors duration-300">
{{ subpage.subpage_title }}
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion config/site/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 class="text-4xl font-extrabold mb-4">
A general-purpose framework and platform for indexing, searching,
grouping, and aggregating data.
</p>
<a href="/docs/main"
<a href="{{ '/docs/main' | relative_url }}"
class="inline-block bg-blue-600 dark:bg-blue-500 text-white py-2 px-4 rounded hover:bg-blue-500 dark:hover:bg-blue-400 transition">
Documentation
</a>
Expand Down
Loading