Title (aka Name)

Why “Title” instead of “Name”?

What Notion calls a page Name, notion2svelte calls <Title>. Why?
 
Well, Notion pages tend to represent a variety of content types…pages, databases, to-dos, etc., so “Name” works as a generic term. notion2svelte is more targeted toward the publishing of creative writing, and <Name>Your page title</Name> just doesn’t feel right.
So…
…becomes…
 

1. Notion original

2. Notion API

Partial output of src/routes/[slug]/notion-export.js
{
  "object": "page",
  …
  "properties": {
    …
    "Name": {
      "id": "title",
      "type": "title",
      "title": [
        {
          "type": "text",
          "text": {
            "content": "Title (aka Name)",
            "link": null
          },
          "annotations": {
            "bold": false,
            "italic": false,
            "strikethrough": false,
            "underline": false,
            "code": false,
            "color": "default"
          },
          "plain_text": "Title (aka Name)",
          "href": null
        }
      ]
    }
  }
}
  javascript

3. Svelte output

Partial output of src/routes/[slug].svelte
<svelte:head>
	<title>Title (aka Name)</title>
</svelte:head>

<Title>Title (aka Name)</Title>
  html
notion2svelte renders <svelte:head> so that the browser tab matches the page title

4. Example rendering

See top of this page, rendered by Title.svelte
Fancy horizontal divider

🏠 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>

Other Components