alphagov / data-standards-authority

Collaboration space for working on data standards and guidance for the DSA
https://alphagov.github.io/data-standards-authority/
Other
24 stars 11 forks source link

Produce schema.org metadata on standards pages #133

Closed jamietanna closed 2 years ago

jamietanna commented 2 years ago

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.