1. Prepare the file structure
Create a working folder with this structure:
sample-business/
├── index.html # required
└── assets/
├── css/style.css # required
├── images/ # local images and logo
└── js/main.js # optionalThe app requires one index.html and rejects additional .html files. It also requires assets/css/style.css; link to it from the document head so the stylesheet is applied. Start with an HTML5 doctype for standards-mode rendering. Semantic HTML, a responsive layout, meaningful image alt text, visible keyboard focus, and content that remains useful without JavaScript are recommended.
Put locally served images, fonts, and other assets under assets/. ZIP paths may contain ASCII letters, numbers, dots, underscores, and hyphens, and each path must be no longer than 240 characters. HTML resource paths are relative to index.html, such as assets/images/hero.jpg. CSS paths are relative to the stylesheet, so use ../images/hero.jpg from assets/css/style.css.
2. Mark editable content
Use exactly one <main data-page> as the editable page root. Each editable section must be its direct child and have a data-section type and a unique data-id.
| Attribute | Purpose |
|---|---|
data-field="name" | Edits the text content of an element. |
data-href="name" | Makes a link's href editable; provide a safe default link. |
data-src="name" | Edits an image src; include the default image in the bundle. |
data-alt="name" | Makes image alt text editable; provide a useful default value. |
data-embed="name" | Edits a supported iframe embed URL. |
data-optional | Marks a field that may be unavailable. |
data-site-logo | Marks an <img> with a bundled source as the replaceable site logo. <img data-src="logo"> is also recognized. |
data-anchor="id" | Marks a navigation target for remapping when its section or block is duplicated. |
Binding names must be unique for each attribute type within the same section or block. Give each data-field its own text element, and do not place another editable field or structural marker inside it. When text changes, the engine distributes the replacement across existing text nodes in proportion to their original lengths while keeping the surrounding markup. Use one text node per field when you want predictable formatting.
This example includes a page root, editable text and image, a replaceable logo, and a contact anchor:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="An introduction to your business">
<title>Your Business</title>
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<header>
<img data-site-logo src="assets/images/logo.png" alt="Business logo">
</header>
<main data-page>
<section data-section="hero" data-id="hero-1">
<h1 data-field="headline">Welcome</h1>
<p data-field="description">Tell visitors about your business.</p>
<img data-src="image" src="assets/images/hero.jpg"
data-alt="imageAlt" alt="A view of the business">
<a data-href="contactLink" href="#contact" data-field="contactLabel">Contact us</a>
</section>
<section data-section="contact" data-id="contact-1" id="contact" data-anchor="contact">
<h2 data-field="heading">Contact</h2>
<p data-field="details">Add your contact information.</p>
</section>
</main>
</body>
</html>Include the images at the paths shown above. Templates without a logo slot cannot use the site logo setting. Android site settings can also update the document title, description, keywords, and optional Open Graph metadata.
The engine accepts link values using https://, mailto:, tel:, or a local fragment such as #contact; it rejects local file paths and other schemes such as http:. The engine does not check whether a fragment target exists, so add a matching HTML id for working navigation. When a section or block is duplicated, IDs and references inside that copy are remapped, including href="#id", data-target="#id", data-anchor, and accessibility ID references. References to targets outside the copy remain unchanged.
3. Add repeatable content
Repeatable blocks
Use data-blocks for a list and data-block for each direct item in that list. Every live item needs a unique data-id. If people should be able to add blocks, put exactly one matching <template data-block-preset> inside the owning section or block; it must contain one data-block prototype.
<section data-section="services" data-id="services-1">
<h2 data-field="heading">Services</h2>
<div data-blocks="service">
<article data-block data-id="service-1">
<h3 data-field="name">First service</h3>
<p data-field="description">Describe this service.</p>
</article>
</div>
<template data-block-preset="service">
<article data-block>
<h3 data-field="name">New service</h3>
<p data-field="description">Describe this service.</p>
</article>
</template>
</section>Group names must be unique within their owning section or block. A group cannot sit directly inside another group, but a block may own another group. The engine supports nested block groups when each group belongs to a section or block and each block is a direct child of its group.
Repeatable sections
To let people add a section, define an inert section preset outside <main data-page>. Its template must contain exactly one prototype whose data-section value matches the preset name. Define each section preset type only once.
<template data-section-preset="intro">
<section data-section="intro">
<h2 data-field="heading">A new section</h2>
<p data-field="description">Add an introduction here.</p>
</section>
</template>Prototypes should include the markup and fields used by live sections or blocks. If a prototype uses an HTML id, make it unique in the document. Live instances need unique data-id values; prototypes do not need one.
4. Assets, safety, and accessibility
- Use the supported markers for editable fields and structure:
data-page,data-section,data-id,data-field,data-src,data-href,data-alt,data-blocks,data-block,data-block-preset,data-section-preset,data-optional,data-anchor,data-site-logo, anddata-embed. Customdata-*attributes do not create editable fields. - Do not use
styleattributes, inline event handlers, inline scripts,<object>,<embed>,<base>, meta refresh, orsrcset. - Use
data-embed="embedUrl"on an iframe with a descriptive title andsandbox="allow-scripts allow-same-origin allow-presentation". Supported HTTPS embed URLs are from YouTube, Google Maps, Vimeo, and Spotify. Copy the URL from the provider’s embed code. Custom template previews disable scripts, so embeds may not be interactive there. - If an interaction needs JavaScript, reference external script files bundled under
assets/, for example<script src="assets/js/main.js" defer>. The engine requires referenced scripts to be bundled locally, and custom template scripts do not run in the app preview. - Bundled CSS files cannot use
@import,expression(), orjavascript:; theirurl()references must resolve to local bundled assets or a fragment such asurl(#gradient). Inline<style>blocks cannot load resources withurl()and cannot use executable CSS; their only allowed import is HTTPS fromfonts.googleapis.com. - HTML resource paths checked by the engine, such as image
srcand stylesheethref, must point to bundled files underassets/. Do not use absolute paths,.., backslashes, percent signs, queries, or fragments in these resource paths. CSSurl()references are relative to the CSS file and must resolve to bundled files. - Use semantic HTML, ordered headings, meaningful alt text, clearly labelled controls, visible keyboard focus, sufficient color contrast, and
prefers-reduced-motionwhen the design uses animation. - The editor does not handle form submissions. If you include a form, connect and test a working submission endpoint yourself; otherwise use a contact link.
5. Package the ZIP
The Android app uses the selected ZIP filename as the custom template name. Choose a clear filename so you can recognize it in your drafts.
You do not need a separate metadata file for a custom template.
Create the ZIP from inside the template folder so index.html and assets/ are at the archive root:
cd sample-business
zip -r ../sample-business.zip index.html assetsKeep these limits in mind:
- The ZIP and its expanded contents must each be no larger than 20,000,000 bytes. Each file may be up to 8,000,000 bytes, and the archive may contain up to 250 entries, including folders.
- HTML may be up to 3,000,000 bytes, 500 elements, and 256 nodes deep, including preset contents. Leave room for edits and added content.
- A deployed website may contain up to 101 files, including
index.html. Asset size and storage limits may also depend on your site plan.
6. Upload and use it in the Android app
- Before uploading, check asset paths, default images, unique HTML
idanddata-idvalues, and matching group and preset names. - Sign in to the Instara Android app and open Templates. Tap Upload template, then choose the ZIP file from your device.
- The app checks the ZIP on your device. If it is valid, choose Preview to inspect it; custom template scripts do not run in the preview.
- Choose Use template to create a local draft. Then test editing text, images, links, and the logo; add or duplicate sections and blocks; and check anchors and assets.
Your custom template stays on your device. Using it does not upload the template ZIP or publish a website. Deploying the edited site is a separate action in the app; it uploads and publishes the generated website files. The template contract is version 2.