Skip to content

Commit 5bebab9

Browse files
authored
Merge pull request #11 from matzemathics/site-title
updated site title
2 parents f2aa171 + f83fe1b commit 5bebab9

File tree

10 files changed

+666
-536
lines changed

10 files changed

+666
-536
lines changed

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore artifacts:
2+
build
3+
coverage
4+
*.md
5+
*.mdx

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

astro.config.mjs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import { favicons } from "favicons";
77
const base = "/nemo-doc";
88

99
async function faviconPlugin(options) {
10-
const icons = await favicons("./logo/build/without-text/nemo-logo-rusty-nomargin.svg", options);
10+
const icons = await favicons(
11+
"./logo/build/without-text/nemo-logo-rusty-nomargin.svg",
12+
options,
13+
);
1114
return {
1215
name: "vite-plugin-favicons",
1316
order: "pre",
@@ -44,16 +47,25 @@ export default defineConfig({
4447
outDir: "./dist/nemo-doc",
4548
integrations: [
4649
starlight({
47-
title: "Nemo Rule Engine",
50+
title: "Nemo",
4851
logo: {
4952
dark: "./src/assets/nemo-logo-rusty-bright-nomargin.svg",
5053
light: "./src/assets/nemo-logo-rusty-nomargin.svg",
5154
},
52-
customCss: ["./src/tailwind.css"],
55+
customCss: [
56+
"./src/tailwind.css",
57+
"./src/styles/custom.css",
58+
// Fontsource files for to regular and semi-bold font weights.
59+
"@fontsource/comfortaa/400.css",
60+
"@fontsource/comfortaa/600.css",
61+
],
5362
favicon: "/favicon.svg",
5463
social: {
5564
github: "https://github.com/knowsys/nemo",
5665
},
66+
components: {
67+
SiteTitle: "./src/components/SiteTitle.astro",
68+
},
5769
sidebar: [
5870
{
5971
label: "Guides",

package-lock.json

Lines changed: 562 additions & 520 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@astrojs/starlight": "^0.25.3",
1515
"@astrojs/starlight-tailwind": "^2.0.3",
1616
"@astrojs/tailwind": "^5.1.0",
17+
"@fontsource/comfortaa": "^5.1.0",
1718
"astro": "^4.10.2",
1819
"favicons": "^7.2.0",
1920
"sharp": "^0.32.5",

src/components/SiteTitle.astro

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
import { logos } from 'virtual:starlight/user-images';
3+
import config from 'virtual:starlight/user-config';
4+
import type { Props } from '../props';
5+
const { siteTitle, siteTitleHref } = Astro.props;
6+
---
7+
8+
<a href={siteTitleHref} class="site-title sl-flex">
9+
{
10+
config.logo && logos.dark && (
11+
<>
12+
<img
13+
class:list={{ 'light:sl-hidden': !('src' in config.logo) }}
14+
alt={config.logo.alt}
15+
src={logos.dark.src}
16+
width={logos.dark.width}
17+
height={logos.dark.height}
18+
/>
19+
{/* Show light alternate if a user configure both light and dark logos. */}
20+
{!('src' in config.logo) && (
21+
<img
22+
class="dark:sl-hidden"
23+
alt={config.logo.alt}
24+
src={logos.light?.src}
25+
width={logos.light?.width}
26+
height={logos.light?.height}
27+
/>
28+
)}
29+
</>
30+
)
31+
}
32+
<span class:list={{ 'sr-only': config.logo?.replacesTitle }}>
33+
{siteTitle}
34+
<span class="font-normal text-base ml-3">
35+
Graph Rule Engine
36+
</span>
37+
</span>
38+
</a>
39+
40+
<style>
41+
.site-title {
42+
align-items: center;
43+
gap: var(--sl-nav-gap);
44+
font-size: var(--sl-text-h4);
45+
font-weight: 600;
46+
color: var(--sl-color-text-accent);
47+
text-decoration: none;
48+
white-space: nowrap;
49+
font-family: "Comfortaa";
50+
}
51+
.site-sub-title {
52+
font-size: var(--sl-text-h5);
53+
font-weight: 400;
54+
}
55+
img {
56+
height: calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y));
57+
width: auto;
58+
max-width: 100%;
59+
object-fit: contain;
60+
object-position: 0 50%;
61+
}
62+
</style>
63+
64+
65+
66+
67+

src/content/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { defineCollection } from 'astro:content';
2-
import { docsSchema } from '@astrojs/starlight/schema';
1+
import { defineCollection } from "astro:content";
2+
import { docsSchema } from "@astrojs/starlight/schema";
33

44
export const collections = {
5-
docs: defineCollection({ schema: docsSchema(), })
5+
docs: defineCollection({ schema: docsSchema() }),
66
};

src/styles/custom.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:root {
2+
}

tailwind.config.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/** @type {import('tailwindcss').Config} */
2-
import starlightPlugin from '@astrojs/starlight-tailwind';
3-
import colors from 'tailwindcss/colors';
2+
import starlightPlugin from "@astrojs/starlight-tailwind";
3+
import colors from "tailwindcss/colors";
44

55
const nemo_blue = {
6-
'950': '#0c2227',
7-
'900': '#18434e',
8-
'600': '#2a768a',
9-
'200': '#8cbfcc',
6+
950: "#0c2227",
7+
900: "#18434e",
8+
600: "#2a768a",
9+
200: "#8cbfcc",
1010
};
1111

1212
export default {
13-
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
13+
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
1414
theme: {
1515
extend: {
1616
colors: {
1717
nemo_blue,
18-
rust: '#9c6f30',
18+
rust: "#9c6f30",
1919
accent: nemo_blue,
2020
},
2121
},
2222
},
2323
plugins: [starlightPlugin()],
24-
}
24+
};

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"extends": "astro/tsconfigs/strict"
3-
}
3+
}

0 commit comments

Comments
 (0)