Data Sources - PageAmp/pageamp GitHub Wiki

PageAmp adds a simple formal representation of dynamic data to plain HTML with the <:datasource> tag.

Static

A data source can either be static or dynamic. A static one includes its own data from the start:

<:datasource :aka="people">
  [
    {"name":"Ann", "role":"Admin"},
    {"name":"Joe", "role":"Account"}
  ]
</:datasource>

Dynamic

A dynamic data source will request data on demand, e.g.:

<:datasource :aka="people" :url="/api/people"/>

Data sources can be accessed by name in data attributes, e.g.:

<div :data=[[people]]>
  <div>Name: [[data.name]]</div>
  <div>Role: [[data.role]]</div>
</div>

Synthetic

A dynamic data source can also be a synthetic one.

TBD

API

:url

:type

Default: "application/json"

⚠️ **GitHub.com Fallback** ⚠️