diff --git a/_config.yml b/_config.yml index 0574c345..9ec488dd 100644 --- a/_config.yml +++ b/_config.yml @@ -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: diff --git a/_data/general/footer.yml b/_data/general/footer.yml index eb05fcee..aa1afa70 100644 --- a/_data/general/footer.yml +++ b/_data/general/footer.yml @@ -6,6 +6,8 @@ site: demo-link - name: Plugins internal: plugins.html + - name: News + internal: news.html - title: Contribute link: diff --git a/_layouts/collection_base.html b/_layouts/collection_base.html new file mode 100644 index 00000000..82ca2e8d --- /dev/null +++ b/_layouts/collection_base.html @@ -0,0 +1,24 @@ +--- +layout: default +--- + +
+ {% if page.backLink or page.backLink == nil %} + + + Back + + {% endif %} +
+ +
+

{{ page.title }}

+

+ {{ page.date | date_to_string }} + {% assign publisher = site.publishers | where: 'short_name', page.publisher | first %} + {% if publisher %} + - {{ publisher.name }} + {% endif %} +

+ {{ content }} +
\ No newline at end of file diff --git a/_layouts/news.html b/_layouts/news.html new file mode 100644 index 00000000..31d8afae --- /dev/null +++ b/_layouts/news.html @@ -0,0 +1,5 @@ +--- +layout: collection_base +base_link: '/news' +--- +{{ content }} diff --git a/_layouts/post.html b/_layouts/post.html index cca97078..6da5956c 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,24 +1,5 @@ --- -layout: default +layout: collection_base +base_link: '/blog' --- - -
- {% if page.backLink or page.backLink == nil %} - - - Back - - {% endif %} -
- -
-

{{ page.title }}

-

- {{ page.date | date_to_string }} - {% assign publisher = site.publishers | where: 'short_name', page.publisher | first %} - {% if publisher %} - - {{ publisher.name }} - {% endif %} -

- {{ content }} -
\ No newline at end of file +{{ content }} diff --git a/_news/2021-10-25-starting.md b/_news/2021-10-25-starting.md new file mode 100644 index 00000000..650e2b27 --- /dev/null +++ b/_news/2021-10-25-starting.md @@ -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. \ No newline at end of file diff --git a/news.html b/news.html new file mode 100644 index 00000000..3e5ca7f4 --- /dev/null +++ b/news.html @@ -0,0 +1,22 @@ +--- +layout: default +title: News +permalink: /news +--- +
+
+

InvenTree News

+
+ + {% for post in site.news %} +
+

+ {{ post.title }} +

+ {{ post.excerpt | strip_html | strip_newlines | truncate: 156 }} + {{ post.date | date_to_string }} | +
+ {% endfor %} +
+
+