diff --git a/admin_manual/conf.py b/admin_manual/conf.py index e86a120d5..a9c42d0b3 100644 --- a/admin_manual/conf.py +++ b/admin_manual/conf.py @@ -297,3 +297,4 @@ current_docs = 'admin_manual' # Generate the versions list html_context['versions'] = generateVersionsDocs(current_docs) +html_context['theme_vcs_pageview_mode'] += current_docs diff --git a/conf.py b/conf.py index 402e4f9a3..b04f09ab5 100644 --- a/conf.py +++ b/conf.py @@ -8,7 +8,7 @@ dir_path = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.abspath(dir_path + '/_ext')) now = datetime.datetime.now() -extensions = ['edit_on_github'] +extensions = [] # General information about the project. copyright = str(now.year) + ' Nextcloud GmbH' @@ -36,9 +36,9 @@ html_logo = "../_shared_assets/static/logo-white.png" rst_epilog = '.. |version| replace:: %s' % version # building the versions list +version_start = 13 # THIS IS THE SUPPORTED VERSION NUMBER +version_stable = 15 # INCREASE THIS NUMBER TO THE LATEST STABLE VERSION NUMBER def generateVersionsDocs(current_docs): - version_start = 13 # THIS IS THE SUPPORTED VERSION NUMBER - version_stable = 15 # INCREASE THIS NUMBER TO THE LATEST STABLE VERSION NUMBER versions_doc = [] for v in range(version_start, version_stable + 1): url = 'https://docs.nextcloud.com/server/%s/%s' % (str(v), current_docs) @@ -46,11 +46,23 @@ def generateVersionsDocs(current_docs): versions_doc.append(tuple(('stable', 'https://docs.nextcloud.com/server/%s/%s' % ('stable', current_docs)))) versions_doc.append(tuple(('latest', 'https://docs.nextcloud.com/server/%s/%s' % ('latest', current_docs)))) return versions_doc + +if version.isdigit(): + github_branch = 'stable%s' % version +else: + github_branch = 'master' html_context = { 'current_version': version, 'READTHEDOCS': True, - 'extra_css_files': ['_static/custom.css'] + 'extra_css_files': ['_static/custom.css'], + + # force github plugin + 'display_github': True, + 'github_user': 'nextcloud', + 'github_repo': 'documentation', + # If current version is an int, use the stablexxx branches, otherwise, edit on master + 'theme_vcs_pageview_mode': 'edit/%s/' % github_branch, # to be completed by each individual conf.py } edit_on_github_project = 'nextcloud/documentation' diff --git a/developer_manual/conf.py b/developer_manual/conf.py index ba0ae367c..425542ee6 100644 --- a/developer_manual/conf.py +++ b/developer_manual/conf.py @@ -315,3 +315,4 @@ StandaloneHTMLBuilder.supported_image_types = [ # Generate the versions list html_context['versions'] = generateVersionsDocs(current_docs) +html_context['theme_vcs_pageview_mode'] += current_docs diff --git a/user_manual/conf.py b/user_manual/conf.py index e94df95e4..d3cc349b2 100644 --- a/user_manual/conf.py +++ b/user_manual/conf.py @@ -308,3 +308,4 @@ current_docs = 'user_manual' # Generate the versions list html_context['versions'] = generateVersionsDocs(current_docs) +html_context['theme_vcs_pageview_mode'] += current_docs diff --git a/user_manual_de/conf.py b/user_manual_de/conf.py index 9357c4a3b..19d3dd8d5 100644 --- a/user_manual_de/conf.py +++ b/user_manual_de/conf.py @@ -300,3 +300,4 @@ current_docs = 'user_manual_de' # Generate the versions list html_context['versions'] = generateVersionsDocs(current_docs) +html_context['theme_vcs_pageview_mode'] += current_docs