diff --git a/.github/workflows/ci-backend-cql-dummy.yml b/.github/workflows/ci-backend-cql-dummy.yml index 42894e161d..d9e4336590 100644 --- a/.github/workflows/ci-backend-cql-dummy.yml +++ b/.github/workflows/ci-backend-cql-dummy.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-backend-cql.yml b/.github/workflows/ci-backend-cql.yml index e2bf0176ab..07027e2b9a 100644 --- a/.github/workflows/ci-backend-cql.yml +++ b/.github/workflows/ci-backend-cql.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' push: @@ -29,6 +30,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-backend-hbase-dummy.yml b/.github/workflows/ci-backend-hbase-dummy.yml index 4b1c10cbb2..e19762e100 100644 --- a/.github/workflows/ci-backend-hbase-dummy.yml +++ b/.github/workflows/ci-backend-hbase-dummy.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-backend-hbase.yml b/.github/workflows/ci-backend-hbase.yml index d1b9f9f246..5d1da2d3e4 100644 --- a/.github/workflows/ci-backend-hbase.yml +++ b/.github/workflows/ci-backend-hbase.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' push: @@ -29,6 +30,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-core-dummy.yml b/.github/workflows/ci-core-dummy.yml index 543d677122..0fa5f8a8e3 100644 --- a/.github/workflows/ci-core-dummy.yml +++ b/.github/workflows/ci-core-dummy.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 631ac061f2..b231a58088 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' push: @@ -28,6 +29,7 @@ on: - 'docs/**' - '.github/workflows/ci-docs.yml' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-index-es-dummy.yml b/.github/workflows/ci-index-es-dummy.yml index ed9f16aea4..e32b2b7250 100644 --- a/.github/workflows/ci-index-es-dummy.yml +++ b/.github/workflows/ci-index-es-dummy.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-index-es.yml b/.github/workflows/ci-index-es.yml index ea4f6f9cdc..dbc92cb322 100644 --- a/.github/workflows/ci-index-es.yml +++ b/.github/workflows/ci-index-es.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' push: @@ -29,6 +30,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-index-solr-dummy.yml b/.github/workflows/ci-index-solr-dummy.yml index c03d01c238..df809b507f 100644 --- a/.github/workflows/ci-index-solr-dummy.yml +++ b/.github/workflows/ci-index-solr-dummy.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-index-solr.yml b/.github/workflows/ci-index-solr.yml index 65b29a73db..d830c929f2 100644 --- a/.github/workflows/ci-index-solr.yml +++ b/.github/workflows/ci-index-solr.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' push: @@ -29,6 +30,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-java-11.yml b/.github/workflows/ci-java-11.yml index 75b61fc28a..9b8cfa3128 100644 --- a/.github/workflows/ci-java-11.yml +++ b/.github/workflows/ci-java-11.yml @@ -28,6 +28,7 @@ on: - 'docs/**' - '.github/workflows/ci-docs.yml' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-release-dummy.yml b/.github/workflows/ci-release-dummy.yml index 9f4b96dcf6..841001135e 100644 --- a/.github/workflows/ci-release-dummy.yml +++ b/.github/workflows/ci-release-dummy.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 88d8f6482f..9c0318b97e 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -21,6 +21,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' push: @@ -29,6 +30,7 @@ on: - '.github/workflows/ci-docs.yml' - '.github/ISSUE_TEMPLATE/**' - 'requirements.txt' + - 'mkdocs.yml' - 'docs.Dockerfile' - '*.md' schedule: diff --git a/docs/theme/js/.gitkeep b/docs/theme/js/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/theme/structor-menu.css b/docs/theme/structor-menu.css deleted file mode 100644 index ff4164c5a7..0000000000 --- a/docs/theme/structor-menu.css +++ /dev/null @@ -1,10 +0,0 @@ -@media only screen and (min-width:76.25em) { - .md-nav__item--version { - border-width: 0.09rem; - border-style: solid; - border-radius: .2rem; - padding-left: .625em !important; - padding-bottom: .425em !important; - margin-top: 1.875rem; - } -} \ No newline at end of file diff --git a/docs/theme/structor-menu.js.gotmpl b/docs/theme/structor-menu.js.gotmpl index 214f8d203b..754ab30597 100644 --- a/docs/theme/structor-menu.js.gotmpl +++ b/docs/theme/structor-menu.js.gotmpl @@ -8,117 +8,50 @@ const versions = [ {{- end}} ]; - // Material theme - function addMaterialMenu(elt, versions) { - const current = versions.find(function (value) { - return value.selected - }) - - const rootLi = document.createElement('li'); - rootLi.classList.add('md-nav__item'); - rootLi.classList.add('md-nav__item--version'); - rootLi.classList.add('md-nav__item--nested'); - - const input = document.createElement('input'); - input.classList.add('md-toggle'); - input.classList.add('md-nav__toggle'); - input.setAttribute('data-md-toggle', 'nav-10000000'); - input.id = "nav-10000000"; - input.type = 'checkbox'; - - rootLi.appendChild(input); - - const lbl01 = document.createElement('label') - lbl01.classList.add('md-nav__link'); - lbl01.setAttribute('for', 'nav-10000000'); - lbl01.textContent = current.text + " "; - - rootLi.appendChild(lbl01); - - const nav = document.createElement('nav') - nav.classList.add('md-nav'); - nav.setAttribute('data-md-component','collapsible'); - nav.setAttribute('data-md-level','1'); - - rootLi.appendChild(nav); - - const lbl02 = document.createElement('label') - lbl02.classList.add('md-nav__title'); - lbl02.setAttribute('for', 'nav-10000000'); - lbl02.textContent = current.text + " "; - - nav.appendChild(lbl02); - - const ul = document.createElement('ul') - ul.classList.add('md-nav__list'); - ul.setAttribute('data-md-scrollfix',''); - - nav.appendChild(ul); - - for (let i = 0; i < versions.length; i++) { - const li = document.createElement('li'); - li.classList.add('md-nav__item'); - - ul.appendChild(li); - - const a = document.createElement('a'); - a.classList.add('md-nav__link'); - if (versions[i].selected) { - a.classList.add('md-nav__link--active'); - } - a.href = window.location.protocol + "//" + window.location.host + "/"; - if (window.location.host.includes(".github.io")) { - a.href = a.href + window.location.pathname.split("/")[1] + "/"; + const current = versions.find(function (value) { + return value.selected + }) + const rootDiv = document.createElement('div'); + rootDiv.classList.add('md-version'); + + const rootLi = document.createElement('button'); + rootLi.classList.add('md-version__current'); + rootLi.textContent = current.text; + rootDiv.appendChild(rootLi) + const ul = document.createElement('ul') + ul.classList.add('md-version__list'); + + + for (let i = 0; i < versions.length; i++) { + const li = document.createElement('li'); + li.classList.add('md-version__item'); + + ul.appendChild(li); + + const a = document.createElement('a'); + a.classList.add('md-version__link'); + if (versions[i].selected) { + a.classList.add('md-nav__link--active'); + } + a.href = window.location.protocol + "//" + window.location.host + "/"; + if (window.location.host.includes(".github.io")) { + a.href = a.href + window.location.pathname.split("/")[1] + "/"; + } + if (versions[i].path) { + a.href = a.href + versions[i].path + "/" + } + a.title = versions[i].text; + a.text = versions[i].text; + + li.appendChild(a); } - if (versions[i].path) { - a.href = a.href + versions[i].path + "/" - } - a.title = versions[i].text; - a.text = versions[i].text; - - li.appendChild(a); - } - - elt.appendChild(rootLi); + rootDiv.appendChild(ul); + elt.appendChild(rootDiv); } -// United theme - -function addMenu(elt, versions){ - const li = document.createElement('li'); - li.classList.add('md-nav__item'); - li.style.cssText = 'padding-top: 1em;'; - - const select = document.createElement('select'); - select.classList.add('md-nav__link'); - select.style.cssText = 'background: white;border: none;color: #00BCD4;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;overflow: hidden;padding: 0.1em;' - select.setAttribute('onchange', 'location = this.options[this.selectedIndex].value;'); - - for (let i = 0; i < versions.length; i++) { - let opt = document.createElement('option'); - opt.value = window.location.protocol + "//" + window.location.host + "/"; - if (versions[i].path) { - opt.value = opt.value + versions[i].path + "/" - } - opt.text = versions[i].text; - opt.selected = versions[i].selected; - select.appendChild(opt); - } - - li.appendChild(select); - elt.appendChild(li); -} - - -const unitedSelector = 'div.navbar.navbar-default.navbar-fixed-top div.container div.navbar-collapse.collapse ul.nav.navbar-nav.navbar-right'; -const materialSelector = 'div.md-container main.md-main div.md-main__inner.md-grid div.md-sidebar.md-sidebar--primary div.md-sidebar__scrollwrap div.md-sidebar__inner nav.md-nav.md-nav--primary ul.md-nav__list'; +const materialSelector = 'header.md-header div.md-header__topic'; let elt = document.querySelector(materialSelector); -if (elt) { - addMaterialMenu(elt, versions); -} else { - const elt = document.querySelector(unitedSelector); - addMenu(elt, versions); -} \ No newline at end of file +addMaterialMenu(elt, versions); diff --git a/mkdocs.yml b/mkdocs.yml index db735e073d..b0d7407250 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -62,7 +62,7 @@ theme: name: 'material' features: - navigation.footer - - navigation.tabs + - navigation.sections palette: primary: 'green' accent: 'teal' @@ -71,8 +71,9 @@ theme: favicon: 'favicon.ico' extra_css: - - 'theme/structor-menu.css' - 'theme/extra.css' +extra_javascript: + - 'theme/js/structor-menu.js' extra: social: