Skip to content

Commit

Permalink
hide contribuiting subsections and update site/build_docs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TOsmanov committed Sep 9, 2021
1 parent 13d93aa commit 70d76ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 11 additions & 3 deletions site/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
# SPDX-License-Identifier: MIT

import os
from packaging import version
import shutil
import subprocess

from packaging import version
import git
import toml

Expand Down Expand Up @@ -33,6 +34,14 @@ def write_version_item(file_object, version, url):
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
Expand Down Expand Up @@ -63,8 +72,7 @@ def run_hugo(content_loc, destination_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)
Expand Down
5 changes: 5 additions & 0 deletions site/content/en/docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Contributing'
weight: 4
manualLink: /docs/contributing
---
1 change: 1 addition & 0 deletions site/content/en/docs/contributing/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ weight: 4
description: 'This section contains documents for CVAT developers.'
hide_feedback: true
ul_show: false
toc_hide: true
---

Please take a moment to review this document in order to make the contribution
Expand Down

0 comments on commit 70d76ba

Please sign in to comment.