Skip to content

Commit

Permalink
Filled in plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
danjoa committed Oct 23, 2023
1 parent 426d1de commit b01a545
Show file tree
Hide file tree
Showing 15 changed files with 207 additions and 1,388 deletions.
35 changes: 18 additions & 17 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { UserConfig, DefaultTheme } from 'vitepress'
import { join, resolve } from 'node:path'
import { promises as fs } from 'node:fs'
import { URL } from 'node:url'
import { sidebar as sideb, nav4 } from './menu'
import { sidebar, nav4 } from './menu'
import * as redirects from './lib/redirects'
import * as cdsMavenSite from './lib/cds-maven-site'
import * as MdAttrsPropagate from './lib/md-attrs-propagate'
Expand Down Expand Up @@ -72,29 +72,30 @@ const localSearchOptions = {
}
} as { provider: 'local'; options?: DefaultTheme.LocalSearchOptions }

const menu = sidebar()
const nav = nav4(menu) as DefaultTheme.NavItem[]

const config:UserConfig<CapireThemeConfig> = {
title: 'CAPire',
description: 'Documentation for SAP Cloud Application Programming Model',
base,
srcExclude: ['**/README.md', '**/LICENSE.md', '**/CONTRIBUTING.md', '**/CODE_OF_CONDUCT.md', '**/menu.md', '**/-*.md'],
themeConfig: {
logo: '/assets/logos/cap.svg',
get sidebar() { return sideb('menu.md') },
get nav() {
const navItems = nav4(config.themeConfig!.sidebar) as DefaultTheme.NavItem[]
return [
navItems.find (i => i.text === 'Getting Started'), //@ts-ignore
...navItems.filter(i => i.text === 'Cookbook').map((item:DefaultTheme.NavItemWithChildren) => {
item.items.unshift({ text: 'Overview', link: '/guides/' }) // add extra overview item to navbar
return item
}),
{ text: 'Reference', items: [
{ text: 'CDS', link: '/cds/' },
{ text: 'Node.js', link: '/node.js/' },
{ text: 'Java', link: '/java/' },
]},
] as DefaultTheme.NavItem[]
},
// IMPORTANT: Don't use getters here, as they are called again and again!
sidebar: menu,
nav: [
nav.find(i => i.text === 'Getting Started'),
nav.find(i => i.text === 'Cookbook'),
{ text: 'More...', items: [
{ text: 'Advanced', link: '/advanced/' },
{ text: 'Plugins', link: '/plugins/' },
{ text: 'Tools', link: '/tools/' },
{ text: 'CDS', link: '/cds/' },
{ text: 'Java', link: '/java/' },
{ text: 'Node.js', link: '/node.js/' },
]},
] as DefaultTheme.NavItem[],
search: localSearchOptions,
footer: {
message: '<a href="https://www.sap.com/about/legal/impressum.html" target="_blank">Legal Disclosure</a> | <a href="https://www.sap.com/corporate/en/legal/terms-of-use.html" target="_blank">Terms of Use</a> | <a href="https://www.sap.com/about/legal/privacy.html" target="_blank">Privacy</a>',
Expand Down
7 changes: 4 additions & 3 deletions .vitepress/theme/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ main {
p {
line-height: 1.5em
}
ul {
padding-left: 2.2em;
ul, ol {
padding-left: 2.5em;
}
.caption {
text-align: center;
Expand All @@ -68,7 +68,8 @@ main {
line-height: 1.4em
}
pre {
padding: 16px 0 !important;
padding: 12px 0 !important;
code { padding: 0 22px !important }
}
:not(pre) > code {
font-style: italic;
Expand Down
10 changes: 10 additions & 0 deletions advanced/index.data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { basename } from 'node:path'
import { createContentLoader } from 'vitepress'
import filter from '../.vitepress/theme/components/indexFilter.js'

const basePath = basename(__dirname)
export default createContentLoader(`**/${basePath}/*.md`, {
transform(rawData) {
return filter(rawData, `/${basePath}/`)
}
})
15 changes: 15 additions & 0 deletions advanced/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
status: released
---

# Advanced Topics and Concepts

This section provides information on advanced topics and concepts that are not covered in the cookbook guides.


<script setup>
import { data as pages } from './index.data.js'
</script>

<br>
<IndexList :pages='pages' />
1 change: 0 additions & 1 deletion cds/index.data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { createContentLoader } from 'vitepress'
import filter from '../.vitepress/theme/components/indexFilter.js'

const basePath = basename(__dirname)

export default createContentLoader(`**/${basePath}/*.md`, {
transform(rawData) {
return filter(rawData, `/${basePath}/`)
Expand Down
3 changes: 0 additions & 3 deletions cds/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
section: CDS
# shorty: CDS
permalink: /cds/
status: released
---

Expand Down
Loading

0 comments on commit b01a545

Please sign in to comment.