:::meta description: How to publish Luccet notes: the file and its first line, opening notes from disk, static hosts and GitHub Pages, pre-rendering with luccet build, Content-Security-Policy, math and offline use, browsers, trust, performance, and what to do when a note does not render. ::: ::site-nav # Publishing {#top} ::toc A note is a static file. To publish it, put it on any web server next to `luccet.js`, or send it to someone: there is no build step, no server code and no database. This page covers what that file must contain, how it behaves from disk and from a host, how to tighten it with a Content-Security-Policy, which browsers it needs, and what to do when a note does not render. Everything here was checked in Chromium and Firefox, which the test suite drives (see [Browsers](#browsers)). Messages quoted on this page are the real ones. ## The file {#the-file} A note is one HTML file. Its first line loads `luccet.js`; everything after that line is the note. ```html ``` This is the canonical first line, and `luccet new` writes it for you (see [luccet new](tools.html#new)). | Part | Why it is there | |---|---| | `` | Standards mode. Without it the note still renders, in quirks mode, where the layout and some add-ons misbehave, and you get a `doc.quirks` error. See [The doctype](#doctype). | | `` | The file is read as UTF-8 wherever it is served from. Without it, a server that does not name a charset makes browsers guess, and non-ASCII text comes out garbled. See [Garbled characters](#charset). | | `` | Loads the engine, which reads the rest of the file as the note and renders it in place. The `src` is a path relative to the note, or a URL. | **What the tag must be.** A plain, synchronous, classic script, on one line: - no `async`, `defer` or `type="module"`: `luccet.js` must run while the browser is still reading the file, to capture the rest of it; - the file it names must be called exactly `luccet.js` (any path, any query string). The browser would run a copy under another name, such as `luccet.min.js`, but the command line and editors would not take the file for a note: keep the name. For a smaller file under the right name, load a release's minified build from `https://cdn.luccet.dev/vX.Y.Z/luccet.js`, or copy it to your site; each [GitHub Release](https://github.com/Luccet/luccet/releases) carries the same file; - the whole tag on one line, not inside a comment. The exact rule is [Note detection](tools.html#detection). Other attributes are allowed on the tag, and some configure `luccet.js` (see [The tag's attributes](#tag-attributes)). ### The doctype {#doctype} Without ``, browsers render the page in **quirks mode**, which emulates old browsers' layout bugs. `luccet.js` has a single way of rendering, in place, keeping the head. It cannot leave quirks mode without replacing the whole document, so it does not try. Instead: - the note still renders; - its layout and some add-ons misbehave in quirks mode, where the browser emulates old layout bugs; - the [panel](#local) and the console report `doc.quirks`, an error, with the fix: ```text error doc.quirks at the luccet.js line (file line 1): the file has no , so the browser renders it in quirks mode, where the layout and some add-ons misbehave (make the first line ) ``` The fix is to put `` first in the file. `luccet build` adds it to the page it writes, with a warning (see [luccet build](#build)). ### The preserved head {#head} Everything before the `luccet.js` tag is the **preserved head**: ordinary HTML that the browser reads before any script runs, and that `luccet.js` keeps as it is. It is the place for what must be in the HTML itself, for crawlers, link previews and readers' browsers: ```html