Content Block Manager is used by publishers to create and manage reusable content blocks.
A content block is a discrete piece of information such as contact details that can be embedded within
multiple pages. When a single block is updated, all documents with it embedded are automatically updated,
therefore reducing duplication of work and ensuring consistency across locations.
This README is for developers using content-block-manager, to view publisher documentation navigate to:
Content Block Manager Publisher Docs.
Running the Application
Use GOV.UK Docker to run any commands that follow.
If you want to run the application with Whitehall, Publisher, Content Store and the frontend apps running (allowing
you to test the whole publishing stack, as well as previewing content):
Note: you need to run the fullstack the first time you run the app to allow it to set up the dbs correctly
govuk-docker run content-block-manager-full
To run the just the application:
govuk-docker run content-block-manager-app
When running the app in docker like this the local development url is: http://content-block-manager.dev.gov.uk/?lead_organisation=
Initial database setup
If you run into issues using the application you might need to manually create and migrate the db.
Run:
govuk-docker run content-block-manager-app bundle exec rails db:create
govuk-docker run content-block-manager-app bundle exec rails db:migrate
or run the combined:
govuk-docker run content-block-manager-app bundle exec rails db:prepare
The run:
govuk-docker run content-block-manager-app bundle exec rails db:seed
Technical documentation
This is a Ruby on Rails app, and should follow our Rails app conventions.
You can use the GOV.UK Docker environment to run the application and its tests with all the necessary dependencies. Follow the usage instructions to get started.
Running the test suite
These commands assume you have the GOV.UK Docker environment running and its binaries in your PATH.
# run all the test suites
govuk-docker-run bundle exec rake
Javascript unit tests can also be run separately:
# run all the JavaScript tests
govuk-docker-run bundle exec rake jasmine
Further documentation
See the docs/ directory.
Licence
MIT License
The Content Modelling Team are available via Slack at #govuk-publishing-content-modelling-dev