diff --git a/_config.yml b/_config.yml index 6cdea89d..d50ff38f 100644 --- a/_config.yml +++ b/_config.yml @@ -12,6 +12,35 @@ description: >- baseurl: "/home.invenhost.com" url: "" +collections: + publishers: + output: true + permalink: "/:title" + plugins: + output: true + custom_permalink_placeholders: ["publisher"] + #permalink: "/:publisher/:title" + +defaults: + - scope: + path: "" + type: "publishers" + values: + layout: "publisher" + - scope: + path: "" + type: "plugins" + values: + layout: "plugin" + - scope: + path: "" + type: "posts" + values: + layout: "post" + - scope: + path: "" + values: + layout: "default" plugins: - jekyll-seo-tag diff --git a/_data/general/footer.yml b/_data/general/footer.yml index f187cc1f..d057460f 100644 --- a/_data/general/footer.yml +++ b/_data/general/footer.yml @@ -49,3 +49,5 @@ internal: education - name: About internal: about + - name: Blog + internal: blog diff --git a/_includes/plugin_card.html b/_includes/plugin_card.html new file mode 100644 index 00000000..c67538a8 --- /dev/null +++ b/_includes/plugin_card.html @@ -0,0 +1,20 @@ +
+
+
+ {% for cat in plugin.categories %} + {{ cat }} + {% endfor %} + {% for tag in plugin.tags %} + {{ tag }} + {% endfor %} +
+

{{ plugin.name }}

+
+ {% if plugin.published_on %}{{ plugin.published_on | date_to_string }} - {% endif %} + {% include publisher_ref.html pub=plugin.publisher %} +
+

