A timeseries site
This complete package installs the shared deterministic synthetic source,
exports its typed data, and renders a homepage plus a captured sensor route.
Prerequisites: Bash, pond on PATH, and matching sitegen vendor assets
(bundled in production images; make vendor for source builds).
No API or live sensor is contacted.
site:
title: Synthetic sensor site
base_url: /sensor-example/
strict: true
exports:
- name: readings
pattern: /sensors/*
routes:
- name: home
type: static
slug: ""
page: /pages/index.md
routes:
- name: sensor
type: template
slug: "$0"
export: readings
page: /pages/sensor.md
#!/bin/bash
set -euo pipefail
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -n "${EXAMPLE_OUTPUT:-}" ]]; then
mkdir "${EXAMPLE_OUTPUT}"
WORK="$(cd "${EXAMPLE_OUTPUT}" && pwd)"
else
WORK="$(mktemp -d "${TMPDIR:-/tmp}/watertown-site.XXXXXX")"
fi
export POND="${WORK}/pond"
pond init --birthplace documentation-site
for path in /sensors /pages /etc; do
pond mkdir "${path}"
done
pond mknod synthetic-timeseries /sensors/temperature \
--config-path "${SOURCE_DIR}/../synthetic-timeseries/config.yaml"
pond copy "host://${SOURCE_DIR}/index.md" /pages/index.md
pond copy "host://${SOURCE_DIR}/sensor.md" /pages/sensor.md
pond mknod sitegen /etc/site --config-path "${SOURCE_DIR}/site.yaml"
pond run /etc/site -- build "${WORK}/site" --strict
find "${WORK}/site/data" -name '*.parquet' | LC_ALL=C sort > "${WORK}/parquet-files.txt"
while IFS= read -r file; do
pond cat "host+table://${file}" --format=table --sql \
'SELECT COUNT(*) AS rows, CAST(SUM(temperature) AS DECIMAL(10,1)) AS total FROM source'
done < "${WORK}/parquet-files.txt" > "${WORK}/exported-values.txt"
echo "Example output: ${WORK}"
Run bash testsuite/examples/timeseries-site/run.sh from a checkout.
The download package also includes the
shared synthetic-timeseries directory it references. Each invocation creates
a fresh output/pond; set EXAMPLE_OUTPUT to an absent directory to retain it.
Test 214 asserts the homepage and temperature.html, base-prefixed chart
assets/manifest, readable Parquet, four rows, and temperature sum 101.6.
This is offline artifact/data coverage, not a headless browser interaction test.
Serve the generated directory under /sensor-example/ using an HTTP server
to use the chart; do not open it as a file:// document.
See export, configuration, and browser behavior. Rebuilding regenerates exports/pages; it does not watch sources, ingest live measurements, or publish.