github dannysmith/astro-editor v1.2.2
Astro Editor v1.2.2

one hour ago

Windows and Linux are now fully supported, collections can have templates for new files, a project can carry its settings in a committed .astro-editor.json, and pasting images and formatted text now works properly.

Windows and Linux

Windows and Linux builds are no longer beta. See Installation.

Templates for new files

If a collection's root folder contains .astro-editor/template.md or .astro-editor/template.mdx, new files in that collection are created from a copy of it. Project Settings shows each collection's template if present. See Templates. (#417)

Other apps and scripts can now create files too with a new astro-editor://new URL scheme that requires the project and collection as parameters, and optionally a folder, title and body. It works exactly like ⌘N. See URL Scheme.

Project settings in your codebase

A project can now keep its settings in a .astro-editor.json at its root, so everyone who edits the site with Astro Editor gets the same file name patterns, field mappings and folders without having to set them up by hand. Your own settings still override these if set and the Project Settings labels values that come from the file. Most projects shouldn't need this, but it can be helpful when working in teams or multiple checkouts of the same Astro site. See Project Settings in Your Codebase. (#418)

Pasting images and formatted text

  • Images – Pasting a screenshot, an image copied from a web page or photo app, or an image file saves it into the collection's assets in exactly the same way as if you'd dragged it in. Images copied from web pages attempt to bring over their alt text. See Pasting images.
  • Formatted text – Text copied from a web page or another app pastes as Markdown, keeping headings, bold and italic, links, lists, quotes and code. ⇧⌘V always pastes as plain text. See Pasting formatted text.
  • HEIC photos – On macOS, HEIC photos from an iPhone are converted to JPEG however they're added.
  • Dropped images – Dropping one image selects its alt text in the editor, so you can type over it straight away.

(#413)

Jump to a heading

Typing # in the command palette lists the open file's headings and lets you jump to one of them quickly. See Commands. (#414)

Smoother scrolling and typewriter mode

Scrolling to the cursor is now animated and should feel much smoother. In typewriter mode, a selection over several lines is centred as a block, and a selection made with the mouse is centred just after you let go. See Focus and Typewriter Modes. (#416)

Frontmatter panel

More schemas get the right frontmatter form control, and a few fields that were flagged wrongly aren't any more:

  • A list of options (z.array(z.enum([...]))) is a dropdown you can pick several from, instead of JSON.
  • A choice of numbers (z.union([z.literal(1), z.literal(2)])) is a dropdown, and saves numbers.
  • Image and reference fields are found in schemas formatted across several lines, like z.object({ ... }).strict().
  • A list whose values don't match its type is shown as JSON, rather than hiding the values that don't fit and dropping them on the next edit.
  • A required field inside an optional object is only flagged as missing once the object has a value.
  • Email fields no longer show Zod's regex as their hint in old Zod versions.
  • Dates like Jul 08 2022 are read as dates in the same way Astro does.

(#419, #422)

Other improvements

  • Starlight docs now sort by sidebar.order by default.
  • In the title field, ⌘Enter moves focus to the editor.
  • I've given the app icon a bit of pilish.

Bug fixes

  • Clicking into the editor – When the editor wasn't focused, clicking into it could sometimes scroll to the top and select a large chunk of text. (#416)
  • Focus mode – Turning it on or off no longer moves the view. (#416)
  • Typewriter mode – Turning it off no longer moves the current line to the top of the editor.
  • Copyedit highlighting – Each word is now highlighted by its own part of speech. Before, every occurrence of a word took the first one's highlight.
  • Pasting a link over a selection – Spaces at the edges of the selection stay outside the link.
  • Outside edits after a settings change – Changes made in another app could go unseen for a few seconds after changing settings or the content config.
  • New files – The title field is scrolled into view when the frontmatter panel is scrolled down.
  • Open in IDE – Files with characters like ; or & in their names now open properly.

Under the hood

The developer tooling has been improved considerably and parts of the codebase have been refactored and reorganised. there is now tooling to automatically generate the screenshots used in the website among other things.

Don't miss a new astro-editor release

NewReleases is sending notifications on new releases.