{{ plugin.excerpt | mardownify | remove: '

' | remove: '

' }}

+ +
+
+ \ No newline at end of file diff --git a/_includes/publisher_ref.html b/_includes/publisher_ref.html new file mode 100644 index 00000000..f173c4e7 --- /dev/null +++ b/_includes/publisher_ref.html @@ -0,0 +1,4 @@ +{% assign publisher_ref = site.publishers | where: 'short_name', include.pub | first %} + +

by mdo {{ include.pub }}

+
\ No newline at end of file diff --git a/_layouts/plugin.html b/_layouts/plugin.html new file mode 100644 index 00000000..22860d26 --- /dev/null +++ b/_layouts/plugin.html @@ -0,0 +1,47 @@ +--- +layout: default +--- +

{{ page.name }}

+{% include publisher_ref.html pub=page.publisher %} + +
+
+ {{ content }} +
+ +
+
+ +
+

Github

+

{{ page.github | remove: "https://github.com/" }}

+ +
+ +
+

Categories

+
    + {% for categorie in page.categories %} +
  1. {{ categorie }}
  2. + {% endfor %} +
+
+ +
+

Tags

+
    + {% for tag in page.tags %} +
  1. {{ tag }}
  2. + {% endfor %} +
+
+ +
+

Website

+

{{ page.website }}

+ +
+ +
+
+
diff --git a/_layouts/post.html b/_layouts/post.html index 049a7417..7de4f444 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -16,5 +16,13 @@ layout: default
+

{{ 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/publisher.html b/_layouts/publisher.html new file mode 100644 index 00000000..8c8e41b6 --- /dev/null +++ b/_layouts/publisher.html @@ -0,0 +1,42 @@ +--- +layout: default +--- +

+ mdo + {{ page.name }} +

+ +
+{% if page.github %} +GitHub +{% endif %} + +{% if page.website %} +Official Website +{% endif %} +
+ +
+

{{ content }}

+
+ +{% assign filtered_posts = site.posts | where: 'publisher', page.short_name %} +{% if filtered_posts and filtered_posts.size != 0 %} +

Posts

+ +{% endif %} + +{% assign filtered_plugins = site.plugins | where: 'publisher', page.short_name %} +{% if filtered_plugins and filtered_plugins.size != 0 %} +

Plugins

+ +{% endif %} \ No newline at end of file diff --git a/_plugins/shopify.md b/_plugins/shopify.md new file mode 100644 index 00000000..0d395825 --- /dev/null +++ b/_plugins/shopify.md @@ -0,0 +1,41 @@ +--- +name: ShopifyIntegrationPlugin org +publisher: matmair +website: https://mjmair.com +github: https://github.com/matmair/ShopifyIntegrationPlugin +categories: + - Integration + - Webhook +tags: + - Shopify + - Orders +--- +A simple Integration into Shopify. + +Let your orders from Shopify be created in autopilot, update your Inventory-Levels from InvenTree and vice-versa. + +## Installation + +1. Navigate to your InvenTree directory and cd into `src/InvenTree/plugins` and execute `git submodule add https://github.com/matmair/ShopifyIntegrationPlugin` there. Enable plugins in the general plugin settings and reload InvenTree. +2. Add a private app to your Shopify store (please register as a dev and use a development store. This is a PoC) +3. Go to the InvenTree settings and fill in the settings for the ShopifyIntegrationPlugin from your new private app. +4. Check out the new navigation tab. + +## Caveat + +Your instance must be reachable for webhooks from Shopify so use ngrok or something like that to expose your instance with HTTPS. + +## State of the code + +This code is bad. It is neither optimized nor is it CI/Cd ready or covered in any way. +I use this Plugin as a PoC to show what will be possible with the new system. + +## Contribute + +The whole plugin system is currently not even in the dev branch. +Feel free to submit issues or just send me a mail to dev AT mjmair.com + + +## No open source? + +Currently I have defined no license so forking is a bad idea copyright-wise. This code should not be used as basis for anything - I will define a license once the plugin system gets released. diff --git a/_posts/2021-10-25-starting.md b/_posts/2021-10-25-starting.md new file mode 100644 index 00000000..f7f4e7d0 --- /dev/null +++ b/_posts/2021-10-25-starting.md @@ -0,0 +1,8 @@ +--- +layout: post +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/_publishers/matmair.md b/_publishers/matmair.md new file mode 100644 index 00000000..dec41a60 --- /dev/null +++ b/_publishers/matmair.md @@ -0,0 +1,7 @@ +--- +short_name: matmair +name: Matthias Mair +github: matmair +website: https:\\mjmair.com +--- +I try to build an ecosystem of reusable plugins and integrations for InvenTree. Code once and KISS! diff --git a/_publishers/schrodingersgat.md b/_publishers/schrodingersgat.md new file mode 100644 index 00000000..d104c21e --- /dev/null +++ b/_publishers/schrodingersgat.md @@ -0,0 +1,7 @@ +--- +short_name: schrodingersgat +name: Oliver +github: SchrodingersGat +website: https:\\inventree.readthedocs.com +--- +Maintainer of InvenTree. diff --git a/blog.html b/blog.html new file mode 100644 index 00000000..3cee36e3 --- /dev/null +++ b/blog.html @@ -0,0 +1,14 @@ +--- +layout: default +title: Blog +--- +

Latest Posts

+ + \ No newline at end of file diff --git a/plugins.html b/plugins.html new file mode 100644 index 00000000..ca56ff1a --- /dev/null +++ b/plugins.html @@ -0,0 +1,44 @@ +--- +layout: default +title: Plugins +--- + + + {% for post in site.posts limit:1 %} +
+
+

{{post.title}}

+

{{post.excerpt}}

+

Continue reading...

+
+
+ {% endfor %} + +
+
+ {% for plugin in site.plugins %} + {% include plugin_card.html plugin=plugin %} + {% endfor %} +
+ +
+
+ +
+

About

+

This repo is a sample plugin repo for @InvenTree created by @matmair

+ +
+ +
+

More InvenTree

+
    +
  1. GitHub
  2. +
  3. Docs
  4. +
  5. Python interface
  6. +
  7. Demo instance feel free to register and play around!
  8. +
+
+
+
+
diff --git a/publishers.html b/publishers.html new file mode 100644 index 00000000..5a207ac6 --- /dev/null +++ b/publishers.html @@ -0,0 +1,15 @@ +--- +layout: default +title: Publishers +--- +

Publishers

+ + \ No newline at end of file