2022-09-29 01:59:28 +00:00
|
|
|
import Link from 'next/link'
|
|
|
|
import { getDocuments, Document } from '../utils/mdx-utils'
|
|
|
|
import Layout from '../components/Layout'
|
|
|
|
import ArrowIcon from '../components/ArrowIcon'
|
|
|
|
import SEO from '../components/SEO'
|
2022-10-01 20:32:01 +00:00
|
|
|
import { getSearchIndex, SearchIndex } from '../utils/search'
|
2022-09-29 01:59:28 +00:00
|
|
|
|
|
|
|
const pages = [
|
|
|
|
{
|
|
|
|
slug: '/variables',
|
|
|
|
title: 'Variables',
|
|
|
|
desc: 'Variables let you define the various objects displayed in Conky including text, bars, graphs, and more.',
|
|
|
|
},
|
2022-09-30 21:15:06 +00:00
|
|
|
{
|
|
|
|
slug: '/config_settings',
|
|
|
|
title: 'Configuration settings',
|
|
|
|
desc: 'Global configuration pramaters for Conky allow you to customize various behaviours.',
|
|
|
|
},
|
2022-09-29 01:59:28 +00:00
|
|
|
{
|
|
|
|
slug: '/lua',
|
|
|
|
title: 'Lua API',
|
|
|
|
desc: 'Program wild things into your Conky with the Lua API',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2022-10-02 00:00:45 +00:00
|
|
|
interface IndexItemProps {
|
|
|
|
href: string
|
|
|
|
as?: string
|
|
|
|
title: string
|
|
|
|
desc?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const IndexItem: React.FunctionComponent<IndexItemProps> = (props) => {
|
|
|
|
return (
|
|
|
|
<div className="md:first:rounded-t-lg md:last:rounded-b-lg backdrop-blur-lg bg-slate-300 dark:bg-black dark:bg-opacity-30 bg-opacity-10 hover:bg-opacity-30 dark:hover:bg-opacity-50 transition border border-gray-800 dark:border-white border-opacity-10 dark:border-opacity-10 border-b-0 last:border-b hover:border-b hovered-sibling:border-t-0">
|
2023-02-26 01:12:11 +00:00
|
|
|
<Link
|
|
|
|
as={props.as}
|
|
|
|
href={props.href}
|
|
|
|
className="py-2 lg:py-4 px-2 lg:px-4 block focus:outline-none focus:ring-4"
|
|
|
|
>
|
|
|
|
<h2 className="text-xl md:text-2xl">{props.title}</h2>
|
|
|
|
{props.desc && <p className="mt-3 text-lg opacity-60">{props.desc}</p>}
|
|
|
|
<ArrowIcon className="mt-4" />
|
2022-10-02 00:00:45 +00:00
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-09-29 01:59:28 +00:00
|
|
|
interface IndexProps {
|
|
|
|
documents: Document[]
|
2022-10-01 20:32:01 +00:00
|
|
|
searchIndex: SearchIndex
|
2022-09-29 01:59:28 +00:00
|
|
|
}
|
2022-10-01 20:32:01 +00:00
|
|
|
|
|
|
|
export default function Index({ documents, searchIndex }: IndexProps) {
|
2022-09-29 01:59:28 +00:00
|
|
|
return (
|
2022-10-01 20:32:01 +00:00
|
|
|
<Layout searchIndex={searchIndex}>
|
2022-09-29 01:59:28 +00:00
|
|
|
<SEO title="Conky" description="Conky documentation" />
|
|
|
|
<main className="w-full">
|
|
|
|
<div className="w-full">
|
|
|
|
{pages.map((p) => (
|
2022-10-02 00:00:45 +00:00
|
|
|
<IndexItem
|
2022-09-29 01:59:28 +00:00
|
|
|
key={p.slug}
|
2022-10-02 00:00:45 +00:00
|
|
|
href={p.slug}
|
|
|
|
title={p.title}
|
|
|
|
desc={p.desc}
|
|
|
|
/>
|
2022-09-29 01:59:28 +00:00
|
|
|
))}
|
|
|
|
{documents.map((document) => (
|
2022-10-02 00:00:45 +00:00
|
|
|
<IndexItem
|
2022-09-29 01:59:28 +00:00
|
|
|
key={document.filePath}
|
2022-10-02 00:00:45 +00:00
|
|
|
as={`/documents/${document.filePath.replace(/\.mdx?$/, '')}`}
|
|
|
|
href={`/documents/[slug]`}
|
|
|
|
title={document.data.title}
|
|
|
|
desc={document.data.description}
|
|
|
|
/>
|
2022-09-29 01:59:28 +00:00
|
|
|
))}
|
2022-10-02 00:00:45 +00:00
|
|
|
<IndexItem
|
|
|
|
href="https://github.com/brndnmtthws/conky/wiki"
|
|
|
|
title="Wiki"
|
|
|
|
desc="The Wiki (hosted on GitHub) contains a number of user configs, Lua scripts, FAQs and more."
|
|
|
|
/>
|
2022-09-29 01:59:28 +00:00
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
</Layout>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getStaticProps() {
|
|
|
|
const documents = getDocuments()
|
2022-10-01 20:32:01 +00:00
|
|
|
const searchIndex = getSearchIndex()
|
2022-09-29 01:59:28 +00:00
|
|
|
|
2022-10-01 20:32:01 +00:00
|
|
|
return { props: { documents, searchIndex } }
|
2022-09-29 01:59:28 +00:00
|
|
|
}
|