mirror of
				https://github.com/inventree/inventree-website.git
				synced 2025-10-31 21:45:47 +00:00 
			
		
		
		
	add news
This commit is contained in:
		| @@ -23,6 +23,9 @@ collections: | ||||
|     output: true | ||||
|     custom_permalink_placeholders: ["publisher"] | ||||
|     #permalink: "/:publisher/:title" | ||||
|   news: | ||||
|     output: true | ||||
|     permalink: /news/:year/:month/:day/:title | ||||
|   posts: | ||||
|     permalink: /blog/:year/:month/:day/:title | ||||
|  | ||||
| @@ -42,6 +45,11 @@ defaults: | ||||
|       type: "posts" | ||||
|     values: | ||||
|       layout: "post" | ||||
|   - scope: | ||||
|       path: "" | ||||
|       type: "news" | ||||
|     values: | ||||
|       layout: "news" | ||||
|   - scope: | ||||
|       path: "" | ||||
|     values: | ||||
|   | ||||
| @@ -6,6 +6,8 @@ | ||||
|     site: demo-link | ||||
|   - name: Plugins | ||||
|     internal: plugins.html | ||||
|   - name: News | ||||
|     internal: news.html | ||||
|  | ||||
| - title: Contribute | ||||
|   link: | ||||
|   | ||||
							
								
								
									
										24
									
								
								_layouts/collection_base.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								_layouts/collection_base.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| --- | ||||
| layout: default | ||||
| --- | ||||
|  | ||||
| <header> | ||||
|     {% if page.backLink or page.backLink == nil %} | ||||
|     <a href="{{ layout.base_link | relative_url }}" class="flex items-center m-5 text-xl hover:underline"> | ||||
|         <img class="w-6 h-6" src="{{ '/assets/back.svg' | relative_url }}" /> | ||||
|         <span>Back</span> | ||||
|     </a> | ||||
|     {% endif %} | ||||
| </header> | ||||
|  | ||||
| <article> | ||||
|     <h1>{{ page.title }}</h1> | ||||
|     <p> | ||||
|       {{ page.date | date_to_string }} | ||||
|       {% assign publisher = site.publishers | where: 'short_name', page.publisher | first %} | ||||
|       {% if publisher %} | ||||
|         - <a href="{{ publisher.url | relative_url }}">{{ publisher.name }}</a> | ||||
|       {% endif %} | ||||
|     </p> | ||||
|     {{ content }} | ||||
| </article> | ||||
							
								
								
									
										5
									
								
								_layouts/news.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								_layouts/news.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| --- | ||||
| layout: collection_base | ||||
| base_link: '/news' | ||||
| --- | ||||
| {{ content }} | ||||
| @@ -1,24 +1,5 @@ | ||||
| --- | ||||
| layout: default | ||||
| layout: collection_base | ||||
| base_link: '/blog' | ||||
| --- | ||||
|  | ||||
| <header> | ||||
|     {% if page.backLink or page.backLink == nil %} | ||||
|     <a href="{{ '/blog' | relative_url }}" class="flex items-center m-5 text-xl hover:underline"> | ||||
|         <img class="w-6 h-6" src="{{ '/assets/back.svg' | relative_url }}" /> | ||||
|         <span>Back</span> | ||||
|     </a> | ||||
|     {% endif %} | ||||
| </header> | ||||
|  | ||||
| <article> | ||||
|     <h1>{{ page.title }}</h1> | ||||
|     <p> | ||||
|       {{ page.date | date_to_string }} | ||||
|       {% assign publisher = site.publishers | where: 'short_name', page.publisher | first %} | ||||
|       {% if publisher %} | ||||
|         - <a href="{{ publisher.url | relative_url }}">{{ publisher.name }}</a> | ||||
|       {% endif %} | ||||
|     </p> | ||||
|     {{ content }} | ||||
| </article> | ||||
| {{ content }} | ||||
|   | ||||
							
								
								
									
										7
									
								
								_news/2021-10-25-starting.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								_news/2021-10-25-starting.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| --- | ||||
| publisher: matmair | ||||
| title: Starting with templates | ||||
| --- | ||||
| A good starting-point for developing your own plugin is taking a look at the [documentation](https://inventree.readthedocs.io/en/latest/extend/plugins/). | ||||
|  | ||||
| You could also use one of the current plugins as a sample. | ||||
							
								
								
									
										22
									
								
								news.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								news.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| --- | ||||
| layout: default | ||||
| title: News | ||||
| permalink: /news | ||||
| --- | ||||
|   <section class="cm-gray-2 body-font"> | ||||
|     <div class="pt-3 pb-1 section-container"> | ||||
|       <h1 class="header-text title-font mb-4 cm-gray-2">InvenTree News</h1> | ||||
|       <div class="flex flex-wrap"> | ||||
|  | ||||
|       {% for post in site.news %} | ||||
|         <div class="p-6 md:w-1/2 flex flex-col items-start"> | ||||
|           <h2 class="header-text title-font mb-4 cm-gray-1"> | ||||
|             <a href="{{ post.url | relative_url }}">{{ post.title }}</a> | ||||
|           </h2> | ||||
|           <span class="leading-relaxed mb-4">{{ post.excerpt | strip_html | strip_newlines | truncate: 156  }}</span> | ||||
|           <span>{{ post.date | date_to_string }} | </span> | ||||
|         </div> | ||||
|       {% endfor %} | ||||
|       </div> | ||||
|     </div> | ||||
|   </section> | ||||
		Reference in New Issue
	
	Block a user