mirror of https://github.com/sveltejs/svelte
Merge 9198d2696e into 05a3bce6bb
commit
43a32bfcbe
@ -0,0 +1 @@
|
||||
<meta name="author" content="Re:Designed"> <link rel="author" href="https://example.com"> <script type="application/ld+json"></script>
|
||||
@ -0,0 +1,10 @@
|
||||
<svelte:head>
|
||||
<meta name="author" content="Re:Designed" />
|
||||
<link rel="author" href="https://example.com" />
|
||||
<script type="application/ld+json"></script>
|
||||
</svelte:head>
|
||||
|
||||
<div>dummy</div>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1,21 @@
|
||||
import { test } from '../../assert';
|
||||
|
||||
export default test({
|
||||
test({ assert, window }) {
|
||||
const head = window.document.head;
|
||||
|
||||
const meta = head.querySelector('meta[name="author"]');
|
||||
const link = head.querySelector('link[rel="author"]');
|
||||
const script = head.querySelector('script[type="application/ld+json"]');
|
||||
|
||||
assert.ok(meta);
|
||||
assert.ok(link);
|
||||
assert.ok(script);
|
||||
|
||||
if (!meta || !link || !script) return;
|
||||
|
||||
assert.equal(meta.getAttribute('class'), null);
|
||||
assert.equal(link.getAttribute('class'), null);
|
||||
assert.equal(script.getAttribute('class'), null);
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,19 @@
|
||||
<svelte:head>
|
||||
<meta name="author" content={author} />
|
||||
<link rel="author" href={author_url} />
|
||||
<script type="application/ld+json"></script>
|
||||
</svelte:head>
|
||||
|
||||
<div class="credits">
|
||||
Site by
|
||||
<a href={author_url} target="_blank" rel="noopener noreferrer author" title={`Authored by ${author}`}>
|
||||
<nobr>{author}</nobr>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let { author = 'Anonymous', author_url = 'https://example.com' } = $props();
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Loading…
Reference in new issue