Skip to main content

Files

The file store holds assets attached to a project — images, logos, and other uploaded or resolved files.

Files can enter the store in three ways:

  • Uploaded manually via the Files tab or CLI
  • Resolved from a keyword (img: <- coffee) — Micropage fetches a match from Unsplash
  • Downloaded from a URL (img: <- https://...) — Micropage downloads and stores the file

For full details on how images are referenced in markup, see Images.

Using the Web App​

  1. Open the Files tab in the editor.
  2. Click Upload and select a file.
  3. Reference it in markup using img: <- filename.

Files resolved from keywords or URLs during a build are also stored here automatically.

Linking to files​

Link to an uploaded file with <- on a link: line (a: works too):

link: Download the menu <- menu.pdf
link: <- price-list.pdf

Without link text, the filename is used. The link resolves to the file's current URL at every publish, so it keeps working after you replace the file. Only files uploaded to the project work here; link: Text <- https://... is an error. A missing file renders as a broken link. Don't combine <- and -> on the same link line. File links work in sections, columns and nav lists, but not in the site [nav] block.

The file's extension sets how a browser handles it:

  • Opens as plain text: .txt, .page, .md, .html, .htm. An .html file shows its source; it is never rendered as a web page.
  • Opens in the browser: .pdf, .json, images, audio, and video. .css is served as a stylesheet.
  • Served with its proper type: .csv, .zip, .docx, .xlsx, .pptx. Browsers usually download these.
  • Downloads: any other file.

Using the CLI​

List files in a project:

micropage files list

Get the public URL for a file:

micropage files url hero.png

Notes​

  • Files are scoped to a project.
  • Filenames are case-sensitive.
  • Deleting a file that is referenced in markup will cause a broken image or link after the next build.