@@ -60,16 +60,23 @@ Terminology
60
60
Template of common markup that surrounds each presented page with navigation, brand identity,
61
61
copyright information and anything else that's shared among some subset of each site.
62
62
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
+
63
69
Components
64
70
----------
65
71
66
72
.. glossary ::
67
73
68
74
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.
71
78
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
73
80
:term: `content service ` for storage and indexing. Otherwise, a local :term: `presenter ` is
74
81
invoked to complete a full build of this subtree of the final site, which is then published to
75
82
CDN and linked on the pull request.
@@ -84,9 +91,9 @@ Components
84
91
repository ` as a source of truth for performing the association.
85
92
86
93
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.
90
97
91
98
layout service
92
99
Given a :term: `presented URL `, return the Handlebars template that should be used to render the
@@ -96,6 +103,40 @@ Components
96
103
97
104
presenter
98
105
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
101
108
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