bookish-press 0.4.43 → 0.4.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,6 +22,7 @@ import PageParagraph from './PageParagraph.svelte';
|
|
|
22
22
|
import Note from '../editor/Note.svelte';
|
|
23
23
|
import Permissions from '../editor/Permissions.svelte';
|
|
24
24
|
import Publish from './Publish.svelte';
|
|
25
|
+
import { onMount } from 'svelte';
|
|
25
26
|
let auth = getUser();
|
|
26
27
|
let book = getBook();
|
|
27
28
|
let edition = getEdition();
|
|
@@ -61,6 +62,11 @@ function addChapter() {
|
|
|
61
62
|
if ($edition)
|
|
62
63
|
edition.set($edition.withNewChapter());
|
|
63
64
|
}
|
|
65
|
+
/** Doing this on mount allows for prerendering an an update. */
|
|
66
|
+
let bookURL = '…';
|
|
67
|
+
onMount(() => {
|
|
68
|
+
bookURL = location.protocol + '//' + location.host + location.pathname;
|
|
69
|
+
});
|
|
64
70
|
</script>
|
|
65
71
|
|
|
66
72
|
{#if $edition}
|
|
@@ -270,10 +276,7 @@ function addChapter() {
|
|
|
270
276
|
.getAuthors()
|
|
271
277
|
.map((author) => Parser.parseFormat($edition, author).toText())
|
|
272
278
|
.join(', ')} ({new Date().getFullYear()}).
|
|
273
|
-
<em>{$edition.getTitle()}</em>. {
|
|
274
|
-
'//' +
|
|
275
|
-
location.host +
|
|
276
|
-
location.pathname},
|
|
279
|
+
<em>{$edition.getTitle()}</em>. {bookURL},
|
|
277
280
|
<em>retrieved {new Date().toLocaleDateString('en-US')}</em>.
|
|
278
281
|
</PageParagraph>
|
|
279
282
|
|