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
12 changes: 5 additions & 7 deletions src/components/Block/Alert.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const icon = icons[type];

<aside class:list={['alert', `alert-${type}`, 'has-icon']}>
<span class={`gg-` + icon}></span>
<div set:html={text} />
<div class="alert-content" set:html={text} />
</aside>

<style>
Expand Down Expand Up @@ -54,13 +54,11 @@ const icon = icons[type];
color: var(--white);
}

.has-icon [class^='gg-'] {
--text-color: oklch(from var(--alert-color) calc(l + 0.25) c h);
.alert-content :global(p:last-of-type) {
margin-bottom: 0;
}
</style>

<style is:inline>
.alert p:last-of-type {
margin-bottom: 0;
.has-icon [class^='gg-'] {
--text-color: oklch(from var(--alert-color) calc(l + 0.25) c h);
}
</style>
1 change: 1 addition & 0 deletions src/pages/404.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: '@layouts/Base.astro'
title: Page not found
description: 404 page not found
robots: noindex, nofollow
---

# 404 Not Found
Expand Down
6 changes: 6 additions & 0 deletions tests/pages/base-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export class BasePage {
};
}

async goto(path: string) {
await this.page.goto(path, {
waitUntil: 'domcontentloaded',
});
}

async getMeta() {
return this.meta;
}
Expand Down
12 changes: 12 additions & 0 deletions tests/spec/404.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { test, expect } from '@playwright/test';
import { BasePage } from '@tests/pages/base-page';

test.describe('404 page not found', () => {
test('page is noindexed', async ({ page }) => {
const base = new BasePage(page);
await base.goto('404-not-found');

const meta = await base.getMeta();
expect(await meta.robots.getAttribute('content')).toBe('noindex, nofollow');
});
});