404
+Not found
+Oops! This page doesn't exist. Try going back to our about page or documentation page.
+diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml
index 9abe9d54..2b38f3f3 100644
--- a/.github/workflows/github_pages.yml
+++ b/.github/workflows/github_pages.yml
@@ -32,7 +32,7 @@ jobs:
- name: Build docs
run: |
- pip install gitpython packaging
+ pip install gitpython packaging toml
python site/build_docs.py
- name: Deploy
diff --git a/site/assets/scss/_custom.scss b/site/assets/scss/_custom.scss
index f8a370ef..95b55697 100644
--- a/site/assets/scss/_custom.scss
+++ b/site/assets/scss/_custom.scss
@@ -133,3 +133,17 @@
#td-cover-block-0 {
background-image: url("../images/background-about-page.jpg");
}
+
+/* Display version menu on mobile version of the site */
+
+#dropdown_ver {
+ right: 5px !important;
+ left: auto;
+}
+
+@media (min-width: 991.98px) {
+ #dropdown_ver {
+ right: 245px !important;
+ left: auto;
+ }
+}
diff --git a/site/build_docs.py b/site/build_docs.py
index 37232b8f..08128672 100644
--- a/site/build_docs.py
+++ b/site/build_docs.py
@@ -3,10 +3,12 @@
# SPDX-License-Identifier: MIT
import os
-from packaging import version
+import shutil
import subprocess
+from packaging import version
import git
+import toml
MINIMUM_VERSION='1.5.0'
@@ -28,10 +30,25 @@ def generate_versioning_config(filename, versions, url_prefix=''):
file_object.write('url = "{}"\n\n'.format(url))
with open(filename, 'w') as f:
- write_version_item(f, 'develop', '{}/'.format(url_prefix))
+ write_version_item(f, 'Latest version', '{}/'.format(url_prefix))
for v in versions:
write_version_item(f, v, '{}/{}'.format(url_prefix, v))
+def git_checkout(tagname, cwd):
+ docs_dir = os.path.join(cwd, 'site', 'content', 'en', 'docs')
+ shutil.rmtree(docs_dir)
+ repo.git.checkout(tagname, '--', 'site/content/en/docs')
+ images_dir = os.path.join(cwd, 'site', 'content', 'en', 'images')
+ shutil.rmtree(images_dir)
+ repo.git.checkout(tagname, '--', 'site/content/en/images')
+
+def change_version_menu_toml(filename, version):
+ data = toml.load(filename)
+ data['params']['version_menu'] = version
+
+ with open(filename,'w') as f:
+ toml.dump(data, f)
+
def generate_docs(repo, output_dir, tags):
def run_hugo(content_loc, destination_dir):
subprocess.run([ # nosec
@@ -50,13 +67,14 @@ def generate_docs(repo, output_dir, tags):
os.makedirs(output_dir)
generate_versioning_config(os.path.join(cwd, 'site', 'versioning.toml'), (t.name for t in tags))
+ change_version_menu_toml(os.path.join(cwd, 'site', 'versioning.toml'), 'Latest version')
run_hugo(content_loc, output_dir)
generate_versioning_config(os.path.join(cwd, 'site', 'versioning.toml'), (t.name for t in tags), '/..')
for tag in tags:
- repo.git.checkout(tag.name, '--', 'site/content/en/docs')
- repo.git.checkout(tag.name, '--', 'site/content/en/images')
+ git_checkout(tag.name, cwd)
destination_dir = os.path.join(output_dir, tag.name)
+ change_version_menu_toml(os.path.join(cwd, 'site', 'versioning.toml'), tag.name)
os.makedirs(destination_dir)
run_hugo(content_loc, destination_dir)
diff --git a/site/config.toml b/site/config.toml
index b9f6f7ac..fbd5ccfe 100644
--- a/site/config.toml
+++ b/site/config.toml
@@ -96,7 +96,7 @@ cvat_terms_of_use = "https://cvat.org/api/v1/restrictions/terms-of-use"
# Menu title if your navbar has a versions selector to access old versions of your site.
# This menu appears only if you have at least one [params.versions] set.
-version_menu = "Releases"
+# version_menu = "Releases"
# Flag used in the "version-banner" partial to decide whether to display a
# banner on every page indicating that this is an archived version of the docs.
diff --git a/site/content/en/docs/administration/_index.md b/site/content/en/docs/administration/_index.md
index 215c41aa..c3e09d42 100644
--- a/site/content/en/docs/administration/_index.md
+++ b/site/content/en/docs/administration/_index.md
@@ -1,9 +1,6 @@
---
-
title: 'Administration'
linkTitle: 'Administration'
weight: 3
description: 'This section contains documents for system administrators.'
-hide_feedback: true
-
---
diff --git a/site/content/en/docs/administration/advanced/_index.md b/site/content/en/docs/administration/advanced/_index.md
index 8f1ad89b..93135df1 100644
--- a/site/content/en/docs/administration/advanced/_index.md
+++ b/site/content/en/docs/administration/advanced/_index.md
@@ -1,9 +1,6 @@
---
-
title: 'Advanced'
linkTitle: 'Advanced'
weight: 2
description: 'This section contains advanced documents for system administrators.'
-hide_feedback: true
-
---
diff --git a/site/content/en/docs/administration/basics/_index.md b/site/content/en/docs/administration/basics/_index.md
index e156be79..f998efaa 100644
--- a/site/content/en/docs/administration/basics/_index.md
+++ b/site/content/en/docs/administration/basics/_index.md
@@ -1,9 +1,6 @@
---
-
title: 'Basics'
linkTitle: 'Basics'
weight: 1
description: 'This section contains basic documents for system administrators.'
-hide_feedback: true
-
---
diff --git a/site/content/en/docs/contributing/_index.md b/site/content/en/docs/contributing/_index.md
index 180ebbce..bf75235b 100644
--- a/site/content/en/docs/contributing/_index.md
+++ b/site/content/en/docs/contributing/_index.md
@@ -3,8 +3,6 @@ title: 'Contributing to this project'
linkTitle: 'Contributing'
weight: 4
description: 'This section contains documents for CVAT developers.'
-hide_feedback: true
-ul_show: false
---
Please take a moment to review this document in order to make the contribution
diff --git a/site/content/en/docs/manual/_index.md b/site/content/en/docs/manual/_index.md
index 611d71ab..c0b2ded5 100644
--- a/site/content/en/docs/manual/_index.md
+++ b/site/content/en/docs/manual/_index.md
@@ -1,9 +1,6 @@
---
-
title: 'Manual'
linkTitle: 'Manual'
weight: 2
description: 'This section contains documents for CVAT simple and advanced users'
-hide_feedback: true
-
---
diff --git a/site/content/en/docs/manual/advanced/_index.md b/site/content/en/docs/manual/advanced/_index.md
index 42c8c55a..9c74f156 100644
--- a/site/content/en/docs/manual/advanced/_index.md
+++ b/site/content/en/docs/manual/advanced/_index.md
@@ -3,6 +3,4 @@ title: "Advanced"
linkTitle: "Advanced"
weight: 2
description: 'This section contains advanced documents for CVAT users'
-hide_feedback: true
-
---
diff --git a/site/content/en/docs/manual/basics/_index.md b/site/content/en/docs/manual/basics/_index.md
index 41121d0b..d03b623f 100644
--- a/site/content/en/docs/manual/basics/_index.md
+++ b/site/content/en/docs/manual/basics/_index.md
@@ -3,6 +3,4 @@ title: "Basics"
linkTitle: "Basics"
weight: 1
description: 'This section contains basic documents for CVAT users'
-hide_feedback: true
-
---
diff --git a/site/content/en/page_404.html b/site/content/en/page_404.html
new file mode 100644
index 00000000..60b3e60d
--- /dev/null
+++ b/site/content/en/page_404.html
@@ -0,0 +1,11 @@
++++
+Title = 404
++++
+
+ Not found Oops! This page doesn't exist. Try going back to our about page or documentation page. Not found Oops! This page doesn't exist. Try going back to our about page or documentation page.404
+ 404
-