@dirsigler/astro-techradar 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.ts +12 -7
- package/package.json +1 -1
- package/src/layouts/Base.astro +3 -3
- package/src/pages/index.astro +7 -5
package/config.ts
CHANGED
|
@@ -18,11 +18,14 @@ export interface ResolvedColorMode {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface TechRadarUserConfig {
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/** Brand name shown in the navbar. */
|
|
22
|
+
name: string;
|
|
23
|
+
|
|
24
|
+
/** Main page title shown as the h1 heading. Falls back to name if not set. */
|
|
25
|
+
title?: string;
|
|
23
26
|
|
|
24
|
-
/**
|
|
25
|
-
|
|
27
|
+
/** Subtitle shown below the title on the main page. */
|
|
28
|
+
subtitle?: string;
|
|
26
29
|
|
|
27
30
|
/**
|
|
28
31
|
* URL path prefix where the tech radar is mounted (e.g. "/techradar").
|
|
@@ -54,8 +57,9 @@ export interface TechRadarUserConfig {
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
export interface ResolvedConfig {
|
|
60
|
+
name: string;
|
|
57
61
|
title: string;
|
|
58
|
-
|
|
62
|
+
subtitle?: string;
|
|
59
63
|
/** Normalized base path with leading slash, no trailing slash. Empty string when mounted at root. */
|
|
60
64
|
basePath: string;
|
|
61
65
|
logo?: string;
|
|
@@ -76,8 +80,9 @@ function normalizeBasePath(raw?: string): string {
|
|
|
76
80
|
|
|
77
81
|
export function resolveConfig(user: TechRadarUserConfig): ResolvedConfig {
|
|
78
82
|
return {
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
name: user.name,
|
|
84
|
+
title: user.title ?? user.name,
|
|
85
|
+
subtitle: user.subtitle,
|
|
81
86
|
basePath: normalizeBasePath(user.basePath),
|
|
82
87
|
logo: user.logo,
|
|
83
88
|
footerText: user.footerText ?? '',
|
package/package.json
CHANGED
package/src/layouts/Base.astro
CHANGED
|
@@ -10,7 +10,7 @@ interface Props {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const { title = config.
|
|
13
|
+
const { title = config.name, description = 'Technology Radar — tracking technology adoption across our organization' } = Astro.props;
|
|
14
14
|
const siteBase = import.meta.env.BASE_URL.replace(/\/+$/, '');
|
|
15
15
|
const base = `${siteBase}${config.basePath}/`;
|
|
16
16
|
const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
|
|
@@ -61,11 +61,11 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
|
|
|
61
61
|
{config.logo && (
|
|
62
62
|
<img
|
|
63
63
|
src={config.logo.startsWith('https://') ? config.logo : `${base}${config.logo.replace(/^\//, '')}`}
|
|
64
|
-
alt={config.
|
|
64
|
+
alt={config.name}
|
|
65
65
|
class="h-8 w-auto"
|
|
66
66
|
/>
|
|
67
67
|
)}
|
|
68
|
-
{config.
|
|
68
|
+
{config.name}
|
|
69
69
|
</a>
|
|
70
70
|
{config.color.toggle && <ThemeToggle />}
|
|
71
71
|
</nav>
|
package/src/pages/index.astro
CHANGED
|
@@ -53,12 +53,14 @@ const legendSegments = segments.map((s) => ({
|
|
|
53
53
|
const ringEntries = Object.entries(RING_LABELS) as [string, string][];
|
|
54
54
|
---
|
|
55
55
|
|
|
56
|
-
<Base title={config.
|
|
56
|
+
<Base title={config.name}>
|
|
57
57
|
<div class="text-center mb-10">
|
|
58
|
-
<h1 class="text-4xl font-bold" style="color: var(--radar-text);">{config.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
<h1 class="text-4xl font-bold" style="color: var(--radar-text);">{config.title}</h1>
|
|
59
|
+
{config.subtitle && (
|
|
60
|
+
<p class="mt-3 text-lg" style="color: var(--radar-text-muted);">
|
|
61
|
+
{config.subtitle}
|
|
62
|
+
</p>
|
|
63
|
+
)}
|
|
62
64
|
</div>
|
|
63
65
|
|
|
64
66
|
<!-- Filter bar -->
|