Skip to content
Snippets Groups Projects
Commit 3eba352d authored by Christopher Krawietz's avatar Christopher Krawietz
Browse files

added correct structure

parent 7cfa8c32
No related branches found
No related tags found
No related merge requests found
const {description} = require('../../../package.json') const {description} = require('../../package.json')
import localization from 'moment/locale/de'
module.exports = { module.exports = {
/** /**
* Ref:https://v1.vuepress.vuejs.org/config/#title * Ref:https://v1.vuepress.vuejs.org/config/#title
...@@ -10,7 +8,7 @@ module.exports = { ...@@ -10,7 +8,7 @@ module.exports = {
* Ref:https://v1.vuepress.vuejs.org/config/#description * Ref:https://v1.vuepress.vuejs.org/config/#description
*/ */
description: description, description: description,
theme: "nc-provider",
/** /**
* Extra tags to be injected to the page HTML `<head>` * Extra tags to be injected to the page HTML `<head>`
* *
...@@ -68,13 +66,10 @@ module.exports = { ...@@ -68,13 +66,10 @@ module.exports = {
['@vuepress/search', { ['@vuepress/search', {
searchMaxSuggestions: 10 searchMaxSuggestions: 10
}], }],
'@vuepress/last-updated', ['@vuepress/last-updated',
{ {
transformer: (timestamp, lang) => { transformer: timestamp => timestamp
const moment = require('moment') }]
return moment(timestamp)
}
}
], ],
/** /**
* Theme configuration, here is the default theme configuration for VuePress. * Theme configuration, here is the default theme configuration for VuePress.
...@@ -83,33 +78,32 @@ module.exports = { ...@@ -83,33 +78,32 @@ module.exports = {
*/ */
themeConfig: { themeConfig: {
title: 'ITVSH Design System Dokumentation', title: 'ITVSH Design System Dokumentation',
logo: '/img/logo.svg',
repoLabel: 'Gitlab', repoLabel: 'Gitlab',
repo: 'https://gitlab.nc-lab.de/nc/Design-System-Doku', repo: 'https://gitlab.nc-lab.de/nc/Design-System-Doku',
editLinks: true, editLinks: true,
docsBranch: 'main',
editLinkText: 'Hilf uns diese Seite zu verbessern!', editLinkText: 'Hilf uns diese Seite zu verbessern!',
lastUpdated: 'Letzte Änderungen', docsBranch: 'main',
searchPlaceholder: 'Suche', docsDir:'src',
lastUpdated: 'Letze Änderungen',
searchPlaceholder: 'Suche...',
search: true, search: true,
smoothScroll: true, smoothScroll: true,
navbar: true, navbar: false,
displayAllHeaders: true, displayAllHeaders: true,
nav: [
{ text: 'Startseite', link: '/' },
{ text: 'Initialisierung', link: '/introduction/' },
{ text: 'Komponenten', link: 'https://google.com' }
],
sidebar: [ sidebar: [
'/',
{ {
title: 'Introduction', title: 'Introduction',
collapsable: false, collapsable: false,
children: [ children: [
['/introduction/', 'Kapitel 1'], ['/introduction/', 'Initialisierung'],
['/introduction/Backend', 'Backend'],
] ]
}, },
{
title: 'Komponenten',
collapsable: false,
children: [
['/components/', 'Komponenten'],
]}
] ]
} }
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* https://v1.vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements * https://v1.vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements
*/ */
import './styles/sass/screen.scss'; import './theme/styles/sass/screen.scss';
export default ({ export default ({
Vue, // the version of Vue being used in the VuePress app Vue, // the version of Vue being used in the VuePress app
options, // the options for the root Vue instance options, // the options for the root Vue instance
......
<template> <template>
<main class="home" :aria-labelledby="data.heroText !== null ? 'main-title' : null"> <section class="home" :aria-labelledby="data.heroText !== null ? 'main-title' : null">
<header class="hero"> <header class="hero">
<h1 v-if="data.heroText !== null" id="main-title" class="Base-h1"> <h1 v-if="data.heroText !== null" id="main-title" class="Base-h1">
{{ data.heroText || $title || 'Hello' }} {{ data.heroText || $title || 'Hello' }}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div v-if="data.footer" class="footer"> <div v-if="data.footer" class="footer">
{{ data.footer }} {{ data.footer }}
</div> </div>
</main> </section>
</template> </template>
<script> <script>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div v-if="lastUpdated" class="last-updated"> <div v-if="lastUpdated" class="last-updated">
<span class="prefix">{{ lastUpdatedText }}:</span> <span class="prefix">{{ lastUpdatedText }}:</span>
<span class="time">{{ lastUpdated }}</span> <span class="time">{{ lastUpdated }} Uhr</span>
</div> </div>
</footer> </footer>
</template> </template>
...@@ -15,13 +15,14 @@ ...@@ -15,13 +15,14 @@
<script> <script>
import isNil from 'lodash/isNil' import isNil from 'lodash/isNil'
import { endingSlashRE, outboundRE } from '@parent-theme/util' import { endingSlashRE, outboundRE } from '@parent-theme/util'
import moment from 'moment'
import localization from 'moment/locale/de'
export default { export default {
name: 'PageEdit', name: 'PageEdit',
computed: { computed: {
lastUpdated () { lastUpdated () {
console.log(this.$page.lastUpdated) return this.$page.lastUpdated && moment(this.$page.lastUpdated).locale("de", localization).format('DD. MMMM yyyy, h:mm')
return this.$page.lastUpdated
}, },
lastUpdatedText () { lastUpdatedText () {
...@@ -31,7 +32,7 @@ export default { ...@@ -31,7 +32,7 @@ export default {
if (typeof this.$site.themeConfig.lastUpdated === 'string') { if (typeof this.$site.themeConfig.lastUpdated === 'string') {
return this.$site.themeConfig.lastUpdated return this.$site.themeConfig.lastUpdated
} }
return 'Letzte Änderung' return 'Last Updated'
}, },
editLink () { editLink () {
...@@ -109,3 +110,4 @@ export default { ...@@ -109,3 +110,4 @@ export default {
} }
} }
</script> </script>
<template>
<aside class="sidebar">
<slot name="top"/>
<SidebarLinks :depth="0" :items="items"/>
<slot name="bottom"/>
</aside>
</template>
<script>
import SidebarLinks from '@parent-theme/components/SidebarLinks.vue'
export default {
name: 'Sidebar',
components: {SidebarLinks},
props: ['items']
}
</script>
<style lang="stylus">
</style>
module.exports = { module.exports = {
extend: '@vuepress/theme-default', extend: '@vuepress/theme-default',
globalLayout: '/layouts/GlobalLayout', globalLayout: '/layouts/GlobalLayout'
plugins: [
'@vuepress/plugin-back-to-top',
'@vuepress/plugin-medium-zoom',
['@vuepress/pwa', {
serviceWorker: true,
popupComponent: 'SWUpdatePopup',
updatePopup: {
message: "Neue Inhalte sind verfügbar.",
buttonText: "Aktualisieren"
}
}],
['@vuepress/search', {
searchMaxSuggestions: 10
}],
'@vuepress/last-updated',
{
transformer: (timestamp, lang) => {
const moment = require('moment')
moment.locale("de", localization).format('LL')
return moment(timestamp).fromNow()
}
}
]
} }
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
<div class="u-container"> <div class="u-container">
<div class="u-limitWidth-12 u-align-center"> <div class="u-limitWidth-12 u-align-center">
<div class="GridCol2MainAside-row u-row"> <div class="GridCol2MainAside-row u-row" v-if="!$page.frontmatter.home">
<div class="GridCol2MainAside-col-aside u-col u-stack--2"> <div class="GridCol2MainAside-col-aside u-col u-stack--2">
<SearchBox/> <SearchBox/>
<Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar"/>
<Sidebar :items="sidebarItems" @toggle-sidebar="toggleSidebar"> <Sidebar :items="sidebarItems" @toggle-sidebar="toggleSidebar">
<template #top> <template #top>
<slot name="sidebar-top"/> <slot name="sidebar-top"/>
...@@ -18,8 +17,7 @@ ...@@ -18,8 +17,7 @@
</div> </div>
<div class="GridCol2MainAside-col-main u-col u-stack--2"> <div class="GridCol2MainAside-col-main u-col u-stack--2">
<slot class="theme-content"/> <slot class="theme-content"/>
<Home v-if="$page.frontmatter.home" /> <Page v-if="!$page.frontmatter.home" :sidebar-items="sidebarItems">
<Page v-else :sidebar-items="sidebarItems">
<template #top> <template #top>
<slot name="page-top" /> <slot name="page-top" />
</template> </template>
...@@ -29,7 +27,7 @@ ...@@ -29,7 +27,7 @@
</Page> </Page>
</div> </div>
</div> </div>
<Home v-if="$page.frontmatter.home" />
</div> </div>
</div> </div>
</div> </div>
...@@ -38,15 +36,13 @@ ...@@ -38,15 +36,13 @@
import Home from "@theme/components/Home"; import Home from "@theme/components/Home";
import Page from "@theme/components/Page"; import Page from "@theme/components/Page";
import SearchBox from '@SearchBox' import SearchBox from '@SearchBox'
import Navbar from '@parent-theme/components/Navbar'; import Sidebar from '@theme/components/Sidebar';
import Sidebar from '@parent-theme/components/Sidebar';
import { resolveSidebarItems } from '@parent-theme/util' import { resolveSidebarItems } from '@parent-theme/util'
export default { export default {
components: { components: {
Page, Page,
SearchBox, SearchBox,
Sidebar, Sidebar,
Navbar,
Home Home
}, },
data () { data () {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
padding-left: 0; padding-left: 0;
} }
.sidebar-group a.sidebar-link { .sidebar-group a.sidebar-link, a.sidebar-link {
padding-left: 1rem; padding-left: 1rem;
} }
......
...@@ -3,7 +3,7 @@ home: true ...@@ -3,7 +3,7 @@ home: true
heroText: Dokumentation Design System SH heroText: Dokumentation Design System SH
tagline: Dokumentation zum Design System des ITVSH tagline: Dokumentation zum Design System des ITVSH
actionText: Zu den Komponenten actionText: Zu den Komponenten
actionLink: /Komponenten/ actionLink: /components/
features: features:
- title: Feature 1 Title - title: Feature 1 Title
details: Feature 1 Description details: Feature 1 Description
......
--- ---
home: false sidebarDepth: 0
sidebar: auto
tagline: Dokumentation zum Design System des ITVSH tagline: Dokumentation zum Design System des ITVSH
--- ---
# Et adversa evincitque erat stabat damnavit gerens # Et adversa evincitque erat stabat damnavit gerens
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment