1.Use site-relative Slugs, by always starting them with /
blog/best-post-ever
/blog/best-post-ever
Use site-relative Slugs
❌ Page-relative links
mantis-shrimp
. Running notion2svelte gets you…
A Svelte page: src/routes/mantis-shrimp/+page.svelte
Links to this page will (probably*) look something like: <a href="link-target">Link</a>
├── src
│ └── routes
│ ├── one.svelte
│ ├── mantis-shrimp/+page.svelte
│ └── subpages
│ ├── two.svelte
│ …
javascript
href="mantis-shrimp"
link in the page
generated from one.svelte (https://foo.io/one), the URL resolves
to https://foo.io + mantis-shrimp ⇒ https://foo.io/mantis-shrimp. So far so good!
href=”mantis-shrimp”
)
clicked from https://foo.io//subpages/two. Here, the relative root is no
longer https://foo.io, but https://foo.io/subpages. Now, when we click
the link, it resolves to htttps://foo.io/subpages/mantis-shrimp which, of
course, does not exist, leading to a 404
😥.
🌞👍 Site-relative links
/
, notion2svelte creates site-relative links. Now, instead of <a href="link-target">Link</a>
, we have <a href="/link-target">Link</a>
,
so, no matter where you link to the ”target” page, the link will be resolved using the site root,
leading us infallibly to https://foo.io/link-target
.
🏠 Browse the docs ⚘
High-level Discussion
Turn-intoable Block Components
Toggle Headings (not yet implemented)
Layout-only Components
Page-level Components
Annotation Components
bold → <strong>
italic → <em>
strikethrough → <s>