-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fecdbf
commit ca524fc
Showing
22 changed files
with
5,249 additions
and
3,527 deletions.
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
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,44 @@ | ||
name: Test docs build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
docs: ${{ steps.filter.outputs.docs }} | ||
steps: | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
docs: | ||
- '.github/workflows/deploy-to-developer-portal-dev.yml' | ||
- '.github/workflows/deploy-to-developer-portal-prod.yml' | ||
- '.github/workflows/test-build.yml' | ||
- 'docusaurus/**' | ||
- 'package-lock.json' | ||
build-docs: | ||
needs: changes | ||
if: ${{ needs.changes.outputs.docs == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'yarn' | ||
- name: Install dependencies | ||
uses: ./.github/actions/yarn-nm-install | ||
|
||
- name: Build documentation website (Dev Portal) | ||
run: yarn docs:build |
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
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,146 @@ | ||
const path = require('path'); | ||
const prism = require('prism-react-renderer'); | ||
|
||
const { | ||
themes: { oneDark }, | ||
} = prism; | ||
|
||
// Replace background and color to better match Grafana theme. | ||
const grafanaPrismTheme = { | ||
...oneDark, | ||
plain: { | ||
color: 'rgb(204, 204, 220)', | ||
backgroundColor: '#181b1f', | ||
}, | ||
}; | ||
|
||
const customFields = { | ||
nodeEnv: process.env.NODE_ENV, | ||
}; | ||
|
||
/** @type {import('@docusaurus/types').Config} */ | ||
const generalConfig = { | ||
title: 'Grafana Scenes', | ||
tagline: 'Build highly interactive Grafana apps with ease.', | ||
baseUrl: 'scenes/', | ||
onBrokenLinks: 'throw', | ||
onBrokenMarkdownLinks: 'warn', | ||
favicon: 'img/favicon.png', | ||
// GitHub pages deployment config. | ||
// If you aren't using GitHub pages, you don't need these. | ||
organizationName: 'grafana', // Usually your GitHub org/user name. | ||
projectName: 'scenes', // Usually your repo name. | ||
|
||
// Even if you don't use internalization, you can use this field to set useful | ||
// metadata like html lang. For example, if your site is Chinese, you may want | ||
// to replace "en" with "zh-Hans". | ||
i18n: { | ||
defaultLocale: 'en', | ||
locales: ['en'], | ||
}, | ||
}; | ||
|
||
const plugins = [ | ||
[ | ||
'docusaurus-lunr-search', | ||
{ | ||
disableVersioning: true, | ||
}, | ||
], | ||
]; | ||
|
||
const presetsDocs = { | ||
path: '../docs', | ||
sidebarPath: require.resolve('./sidebars.js'), | ||
// Please change this to your repo. | ||
// Remove this to remove the "edit this page" links. | ||
editUrl: 'https://github.com/grafana/scenes/edit/main/docusaurus/website', | ||
}; | ||
|
||
const presetsTheme = { | ||
customCss: require.resolve('./src/css/custom.css'), | ||
}; | ||
|
||
const themeConfigNavbar = { | ||
title: 'Grafana Scenes', | ||
logo: { | ||
alt: 'Grafana Logo', | ||
src: 'img/logo.svg', | ||
}, | ||
items: [ | ||
{ href: 'https://community.grafana.com/c/support/scenes/85', label: 'Help', position: 'right' }, | ||
{ | ||
href: 'https://www.github.com/grafana/scenes', | ||
label: 'GitHub', | ||
position: 'right', | ||
}, | ||
], | ||
}; | ||
|
||
const themeConfigFooter = { | ||
style: 'dark', | ||
links: [ | ||
{ | ||
title: 'Docs', | ||
items: [ | ||
{ | ||
label: 'Get Started', | ||
to: '/', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Community', | ||
items: [ | ||
{ | ||
label: 'Github Issues', | ||
href: 'https://www.github.com/grafana/scenes/issues', | ||
}, | ||
{ | ||
label: 'Grafana Community Forums', | ||
href: 'https://community.grafana.com/c/support/scenes/85', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Social', | ||
items: [ | ||
{ | ||
label: 'GitHub', | ||
href: 'https://www.github.com/grafana/scenes', | ||
}, | ||
], | ||
}, | ||
], | ||
copyright: `Copyright © ${new Date().getFullYear()} Grafana Labs. Built with Docusaurus.`, | ||
}; | ||
|
||
const themeConfigPrism = { | ||
theme: grafanaPrismTheme, | ||
additionalLanguages: ['bash', 'diff', 'json'], | ||
magicComments: [ | ||
{ | ||
className: 'code-block-addition-highlighted-line', | ||
line: 'addition-highlight-next-line', | ||
block: { start: 'addition-highlight-start', end: 'addition-highlight-end' }, | ||
}, | ||
], | ||
}; | ||
|
||
const themeConfigColorMode = { | ||
defaultMode: 'dark', | ||
disableSwitch: true, | ||
respectPrefersColorScheme: false, | ||
}; | ||
|
||
module.exports = { | ||
customFields, | ||
generalConfig, | ||
plugins, | ||
presetsDocs, | ||
presetsTheme, | ||
themeConfigNavbar, | ||
themeConfigFooter, | ||
themeConfigPrism, | ||
themeConfigColorMode, | ||
}; |
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,71 @@ | ||
// @ts-check | ||
// Note: type annotations allow type checking and IDEs autocompletion | ||
|
||
const { | ||
generalConfig, | ||
plugins, | ||
presetsDocs, | ||
presetsTheme, | ||
themeConfigNavbar, | ||
themeConfigFooter, | ||
themeConfigPrism, | ||
themeConfigColorMode, | ||
} = require('./docusaurus.config.base'); | ||
|
||
const devPortalHome = 'https://grafana-dev.com/developers'; | ||
const [docsFooterLinks, ...otherFooterLinks] = themeConfigFooter.links; | ||
|
||
/** @type {import('@docusaurus/types').Config} */ | ||
const config = { | ||
...generalConfig, | ||
url: 'https://grafana-dev.com/', | ||
baseUrl: 'developers/scenes/', | ||
plugins, | ||
presets: [ | ||
[ | ||
'classic', | ||
/** @type {import('@docusaurus/preset-classic').Options} */ | ||
({ | ||
docs: { | ||
...presetsDocs, | ||
routeBasePath: '/', | ||
}, | ||
theme: presetsTheme, | ||
blog: false, | ||
}), | ||
], | ||
], | ||
|
||
themeConfig: | ||
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */ | ||
({ | ||
navbar: { | ||
...themeConfigNavbar, | ||
items: [ | ||
{ href: devPortalHome, label: 'Portal Home', position: 'right', target: '_self' }, | ||
...themeConfigNavbar.items, | ||
], | ||
}, | ||
footer: { | ||
...themeConfigFooter, | ||
links: [ | ||
{ | ||
...docsFooterLinks, | ||
items: [ | ||
...docsFooterLinks.items, | ||
{ | ||
label: 'Portal Home', | ||
href: devPortalHome, | ||
target: '_self', | ||
}, | ||
], | ||
}, | ||
...otherFooterLinks, | ||
], | ||
}, | ||
prism: themeConfigPrism, | ||
colorMode: themeConfigColorMode, | ||
}), | ||
}; | ||
|
||
module.exports = config; |
Oops, something went wrong.