mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
feat: inject logos collective footer links into theme config
This commit is contained in:
@@ -119,71 +119,6 @@ const config = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Research',
|
||||
items: [
|
||||
{
|
||||
href: '/',
|
||||
label: 'VacP2P',
|
||||
},
|
||||
{
|
||||
href: '/',
|
||||
label: 'AFAIK',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Infrastructure',
|
||||
items: [
|
||||
{
|
||||
href: '/',
|
||||
label: 'Waku',
|
||||
},
|
||||
{
|
||||
href: '/',
|
||||
label: 'Nimbus',
|
||||
},
|
||||
{
|
||||
href: '/',
|
||||
label: 'Codex',
|
||||
},
|
||||
{
|
||||
href: '/',
|
||||
label: 'Nomos',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Creative Studio',
|
||||
items: [
|
||||
{
|
||||
href: '/',
|
||||
label: 'Acid.info',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Movement',
|
||||
items: [
|
||||
{
|
||||
href: '/',
|
||||
label: 'Logos',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'User-facing products',
|
||||
items: [
|
||||
{
|
||||
href: '/',
|
||||
label: 'Status',
|
||||
},
|
||||
{
|
||||
href: '/',
|
||||
label: 'Keycard',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -58,9 +58,8 @@ export default function logosPreset(
|
||||
path.join(__dirname, '../static', options.businessUnit),
|
||||
]
|
||||
|
||||
siteConfig.themeConfig = defaultsDeep(
|
||||
[{}, context.siteConfig.themeConfig, themeConfigs[options.businessUnit]],
|
||||
false,
|
||||
siteConfig.themeConfig = themeConfigs[options.businessUnit](
|
||||
context.siteConfig.themeConfig,
|
||||
)
|
||||
|
||||
Object.entries(siteConfig).forEach(
|
||||
|
||||
@@ -18,7 +18,73 @@ export const baseThemeConfig: ThemeConfig = {
|
||||
},
|
||||
footer: {
|
||||
logo: {},
|
||||
links: [],
|
||||
links: [
|
||||
{
|
||||
title: 'shared:Research',
|
||||
items: [
|
||||
{
|
||||
href: 'https://vac.dev',
|
||||
label: 'VacP2P',
|
||||
},
|
||||
{
|
||||
href: 'https://afaik.institute',
|
||||
label: 'AFAIK',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'shared:Infrastructure',
|
||||
items: [
|
||||
{
|
||||
href: 'https://waku.org/',
|
||||
label: 'Waku',
|
||||
},
|
||||
{
|
||||
href: 'https://nimbus.team/',
|
||||
label: 'Nimbus',
|
||||
},
|
||||
{
|
||||
href: 'https://codex.storage',
|
||||
label: 'Codex',
|
||||
},
|
||||
{
|
||||
href: '#',
|
||||
label: 'Nomos',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'shared:Creative Studio',
|
||||
items: [
|
||||
{
|
||||
href: 'https://acid.info',
|
||||
label: 'Acid.info',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'shared:Movement',
|
||||
items: [
|
||||
{
|
||||
href: 'https://logos.co',
|
||||
label: 'Logos',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'shared:User-facing products',
|
||||
items: [
|
||||
{
|
||||
href: 'https://status.im',
|
||||
label: 'Status',
|
||||
},
|
||||
{
|
||||
href: 'https://keycard.tech',
|
||||
label: 'Keycard',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `Logos, ${new Date().getFullYear()}`,
|
||||
},
|
||||
prism: {
|
||||
|
||||
@@ -1,11 +1,32 @@
|
||||
import { ThemeConfig } from '@docusaurus/types'
|
||||
import { ThemeConfig } from '@docusaurus/preset-classic'
|
||||
import { BusinessUnits } from '../types'
|
||||
import { defaultsDeep } from '../utils/object.utils'
|
||||
import baseThemeConfig from './base'
|
||||
import codexThemeConfig from './codex'
|
||||
import logosThemeConfig from './logos'
|
||||
import wakuThemeConfig from './waku'
|
||||
|
||||
export const themeConfigs: Record<BusinessUnits, ThemeConfig> = {
|
||||
[BusinessUnits.Logos]: logosThemeConfig,
|
||||
[BusinessUnits.Codex]: codexThemeConfig,
|
||||
[BusinessUnits.Waku]: wakuThemeConfig,
|
||||
const merge =
|
||||
(base: ThemeConfig) =>
|
||||
(config: ThemeConfig): ThemeConfig => {
|
||||
const merged: ThemeConfig = {
|
||||
...(defaultsDeep([{}, config, base], false) as ThemeConfig),
|
||||
}
|
||||
|
||||
return {
|
||||
...merged,
|
||||
footer: {
|
||||
...merged.footer,
|
||||
links: [
|
||||
...(merged.footer?.links ?? []),
|
||||
...(baseThemeConfig.footer?.links ?? []),
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export const themeConfigs: Record<BusinessUnits, ReturnType<typeof merge>> = {
|
||||
[BusinessUnits.Logos]: merge(logosThemeConfig),
|
||||
[BusinessUnits.Codex]: merge(codexThemeConfig),
|
||||
[BusinessUnits.Waku]: merge(wakuThemeConfig),
|
||||
}
|
||||
|
||||
@@ -1,11 +1,30 @@
|
||||
import React from 'react'
|
||||
import clsx from 'clsx'
|
||||
import styles from './styles.module.scss'
|
||||
import { Button } from '@acid-info/lsd-react'
|
||||
import { MultiColumnFooter, SimpleFooter } from '@docusaurus/theme-common'
|
||||
import clsx from 'clsx'
|
||||
import React from 'react'
|
||||
import styles from './styles.module.scss'
|
||||
|
||||
const groupLinks = (
|
||||
links: MultiColumnFooter['links'] | SimpleFooter['links'],
|
||||
) => {
|
||||
const siteLinks: any[] = []
|
||||
const sharedLinks: any[] = []
|
||||
|
||||
for (const link of links) {
|
||||
if (
|
||||
'title' in link &&
|
||||
typeof link.title === 'string' &&
|
||||
link.title.startsWith('shared:')
|
||||
) {
|
||||
sharedLinks.push({ ...link, title: link.title.slice(7) })
|
||||
} else siteLinks.push(link)
|
||||
}
|
||||
|
||||
return [siteLinks, sharedLinks]
|
||||
}
|
||||
|
||||
export default function FooterLayout({ style, links, logo, copyright }) {
|
||||
const firstRow = [...links.props.links.slice(0, 2)]
|
||||
const secondRow = [...links.props.links.slice(2)]
|
||||
const [firstRow, secondRow] = groupLinks(links.props.links)
|
||||
|
||||
const handleScrollToTop = () => {
|
||||
window.scrollTo({
|
||||
|
||||
Reference in New Issue
Block a user