mirror of
				https://github.com/fooflington/selfdefined.git
				synced 2025-10-30 21:58:32 +00:00 
			
		
		
		
	feat(11ty): move table of content in partial file
This commit is contained in:
		
							
								
								
									
										24
									
								
								11ty/_includes/components/table-of-content.njk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								11ty/_includes/components/table-of-content.njk
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | |||||||
|  | <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.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> | ||||||
|  | </section> | ||||||
| @@ -21,31 +21,7 @@ | |||||||
|   <body> |   <body> | ||||||
|     <main> |     <main> | ||||||
|       {{ content | safe }} |       {{ content | safe }} | ||||||
|       <section> |       {% include 'components/table-of-content.njk' %} | ||||||
|         <h2>Table of Content</h2> |  | ||||||
|         <div class="auto-grid list"> |  | ||||||
|           <ul> |  | ||||||
|             {% for definition in collections.definitions %} |  | ||||||
|               {% set renderedName %} |  | ||||||
|                 {{ definition.data.title}} |  | ||||||
|                 {%- if definition.data.flag 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> |  | ||||||
|         </div> |  | ||||||
|       </section> |  | ||||||
|       <section> |       <section> | ||||||
|         <h2>Words</h2> |         <h2>Words</h2> | ||||||
|         {% include 'components/defintions-list.njk' %} |         {% include 'components/defintions-list.njk' %} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Oscar
					Oscar