Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default defineConfig({
replacesTitle: true,
},
favicon: '/favicon.svg',
components: { Head: './src/components/Head.astro' },
customCss: ['./src/styles/fonts.css', './src/styles/docs.css'],
head: [
{
Expand Down
1 change: 1 addition & 0 deletions public/widgets/backup/backup.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Backup</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/books/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Books</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/clock/analog.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Analog Clock</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/clock/digital.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Clock</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/connections/connections-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Connections — Map</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/connections/connections-vpn.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Connections — VPN</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/dashboard-switch/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Dashboard Switch</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/disk-health/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Disk Health</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/dns/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DNS Server</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/github/contributions.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>GitHub Contributions</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/github/pullrequests.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>GitHub Pull Requests</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/nowplaying/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Now Playing</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/system-summary/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>System Stats</title>
<style>
Expand Down
1 change: 1 addition & 0 deletions public/widgets/weather/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weather</title>
<style>
Expand Down
10 changes: 7 additions & 3 deletions scripts/sync-widgets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { join, resolve } from 'node:path';
const REPO = process.env.STACKYARD_REPO ?? resolve(process.cwd(), '..', 'stackyard');
const PUB = resolve(process.cwd(), 'public');
const META = '<meta name="color-scheme" content="dark">';
const ROBOTS = '<meta name="robots" content="noindex">';

for (const [from, to] of [
[join(REPO, 'ui', 'widgets'), join(PUB, 'widgets')],
Expand All @@ -28,12 +29,15 @@ function walk(dir, out = []) {
let patched = 0;
for (const file of walk(join(PUB, 'widgets'))) {
let html = readFileSync(file, 'utf8');
if (html.includes('name="color-scheme"')) continue;
const charset = html.match(/<meta charset="[^"]*">/i);
if (!charset) continue;
html = html.replace(charset[0], `${charset[0]}\n${META}`);
const inject = [];
if (!html.includes('name="color-scheme"')) inject.push(META);
if (!html.includes('name="robots"')) inject.push(ROBOTS);
if (inject.length === 0) continue;
html = html.replace(charset[0], [charset[0], ...inject].join('\n'));
writeFileSync(file, html);
patched++;
}

console.log(`widgets and js synced from ${REPO}; color-scheme declared in ${patched} documents`);
console.log(`widgets and js synced from ${REPO}; meta injected into ${patched} documents`);
37 changes: 37 additions & 0 deletions src/components/Head.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
import Default from '@astrojs/starlight/components/Head.astro';

const site = Astro.site?.href.replace(/\/$/, '') ?? '';
const { entry, id } = Astro.locals.starlightRoute;
const pageTitle = entry.data.title;
const pageDescription = entry.data.description ?? '';

const segments = id.split('/').filter(Boolean);
const crumbs = [{ name: 'Stackyard', item: `${site}/` }];
let path = '';
for (const segment of segments.slice(0, -1)) {
path += `/${segment}`;
crumbs.push({
name: segment.replace(/-/g, ' ').replace(/^./, (c) => c.toUpperCase()),
item: `${site}${path}/`,
});
}
crumbs.push({ name: pageTitle, item: new URL(Astro.url.pathname, `${site}/`).href });

const breadcrumb = {
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: crumbs.map((crumb, index) => ({
'@type': 'ListItem',
position: index + 1,
name: crumb.name,
item: crumb.item,
})),
};
---

<Default {...Astro.props}><slot /></Default>
<meta name="twitter:title" content={`${pageTitle} | Stackyard`} />
{pageDescription && <meta name="twitter:description" content={pageDescription} />}
<meta property="og:image:alt" content="The Stackyard dashboard, showing app tiles and widgets" />
<script type="application/ld+json" set:html={JSON.stringify(breadcrumb)} />
3 changes: 2 additions & 1 deletion src/pages/docs/changelog.astro
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ const headings: Heading[] = failed
<>
<p class="cl-lede">
Generated from <code>CHANGELOG.md</code> in the repository. Per-release notes are on the{' '}
<a href={`${REPO}/releases`}>releases</a> page.
<a href={`${REPO}/releases`}>releases</a> page. Subscribe to new releases with the{' '}
<a href={`${REPO}/releases.atom`}>release feed</a>.
</p>

{latest && (
Expand Down
69 changes: 50 additions & 19 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,57 @@ const version = readAppVersion();

const title = 'Stackyard: a homelab dashboard you\'ll actually use';
const description =
'A calm, customizable dashboard for your services, designed to be useful without becoming another wall of data.';
'A calm, customizable dashboard for the services you self-host. Open source, runs in Docker, and useful without becoming another wall of data.';

const site = Astro.site?.href.replace(/\/$/, '') ?? '';
const canonical = `${site}/`;
const ogImage = `${site}/img/og.jpg`;

const publisher = {
'@type': 'Organization',
'@id': `${site}/#organization`,
name: 'Stackyard',
url: `${site}/`,
logo: `${site}/img/stackyard-wordmark-dark.svg`,
sameAs: ['https://github.com/SandObserver/stackyard'],
};

const schema = {
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name: 'Stackyard',
description,
url: canonical,
image: ogImage,
applicationCategory: 'BrowserApplication',
operatingSystem: 'Docker, Linux, Windows, macOS',
license: 'https://www.apache.org/licenses/LICENSE-2.0',
isAccessibleForFree: true,
offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' },
softwareHelp: `${site}/docs/`,
codeRepository: 'https://github.com/SandObserver/stackyard',
author: { '@type': 'Person', name: 'SandObserver', url: 'https://github.com/SandObserver' },
'@graph': [
publisher,
{
'@type': 'WebSite',
'@id': `${site}/#website`,
name: 'Stackyard',
url: `${site}/`,
description,
publisher: { '@id': `${site}/#organization` },
inLanguage: 'en',
},
{
'@type': 'SoftwareApplication',
'@id': `${site}/#software`,
name: 'Stackyard',
description,
url: canonical,
image: ogImage,
applicationCategory: 'BrowserApplication',
applicationSubCategory: 'Self-hosted homelab dashboard',
operatingSystem: 'Docker, Linux, Windows, macOS',
...(version ? { softwareVersion: version } : {}),
downloadUrl: `${site}/docs/installation/docker/`,
installUrl: `${site}/docs/installation/docker/`,
releaseNotes: `${site}/docs/changelog/`,
license: 'https://www.apache.org/licenses/LICENSE-2.0',
isAccessibleForFree: true,
offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' },
softwareHelp: `${site}/docs/`,
codeRepository: 'https://github.com/SandObserver/stackyard',
publisher: { '@id': `${site}/#organization` },
author: { '@type': 'Person', name: 'SandObserver', url: 'https://github.com/SandObserver' },
},
],
};
---

Expand All @@ -50,6 +80,7 @@ const schema = {
<meta property="og:image" content={ogImage} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="The Stackyard dashboard, showing app tiles and widgets" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
Expand Down Expand Up @@ -80,10 +111,10 @@ const schema = {

<header class="hero">
<h1>A homelab dashboard you'll actually use.</h1>
<p>A calm, customizable dashboard for your services, designed to be useful without becoming another wall of data.</p>
<p>A calm, customizable dashboard for the services you self-host. Open source, runs in Docker, and useful without becoming another wall of data.</p>
<div class="cta-row">
<a class="btn btn-accent" href="/docs/installation/docker/">Install</a>
<a class="btn btn-quiet" href="https://demo.sandobserver.com" target="_blank" rel="noopener noreferrer">Demo</a>
<a class="btn btn-accent" href="/docs/installation/docker/">Install with Docker</a>
<a class="btn btn-quiet" href="https://demo.sandobserver.com" target="_blank" rel="noopener noreferrer">Live demo</a>
</div>
</header>
</div>
Expand Down Expand Up @@ -235,7 +266,7 @@ const schema = {
<div class="feature">
<div class="ftext">
<h2>Useful widgets, when you need them</h2>
<p>Pull in the information that is actually useful, from the services you already run. Add only what earns its place on the screen.</p>
<p>Pull in the information that is actually useful, from the self-hosted services you already run. Add only what earns its place on the screen.</p>
</div>
<div class="fvis marquee" role="img" aria-label="Services Stackyard widgets can read from">
<div class="mrow mrow-a">
Expand All @@ -252,7 +283,7 @@ const schema = {
<div class="feature">
<div class="ftext">
<h2>No configuration files required</h2>
<p>Add apps, configure widgets, set up badges, and arrange your layout, all from the admin UI. Export your setup for a backup, import it to move to a new machine.</p>
<p>Add apps, configure widgets, set up badges, and arrange your layout, all from the admin UI. There is no YAML to hand-edit. Export your setup for a backup, import it to move to a new machine.</p>
</div>
<div class="fvis">
<div class="admin" role="img" aria-label="The Stackyard admin dashboard list">
Expand Down