Script and ad placeholders¶
Empty HTML hooks for the external scripts / ads team (epic AISD-230,
worker half AISD-233). The Cloudflare Worker does not inject ads,
prebid, or bytes from the cms_scripts S3 bucket in this release.
Source: shell mirrors under
templates/templates/,src/layout/index.ts(renderLayout),test/shell-slots.test.ts.
Contract (data-slot)¶
| Name | Placement | Intent |
|---|---|---|
below_title |
Article shell, immediately after .article-meta |
~100px ad slot under title/byline |
after_section |
Article shell, after data-render="content_blocks" |
Sentinel for ~300px after-section ads (one marker in the shell; per-section cloning is out of scope) |
custom_scripts_header |
Shell block scripts_header |
Empty head script mount |
custom_scripts_body |
Shell block scripts_body |
Empty body script mount |
Markup (exact attribute names — do not rename):
<div data-slot="below_title"></div>
<div data-slot="after_section"></div>
<div data-slot="custom_scripts_header"></div>
<div data-slot="custom_scripts_body"></div>
Placeholders must stay empty (no sample ads, no nested <script>).
How the worker emits them¶
Active shells (celebrity-v1, default) carry dedicated blocks:
<template data-block="scripts_header"><div data-slot="custom_scripts_header"></div></template>
<template data-block="scripts_body"><div data-slot="custom_scripts_body"></div></template>
renderLayout splices those blocks into every full page:
scripts_header→ end of<head>(after JSON-LD / styles)scripts_body→ after footer, before the nav-toggle and load-more runtimes
Article-inline slots (below_title, after_section) come from the hydrated
article shell block, not from renderLayout.
If a shell omits scripts_header / scripts_body, those mounts are simply
absent (no error).
Out of scope (follow-up)¶
- Reading
cms_scriptsor injecting JS into the slots - Consuming site setting
scripts_split_config - Auto-cloning
after_sectionbetween every rendered content section
Registry + upload APIs live in cms-api / hq (AISD-231 / AISD-232). See
cms-api/docs/scripts-registry.md (portal:
Scripts registry).
Operator: bump shell + upload¶
- Edit the mirror under
templates/templates/<slug>/<old-version>/shell.html(or producesha256(shell)[:12]as the new version directory). - Upload on stage via cms-api admin:
# celebrity-v1 id=1, default id=-1 (stage today)
curl -X POST "http://cms-api-stg.skyneto.com/admin/v1/templates/1/file" \
-H "Authorization: Bearer $CMS_ADMIN_TOKEN" \
-F "file=@templates/templates/celebrity-v1/<version>/shell.html;type=text/html" \
-F "version=<version>"
- Re-sync git mirrors per
templates/README.mdin the cms-cf-worker repo. - Purge + redeploy if settings/HTML must refresh everywhere — see Caching → propagation recipe.
Verify¶
View-source on a plain article URL (no ?query):
- All four
data-slot="…"names present where the shell defines them - Slot inner HTML empty; no new
<script>from this ticket - Health / sample article still 200