From 6da9168240a7fbc4d9f31f508e2a7cd4cc2daf48 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Tue, 19 May 2020 09:03:37 -0700 Subject: [PATCH] Website global search feature (#18288) * init global search ui * add hover effect to icon and refactor js * add search bar ui styles * fix search UI's effect on navbar height * add fade in/out effect to search ui and navbar * update search trigger to click and add x button for close * add version select for search * fix version typo * update dropdown * fix hitsperpage reset after change version * fix nav trigger not show * update search border css class name * make dropdown style consistent * global search mobile&tablet UI * adjust mobile search result width * extract global search related styles to a seperate scss * restore formatting to existing code * format & coding style * fix caret height bug * add mobile compatible UI * add license header to js files and update dropdown width * put docsearch css before main to overrides * update search result panel height * dynamically generate version dropdown * use more accurate selector over search result * use vh for height * add comments to scss * move versions to Jekyll global variable * remove redundant version key * make global search default version the same as website version Co-authored-by: Yang Shi --- docs/static_site/src/_config.yml | 11 + docs/static_site/src/_config_beta.yml | 13 +- docs/static_site/src/_config_prod.yml | 13 +- docs/static_site/src/_includes/head.html | 9 +- docs/static_site/src/_includes/header.html | 45 +++- docs/static_site/src/_sass/globalSearch.scss | 217 ++++++++++++++++++ .../static_site/src/_sass/minima/_layout.scss | 16 ++ .../src/assets/img/search-icon.svg | 3 + .../static_site/src/assets/js/globalSearch.js | 118 ++++++++++ docs/static_site/src/assets/main.scss | 1 + 10 files changed, 441 insertions(+), 5 deletions(-) create mode 100644 docs/static_site/src/_sass/globalSearch.scss create mode 100644 docs/static_site/src/assets/img/search-icon.svg create mode 100644 docs/static_site/src/assets/js/globalSearch.js diff --git a/docs/static_site/src/_config.yml b/docs/static_site/src/_config.yml index 6dcc9c2aa405..12987e85071f 100644 --- a/docs/static_site/src/_config.yml +++ b/docs/static_site/src/_config.yml @@ -37,6 +37,17 @@ description: >- # this means to ignore newlines until "baseurl:" twitter_username: apachemxnet github_username: apache/incubator-mxnet youtube_username: apachemxnet +versions: + - master + - 1.6 + - 1.5.0 + - 1.4.1 + - 1.3.1 + - 1.2.1 + - 1.1.0 + - 1.0.0 + - 0.12.1 + - 0.11.0 # Build settings markdown: kramdown diff --git a/docs/static_site/src/_config_beta.yml b/docs/static_site/src/_config_beta.yml index dc4ecdd25f65..84f62e758e24 100644 --- a/docs/static_site/src/_config_beta.yml +++ b/docs/static_site/src/_config_beta.yml @@ -39,7 +39,18 @@ url: https://thomasdelteil.github.io twitter_username: apachemxnet github_username: apache/incubator-mxnet youtube_username: apachemxnet - +versions: + - master + - 1.6 + - 1.5.0 + - 1.4.1 + - 1.3.1 + - 1.2.1 + - 1.1.0 + - 1.0.0 + - 0.12.1 + - 0.11.0 + # Build settings markdown: redcarpet redcarpet: diff --git a/docs/static_site/src/_config_prod.yml b/docs/static_site/src/_config_prod.yml index 6c91fe91cdea..49a2a3f3619b 100644 --- a/docs/static_site/src/_config_prod.yml +++ b/docs/static_site/src/_config_prod.yml @@ -39,7 +39,18 @@ twitter_username: apachemxnet github_username: apache/incubator-mxnet youtube_username: apachemxnet google_analytics: UA-96378503-1 - +versions: + - master + - 1.6 + - 1.5.0 + - 1.4.1 + - 1.3.1 + - 1.2.1 + - 1.1.0 + - 1.0.0 + - 0.12.1 + - 0.11.0 + # Build settings markdown: redcarpet redcarpet: diff --git a/docs/static_site/src/_includes/head.html b/docs/static_site/src/_includes/head.html index 688a3dc457d5..5de810a5958e 100644 --- a/docs/static_site/src/_includes/head.html +++ b/docs/static_site/src/_includes/head.html @@ -5,14 +5,15 @@ {%- seo -%} + {%- feed_meta -%} {%- if jekyll.environment == 'production' and site.google_analytics -%} {%- include google-analytics.html -%} {%- endif -%} - - + +