From 355327b557d06253f4203c9f3be9fba0f3ff6a9d Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Sun, 8 Aug 2021 21:15:56 -0400 Subject: [PATCH] docs: update docset build to fetch data samples from absolute instead of relative URL --- package.json | 2 +- site/_config_docset.yml | 18 ++++++++---------- site/_layouts/base.html | 4 ++-- site/_layouts/plain.html | 2 +- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 2febcee4df..c752e2ffd9 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "schema": "mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/", "renameschema": "scripts/rename-schema.sh", "presite": "yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh", - "docset": "yarn data && yarn schema && yarn build:site && yarn build:docset && yarn build:versions && scripts/create-example-pages.sh", + "docset": "yarn schema && yarn build:site && yarn build:docset && yarn build:versions && scripts/create-example-pages.sh", "site": "yarn site:only", "site:only": "pushd site && bundle exec jekyll serve -I -l && popd", "prettierbase": "prettier '**/*.{md,css,yml}'", diff --git a/site/_config_docset.yml b/site/_config_docset.yml index 10499e0a44..4dd8d015ba 100644 --- a/site/_config_docset.yml +++ b/site/_config_docset.yml @@ -1,15 +1,15 @@ # Config for building a docset -# Initially created by Dash, but supported by several OSS tools too -# (Velocity, Zeal, etc) +# For usage: https://github.com/hydrosquall/vega-lite-docset-generator title: Vega-Lite -description: Bare SEO for offline usage +description: N/A -# removing baseurl b/c dash docsets don't work with absolute paths -# end up needing the -# if this doesn't work out, rewrite all link refs using BS4 later... - -# using https://ricostacruz.com/til/relative-paths-in-jekyll as workaround +# Alternative: Rewrite the paths to relative URLs locally +# None of these worked when simply applied to base.html, so I ended up transforming +# the base URL in my python script instead. Leaving notes in here for posterity. +# https://ricostacruz.com/til/relative-paths-in-jekyll +# https://gist.github.com/Ketrel/1f36fca6b4148f7263b3ee8fdb0923e7 +# https://github.com/jekyll/jekyll/issues/6360 baseurl: 'DOCSET_BASE_TO_REPLACE' # the subpath of your site, e.g. /blog/ url: 'https://vega.github.io' # the base hostname & protocol for your site @@ -31,7 +31,5 @@ kramdown: disable: true plugins: - # - jekyll-sitemap - # - jekyll-seo-tag - jekyll-mentions - jekyll-redirect-from diff --git a/site/_layouts/base.html b/site/_layouts/base.html index 439560dbff..71cd80fcee 100644 --- a/site/_layouts/base.html +++ b/site/_layouts/base.html @@ -9,8 +9,8 @@ {% if site.is_docset_build == true %} {% else %} {% seo %}