zachleat / speedlify

Benchmark the web performance and accessibility of sites over time.
https://www.speedlify.dev/
MIT License
929 stars 167 forks source link

single vertical index? #25

Open aanomm opened 4 years ago

aanomm commented 4 years ago

hello

zachleat commented 4 years ago

Hmm, maybe is there’s only one vertical it can automatically redirect to it?

aanomm commented 4 years ago
smth commented 2 years ago

I did this recently. My approach was to copy the pagination stuff to the home page front matter (index.njk):

maxResults: 1
pagination:
  data: "sites"
  size: 1
  alias: vertical
counts:
  performance: 0
  accessibility: 0
  bestPractices: 0
  seo: 0
  perfect: 0
  total: 0

Then if only one vertical include the categories.njk stuff in index.njk (could probably be extracted into an include)

{% if sites|length > 1 %}
  <!-- existing index.njk templating -->
{% else %}
  <!-- shared categories.njk templating-->
{% endif %}