www: fix accessibility issues (#1243)
Address accessibility issues pointed out by Lighthouse.
This commit is contained in:
@@ -4,6 +4,7 @@ export default function DocsTitle(props: { title: string }) {
|
|||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
class="text(2xl gray-900) flex items-center"
|
class="text(2xl gray-900) flex items-center"
|
||||||
|
aria-label="Top Page"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
preserveAspectRatio="xMinYMin"
|
preserveAspectRatio="xMinYMin"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default function Header(props: { title: string; active: string }) {
|
|||||||
|
|
||||||
function Logo() {
|
function Logo() {
|
||||||
return (
|
return (
|
||||||
<a href="/" class="flex mr-3 items-center">
|
<a href="/" class="flex mr-3 items-center" aria-label="Top Page">
|
||||||
<img
|
<img
|
||||||
src="/logo.svg"
|
src="/logo.svg"
|
||||||
alt="Fresh logo"
|
alt="Fresh logo"
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export default function NavigationBar(
|
|||||||
<a
|
<a
|
||||||
href="https://github.com/denoland/fresh"
|
href="https://github.com/denoland/fresh"
|
||||||
class="hover:text-green-600 inline-block"
|
class="hover:text-green-600 inline-block"
|
||||||
|
aria-label="GitHub"
|
||||||
>
|
>
|
||||||
<Icons.GitHub />
|
<Icons.GitHub />
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const Slide = (props: SlideProps) => {
|
|||||||
class={`${props.class} ${color} h-80 w-full text-center text-black p-5`}
|
class={`${props.class} ${color} h-80 w-full text-center text-black p-5`}
|
||||||
>
|
>
|
||||||
{text}
|
{text}
|
||||||
<img src={url} />
|
<img src={url} alt={text} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ export default function Footer({ children }: Props) {
|
|||||||
<a
|
<a
|
||||||
href="https://github.com/denoland/fresh"
|
href="https://github.com/denoland/fresh"
|
||||||
class="inline-block hover:text-black"
|
class="inline-block hover:text-black"
|
||||||
|
aria-label="GitHub"
|
||||||
>
|
>
|
||||||
<BrandGithub />
|
<BrandGithub />
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import PageFooter from "../components/Footer.tsx";
|
|||||||
import Header from "../components/Header.tsx";
|
import Header from "../components/Header.tsx";
|
||||||
import ComponentGallery from "../islands/ComponentGallery.tsx";
|
import ComponentGallery from "../islands/ComponentGallery.tsx";
|
||||||
|
|
||||||
import { Head } from "$fresh/runtime.ts";
|
import { asset, Head } from "$fresh/runtime.ts";
|
||||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||||
|
|
||||||
function getSource(path: string) {
|
function getSource(path: string) {
|
||||||
@@ -30,19 +30,29 @@ export const handler: Handlers<HomeProps> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const TITLE = "Components | fresh";
|
||||||
|
const DESCRIPTION = "A collection of components made for Fresh.";
|
||||||
|
|
||||||
interface HomeProps {
|
interface HomeProps {
|
||||||
sources: Record<string, string>;
|
sources: Record<string, string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Home(props: PageProps<HomeProps>) {
|
export default function Home(props: PageProps<HomeProps>) {
|
||||||
|
const ogImageUrl = new URL(asset("/home-og.png"), props.url).href;
|
||||||
return (
|
return (
|
||||||
<div class="bg-white h-full">
|
<div class="bg-white h-full">
|
||||||
<Head>
|
<Head>
|
||||||
<title>Components | fresh</title>
|
<title>{TITLE}</title>
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://esm.sh/prismjs@1.27.0/themes/prism-dark.min.css"
|
href="https://esm.sh/prismjs@1.27.0/themes/prism-dark.min.css"
|
||||||
/>
|
/>
|
||||||
|
<meta name="description" content={DESCRIPTION} />
|
||||||
|
<meta property="og:title" content={TITLE} />
|
||||||
|
<meta property="og:description" content={DESCRIPTION} />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:url" content={props.url.href} />
|
||||||
|
<meta property="og:image" content={ogImageUrl} />
|
||||||
</Head>
|
</Head>
|
||||||
<Header title="components" active="/components" />
|
<Header title="components" active="/components" />
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ export const handler: Handlers<Data> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function DocsPage(props: PageProps<Data>) {
|
export default function DocsPage(props: PageProps<Data>) {
|
||||||
let description;
|
const ogImageUrl = new URL(asset("/home-og.png"), props.url).href;
|
||||||
|
const title = `${props.data.page?.title ?? "Not Found"} | fresh docs`;
|
||||||
|
let description = "Fresh Document";
|
||||||
|
|
||||||
if (props.data.page.data.description) {
|
if (props.data.page.data.description) {
|
||||||
description = String(props.data.page.data.description);
|
description = String(props.data.page.data.description);
|
||||||
@@ -60,9 +62,14 @@ export default function DocsPage(props: PageProps<Data>) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{props.data.page?.title ?? "Not Found"} | fresh docs</title>
|
<title>{title}</title>
|
||||||
<link rel="stylesheet" href={asset("/gfm.css")} />
|
<link rel="stylesheet" href={asset("/gfm.css")} />
|
||||||
{description && <meta name="description" content={description} />}
|
<meta name="description" content={description} />
|
||||||
|
<meta property="og:title" content={title} />
|
||||||
|
<meta property="og:description" content={description} />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:url" content={props.url.href} />
|
||||||
|
<meta property="og:image" content={ogImageUrl} />
|
||||||
</Head>
|
</Head>
|
||||||
<div class="flex flex-col min-h-screen">
|
<div class="flex flex-col min-h-screen">
|
||||||
<Header title="docs" active="/docs" />
|
<Header title="docs" active="/docs" />
|
||||||
|
|||||||
+14
-3
@@ -1,14 +1,25 @@
|
|||||||
import { Head } from "$fresh/runtime.ts";
|
import { asset, Head } from "$fresh/runtime.ts";
|
||||||
|
import { PageProps } from "$fresh/server.ts";
|
||||||
import Projects, { Project } from "../components/Projects.tsx";
|
import Projects, { Project } from "../components/Projects.tsx";
|
||||||
import Header from "../components/Header.tsx";
|
import Header from "../components/Header.tsx";
|
||||||
import Footer from "../components/Footer.tsx";
|
import Footer from "../components/Footer.tsx";
|
||||||
import projects from "../data/showcase.json" assert { type: "json" };
|
import projects from "../data/showcase.json" assert { type: "json" };
|
||||||
|
|
||||||
export default function ShowcasePage() {
|
const TITLE = "Showcase | fresh";
|
||||||
|
const DESCRIPTION = "Selection of projects that have been built with Fresh.";
|
||||||
|
|
||||||
|
export default function ShowcasePage(props: PageProps) {
|
||||||
|
const ogImageUrl = new URL(asset("/home-og.png"), props.url).href;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>Showcase | fresh</title>
|
<title>{TITLE}</title>
|
||||||
|
<meta name="description" content={DESCRIPTION} />
|
||||||
|
<meta property="og:title" content={TITLE} />
|
||||||
|
<meta property="og:description" content={DESCRIPTION} />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:url" content={props.url.href} />
|
||||||
|
<meta property="og:image" content={ogImageUrl} />
|
||||||
</Head>
|
</Head>
|
||||||
<Header title="showcase" active="/showcase" />
|
<Header title="showcase" active="/showcase" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user