diff --git a/README.md b/README.md index 64a0663..5b1734f 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ additionalLinkTags={[ }, { rel: 'manifest', - href: '/manifest.json' + href: 'https://www.test.ie/manifest.json' } ]} ``` @@ -374,7 +374,7 @@ it will result in this being rendered: ```html - + ``` ## Open Graph diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 2feea1c..4d4c230 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -38,7 +38,7 @@ additionalLinkTags={[ { rel: 'icon', - href: 'https://www.test.ie/favicon.ico' + href: '/favicon.ico' }, { rel: 'apple-touch-icon', @@ -57,7 +57,7 @@ }, { rel: 'manifest', - href: '/manifest.json' + href: 'https://www.test.ie/manifest.json' } ]} /> diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..825b9e6 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/tests/normal.test.ts b/tests/normal.test.ts index d7379d9..f65f2a8 100644 --- a/tests/normal.test.ts +++ b/tests/normal.test.ts @@ -1,6 +1,6 @@ import { test, expect } from '@playwright/test'; -test('Normal SEO loads correctly', async ({ page }) => { +test('Normal SEO loads correctly', async ({ page, baseURL }) => { await page.goto('/'); await expect(page).toHaveTitle('Normal | Svelte Meta Tags'); await expect(page.locator('h1')).toContainText('Normal SEO'); @@ -41,7 +41,7 @@ test('Normal SEO loads correctly', async ({ page }) => { 'https://www.example.ie/twitter-image.jpg' ); await expect(page.locator('head meta[name="twitter:image:alt"]')).toHaveAttribute('content', 'Twitter image alt'); - await expect(page.locator('head link[rel="icon"]')).toHaveAttribute('href', 'https://www.test.ie/favicon.ico'); + await expect(page.locator('head link[rel="icon"]')).toHaveAttribute('href', `${baseURL}/favicon.ico`); const appleTouchIcon = page.locator('head link[rel="apple-touch-icon"]'); await expect(appleTouchIcon).toHaveCount(2); await expect(appleTouchIcon.nth(0)).toHaveAttribute('sizes', '76x76'); @@ -49,5 +49,5 @@ test('Normal SEO loads correctly', async ({ page }) => { const maskIcon = page.locator('head link[rel="mask-icon"]'); await expect(maskIcon).toHaveAttribute('href', 'https://www.test.ie/safari-pinned-tab.svg'); await expect(maskIcon).toHaveAttribute('color', '#193860'); - await expect(page.locator('head link[rel="manifest"]')).toHaveAttribute('href', '/manifest.json'); + await expect(page.locator('head link[rel="manifest"]')).toHaveAttribute('href', 'https://www.test.ie/manifest.json'); });