You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Frontmatter is a way to add metadata to a Pluto.jl notebook, such as the title, description, authors, cover image, license, date and more. This data is used when **sharing notebooks online**, using [Pluto HTML exports](../export-html/), [`PlutoUI.NotebookCard`](https://featured.plutojl.org/basic/plutoui.jl#NotebookCard), [PlutoSliderServer](https://github.com/JuliaPluto/PlutoSliderServer.jl), [PlutoPages](https://github.com/JuliaPluto/PlutoPages.jl) or [pluto.land](https://pluto.land).
12
+
13
+
For example, the [featured notebooks](../featured-notebooks/) use frontmatter. When you see the list of all featured notebooks, notice how they all have a title, description, cover image and authors. And they are
14
+
15
+
16
+
## The frontmatter GUI
17
+
When editing a Pluto notebook, you can open the frontmatter editor by clicking the "Share button" in the top right.
18
+
19
+
<img src="$(root_url)/assets/img/Share button screenshot.png" alt="Screenshot of the Share button" width="1532" height="282">
20
+
21
+
In the share menu, click the <img src="https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/newspaper-outline.svg" alt="📰" width=17px style="filter: var(--image-filters);"> icon to open the frontmatter editor.
<p>Here is a screenshot of the frontmatter editor. Scroll down to see more.</p>
26
+
27
+
<img src="$(root_url)/assets/img/frontmatter heatmap screenshot.png" alt="Screenshot of the frontmatter editor" width="854" height="1570">
28
+
</blockquote>
29
+
30
+
In this editor, you can edit fields and add new fields. You are free to enter any data that you want (which you might want to [use](#Pluto.frontmatter) in your custom scripts), but some frontmatter entries have special meaning in the Pluto ecosystem.
31
+
32
+
### Special frontmatter entries
33
+
The following keys have special meaning:
34
+
- **`title`** – the title of the document. When not used, the notebook filename is used as title. This is used in Pluto.jl HTML exports as the `<title>` tag.
35
+
- **`description`** – the description of the document. This is used in Pluto.jl HTML exports as the `<meta name="description" content="...">` tag.
36
+
- **`image`** – the URL of the cover image of the document.
37
+
- **`date`** – the date of the document.
38
+
- **`license`** – the license of the document.
39
+
- **`tags`** – a vector of tags for the document, used by the PlutoPages.jl sidebar and search, and PlutoSliderServer.jl.
40
+
- **`layout`** – the PlutoPages.jl layout file of the document.
41
+
- **`order`** – the order of the document within its category.
42
+
43
+
### Open Graph (OG) tags
44
+
The following keys are used as [Open Graph (OG) tags](https://ogp.me/) in Pluto.jl HTML exports (using `<meta property="og:...">`):
Setting these values helps with sharing notebooks on social media and search engine optimization.
49
+
50
+
### The `author` field
51
+
There is also a vector `author` that is used to provide the authors of the notebook. The following fields have special meaning in the Pluto ecosystem:
52
+
- **`name`** – the name of the author.
53
+
- **`url`** – the URL of the author's website. If this is a github user/organization URL, the author's avatar will be shown in the notebook.
54
+
- **`image`** - the URL of the author's avatar. This is not needed if the `url` is a github URL.
55
+
56
+
57
+
## PlutoPages.jl
58
+
If you are using [PlutoPages.jl](https://github.com/JuliaPluto/PlutoPages.jl) to write your website, you should at least set the following frontmatter entries for every page: `layout` and `tags`. (`layout` is the name of the layout file in the `src/_includes/` directory.)
59
+
60
+
61
+
## Featured notebooks
62
+
If you are writing a featured notebook, check out other featured notebook files to see which frontmatter entries are required.
63
+
64
+
65
+
## <span id="Pluto.frontmatter">Accessing frontmatter from Julia</span>
66
+
If you are writing a script to process Pluto notebooks, you can access the frontmatter data using the **`Pluto.frontmatter`** function. This function takes a notebook path as an argument, and returns a `Dict` with the frontmatter data.
0 commit comments