Skip to content

Commit

Permalink
Improve build speed for large sites by avoiding a document find on ev…
Browse files Browse the repository at this point in the history
…ery page (breaking change for those styling custom pages with body classes)
  • Loading branch information
quincylvania committed Jul 22, 2024
1 parent 9d98cab commit 6e51039
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions _includes/body_classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
{%- assign componenturl = '/' -%}
{%- for part in path_parts -%}
{%- assign componenturl = componenturl | append: part | append: '/' -%}
{%- assign componentpage = site.documents | find: 'url', componenturl -%}
{%- if componentpage and componentpage.title %}
page-{{ componentpage.title | slugify }}
{% endif -%}
{%- endfor %}
ispage-{{ page.title | slugify }}
page-{{ componenturl | slugify }}
{% endfor %}
ispage-{{ page.url | slugify }}

0 comments on commit 6e51039

Please sign in to comment.