Skip to content

Commit

Permalink
Add li option
Browse files Browse the repository at this point in the history
  • Loading branch information
moisseev committed Apr 11, 2024
1 parent 28baa82 commit dba6178
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions _includes/directory-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@

Parameters that can be passed as include or Front Matter directory-tree hash:

li The generated tree is a list item. Do not wrap an <ul> tag around it.

dir_class Add a class attribute with the specified classes to <li> tags of all directories.
If not set, wrap a <strong> tag around titles of all directories.

strong Wrap a <strong> tag around titles of the pages that have `strong: true` in the Front Matter.
Default: false.
{%- endcomment -%}
<ul>
{%- unless include.li or page.directory-tree.li %}<ul>{%- endunless %}
{%- if include.dir_class -%}
{%- assign dir_li = '<li class="' | append: include.dir_class | append: '">' -%}
{%- else -%}
Expand Down Expand Up @@ -111,4 +113,4 @@
</ul>
</li>
{%- endfor %}
</ul>
{% unless include.li or page.directory-tree.li -%}</ul>{%- endunless %}
1 change: 1 addition & 0 deletions _layouts/doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@

{% include directory-tree.html
dir="/doc/modules"
li=true
strong=true
dir_class="r-docs-subnav list-group-item" %}

Expand Down

0 comments on commit dba6178

Please sign in to comment.