Repository navigation
docs: add format and validation pages, and search titles - #5
Merged
Merged
Conversation
People search for the two-letter state codes of the new postcode, and no page listed them. The build now writes a page of the codes from spec/data/states.json, the file that the SDKs read, so the page cannot drift from the SDKs (CS-4). The page shows the name and the ISO 3166-2:NG code of each state, and it quotes the source of the codes. Signed-off-by: MobileMage <aidelojejoshua@gmail.com>
Developers search for the format of the postcode, for a regex and for a way to validate a postcode, and no page answered those searches. The format page describes the segments, the forms and the legacy postcode from grammar.md. Its regex runs in CI, and a test compares it with the state codes and with the parse vectors of the spec. The validation page reuses the examples of the guides, and CI runs each one (DOC-3). Signed-off-by: MobileMage <aidelojejoshua@gmail.com>
A search result shows the title and the description of a page. The old ones used few of the words that people type, such as "Nigerian postcode checker". Each hand-written page now names its subject in those words, with a description of 150 characters or fewer. The sidebar labels stay as they were. The home page gives its og:type as website, carries JSON-LD for the site and its source code, and links the new pages. Signed-off-by: MobileMage <aidelojejoshua@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Search engines barely list this site, and no page answered the questions that developers and
shop owners type about Nigeria's new postcode. This change names each page in those words, and
it adds three pages that answer them.
Each hand-written page now has a title and a meta description that state its subject in search
words, such as "Nigerian postcode checker" for the playground. Each description has 150
characters or fewer, and a unit test keeps it so. The sidebar labels, the site name "Gatepost"
and the line "Unofficial. Not made or endorsed by NIPOST." stay where they were.
The home page now sets og:type to website. It also carries inline JSON-LD with one WebSite object
and one SoftwareSourceCode object. The data loads nothing from another site.
The new page "Nigeria's digital postcode format" describes the five segments, the written forms,
the rule that 00 is never a valid LGA or unit, and the old 6-digit postcode. Every rule comes from
spec/grammar.md and spec/data. The page gives a regex for the format check, and it says that only
NIPOST's gateway knows whether a postcode exists. A unit test checks that the regex lists the 37
state codes of spec/data/states.json and agrees with parse on 87 vectors of the spec.
The new page "Validate a Nigerian postcode" checks a postcode in TypeScript, in PHP and in a plain
HTML form. It reuses the examples of the guides, and CI runs each one. The HTML block is the
quickstart of the field README, as the examples test requires.
The build now writes a "State codes" page from spec/data/states.json, beside the other spec pages,
so nobody types the codes by hand. The home page and the format page link the new pages. The
Start group of the sidebar lists the format page and the validation page, and the Spec group
lists the state codes.
The target searches:
One note for a later change: Packagist lists gatepost/postcode v0.1.0-alpha.1, but the PHP guide
still says that the first alpha is not published. This change leaves that notice as it is,
because src/release-state.json holds one state for all the packages.
pnpm check passes on this branch.
Signed-off-by: MobileMage aidelojejoshua@gmail.com