mirror of
https://github.com/nextcloud/documentation.git
synced 2025-10-26 11:18:02 +00:00
Merge pull request #963 from nextcloud/stb14-edit-on-github
Add edit-on-github functionality
This commit is contained in:
commit
ae293e91ef
@ -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
|
||||
|
||||
20
conf.py
20
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)
|
||||
@ -47,10 +47,22 @@ def generateVersionsDocs(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'
|
||||
|
||||
@ -314,4 +314,6 @@ StandaloneHTMLBuilder.supported_image_types = [
|
||||
]
|
||||
|
||||
# Generate the versions list
|
||||
html_context['versions'] = generateVersionsDocs(current_docs)
|
||||
html_context['versions'] = generateVersionsDocs(current_docs)
|
||||
html_context['theme_vcs_pageview_mode'] += current_docs
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user