Skip to content

Commit

Permalink
Add party to candidate pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tewson committed Apr 9, 2024
1 parent 42a5821 commit 468187d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/candidates/[candidate].astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export async function getStaticPaths() {
return candidates.map((candidateRecord) => {
const candidateFullName = getStringFieldValue(candidateRecord, "Full name");
const candidatePartyName = getLookupFieldValue(
candidateRecord,
"Party name"
);
const candidateAreaName = getLookupFieldValue(candidateRecord, "Area name");
const candidateAreaLocalAuthorityName = getLookupFieldValue(
candidateRecord,
Expand Down Expand Up @@ -78,6 +82,7 @@ export async function getStaticPaths() {
},
props: {
candidateFullName,
candidatePartyName,
candidateAreaName,
candidateAreaLocalAuthorityName,
candidateProfilePictureUrl,
Expand All @@ -90,6 +95,7 @@ export async function getStaticPaths() {
const {
candidateFullName,
candidatePartyName,
candidateAreaName,
candidateAreaLocalAuthorityName,
candidateProfilePictureUrl,
Expand All @@ -109,7 +115,7 @@ const {
</div>
<HeaderTitle>{candidateFullName}</HeaderTitle>
<HeaderSubtitle>
Candidate for
{candidatePartyName} candidate for
<Link
to={`areas/${lodash.kebabCase(candidateAreaLocalAuthorityName)}/${lodash.kebabCase(candidateAreaName)}`}
>
Expand Down

0 comments on commit 468187d

Please sign in to comment.