From b6d1e8d164c87d1f3c5741f1446688de6b58edb3 Mon Sep 17 00:00:00 2001 From: slowe <299787+slowe@users.noreply.github.com> Date: Wed, 3 Apr 2024 01:27:57 +0100 Subject: [PATCH] Add search page --- src/_includes/css/custom.css | 11 ++ src/_includes/partials/header.njk | 1 + src/search.njk | 107 ++++++++++++++++++ src/themes/economy/covid-grants.njk | 1 + src/themes/economy/house-prices.njk | 2 +- src/themes/economy/unemployment.njk | 1 + src/themes/economy/wages.njk | 1 + src/themes/energy/fuel-poverty.njk | 1 + src/themes/energy/households-off-gas-grid.njk | 1 + src/themes/environment/green-belt/index.njk | 1 + .../environment/storm-overflows/index.njk | 1 + src/themes/health/disability.njk | 1 + src/themes/society/child-poverty.njk | 3 +- src/themes/society/education-attainment.njk | 3 +- src/themes/society/electorate.njk | 3 +- src/themes/society/eu-referendum.njk | 1 + src/themes/society/heritage-at-risk/index.njk | 3 +- src/themes/society/imd.njk | 3 +- src/themes/society/population.njk | 1 + src/themes/society/school-allocations.njk | 1 + src/themes/society/sexuality.njk | 1 + src/themes/transport/active-travel.njk | 3 +- src/themes/transport/bus-service-changes.njk | 3 +- .../transport/distance-travelled-to-work.njk | 1 + src/themes/transport/ev-charging-points.njk | 5 +- .../transport/road-traffic-accidents.njk | 1 + 26 files changed, 150 insertions(+), 11 deletions(-) create mode 100644 src/search.njk diff --git a/src/_includes/css/custom.css b/src/_includes/css/custom.css index fa23a2c..39d6014 100644 --- a/src/_includes/css/custom.css +++ b/src/_includes/css/custom.css @@ -60,6 +60,17 @@ input[type="range"].oi-slider-control:focus::-moz-range-thumb{ outline: 4px soli .credit svg { position:relative;top:2px; } .embed { display: block; text-align: center; font-size:0.8em; color: #555; margin-bottom: 1rem; } +#filter { position: relative; } +#filter label { position: absolute; line-height:0; left: 0.5em; top: 50%; transform: translate3d(0,-50%,0); } +#filter input[type=text] { padding-left: 1.75em; width: 100%; font-size: 1rem; line-height: 2rem; } +#pages { list-style: none; margin: 0; margin-top: 2em; } +#pages li { margin-bottom: 1rem; } +#pages li:last-child { margin-bottom: 0; } +#pages li a { display: block; text-decoration: none; padding: 1rem; } +#pages li a:focus, #pages li a:hover { background: black; color: white; } +#pages li a svg { margin-right:0.5rem; } +#pages li .page-title { font-size: 1.2em; font-weight: bold; font-family: Poppins; line-height: 1rem; } +#pages li .page-title { margin-bottom: 0.5rem; } @media only screen and (max-width: 1080px) { .grid-list { grid-template-columns: repeat(2,1fr); grid-gap: 0.25em; } diff --git a/src/_includes/partials/header.njk b/src/_includes/partials/header.njk index b623069..12911a9 100644 --- a/src/_includes/partials/header.njk +++ b/src/_includes/partials/header.njk @@ -10,6 +10,7 @@
The government states that the "fundamental aim" of the green belt "is to prevent urban sprawl by keeping land permanently open" around urban areas. England had around 16,384 km² (or 6,326 square miles) of green belt land at the end of March 2023, covering 12.6% of England's land area. The green belt is clustered around 15 urban cores; the largest are London (5,085 km²), Merseyside and Greater Manchester (2,477 km²) and South and West Yorkshire (including Sheffield, Leeds and Bradford, 2,465 km²).
diff --git a/src/themes/environment/storm-overflows/index.njk b/src/themes/environment/storm-overflows/index.njk index da364a9..dbf6cda 100644 --- a/src/themes/environment/storm-overflows/index.njk +++ b/src/themes/environment/storm-overflows/index.njk @@ -5,6 +5,7 @@ created: 2023-08-22T17:44 updated: 2024-03-27T19:05 description: | Constituency-level data on sewage overflows. +keywords: [water,storm,overflow,spill,sewage] ---The Water and Sewerage Companies provide data to the Environment Agency each year as part of their regulatory Annual Return, to fulfil their permitted conditions to discharge from these storm overflows under the Environmental Permitting Regulations. We took the OS Grid Reference for every storm overflow event reported in the Environment Agency's Event Duration Monitoring datasets (2022 and 2023) and found the corresponding Parliamentary constituency to create the visualisations for total number of spills and total duration in hours.
diff --git a/src/themes/health/disability.njk b/src/themes/health/disability.njk index b1892ab..4e29b70 100644 --- a/src/themes/health/disability.njk +++ b/src/themes/health/disability.njk @@ -5,6 +5,7 @@ created: 2023-08-16T15:37 updated: 2023-08-16T15:37 description: | Disability as measured in the 2021 census at constituency-level (England & Wales). +keywords: [disability,health,covid] config: ref: width: 600 diff --git a/src/themes/society/child-poverty.njk b/src/themes/society/child-poverty.njk index b702d9d..d38ea6a 100644 --- a/src/themes/society/child-poverty.njk +++ b/src/themes/society/child-poverty.njk @@ -4,7 +4,8 @@ theme: society created: 2023-08-24T15:59 updated: 2023-08-24T15:59 description: | - Child poverty by constituency (UK). + Constituency-level data on child poverty in the UK (2021/2). +keywords: [relative,absolute,poverty,children,HMRC,inequality] ---This page provides constituency-level data on child poverty in the UK (2021/2). Use the slider to switch between relative and absolute poverty.
diff --git a/src/themes/society/education-attainment.njk b/src/themes/society/education-attainment.njk index d65440a..557de74 100644 --- a/src/themes/society/education-attainment.njk +++ b/src/themes/society/education-attainment.njk @@ -4,7 +4,8 @@ theme: society created: 2023-10-24T18:40 updated: 2023-10-24T18:40 description: | - Education attainment by constituency (England). + Educational attainment in state-funded schools in England. There are breakdowns of GCSE A*-C, KS4 Attainment 8 and KS2 Attainment. +keywords: [education,attainment,schools,GCSE,KS4,KS2,english,maths,standard] ---This page provides constituency-level data on educational attainment in state-funded schools in England. There are breakdowns of GCSE A*-C, KS4 Attainment 8 and KS2 Attainment.
diff --git a/src/themes/society/electorate.njk b/src/themes/society/electorate.njk index 42d51e7..0e5e3ab 100644 --- a/src/themes/society/electorate.njk +++ b/src/themes/society/electorate.njk @@ -4,7 +4,8 @@ theme: society created: 2023-08-16T20:06 updated: 2023-08-16T20:06 description: | - Electorate by constituency (UK). + Electorate by constituency (UK) for both the new and existing constituencies +keywords: [electorate,people] ---Historic England's Heritage at Risk (HAR) programme helps to understand the overall state of England's historic sites. It identifies those sites that are most at risk of being lost as a result of neglect, decay or inappropriate development. We've taken the 2023 version of Historic England's Heritage at Risk register and summed up all entries by constituency. We have views for all entries, archaeology, building or structure, conservation area, and place of worship.
diff --git a/src/themes/society/imd.njk b/src/themes/society/imd.njk index ff999c4..b47b988 100644 --- a/src/themes/society/imd.njk +++ b/src/themes/society/imd.njk @@ -3,7 +3,8 @@ title: Indicies of Multiple Deprivation (UK) theme: society created: 2023-10-24T10:15 description: | - Composite IMD scores by MySociety (UK). + Composite indices of multiple-deprivation scores by MySociety (UK). +keywords: [IMD] ---This page provides constituency-level data on composite IMD scores (2020). See the notes below.
diff --git a/src/themes/society/population.njk b/src/themes/society/population.njk index f5dd9c9..7d44c2c 100644 --- a/src/themes/society/population.njk +++ b/src/themes/society/population.njk @@ -5,6 +5,7 @@ created: 2023-09-13T13:32 updated: 2023-09-13T13:32 description: | Population by constituency (UK). +keywords: [population,people,age,breakdown] --- diff --git a/src/themes/society/school-allocations.njk b/src/themes/society/school-allocations.njk index 4cc4d4a..02eaf15 100644 --- a/src/themes/society/school-allocations.njk +++ b/src/themes/society/school-allocations.njk @@ -5,6 +5,7 @@ created: 2023-10-24T17:10 updated: 2023-10-24T17:10 description: | School funding by constituency (England). +keywords: [school,funding,allocations,per pupil] ---This page provides constituency-level data on school funding for mainstream state-funded schools in England. Use the slider to change years.
diff --git a/src/themes/society/sexuality.njk b/src/themes/society/sexuality.njk index eda4160..81c197a 100644 --- a/src/themes/society/sexuality.njk +++ b/src/themes/society/sexuality.njk @@ -5,6 +5,7 @@ created: 2023-10-10T21:00 updated: 2023-10-10T21:00 description: | This dataset provides Census 2021 estimates that classify usual residents aged 16 years and over in England and Wales by sexual orientation. The estimates are as at Census Day, 21 March 2021. +keywords: [straight,heterosexual,gay,lesbian,bisexual,sexual,orientations] ---This dataset provides Census 2021 estimates that classify usual residents aged 16 years and over in England and Wales by sexual orientation. The estimates are as at Census Day, 21 March 2021.
diff --git a/src/themes/transport/active-travel.njk b/src/themes/transport/active-travel.njk index 3571bfa..00da670 100644 --- a/src/themes/transport/active-travel.njk +++ b/src/themes/transport/active-travel.njk @@ -4,7 +4,8 @@ theme: transport created: 2023-09-13T18:51 updated: 2023-09-13T18:51 description: | - Walking and cycling (England). + Walking and cycling (England) based on the National Travel Survey and Active Lives Survey. +keywords: [walking,cycling,active,travel,cycle,adults] ---Data and statistics about walking and cycling, based on the National Travel Survey and Active Lives Survey.
diff --git a/src/themes/transport/bus-service-changes.njk b/src/themes/transport/bus-service-changes.njk index 1c1c409..6ede1aa 100644 --- a/src/themes/transport/bus-service-changes.njk +++ b/src/themes/transport/bus-service-changes.njk @@ -4,7 +4,8 @@ theme: transport created: 2023-11-29T21:45 updated: 2023-11-29T21:45 description: | - This dataset shows how bus services have changed from 2010 to 2023. + This dataset was created by Friends of the Earth and the University of Leeds and shows how bus services have changed from 2010 to 2023. +keywords: [bus,services,public,GTFS,transit] ---This dataset was created by Friends of the Earth and the University of Leeds and involved a huge and complex analysis of all available local and national timetable data in England and Wales from 2010 to 2023. It has shown that while London has had an almost constant level of bus provision, many other parts of the country have seen declines of more than two-thirds. Read the full report from Friends of the Earth. The data are presented for the new constituencies that will be used for the expected general election in 2024.
diff --git a/src/themes/transport/distance-travelled-to-work.njk b/src/themes/transport/distance-travelled-to-work.njk index f7a3164..5ad011b 100644 --- a/src/themes/transport/distance-travelled-to-work.njk +++ b/src/themes/transport/distance-travelled-to-work.njk @@ -5,6 +5,7 @@ created: 2023-10-10T20:58 updated: 2023-10-10T20:58 description: | This dataset provides Census 2021 estimates that classify usual residents aged 16 years and over in employment the week before the census in England and Wales by the distance they travelled to work. +keywords: [distance,work,employment,km] ---This dataset provides Census 2021 estimates that classify usual residents aged 16 years and over in employment the week before the census in England and Wales by the distance they travelled to work. The estimates are as at Census Day, 21 March 2021. This visualisation only shows those who travel to work. It does not include those who work at home, in no fixed place, outside the UK, or on an offshore installation.
diff --git a/src/themes/transport/ev-charging-points.njk b/src/themes/transport/ev-charging-points.njk index 749f1bf..336e26a 100644 --- a/src/themes/transport/ev-charging-points.njk +++ b/src/themes/transport/ev-charging-points.njk @@ -5,14 +5,13 @@ created: 2023-08-31T16:40 updated: 2023-08-31T16:40 description: | Electric vehicle charging points by constituency (UK). +keywords: [EV,home,workplace,public,National Chargepoint Registry,sockets,charging,emissions,OZEV] ---This page aims to present data on electric vehicle (EV) charging for home, workplace, public (ONS/ZapMap and National Chargepoint Registry), and combined charging sockets/devices/connections.
- To present an idea of the full picture we combine the number of home, workplace, public charging sockets/devices/connections (see notes below).
- +To present an idea of the full picture we combine the number of home, workplace, public charging sockets/devices/connections (see notes below).
{% comp 'wrapper', { "component": comp.oi.map.hex_cartogram, diff --git a/src/themes/transport/road-traffic-accidents.njk b/src/themes/transport/road-traffic-accidents.njk index 6fd87d5..de3b05e 100644 --- a/src/themes/transport/road-traffic-accidents.njk +++ b/src/themes/transport/road-traffic-accidents.njk @@ -5,6 +5,7 @@ created: 2023-08-15T17:52 updated: 2023-08-15T17:52 description: | Constituency-level data on road accidents in England, Scotland and Wales. +keywords: [accident,fatal,serious,police,car] config: all: width: 600