rdatools / rdabase

Redistricting analytics data & shared code
MIT License
0 stars 0 forks source link

Add a one-liner on the state page #67

Open alecramsay opened 4 hours ago

alecramsay commented 4 hours ago

With the name, # of counties, # of districts for the type of plan, and total population with commas.

{% assign state = site.data.states | where:"xx", xx | first %}
{% assign plan-lower = plan-type | downcase %}

<p>{{ state["name"] }} has {{ state["counties"] counties }}, TBD {{ plan-lower }} state house districts, and a total population of {{ state["population"] }}. </p>
alecramsay commented 4 hours ago

Helpful snippets from pg

{% assign label-lower = label | downcase %}
...
{% assign state = site.data.states | where:"xx", xx | first %}
...
{% capture map-link %}
https://davesredistricting.org/join/{{ state[label-lower] }}
{% endcapture %}