From 3e56ba05ccbc5a7d8bef50dc0216d176adc48917 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Fri, 3 Sep 2021 10:29:19 +0800 Subject: [PATCH] docs: fix missing static file path Also update layout of version table --- docs/_static/js/version_table.js | 20 ++++++++++++++++---- docs/_static/version_table.html | 4 ++-- docs/conf_common.py | 2 ++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/_static/js/version_table.js b/docs/_static/js/version_table.js index 66e6f5bd68..d4f84ebdb6 100644 --- a/docs/_static/js/version_table.js +++ b/docs/_static/js/version_table.js @@ -23,7 +23,7 @@ $(document).ready(function() { (Where 'idf_target' path element are optional depending on if the project has multiple target support) */ - let project_base_url = DOCUMENTATION_OPTIONS.URL_ROOT + "../.."; + let project_base_url = DOCUMENTATION_OPTIONS.URL_ROOT + "../../.."; if (DOCUMENTATION_OPTIONS.IDF_TARGETS) { project_base_url += "/.."; } @@ -38,17 +38,29 @@ $(document).ready(function() { return result + "/"; }; - old_ver_list = ""; + old_ver_table = ""; + old_ver_table_row = "" + let row_items = 0; + const ITEMS_PER_ROW = 4; for (let i = 0; i < versions.length; i++) { let v = versions[i]; let url = getVersionUrl(v); if (v.old) { - old_ver_list += "
  • " + v.name + "
  • "; + old_ver_table_row += "" + v.name + ""; + row_items++; + if (row_items === ITEMS_PER_ROW) { + old_ver_table_row += "" + old_ver_table += old_ver_table_row + + /* Prepare a new row */ + old_ver_table_row = "" + row_items = 0 + } } } - $( "#version_list" ).append(old_ver_list); + $( "#version_table" ).append(old_ver_table); }); diff --git a/docs/_static/version_table.html b/docs/_static/version_table.html index 6e0feedbbe..6888880154 100644 --- a/docs/_static/version_table.html +++ b/docs/_static/version_table.html @@ -1,7 +1,7 @@ -
      + - +
      diff --git a/docs/conf_common.py b/docs/conf_common.py index 9ac164db38..9973e56e8c 100644 --- a/docs/conf_common.py +++ b/docs/conf_common.py @@ -187,6 +187,8 @@ with open('../page_redirects.txt') as f: raise RuntimeError('Invalid line in page_redirects.txt: %s' % line) html_redirect_pages = [tuple(line.split(' ')) for line in lines] +html_static_path = ['../_static'] + # Callback function for user setup that needs be done after `config-init`-event # config.idf_target is not available at the initial config stage