Skip to content

Demo vault

Every screenshot and code block on this page comes from the bundled demo vault.

Download the English demo vault

Import and export ​

Template rules live in a .json or .js file and come in through the "Profiles" section of the settings. Importing is an overwrite-by-id update with whole-file validation: all of it applies, or none of it does.

File format ​

json
{
  "id": "wide",
  "name": "wide",
  "floatAlignment": "alternate",
  "rules": [
    { "ratioRange": "[0.75,1.35]", "width": 0.68, "layout": "auto", "side": "auto" },
    { "ratioRange": "(1.35,5]", "width": "0.55 + 0.1 * Math.log(r)", "layout": "auto", "side": "auto" }
  ]
}

Save it as .json and pick it in Settings → AutoGallery → Profiles → Import profiles. The file may also contain an array, importing several templates at once.

FieldOptionalWhen omitted
idyesthe file name is used
nameyesthe id is used
floatAlignmentyesalternate
rulesyesan empty array is treated as auto

Overwrite semantics ​

SituationResult
same id as an existing templatereplaced entirely
templates not mentioned in the filekept as they are
id is the built-in autoalways skipped, never overwritten
a rule has an invalid expressionthat rule is dropped silently

The last row deserves its own sentence: an invalid rule does not raise an error, it just disappears. After importing, count the rules in the same panel against the file — a smaller number means an expression failed validation.

Whole-file validation ​

If any template in the file is invalid, the whole file is rejected and nothing is written. There is no half-applied state where the first two templates took effect and the last two did not.

External profile file ​

The externalProfilePath setting can point at a configuration file outside the vault, for teams that want templates to travel with a repository rather than with a personal vault:

  • The path may be absolute or relative to the vault root.
  • If the file is missing or unreadable, the last successfully imported configuration stays — templates are never wiped.
  • Export can write to that path or download to the system downloads folder.

Export ​

"Export all" writes every current template into one file in exactly the import format, so an exported file can be edited and imported straight back.

Validation and troubleshooting ​

SymptomCauseFix
"No layout templates to import"the file only contains auto, or a field name is wrongcheck that rules is an array
Import succeeds but rules are missingan expression used a bare min / maxwrite Math.min / Math.max
Nothing changed after importingno route uses the templatesee Routing
One image still ignores the templateit has its own ag:widthremove the parameter, or accept that parameters win

Next ​