Skip to main content

afrigov is an open-source project. It is not a government website and is not affiliated with any government.

Previewing neutral core Change

afrigov Web toolkit for government

WordPress

Most government websites in Africa run on WordPress. A theme and a blocks plugin bring afrigov there, so an editor builds accessible pages in the WordPress editor without writing code.

The theme: afrigovPress

The parts of the site an editor should not be able to break:

  • The official banner, header, menus with section menus, search and footer.
  • The country pack as a setting: colours, flag and the banner's words.
  • News as a list of posts with dates and pictures, and articles with a lead picture.
  • A title, description and sharing details for every page, written from what the editor wrote.

afrigovPress on GitHub

The plugin: afrigov blocks

afrigov's components as WordPress blocks. Each block is a fixed shape you fill in on the page:

  • Type on the page itself. The hero's title, the cards, the steps and the key figures are edited where they appear, and the editor looks like the published page.
  • Add buttons for repeating parts. Service cards have Add card, steps have Add step, and so on. Only the right kind of item fits inside.
  • Variants from the toolbar. Click a block and choose its layout or style, such as a hero over a photo or a tinted card.
  • Pictures where they go. A block with a picture shows a Choose a picture button in its place.
  • News and events. News is ordinary WordPress posts. Events have their own place in the admin, with a date, a time and a place, and move to the past list by themselves.
  • A short block list on pages. Pages offer the afrigov blocks and the basic writing blocks, and leave out the ones that break the look.

The plugin works with other themes too: it brings afrigov's stylesheet with it when the theme does not. afrigov blocks on GitHub

Tested on a real site

The Nigerian science ministry's rebuild was built a second time in WordPress, with the theme and the plugin. Its pages have the same components and words as the hand-built rebuild, and every page scores 100 with Audit. The differences are the contact form, which comes from a forms plugin, and what WordPress adds, such as links between news articles.

Try it

You need Docker and Node. This starts WordPress on your computer with the theme and the plugin:

git clone https://github.com/afrigov/afrigovPress
git clone https://github.com/afrigov/afrigov-blocks
cd afrigov-blocks && npm install && npm run build
cd ../afrigovPress && npm install && npm start

Then open http://localhost:8888/wp-admin and log in as admin with the password password.