All topics

Editing from a Browser

An editor is a protected folder whose pages change your other folders from a browser. Someone signed in to it can add photos to the family gallery, write a blog post or choose the tiles of a sensor dashboard from a laptop or a phone, in the folders you checked for the editor.

To change a site yourself on the device, use Settings, Posts and Files on its folder's screen (see Template Sites).

Making an editor

On the Content tab, choose Editor… from the + menu (Example editor… on iOS 15), pick the folder it should edit and give the editor a name, with Pro. The list offers your public and protected folders and your groups. Git repositories and backup vaults are left out: a repository changes when someone pushes to it, and a vault belongs to whoever backs up into it.

The editor is created protected, with the folder you picked checked. Open its address in a browser and sign in with a device account to use its pages.

Pages for each kind of site

A Safari window with a blog editor's Files tab, listing the blog's folders and files with View, Edit, Rename and Delete beside each file

The pages follow the folder you picked:

An editor made for a gallery, blog, podcast, download site, sensor dashboard or group also has a Settings tab, first in the row. It sets the site's title, a description shown under it and in search results and link previews, for a blog a tagline that follows the title in the browser tab, for a podcast what directories ask of a show and its artwork, an introduction above the photos, posts, episodes, files or tiles, and the look: Night, Paper, Sand or Forest colors, an accent color of your own and a mono, sans or serif typeface. The editor's own pages take on the same look, and show a pick as soon as it is made. A site made before these settings shows them once its pages are updated with Update Example Files on its folder's screen.

Writing templates

A Safari window with a blog's post layout open in the file manager, and the list of what page offers open under the caret

In the file manager's editor, a post's text and the introduction, typing inside {{ }} or {% %} opens a list of what Liquid offers there: tags, filters, includes and the site's own variables like page.title or site.posts. Each entry shows what it gives on this site, from the page the file is made with, so page.title in a post layout shows the title of the newest post. Pick one with a tap, or with the arrow keys and Return. Escape closes the list, and Control-Space opens it where nothing is typed yet.

HTML and Markdown files, posts and the introduction show their syntax in colors as you type: tags, attributes and their values, headings, emphasis, code and links, Liquid in a color of its own, and the front matter's keys and values. The colors follow the site's theme.

Who can change what

An editor lets someone change a folder while all three of these hold:

  1. they are signed in to the editor, which a protected folder asks for;
  2. the folder is checked for the editor;
  3. their account can open the folder in a browser: any account for a public folder, and for a protected one an account whose scope includes it.

The three are checked again for every change, so unchecking a folder, narrowing an account or setting the editor to another access level stops changes at once, in pages that are already open as well. A helper whose account reaches only the editor can still add photos to a public gallery through it, while the gallery stays out of reach on their network drive.

Checking more folders

On the editor's screen in the app, the … button beside the Access setting lists the folders it can edit, with a check mark on each one it does. The button works while the editor is protected and the list has something to choose. Checking a folder needs Pro, and unchecking works with or without it. With more than one folder checked, the pages show a menu for choosing the one to work on.

The editor itself appears in the list as Its own pages. Checking it lets the pages change themselves, which suits adjusting them from a browser. If such an edit breaks them, Restore Editor Pages… in the menu of the folder's Contents section brings back the original pages and keeps every file you added.

Keeping the pages current

The pages are ordinary files in the editor folder, made the way the example sites are. Keep editor updated lets a newer version of the app refresh the pages you have left as they were, and Update Editor Pages does it once. Pages you edited stay as you left them.

How a change travels

Each change is one request with a link the page fetches from the editor right before making it. A link names one file and one action and expires after five minutes, and the browser holds only its sign-in to the editor. The pages ask for links at .nasreborn/links inside the editor folder, which pages you write yourself can use as well:

GET /family-editor/.nasreborn/links?op=targets
GET /family-editor/.nasreborn/links?op=put&target=family-gallery&key=photos/beach.jpg

op is targets, get, put, delete, copy (a PUT carrying x-amz-copy-source) or list (with prefix, delimiter and continuation-token). The answer is JSON with the link, the method to use and when the link expires. Send the request itself without credentials, credentials: "omit" in fetch, as the editor's own links.js does. op=complete with a target and a key answers the completions for writing that file, as JSON.