As well as producing human-readable standards, we should be producing
machine-readable metadata for automagic consumption of the standards
we're producing.
As the standard across Government is schema.org, we need to produce
schema.org metadata.
To simplify the logic for generating this data, we can create Ruby
classes per entity, and store the schema.org representation internally.
Using classes allows us to centrally set up the classes with a base
class, as well as - in the future - allow for unit testing of these
isolated components.
Due to the way that Middleman currently uses ActiveSupport's JSON
encoder, we need to make sure that we implement as_json to allow
nesting our objects more nicely and allow them to be JSON encoded
without a problem.
As well as producing human-readable standards, we should be producing machine-readable metadata for automagic consumption of the standards we're producing.
As the standard across Government is schema.org, we need to produce schema.org metadata.
To simplify the logic for generating this data, we can create Ruby classes per entity, and store the schema.org representation internally. Using classes allows us to centrally set up the classes with a base class, as well as - in the future - allow for unit testing of these isolated components.
Due to the way that Middleman currently uses ActiveSupport's JSON encoder, we need to make sure that we implement
as_json
to allow nesting our objects more nicely and allow them to be JSON encoded without a problem.