Skip to content

Commit 0dcb395

Browse files
RobbertCharlotte Gieltjespetergoes
authored
feat: use community page layout for website-next (#4045)
closes: #3969 closes: #3970 --------- Co-authored-by: Charlotte Gieltjes <charlotte.gieltjes@rebels.io> Co-authored-by: Peter Goes <petergoes@gmail.com>
1 parent ba9389a commit 0dcb395

File tree

12 files changed

+352
-75
lines changed

12 files changed

+352
-75
lines changed

packages/website/package.json

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,18 @@
3535
"@nl-design-system-candidate/skip-link-css": "1.0.5",
3636
"@nl-design-system-candidate/skip-link-react": "1.1.7",
3737
"@nl-design-system-community/ma-design-tokens": "2.5.0",
38-
"@utrecht/body-css": "2.0.1",
39-
"@utrecht/body-react": "0.0.10",
40-
"@utrecht/page-body-css": "1.0.1",
41-
"@utrecht/page-body-react": "1.0.10",
42-
"@utrecht/page-layout-css": "2.0.1",
43-
"@utrecht/page-layout-react": "1.0.9",
44-
"@utrecht/root-css": "3.0.0",
45-
"@utrecht/root-react": "1.0.11"
38+
"@tabler/icons-react": "3.36.1",
39+
"@utrecht/body-css": "4.0.0",
40+
"@utrecht/body-react": "0.0.11",
41+
"@utrecht/breadcrumb-nav-css": "3.0.0",
42+
"@utrecht/link-list-css": "4.0.0",
43+
"@utrecht/nav-list-css": "2.0.0",
44+
"@utrecht/page-body-css": "2.0.0",
45+
"@utrecht/page-body-react": "1.0.11",
46+
"@utrecht/page-layout-css": "4.0.0",
47+
"@utrecht/page-layout-react": "1.0.11",
48+
"@utrecht/root-css": "4.1.0",
49+
"@utrecht/root-react": "1.0.15"
4650
},
4751
"devDependencies": {
4852
"@astrojs/mdx": "5.0.1",
@@ -54,6 +58,12 @@
5458
"@nl-design-system/tsconfig": "1.0.5",
5559
"@types/react": "18.3.27",
5660
"@types/react-dom": "18.3.7",
61+
"@utrecht/nav-bar-css": "3.1.0",
62+
"@utrecht/nav-bar-react": "1.1.0",
63+
"@utrecht/page-footer-css": "4.0.0",
64+
"@utrecht/page-footer-react": "1.0.11",
65+
"@utrecht/page-header-css": "3.0.0",
66+
"@utrecht/page-header-react": "1.0.10",
5767
"astro": "6.0.5",
5868
"cheerio": "1.2.0",
5969
"react": "18.3.1",

packages/website/src/components/body/body.tsx

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '@utrecht/breadcrumb-nav-css/dist/index.css';
2+
export { BreadcrumbNav, BreadcrumbNavLink, BreadcrumbNavSeparator } from '@utrecht/component-library-react';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '@utrecht/link-list-css/dist/index.css';
2+
export { LinkList, LinkListLink } from '@utrecht/component-library-react';
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
export const Logo = () => (
2+
<svg width="179" height="52" viewBox="0 0 179 52" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<path d="M140.709 0.0127563H145.28V3.18864H140.709V0.0127563Z" fill="currentColor" />
4+
<path
5+
fillRule="evenodd"
6+
clipRule="evenodd"
7+
d="M97.143 1.19735H88.9033V20.6338H97.0798C103.261 20.6338 106.933 16.8418 106.933 10.6901C106.933 4.53839 103.94 1.20053 97.143 1.20053V1.19735ZM96.7231 16.81H93.5346V5.05288H96.5589C100.647 5.05288 102.292 6.57413 102.292 10.6901C102.292 14.806 100.745 16.8132 96.7231 16.8132V16.81Z"
8+
fill="currentColor"
9+
/>
10+
<path
11+
d="M54.9975 5.42122C55.1932 8.30809 55.3858 12.4209 55.3858 14.7869H55.3826V20.6496H51.0671V1.21317H57.6367L61.0178 7.72373C62.2396 10.1215 63.5276 13.4594 64.301 15.7905L64.8156 15.727C64.5915 12.9068 64.4305 9.50541 64.4305 7.20607V1.21317H68.7113V20.6496H62.5616L58.6343 12.9703C57.7314 11.0933 56.4118 7.85077 55.5121 5.3577L54.9975 5.42122Z"
12+
fill="currentColor"
13+
/>
14+
<path d="M76.468 16.4701H84.7424V20.6464H71.8304V1.21317H76.468V16.4701Z" fill="currentColor" />
15+
<path
16+
fillRule="evenodd"
17+
clipRule="evenodd"
18+
d="M123.062 16.3876C122.386 19.0455 120.615 21.0525 116.269 21.053C111.667 21.0524 108.511 18.5911 108.511 13.2784C108.511 7.96517 111.375 4.85598 116.334 4.85598C121.035 4.85598 123.257 7.64123 123.257 11.8842C123.257 12.5321 123.223 13.1482 123.16 13.9581H112.824C113.079 16.4194 114.206 17.5214 116.299 17.5214C118.393 17.5214 119.005 16.5496 119.39 15.384L123.062 16.3876ZM119.229 11.7254C119.166 9.32762 118.168 8.16207 116.205 8.16207C114.238 8.16207 113.079 9.19741 112.855 11.7254H119.229Z"
19+
fill="currentColor"
20+
/>
21+
<path
22+
d="M132.015 17.9756C130.114 17.9756 129.085 17.1022 128.697 15.4158L124.77 16.2256C125.189 19.0109 126.768 21.0847 131.917 21.0847C136.52 21.0847 138.487 19.2713 138.487 16.2923C138.487 13.8945 137.328 12.3098 132.561 11.303C129.827 10.7536 129.407 10.1375 129.407 9.29587C129.407 8.39074 130.117 7.90165 131.563 7.90165C133.142 7.90165 133.849 8.51778 134.203 10.1057L138.098 9.29587C137.552 6.60589 135.974 4.85916 131.658 4.85916C127.342 4.85916 125.249 6.60907 125.249 9.55629C125.249 12.1796 126.667 13.5706 130.853 14.4821C133.653 15.0315 134.266 15.5524 134.266 16.4892C134.234 17.4928 133.492 17.9787 132.012 17.9787L132.015 17.9756Z"
23+
fill="currentColor"
24+
/>
25+
<path d="M145.28 5.2752H140.902V20.6306H145.28V5.2752Z" fill="currentColor" />
26+
<path
27+
fillRule="evenodd"
28+
clipRule="evenodd"
29+
d="M157.994 17.5214C161.375 17.5214 162.922 19.0108 162.922 21.5103H162.912C162.912 24.7179 160.819 26.3376 154.638 26.3376C148.81 26.3376 147.168 25.1403 147.168 23.2284C147.168 21.8342 148.684 20.8973 150.745 20.4749V20.2812C149.103 20.0557 148.393 19.2459 148.393 18.1756C148.393 17.299 149.069 16.521 150.325 15.9715L151.452 15.3872C149.167 14.6408 147.91 13.0243 147.91 10.6265C147.91 7.19338 150.489 5.2815 154.833 5.2815H162.562V8.58442H160.888C160.147 8.58442 159.184 8.55266 157.959 8.42245L157.927 8.77815C159.828 9.13385 161.438 9.84524 161.438 11.6269C161.438 14.1867 159.023 15.8381 154.742 15.8381C153.807 15.8381 152.939 15.7397 152.197 15.5777L151.942 15.9969C151.781 16.2891 151.651 16.5781 151.651 16.8385C151.651 17.388 152.036 17.6166 153.002 17.6166C153.852 17.6166 154.717 17.5944 155.572 17.569C155.679 17.5661 155.786 17.5632 155.892 17.5603C156.611 17.5406 157.317 17.5214 157.994 17.5214ZM157.738 10.7821C157.738 9.55306 156.838 8.613 154.745 8.613C152.652 8.613 151.815 9.54989 151.815 10.7821C151.815 12.0144 152.557 12.9544 154.745 12.9544C156.933 12.9544 157.738 12.0112 157.738 10.7821ZM152.62 20.3701C151.27 20.3701 150.465 21.0172 150.464 21.763C150.465 22.797 151.274 23.2506 154.941 23.2506C158.609 23.2506 159.544 22.7012 159.544 21.6309C159.544 20.8878 159.029 20.3701 157.804 20.3701H152.62Z"
30+
fill="currentColor"
31+
/>
32+
<path
33+
d="M169.109 12.0779C169.109 10.1692 170.299 8.83854 172.165 8.83854C173.775 8.83854 174.482 9.90881 174.482 11.4618V20.6306H178.861V10.2328C178.861 6.8949 177.38 4.85598 174.451 4.85598C172.067 4.85598 170.201 6.41216 169.299 9.39114H169.008V5.27837H164.727V20.6338H169.106V12.0811L169.109 12.0779Z"
34+
fill="currentColor"
35+
/>
36+
<path
37+
d="M55.3258 31.8573C55.3258 32.9911 55.8751 33.801 59.6729 34.4806L59.6666 34.487C65.6554 35.5572 66.9434 37.8248 66.9434 40.6418C66.9434 44.3671 64.5284 46.6347 58.8616 46.6347C52.6803 46.603 50.5872 43.8177 50.1673 40.4481L54.5776 39.508C55.029 41.8391 56.6707 42.9094 59.0542 42.9094C61.2104 42.9094 62.2743 42.1948 62.2743 40.9658C62.2743 39.6033 61.4061 38.8919 57.7346 38.2758C52.3898 37.4342 50.7482 35.3286 50.7482 32.1209C50.7482 28.4623 53.2927 26.29 58.5743 26.29C63.8559 26.29 65.949 28.6529 66.4951 31.9907L61.8923 32.8959C61.4408 30.9173 60.6674 29.9137 58.3502 29.9137C56.2918 29.9137 55.3258 30.6283 55.3258 31.8573Z"
38+
fill="currentColor"
39+
/>
40+
<path
41+
d="M76.9049 39.7662L76.9045 39.7675L76.8247 40.0765L76.7756 40.266C76.6241 40.8492 76.4709 41.4395 76.3228 42.0297H75.7766C75.4925 40.9277 75.1894 39.7939 74.8927 38.6982V38.6918C74.6843 37.9201 74.4823 37.1674 74.296 36.4592L72.7807 30.822H67.9821L73.7151 45.9837C73.0048 47.6034 72.1998 47.8956 70.656 47.8956C70.012 47.8956 69.3364 47.8003 68.6924 47.6669L68.0484 51.3922C68.8534 51.5224 69.4974 51.6209 70.5613 51.6209C74.3907 51.6209 76.3259 50.0012 77.8065 46.2441L83.8269 30.8252H79.1262L77.7087 36.5608V36.5577C77.4776 37.5484 77.1964 38.6375 76.906 39.7617L76.9055 39.7639L76.9049 39.7662Z"
42+
fill="currentColor"
43+
/>
44+
<path
45+
d="M88.8496 34.8395C88.8496 35.6811 89.2695 36.2972 92.0034 36.8498L92.0003 36.8466C96.7673 37.8534 97.9259 39.4382 97.9259 41.836C97.9259 44.8149 95.9591 46.6284 91.3563 46.6284C86.2041 46.6284 84.6288 44.5545 84.2089 41.7693L88.1361 40.9594C88.5245 42.6458 89.5536 43.5192 91.4541 43.5192C92.9347 43.5192 93.6766 43.0333 93.7082 42.0297C93.7082 41.0928 93.0957 40.5719 90.2955 40.0225C86.1094 39.1174 84.6951 37.7232 84.6951 35.0999C84.6951 32.1527 86.785 30.4028 91.1005 30.4028C95.4161 30.4028 96.9946 32.1495 97.5408 34.8395L93.6451 35.6493C93.2915 34.0614 92.5812 33.4453 91.0058 33.4453C89.5599 33.4453 88.8496 33.9343 88.8496 34.8395Z"
46+
fill="currentColor"
47+
/>
48+
<path
49+
d="M107.166 42.4806C105.847 42.4806 105.395 41.8677 105.395 40.6354V34.3186H109.42V30.8188H105.395V26.868H101.017V30.8188H99.1477V34.3186H101.017V41.3468C101.017 44.2623 102.497 46.6283 106.039 46.6283C107.713 46.6283 108.486 46.3997 109.648 46.044L109.165 42.0932C108.584 42.2869 107.845 42.4806 107.166 42.4806Z"
50+
fill="currentColor"
51+
/>
52+
<path
53+
fillRule="evenodd"
54+
clipRule="evenodd"
55+
d="M111.097 38.822C111.097 33.5088 113.963 30.3996 118.923 30.3996V30.4028C123.624 30.4028 125.843 33.188 125.843 37.431C125.843 38.0757 125.811 38.6918 125.745 39.5017H115.409C115.665 41.963 116.789 43.065 118.885 43.065C120.981 43.065 121.594 42.0932 121.979 40.9276L125.65 41.9312C124.975 44.5894 123.204 46.5966 118.857 46.5966C114.254 46.5966 111.097 44.1353 111.097 38.822ZM118.793 33.7025C116.827 33.7025 115.668 34.7379 115.444 37.2659H121.818C121.755 34.8681 120.76 33.7025 118.793 33.7025Z"
56+
fill="currentColor"
57+
/>
58+
<path
59+
d="M147.642 30.3996C145.132 30.3996 143.396 31.9875 142.556 35.0014H142.202C142.01 32.1177 140.69 30.3996 137.985 30.3996C135.57 30.3996 133.735 31.9558 132.864 34.9347H132.542V30.822H128.261V46.1742H132.64V37.6215C132.64 35.7097 133.833 34.3821 135.699 34.3821C137.278 34.3821 138.016 35.4524 138.016 37.0054V46.1742H142.395V37.6215C142.395 35.7097 143.554 34.3821 145.419 34.3821C147.033 34.3821 147.74 35.4524 147.74 37.0054V46.1742H152.15V35.7764C152.15 32.4385 150.638 30.3996 147.642 30.3996Z"
60+
fill="currentColor"
61+
/>
62+
<path
63+
fillRule="evenodd"
64+
clipRule="evenodd"
65+
d="M0.808139 1.16556H44.9046C45.2172 1.16556 45.4697 1.41964 45.4697 1.73405V23.9112C45.4697 26.9791 44.8699 29.9581 43.6892 32.7656C42.5495 35.4778 40.9206 37.9074 38.8464 39.9939C36.7691 42.0805 34.3541 43.7192 31.6612 44.8657C28.8673 46.0567 25.906 46.6569 22.8564 46.6569C19.8068 46.6569 16.8424 46.0535 14.0516 44.8657C11.3587 43.7192 8.94049 42.0805 6.86636 39.9939C4.79223 37.9074 3.16324 35.4746 2.02357 32.7656C0.842869 29.9581 0.243042 26.976 0.243042 23.9112V1.73405C0.243042 1.41964 0.498756 1.16556 0.808139 1.16556ZM22.8596 5.09413C22.2629 4.51295 21.4389 4.1509 20.5234 4.16042V4.1636C17.619 4.19218 16.1889 7.65707 18.2378 9.68646L22.566 13.9707C22.5723 13.9755 22.577 13.9803 22.5818 13.985C22.5865 13.9898 22.5912 13.9945 22.5975 13.9993C22.6764 14.0692 22.7712 14.0978 22.8627 14.0978C22.9574 14.0978 23.049 14.066 23.1279 13.9993L23.1595 13.9676L27.4877 9.68329C29.5365 7.6539 28.1033 4.19218 25.202 4.16042C24.2833 4.1509 23.4594 4.50977 22.8596 5.09413ZM7.57668 23.9112C7.57668 32.2448 14.4147 38.9999 22.8532 38.9999H22.8501C31.2887 38.9999 38.1266 32.2448 38.1266 23.9112V14.5329C38.1266 14.2248 37.8741 13.9739 37.5615 13.9739H31.8727C27.4119 13.9739 23.7088 17.1688 22.9795 21.3674C22.97 21.4341 22.9101 21.4817 22.8406 21.4753C22.7806 21.4722 22.7333 21.4245 22.7206 21.3674C21.9882 17.1688 18.2851 13.9739 13.8275 13.9739H8.13862C7.82923 13.9739 7.57668 14.2248 7.57668 14.5329V23.9112Z"
66+
fill="currentColor"
67+
/>
68+
</svg>
69+
);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '@utrecht/nav-bar-css/dist/index.css';
2+
export { NavBar } from '@utrecht/nav-bar-react';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '@utrecht/nav-list-css/dist/index.css';
2+
export { NavList, NavListLink, NavListLinkButton } from '@utrecht/component-library-react';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '@utrecht/page-footer-css/dist/index.css';
2+
export { PageFooter } from '@utrecht/page-footer-react';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '@utrecht/page-header-css/dist/index.css';
2+
export { PageHeader } from '@utrecht/page-header-react';

packages/website/src/layouts/document.astro

Lines changed: 84 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
---
22
import { siteName, siteTitle, siteThemeColor, siteColorScheme, siteKeywords, twitterCard } from '../seo.config.ts';
33
import { Root } from '@components/root/root';
4-
import { Body } from '@components/body/body';
54
import { PageBody } from '@components/page-body/page-body';
5+
import { PageHeader } from '@components/page-header/page-header';
6+
import { PageFooter } from '@components/page-footer/page-footer';
7+
import { NavBar } from '@components/nav-bar/nav-bar';
68
import { PageLayout } from '@components/page-layout/page-layout';
79
import { SkipLink } from '@components/skip-link/skip-link.tsx';
10+
import { NavList } from '@components/nav-list/nav-list';
11+
import { NavListLink } from '@components/nav-list/nav-list';
12+
import { Logo } from '@components/logo/logo';
13+
import { LinkList, LinkListLink } from '@components/link-list/link-list';
14+
import { BreadcrumbNav, BreadcrumbNavLink, BreadcrumbNavSeparator } from '@components/breadcrumb-nav/breadcrumb-nav';
15+
import { IconChevronRight } from '@tabler/icons-react';
816
917
import '@fontsource/fira-code';
1018
import '@fontsource/fira-sans/700';
@@ -21,9 +29,21 @@ interface Props {
2129
keywords?: string[];
2230
index?: boolean;
2331
follow?: boolean;
32+
showBreadcrumbs?: boolean;
2433
}
2534
26-
const { title, titleSm, description, lang = 'nl', keywords, seoImage, seoImageAlt, index = true, follow } = Astro.props;
35+
const {
36+
title,
37+
titleSm,
38+
description,
39+
lang = 'nl',
40+
keywords,
41+
seoImage,
42+
seoImageAlt,
43+
index = true,
44+
follow,
45+
showBreadcrumbs = true,
46+
} = Astro.props;
2747
2848
const fallbackSeoImage = '/social-image_nl-design-system.png';
2949
const fallbackSeoImageAlt = 'Logo van NL Design System';
@@ -35,6 +55,28 @@ const _seoImageAlt = seoImage ? seoImageAlt : fallbackSeoImageAlt;
3555
const _keywords = new Set([...siteKeywords, ...(keywords || [])]);
3656
const _follow = follow === undefined ? index : follow;
3757
const _robots = `${index ? 'index' : 'noindex'} ${_follow ? 'follow' : 'nofollow'}`;
58+
59+
const mainNavigationItems = [
60+
{ href: '/', label: 'Home' },
61+
{ href: '/handboek/', label: 'Handboek' },
62+
{ href: '/richtlijnen/', label: 'Richtlijnen' },
63+
{ href: '/componenten/', label: 'Componenten' },
64+
{ href: '/voorbeelden/', label: 'Voorbeelden' },
65+
{ href: '/community/', label: 'Community' },
66+
{ href: '/project/', label: 'Project' },
67+
];
68+
69+
const footerNavigationItems = [
70+
{ href: '/blog/', label: 'Blog' },
71+
{ href: '/project/kernteam/', label: 'Contact' },
72+
{ href: '/toegankelijkheidsverklaring/', label: 'Toegankelijkheid' },
73+
{ href: '/privacyverklaring/', label: 'Privacyverklaring' },
74+
{ href: '/colofon/', label: 'Colofon' },
75+
{ href: '/github/', label: 'GitHub' },
76+
{ href: '/slack/', label: 'Slack' },
77+
{ href: '/figma/', label: 'Figma' },
78+
{ href: 'https://www.linkedin.com/company/nl-design-system/', label: 'LinkedIn', external: true },
79+
];
3880
---
3981

4082
<Root lang={lang} dir="ltr">
@@ -67,37 +109,58 @@ const _robots = `${index ? 'index' : 'noindex'} ${_follow ? 'follow' : 'nofollow
67109
<slot name="head" />
68110
</head>
69111

70-
<Body>
112+
<body>
71113
<SkipLink href="#main">Naar de inhoud</SkipLink>
72114
<PageLayout>
73-
<header>
74-
TODO: PageHeader
75-
<nav aria-labelledby="hoofdnavigatie-label">
76-
<h2 id="hoofdnavigatie-label">Hoofdmenu</h2>
77-
TODO: Hoofd navigatie
78-
</nav>
79-
</header>
80-
115+
<PageHeader>
116+
<a href="/" aria-label="Link naar Homepagina"><Logo /></a>
117+
</PageHeader>
118+
<NavBar aria-labelledby="hoofdnavigatie-label">
119+
<h2 hidden id="hoofdnavigatie-label">Hoofdmenu</h2>
120+
<NavList>
121+
{mainNavigationItems.map(({ href, label }) => <NavListLink href={href}>{label}</NavListLink>)}
122+
</NavList>
123+
</NavBar>
81124
<PageBody>
82-
<nav aria-labelledby="breadcrumb-label">
83-
<h2 id="breadcrumb-label">Kruimelpad</h2>
84-
TODO: Breadcrumb navigatie
85-
</nav>
125+
{
126+
showBreadcrumbs && (
127+
<nav aria-labelledby="breadcrumb-label">
128+
<h2 hidden id="breadcrumb-label">
129+
Kruimelpad
130+
</h2>
131+
<BreadcrumbNav>
132+
<BreadcrumbNavLink href="/">Home</BreadcrumbNavLink>
133+
<BreadcrumbNavSeparator>
134+
<IconChevronRight />
135+
</BreadcrumbNavSeparator>
136+
<BreadcrumbNavLink href="#">{title}</BreadcrumbNavLink>
137+
</BreadcrumbNav>
138+
</nav>
139+
)
140+
}
86141

87142
<main id="main">
88143
<slot />
89144
</main>
90145
</PageBody>
91146

92-
<footer>
93-
TODO: PageFooter
147+
<PageFooter>
94148
<nav aria-labelledby="site-navigatie-label">
95-
<h2 id="site-navigatie-label">Submenu</h2>
96-
TODO: Footer navigatie
149+
<h2 hidden id="site-navigatie-label">Submenu</h2>
150+
<LinkList>
151+
{
152+
footerNavigationItems.map(({ href, label }) => (
153+
<LinkListLink href={href}>
154+
{label}
155+
<IconChevronRight slot="icon" />
156+
</LinkListLink>
157+
))
158+
}
159+
</LinkList>
97160
</nav>
98-
</footer>
161+
</PageFooter>
99162
</PageLayout>
100-
</Body>
163+
</body>
101164
</Root>
102165

103166
<style is:global>

0 commit comments

Comments
 (0)