Skip to content

Commit

Permalink
switch to typescript config
Browse files Browse the repository at this point in the history
  • Loading branch information
benediktschwab committed Oct 3, 2024
1 parent 361d4fc commit b3fd80c
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 40 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
"@fontsource/open-sans": "^5.1.0",
"@reach/skip-nav": "^0.18.0",
"next": "^14.2.14",
"nextra": "3.0.2",
"nextra-theme-docs": "3.0.2",
"nextra": "3.0.3",
"nextra-theme-docs": "3.0.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"sharp": "^0.33.5",
"typescript": "5.6.2"
},
"devDependencies": {
"@types/node": "22.7.4",
"@types/react": "18.3.10",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
Expand Down
8 changes: 4 additions & 4 deletions pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import RtronLogo from "../components/logos/rtron";
---
title: R:trån – Processing Library for Road Space Models
---

{
// wrapped with {} to mark it as javascript so mdx will not put it under a p tag
}
import RtronLogo from "../components/logos/rtron";

<div className="grid place-items-center pt-5">
<RtronLogo height={200}/>
Expand Down
42 changes: 21 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions tailwind.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Config } from 'tailwindcss'

export default {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./theme.config.tsx'
],
theme: {
extend: {}
},
plugins: [],
darkMode: 'class'
} satisfies Config
46 changes: 42 additions & 4 deletions theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {useConfig} from 'nextra-theme-docs'
import TumLogo from './components/logos/tum'
import SavenowLogo from './components/logos/savenow'
import RtronSmallLogo from "./components/logos/rtron-small";
import {useRouter} from "next/router";

const config: DocsThemeConfig = {
project: {
Expand All @@ -27,10 +28,47 @@ const config: DocsThemeConfig = {
</span>
</>
),
head: () => (
<>
</>
),
head: function useHead() {
const config = useConfig()
const { route } = useRouter()
const isDefault = route === '/' || !config.title

const description =
config.frontMatter.description ||
'Processing Library for Road Space Models.'
const title = config.title + (route === '/' ? '' : ' - r:trån')

return (
<>
<title>{title}</title>
<meta property="og:title" content={title} />
<meta name="description" content={description} />
<meta property="og:description" content={description} />

<meta name="msapplication-TileColor" content="#fff" />
<meta httpEquiv="Content-Language" content="en" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site:domain" content="rtron.io" />
<meta name="twitter:url" content="https://rtron.io" />
<meta name="apple-mobile-web-app-title" content="rtron" />
<link rel="icon" href="/favicon.ico" type="image/ico" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="icon" href="/favicon.png" type="image/png" />
<link
rel="icon"
href="/favicon-dark.svg"
type="image/svg+xml"
media="(prefers-color-scheme: dark)"
/>
<link
rel="icon"
href="/favicon-dark.png"
type="image/png"
media="(prefers-color-scheme: dark)"
/>
</>
)
},
footer: {
content: (
<>
Expand Down

0 comments on commit b3fd80c

Please sign in to comment.