Skip to content

Commit

Permalink
Use dir name if index page or title is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
moisseev committed Apr 25, 2024
1 parent 5e555a4 commit 6e0a7bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions _includes/directory-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@
{%- assign dir_index_page = dir_pages | where: "name", "index.md" | first -%}
{%- unless dir_index_page -%}
{%- assign dir_index_page = dir_pages | where: "name", "index.html" | first -%}
{%- endunless %}
<a href="{{ site.baseurl }}{{ pg.dir }}">{{ dir_strong }}{{ dir_index_page.title }}{{ dir_strong_closing }}</a>
{%- endunless -%}
{%- if dir_index_page %}
<a href="{{ site.baseurl }}{{ pg.dir }}">{{ dir_strong }}{{ dir_index_page.title | default: dir }}{{ dir_strong_closing }}</a>
{%- else %}
{{ dir_strong }}{{ dir }}{{ dir_strong_closing }}
{%- endif -%}
{%- else %}
{{ dir_strong }}{{ dir }}{{ dir_strong_closing }}
{%- endif %}
Expand Down

0 comments on commit 6e0a7bf

Please sign in to comment.