-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enabling versioning of documentation: #45
Open
ppanero
wants to merge
4
commits into
inveniosoftware:master
Choose a base branch
from
ppanero:versioning
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@media only screen and (max-width:76.1875em) { | ||
#version-selector { | ||
padding: .6rem .8rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
window.addEventListener("DOMContentLoaded", function() { | ||
// This is a bit hacky. Figure out the base URL from a known CSS file the | ||
// template refers to... | ||
var ex = new RegExp("/?assets/fonts/material-icons.css$"); | ||
var sheet = document.querySelector('link[href$="material-icons.css"]'); | ||
|
||
var REL_BASE_URL = sheet.getAttribute("href").replace(ex, ""); | ||
var ABS_BASE_URL = sheet.href.replace(ex, ""); | ||
var CURRENT_VERSION = ABS_BASE_URL.split("/").pop(); | ||
|
||
function makeSelect(options, selected) { | ||
var select = document.createElement("select"); | ||
select.classList.add("form-control"); | ||
|
||
options.forEach(function(i) { | ||
var option = new Option(i.text, i.value, undefined, | ||
i.value === selected); | ||
select.add(option); | ||
}); | ||
|
||
return select; | ||
} | ||
|
||
var xhr = new XMLHttpRequest(); | ||
xhr.open("GET", REL_BASE_URL + "/../versions.json"); | ||
xhr.onload = function() { | ||
var versions = JSON.parse(this.responseText); | ||
|
||
var realVersion = versions.find(function(i) { | ||
return i.version === CURRENT_VERSION || | ||
i.aliases.includes(CURRENT_VERSION); | ||
}).version; | ||
|
||
var select = makeSelect(versions.map(function(i) { | ||
return {text: i.title, value: i.version}; | ||
}), realVersion); | ||
select.addEventListener("change", function(event) { | ||
window.location.href = REL_BASE_URL + "/../" + this.value; | ||
}); | ||
|
||
var container = document.createElement("div"); | ||
container.id = "version-selector"; | ||
container.className = "md-nav__item"; | ||
container.appendChild(select); | ||
|
||
var sidebar = document.querySelector(".md-nav--primary > .md-nav__list"); | ||
sidebar.parentNode.insertBefore(container, sidebar); | ||
}; | ||
xhr.send(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,78 @@ | ||
# Project information | ||
site_name: 'User Documentation' | ||
site_description: 'InvenioRDM user documentation web site' | ||
site_url: 'https://inveniordm.docs.cern.ch' | ||
site_name: User Documentation | ||
site_description: InvenioRDM user documentation web site | ||
site_url: https://inveniordm.docs.cern.ch | ||
|
||
# Repository | ||
repo_name: 'docs-invenio-rdm' | ||
repo_url: 'https://github.com/inveniosoftware/docs-invenio-rdm' | ||
repo_name: docs-invenio-rdm | ||
repo_url: https://github.com/inveniosoftware/docs-invenio-rdm | ||
|
||
# Copyright | ||
copyright: 'Copyright © 2019-2020 CERN and Northwestern University.' | ||
copyright: Copyright © 2019-2020 CERN and Northwestern University. | ||
|
||
# Configuration | ||
theme: | ||
name: 'material' | ||
custom_dir: 'theme' | ||
palette: | ||
primary: 'white' | ||
font: | ||
text: 'Open Sans' | ||
code: 'Roboto Mono' | ||
logo: 'images/logo-rdm.png' | ||
favicon: 'images/favicon.svg' | ||
feature: | ||
tabs: true | ||
name: material | ||
custom_dir: theme | ||
palette: | ||
primary: white | ||
font: | ||
text: Open Sans | ||
code: Roboto Mono | ||
logo: images/logo-rdm.png | ||
favicon: images/favicon.svg | ||
feature: | ||
tabs: true | ||
|
||
nav: | ||
- Home: 'index.md' | ||
- Home: index.md | ||
- Install: | ||
- Installation: 'install/index.md' | ||
- Installation: install/index.md | ||
- Preview: | ||
- Quick preview of InvenioRDM: 'preview/index.md' | ||
- Quick preview of InvenioRDM: preview/index.md | ||
- Develop: | ||
- Getting Started: 'develop/index.md' | ||
- Install Locally: 'develop/install_locally.md' | ||
- Run: 'develop/run.md' | ||
- Make it your own: 'develop/make_it_your_own.md' | ||
- Troubleshooting: 'develop/troubleshoot.md' | ||
- Cleanup: 'develop/cleanup.md' | ||
- Getting Started: develop/index.md | ||
- Install Locally: develop/install_locally.md | ||
- Run: develop/run.md | ||
- Make it your own: 'develop/make_it_your_own.md' | ||
- Troubleshooting: develop/troubleshoot.md | ||
- Cleanup: develop/cleanup.md | ||
- Extensions: | ||
- What can be added?: 'extensions/index.md' | ||
- Add your extensions: 'extensions/custom.md' | ||
- S3 Storage: 'extensions/s3.md' | ||
- What can be added?: extensions/index.md | ||
- Add your extensions: extensions/custom.md | ||
- S3 Storage: extensions/s3.md | ||
- Deploy: | ||
- How can I deploy it?: 'deployment/index.md' | ||
- OpenShift: 'deployment/openshift.md' | ||
- Kubernetes: 'deployment/kubernetes.md' | ||
- System components: 'deployment/services.md' | ||
- Configuration: 'deployment/configuration.md' | ||
- Building your image: 'deployment/image.md' | ||
- Image registries: 'deployment/registries.md' | ||
- Benchmarking: 'deployment/benchmark.md' | ||
- How can I deploy it?: deployment/index.md | ||
- OpenShift: deployment/openshift.md | ||
- Kubernetes: deployment/kubernetes.md | ||
- System components: deployment/services.md | ||
- Configuration: deployment/configuration.md | ||
- Building your image: deployment/image.md | ||
- Image registries: deployment/registries.md | ||
- Benchmarking: deployment/benchmark.md | ||
|
||
|
||
# Customization | ||
extra: | ||
social: | ||
- type: 'github' | ||
link: 'https://github.com/inveniosoftware' | ||
- type: 'twitter' | ||
link: 'https://twitter.com/inveniosoftware' | ||
- type: 'comments' | ||
link: 'https://invenio-talk.web.cern.ch/c/projects/invenio-rdm' | ||
- type: 'globe' | ||
link: 'https://inveniosoftware.org/products/rdm/' | ||
social: | ||
- type: github | ||
link: https://github.com/inveniosoftware | ||
- type: twitter | ||
link: https://twitter.com/inveniosoftware | ||
- type: comments | ||
link: https://invenio-talk.web.cern.ch/c/projects/invenio-rdm | ||
- type: globe | ||
link: https://inveniosoftware.org/products/rdm/ | ||
extra_css: | ||
- stylesheets/extra.css | ||
- css/version-select.css | ||
|
||
# Extensions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: misalignment of the comment I think |
||
markdown_extensions: | ||
- admonition | ||
- codehilite: | ||
guess_lang: false | ||
guess_lang: false | ||
- toc: | ||
permalink: true | ||
permalink: true | ||
extra_javascript: | ||
- js/version-select.js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moderate: Are indentation: 4 spaces or 2 spaces? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
|
||
mkdocs>=1.0.4 | ||
mkdocs-material>=4.6.0 | ||
mike>=0.5.1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Does mike auto-rewrite the mkdocs.yml? I am not sure I like this 😅