Skip to content

Commit b14108a

Browse files
committed
Merge pull request #34 from smashwilson/metadata-envelope
Introduce the term "metadata envelope".
2 parents 22f5a83 + 481f4c6 commit b14108a

File tree

1 file changed

+49
-8
lines changed

1 file changed

+49
-8
lines changed

running/architecture.rst

+49-8
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,23 @@ Terminology
6060
Template of common markup that surrounds each presented page with navigation, brand identity,
6161
copyright information and anything else that's shared among some subset of each site.
6262

63+
metadata envelope
64+
metadata envelopes
65+
JSON document that contains a single page's worth of content as a rendered HTML fragment, along with
66+
any additional information necessary for the presentation of that page. See :ref:`the schema section
67+
<envelope-schema>` for a description of the expected structure.
68+
6369
Components
6470
----------
6571

6672
.. glossary::
6773

6874
preparer
69-
Process responsible for converting a :term:`content repository` into a directory tree of JSON
70-
documents, each of which contains one page of rendered HTML and associated metadata.
75+
Process responsible for converting a :term:`content repository` into a directory tree of
76+
:term:`metadata envelopes`, each of which contains one page of rendered HTML and associated
77+
metadata.
7178

72-
If the current branch is live, the generated JSON documents are then submitted to the
79+
If the current branch is live, the generated envelopes are then submitted to the
7380
:term:`content service` for storage and indexing. Otherwise, a local :term:`presenter` is
7481
invoked to complete a full build of this subtree of the final site, which is then published to
7582
CDN and linked on the pull request.
@@ -84,9 +91,9 @@ Components
8491
repository` as a source of truth for performing the association.
8592

8693
content service
87-
Service that accepts submissions and queries for the most recent page content associated with a
88-
specific :term:`content ID`. Content submitted here will have its structure validated and
89-
indexed.
94+
Service that accepts submissions and queries for the most recent :term:`metadata envelope`
95+
associated with a specific :term:`content ID`. Content submitted here will have its structure
96+
validated and indexed.
9097

9198
layout service
9299
Given a :term:`presented URL`, return the Handlebars template that should be used to render the
@@ -96,6 +103,40 @@ Components
96103

97104
presenter
98105
Accept HTTP requests from users. Map the requested :term:`presented URL` to :term:`content ID`
99-
by querying the :term:`mapping service`, then access the requested content using the
100-
:term:`content service`. Inject the content into an approriate :term:`layout` and send the
106+
by querying the :term:`mapping service`, then access the requested :term:`metadata envelope`
107+
using the :term:`content service`. Inject the envelope into an approriate :term:`layout` and send the
101108
final HTML back in an HTTP response.
109+
110+
.. _envelope-schema:
111+
112+
Metadata Envelope Schema
113+
------------------------
114+
115+
Much of the deconst system involves the manipulation of :term:`metadata envelopes`, the JSON documents
116+
produced by each :term:`preparer` that contain the actual content to render. To be presented properly,
117+
envelopes must adhere to a common schema.
118+
119+
Here's a `JSON schema <http://json-schema.org/>`_ document that describes its expected structure:
120+
121+
.. code-block:: json
122+
123+
{
124+
"$schema": "http://json-schema.org/draft-04/schema#",
125+
"title": "Deconst Metadata Envelope",
126+
"type": "object",
127+
"properties": {
128+
"body": {
129+
"description": "Partially rendered HTML to be injected into a selected layout.",
130+
"type": "string",
131+
},
132+
"required": ["body"]
133+
}
134+
}
135+
136+
This is an example envelope that demonstrates the full document structure in a more concrete way:
137+
138+
.. code-block:: json
139+
140+
{
141+
"body": "<h1>Rendered HTML</h1>"
142+
}

0 commit comments

Comments
 (0)