diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000000..b347b11eac --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.3 diff --git a/package.json b/package.json index 30e12dd3c6..c752e2ffd9 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "build:toc": "yarn build:jekyll && scripts/generate-toc", "build:site": "rollup -c site/rollup.config.mjs", "build:jekyll": "pushd site && bundle exec jekyll build -q && popd", + "build:docset": "pushd site && bundle exec jekyll build -c _config_docset.yml -q && popd", "build:versions": "scripts/update-version.sh", "clean": "yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete", "clean:build": "del-cli 'build/*' !build/vega-lite-schema.json", @@ -53,6 +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 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.yml b/site/_config.yml index 35de4a2c82..74af815af3 100644 --- a/site/_config.yml +++ b/site/_config.yml @@ -12,6 +12,7 @@ exclude: - Gemfile - Gemfile.lock - static/*.ts +is_docset_build: false # Control behaviors that make it easier to replace absolute with relative paths for offline friendly builds. False for deploying to the public docs. markdown: kramdown highlighter: none diff --git a/site/_config_docset.yml b/site/_config_docset.yml new file mode 100644 index 0000000000..4dd8d015ba --- /dev/null +++ b/site/_config_docset.yml @@ -0,0 +1,35 @@ +# Config for building a docset +# For usage: https://github.com/hydrosquall/vega-lite-docset-generator + +title: Vega-Lite +description: N/A + +# 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 +is_docset_build: true +twitter: + username: vega_vis +exclude: + - Gemfile + - Gemfile.lock + - static/*.ts + +markdown: kramdown +highlighter: none + +kramdown: + input: GFM + auto_id_stripping: true + syntax_highlighter_opts: + disable: true + +plugins: + - jekyll-mentions + - jekyll-redirect-from diff --git a/site/_layouts/base.html b/site/_layouts/base.html index 54156d76e7..71cd80fcee 100644 --- a/site/_layouts/base.html +++ b/site/_layouts/base.html @@ -7,11 +7,16 @@ - {% seo %} - + {% if site.is_docset_build == true %} + + {% else %} {% seo %} + {% endif %} diff --git a/site/_layouts/page_submenu.html b/site/_layouts/page_submenu.html index a8f9e4ec9f..a8a93e348d 100644 --- a/site/_layouts/page_submenu.html +++ b/site/_layouts/page_submenu.html @@ -25,7 +25,7 @@
{% else %} {% if link.sub-sidebar %}