mirror of
				https://github.com/fooflington/selfdefined.git
				synced 2025-10-31 06:08:33 +00:00 
			
		
		
		
	feat(eleventy): split table of content into sub sections
This commit is contained in:
		
							
								
								
									
										19
									
								
								11ty/_includes/components/table-of-content-item.njk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								11ty/_includes/components/table-of-content-item.njk
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| {% set renderedName %} | ||||
|   {{ definition.data.title}} | ||||
|   {%- if | ||||
|     definition.data.flag and | ||||
|     definition.data.flag.type and | ||||
|     (definition.data.flag.level == 'avoid') -%} | ||||
|     <span class="flag__red">{{ definition.data.flag.type }}</span> | ||||
|   {% endif %} | ||||
| {% endset %} | ||||
| <li> | ||||
|   {%- if definition.data.defined -%} | ||||
|     <a | ||||
|       href={{ definition.data.slug | linkTarget | url }} | ||||
|       class="word__link" | ||||
|     >{{ renderedName | safe }}</a> | ||||
|   {%- else -%} | ||||
|     {{ renderedName | safe }} | ||||
|   {% endif %} | ||||
| </li> | ||||
| @@ -1,27 +1,16 @@ | ||||
| <section> | ||||
|   <nav class="auto-grid list" aria-label="Definitions"> | ||||
|     <ul> | ||||
|       {% for definition in collections.definitions %} | ||||
|         {% set renderedName %} | ||||
|           {{ definition.data.title}} | ||||
|           {%- if | ||||
|             definition.data.flag and | ||||
|             definition.data.flag.type and | ||||
|             (definition.data.flag.level == 'avoid') -%} | ||||
|             <span class="flag__red">{{ definition.data.flag.type }}</span> | ||||
|           {% endif %} | ||||
|         {% endset %} | ||||
|         <li> | ||||
|           {%- if definition.data.defined -%} | ||||
|             <a | ||||
|               href={{ definition.data.slug | linkTarget | url }} | ||||
|               class="word__link" | ||||
|             >{{ renderedName | safe }}</a> | ||||
|           {%- else -%} | ||||
|             {{ renderedName | safe }} | ||||
|           {% endif %} | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   <nav class="" aria-label="Definitions"> | ||||
|     <ol class="auto-grid list"> | ||||
|     {% for section in collections.definitions %} | ||||
|       <li> | ||||
|         <span class="sub-headline">{{ section.title }}</span> | ||||
|         <ol> | ||||
|           {% for definition in section.definitions %} | ||||
|             {% include 'components/table-of-content-item.njk' %} | ||||
|           {% endfor %} | ||||
|         </ol> | ||||
|       </li> | ||||
|     {% endfor %} | ||||
|     </ol> | ||||
|   </nav> | ||||
| </section> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Oscar
					Oscar