talos/docs/website/store/sidebar.js
Andrew Rynhard 13d0e5840c docs: add v0.3 boilerplate
This adds the logic for handling multiple versions of documentation, and
adds a copy of the v0.2 docs as a starting point.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-10-18 23:46:12 -07:00

52 lines
785 B
JavaScript

export const state = () => ({
activeDocPath: '',
lang: '',
version: '',
sections: {},
menu: []
})
export const getters = {
getMenu(state) {
return state.menu
},
getSections(state) {
return state.sections
},
getLang(state, lang) {
return state.lang
},
getVersion(state) {
return state.version
},
getActiveDocPath(state) {
return state.activeDocPath
}
}
export const mutations = {
setMenu(state, menu) {
state.menu = menu
},
setSections(state, sections) {
state.sections = sections
},
setLang(state, lang) {
state.lang = lang
},
setVersion(state, version) {
state.version = version
},
setActiveDocPath(state, activeDocPath) {
state.activeDocPath = activeDocPath.replace('docs/', '')
}
}