Пересобранный и видоизмененный conky для ОСГОС
This commit is contained in:
commit
3a48cf8c86
738 changed files with 217718 additions and 0 deletions
22
web/pages/404.tsx
Normal file
22
web/pages/404.tsx
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import Layout from '../components/Layout'
|
||||
import SEO from '../components/SEO'
|
||||
import Doggy from '../components/Doggy'
|
||||
|
||||
export default function FourOhFour() {
|
||||
return (
|
||||
<Layout>
|
||||
<SEO title="Conky" description="Conky documentation" />
|
||||
<main className="w-full">
|
||||
<div className="flex flex-col items-center">
|
||||
<h1 className="text-4xl py-8 px-2 lg:px-4 font-extrabold text-center">404: Not found 😢</h1>
|
||||
<Doggy />
|
||||
<h2 className="text-3xl py-4 font-serif mb-8">Here’s a doggy 😀</h2>
|
||||
</div>
|
||||
</main>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export function getStaticProps() {
|
||||
return { props: {} }
|
||||
}
|
||||
11
web/pages/_app.tsx
Normal file
11
web/pages/_app.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import '@fontsource-variable/fira-code'
|
||||
import '@fontsource-variable/inter'
|
||||
import '@fontsource-variable/newsreader'
|
||||
import '../styles/globals.css'
|
||||
import { AppProps } from 'next/app'
|
||||
|
||||
function App({ Component, pageProps }: AppProps) {
|
||||
return <Component {...pageProps} />
|
||||
}
|
||||
|
||||
export default App
|
||||
20
web/pages/_document.tsx
Normal file
20
web/pages/_document.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import React from 'react'
|
||||
import Document, { Html, Head, Main, NextScript } from 'next/document'
|
||||
|
||||
class MyDocument extends Document {
|
||||
render() {
|
||||
return (
|
||||
<Html lang="en" className="theme-compiled scroll-smooth">
|
||||
<Head />
|
||||
<body
|
||||
className={`antialiased bg-white dark:bg-gray-900 dark:text-white leading-base`}
|
||||
>
|
||||
<Main />
|
||||
<NextScript />
|
||||
</body>
|
||||
</Html>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default MyDocument
|
||||
37
web/pages/config_settings.tsx
Normal file
37
web/pages/config_settings.tsx
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import Layout from '../components/Layout'
|
||||
import SEO from '../components/SEO'
|
||||
import {
|
||||
getConfigSettings,
|
||||
Documentation,
|
||||
filterDesc,
|
||||
} from '../utils/doc-utils'
|
||||
import Docs from '../components/Docs'
|
||||
|
||||
export interface ConfigSettingsProps {
|
||||
config_settings: Documentation
|
||||
}
|
||||
|
||||
export default function ConfigSettings(props: ConfigSettingsProps) {
|
||||
return (
|
||||
<Layout>
|
||||
<SEO
|
||||
title="Conky – Config settings"
|
||||
description="Conky configuration settings"
|
||||
/>
|
||||
<main className="w-full pt-4">
|
||||
<div>
|
||||
<h1 className="text-2xl px-2 lg:px-4" data-cy="page-heading">
|
||||
Configuration settings
|
||||
</h1>
|
||||
</div>
|
||||
<Docs docs={props.config_settings} braces={false} assign={true} />
|
||||
</main>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getStaticProps() {
|
||||
const config_settings = filterDesc(getConfigSettings())
|
||||
|
||||
return { props: { config_settings } }
|
||||
}
|
||||
103
web/pages/documents/[slug].tsx
Normal file
103
web/pages/documents/[slug].tsx
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
import {
|
||||
getNextDocumentBySlug,
|
||||
getDocumentBySlug,
|
||||
getPreviousDocumentBySlug,
|
||||
documentFilePaths,
|
||||
} from '../../utils/mdx-utils'
|
||||
|
||||
import Layout from '../../components/Layout'
|
||||
import SEO from '../../components/SEO'
|
||||
import { GetStaticProps } from 'next'
|
||||
import Link from 'next/link'
|
||||
import { unified } from 'unified'
|
||||
import rehypeReact from 'rehype-react'
|
||||
import * as prod from 'react/jsx-runtime'
|
||||
import rehypeParse from 'rehype-parse'
|
||||
import { createElement, Fragment, useEffect, useState } from 'react'
|
||||
|
||||
const production = { Fragment: prod.Fragment, jsx: prod.jsx, jsxs: prod.jsxs }
|
||||
|
||||
interface FrontMatter {
|
||||
title: string
|
||||
description: string
|
||||
}
|
||||
|
||||
interface DocumentPageProps {
|
||||
source: string
|
||||
frontMatter: FrontMatter
|
||||
}
|
||||
|
||||
export default function DocumentPage({
|
||||
source,
|
||||
frontMatter,
|
||||
}: DocumentPageProps) {
|
||||
const [children, setChildren] = useState(createElement(Fragment))
|
||||
|
||||
useEffect(
|
||||
function () {
|
||||
;(async function () {
|
||||
const file = await unified()
|
||||
.use(rehypeParse, { fragment: true })
|
||||
// @ts-expect-error: the react types are missing.
|
||||
.use(rehypeReact, { ...production, components: { a: Link } })
|
||||
.process(source)
|
||||
|
||||
setChildren(file.result)
|
||||
})()
|
||||
},
|
||||
[source]
|
||||
)
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<SEO
|
||||
title={`${frontMatter.title}`}
|
||||
description={frontMatter.description}
|
||||
/>
|
||||
<article className="p-2 pt-4 lg:p-4 w-full">
|
||||
<header>
|
||||
<h1 className="text-3xl md:text-5xl dark:text-white mb-12">
|
||||
{frontMatter.title}
|
||||
</h1>
|
||||
{frontMatter.description && (
|
||||
<p className="text-xl mb-4">{frontMatter.description}</p>
|
||||
)}
|
||||
</header>
|
||||
<main>
|
||||
<article className="prose dark:prose-invert">{children}</article>
|
||||
</main>
|
||||
</article>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export const getStaticProps: GetStaticProps = async ({ params }) => {
|
||||
if (params) {
|
||||
const { source, data } = await getDocumentBySlug(params.slug as string)
|
||||
const prevDocument = getPreviousDocumentBySlug(params.slug as string)
|
||||
const nextDocument = getNextDocumentBySlug(params.slug as string)
|
||||
|
||||
return {
|
||||
props: {
|
||||
source,
|
||||
frontMatter: data,
|
||||
prevDocument,
|
||||
nextDocument,
|
||||
},
|
||||
}
|
||||
}
|
||||
return { props: {} }
|
||||
}
|
||||
|
||||
export const getStaticPaths = async () => {
|
||||
const paths = documentFilePaths
|
||||
// Remove file extensions for page paths
|
||||
.map((path) => path.replace(/\.mdx?$/, ''))
|
||||
// Map the path into the static paths object required by Next.js
|
||||
.map((slug) => ({ params: { slug } }))
|
||||
|
||||
return {
|
||||
paths,
|
||||
fallback: false,
|
||||
}
|
||||
}
|
||||
90
web/pages/index.tsx
Normal file
90
web/pages/index.tsx
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
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'
|
||||
|
||||
const pages = [
|
||||
{
|
||||
slug: '/variables',
|
||||
title: 'Variables',
|
||||
desc: 'Variables let you define the various objects displayed in Conky including text, bars, graphs, and more.',
|
||||
},
|
||||
{
|
||||
slug: '/config_settings',
|
||||
title: 'Configuration settings',
|
||||
desc: 'Global configuration pramaters for Conky allow you to customize various behaviours.',
|
||||
},
|
||||
{
|
||||
slug: '/lua',
|
||||
title: 'Lua API',
|
||||
desc: 'Program wild things into your Conky with the Lua API',
|
||||
},
|
||||
]
|
||||
|
||||
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">
|
||||
<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" />
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
interface IndexProps {
|
||||
documents: Document[]
|
||||
}
|
||||
|
||||
export default function Index({ documents }: IndexProps) {
|
||||
return (
|
||||
<Layout>
|
||||
<SEO title="Conky" description="Conky documentation" />
|
||||
<main className="w-full">
|
||||
<div className="w-full">
|
||||
{pages.map((p) => (
|
||||
<IndexItem
|
||||
key={p.slug}
|
||||
href={p.slug}
|
||||
title={p.title}
|
||||
desc={p.desc}
|
||||
/>
|
||||
))}
|
||||
{documents.map((document) => (
|
||||
<IndexItem
|
||||
key={document.filePath}
|
||||
as={`/documents/${document.filePath.replace(/\.mdx?$/, '')}`}
|
||||
href={`/documents/[slug]`}
|
||||
title={document.data.title ?? 'Untitled'}
|
||||
desc={document.data.description}
|
||||
/>
|
||||
))}
|
||||
<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."
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export function getStaticProps() {
|
||||
const documents = getDocuments()
|
||||
|
||||
return { props: { documents } }
|
||||
}
|
||||
30
web/pages/lua.tsx
Normal file
30
web/pages/lua.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import Layout from '../components/Layout'
|
||||
import SEO from '../components/SEO'
|
||||
import { getLua, Documentation, filterDesc } from '../utils/doc-utils'
|
||||
import Docs from '../components/Docs'
|
||||
|
||||
export interface LuaProps {
|
||||
lua: Documentation
|
||||
}
|
||||
|
||||
export default function Lua(props: LuaProps) {
|
||||
return (
|
||||
<Layout>
|
||||
<SEO title="Conky – Lua API" description="Conky Lua API documentation" />
|
||||
<main className="w-full pt-4">
|
||||
<div>
|
||||
<h1 className="text-2xl px-2 lg:px-4" data-cy="page-heading">
|
||||
Lua API
|
||||
</h1>
|
||||
</div>
|
||||
<Docs docs={props.lua} braces={false} assign={false} />
|
||||
</main>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getStaticProps() {
|
||||
const lua = filterDesc(getLua())
|
||||
|
||||
return { props: { lua } }
|
||||
}
|
||||
31
web/pages/variables.tsx
Normal file
31
web/pages/variables.tsx
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import Layout from '../components/Layout'
|
||||
import SEO from '../components/SEO'
|
||||
import { getVariables, Documentation, filterDesc } from '../utils/doc-utils'
|
||||
import Docs from '../components/Docs'
|
||||
|
||||
export interface VariablesProps {
|
||||
variables: Documentation
|
||||
}
|
||||
|
||||
export default function Variables(props: VariablesProps) {
|
||||
return (
|
||||
<Layout>
|
||||
<SEO
|
||||
title="Conky – Variables"
|
||||
description="Conky object variables documentation"
|
||||
/>
|
||||
<main className="w-full pt-4">
|
||||
<h1 className="text-2xl px-2 lg:px-4" data-cy="page-heading">
|
||||
Variables
|
||||
</h1>
|
||||
<Docs docs={props.variables} braces={true} assign={false} />
|
||||
</main>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getStaticProps() {
|
||||
const variables = filterDesc(getVariables())
|
||||
|
||||
return { props: { variables } }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue