diff --git a/candidates/greater-geelong.csv b/candidates/greater-geelong.csv deleted file mode 100644 index 4fddad0..0000000 --- a/candidates/greater-geelong.csv +++ /dev/null @@ -1,3 +0,0 @@ -Council,Ward,Candidate Name,Rating -Brimbank,Harvester,Joe Blogs,1 -Brimbank,Harvester,Jane Doe,5 \ No newline at end of file diff --git a/candidates/brimbank.csv b/data/brimbank/candidates.csv similarity index 100% rename from candidates/brimbank.csv rename to data/brimbank/candidates.csv diff --git a/data/greater-geelong/candidates.csv b/data/greater-geelong/candidates.csv new file mode 100644 index 0000000..fa03db0 --- /dev/null +++ b/data/greater-geelong/candidates.csv @@ -0,0 +1,3 @@ +Council,Ward,Candidate Name,Rating +Greater Geelong,Kardinia,Joe Blogs,1 +Greater Geelong,You Yangs,Jane Doe,5 \ No newline at end of file diff --git a/make-council-pages.sh b/make-council-pages.sh index 6589098..c4ca632 100644 --- a/make-council-pages.sh +++ b/make-council-pages.sh @@ -10,6 +10,10 @@ # The "wardNames" field must be a list of strings. COUNCILS_FILE="council_names.json" +# The folder containing data for each council. +# Includes the list of candidates and any media. +DATA_PATH="data" + # Controls the flags that are passed to every usage of the wp command. WP_FLAGS="--allow-root --path=/var/www/html" @@ -21,7 +25,7 @@ function create_or_update_page() { slug=$(echo "$council_block" | jq -r '.slug') - content=$(echo "$council_block" | jq -c | php php-template/main.php --council-file "php://stdin" --candidates-file "candidates/$slug.csv") + content=$(echo "$council_block" | jq -c | php php-template/main.php --council-file "php://stdin" --candidates-file "$DATA_PATH/$slug/candidates.csv) if [ $? -eq 0 ]; then