Add make-council-pages.sh script

This commit is contained in:
2024-07-28 19:05:20 +10:00
parent f149107943
commit 3018c1e30a
2 changed files with 47 additions and 0 deletions

View File

@@ -13,3 +13,7 @@ The file can be generated using the jq tool and the VEC data:
'''
jq '[.[] | {name: .electorateName, electorateId: .electorateId, shortName: .parentElectorateName | match("(.*?)(?:(?: Rural)?(?: City| Shire) Council)").captures[0].string, parentElectorateId: .parentElectorateId, councilName: .parentElectorateName }] | group_by(.parentElectorateId) | map({shortName: .[0].shortName, councilName: .[0].councilName, wardNames: . | map(.name) }) | sort_by(.shortName)' "VEC Data\wards.json" > council_names.json
'''
## make-council-pages.sh
This is a bash script for creating a page in WordPress for each council. If a page for a council already exists, the page will be updated instead. The source of councils for this script is the "council_names.json" file. The script needs the `jq` and `wp` tools.