Guide: Obsidian plug-in for exporting notes to Strapi
Posted on April 4, 2024 - by Andy Cinquin
Obsidian pluginStrapiExport notesStep-by-step configurationObsidianAPI StrapiOpenAIContent export
Obsidian Plugin for exporting a note to Strapi
In this article, we'll take a step-by-step look at how to use my Obsidian Plugin in Strapi.
The elements required are :
- An item you want to publish, written in your Obsidian Vault
- An API online, and available.
- Remote access from the Internet to your API possible (local access won't work!).
- An OpenAI key.
Tuto
When I create this article, I'm going to go through the configuration of this plugin with you. First step, install the plugin:🚀 Strapi Exporter: Supercharge Your Obsidian-to-Strapi Workflow, export an obsidian notes directly to your Strapi API
Go to release
Download main.js & manifest.js, the latest version available.
Then go to the root of our Obsidian (for me it's
C:\Users\andyq\Obsidian
)Go to .obsidian
Then into plugins
And create a new folder
"notes-to-strapi-export-article-ai
".Then we open our Vault Obsidian and go through the parameters.
We activate the plugin, then move on to the configuration section.
Configuration
Let's move on to configuration
Strapi API Token
We'll start with the Strapi token.Go to the Strapi API. In settings, API Token, and create a token
Simple
Full access, so you don't have to worry about rights.
Advanced (optional)
With the rights strictly necessary to create an article, it is also necessary to have image upload rights.
We take the generated Obsidian token, and put it in our config:
Open AI Settings
OpenAI PlatformWe'll look for a secret in the OpenAI config.
Create our secret here,
Set our key here
Additional prompt
Complete with an additional prompt if necessary, to specify additional information. Here, we're free to give ChatGPT additional information to get better results. For example, in my configuration I put this :
If present, the locale needs to be 'fr' and the content in French, and generate at least 8 tags if present in the schema too. If present, the rank needs to be 999. Meta Description: Write an attractive meta description including the main keyword, which encourages clicking on the article from the search results. Optimization for Readers and Search Engines: Write content that is not only optimized for search engines but also engaging and informative for readers. The content must answer their questions or solve a problem.
Strapi settings - call 1
Strapi URL ( call 1 )
We're now going to configure the first call (the one that will create our articles, for example).
To do this, go to documentation, then Open Documentation
We retrieve the general URL of our Strapi, which for me is:And we replace the local address displayed by the remote address, which for me is: https:
//api.andy-cinquin.fr
Json template config
And we retrieve from our swagger on the Strapi side, the data schema we need to send. We delete the links to other cascading tables (sorry! it's not yet implemented!) And we delete the "content" part (the part that will correspond to the main content of your article / realization ), as well as the images for the moment.
This gives me :
{ "data": { "title": "string", "seo_title": "string", "seo_description": "string", "slug": "string", "excerpt": "string", "links": [ { "id": "number", "label": "string", "url": "string" } ], "subtitle": "string", "type": "string", "rank": "number", "tags": [ { "id": "number", "name": "string" } ], "locale": "string" } }
Json template config description
Next, we'll configure the rest of our plugin with the "description" section. We use the same template, but describe what our data should look like, giving details and indications. In natural language (managed by an LLM, incredible isn't it?)
{ "data": { "title": "Title of the item, as a short string", "seo_title": "SEO optimized title, as a short string", "seo_description": "SEO optimized description, as a short string", "slug": "URL-friendly string derived from the title", "excerpt": "A short preview or snippet from the content", "links": "Array of related links with ID, label, and URL", "subtitle": "Subtitle or secondary title, as a short string", "type": "Category or type of the item, as a short string", "rank": "Numerical ranking or order priority, as a number", "tags": "Array of associated tags with ID and name", "locale": "Locale or language code, as a short string" } }
It looks like this to me!
Strapi create url
This is the complete url to the creation of an article or realization, for me it's https
://api.andy-cinquin.fr/api/articles
Strapi content attribute name call
For me, the main content of my article is found here, I just indicate the name of this field here (I do this to save tokens in API calls to OpenAI!).
Optional (image)
If you have an image, for example a background, or an illustration to add to your API at the same time, and you want to do everything at once, this is a good method.
To be able to use it, you need to have a folder in your Obsidian called "image"The architecture should look like this to be able to use a single image
Optional (gallery)
Same system as for images, but with "gallery".
Configuration call 2 ( optional )
You can also configure a second route, in the same way
-> You'll need to restart your application when you activate your second route!
Using the application
Once all this is configured, simply click on the little upload icon on the left of the sidebar to upload the article itself.
And that's it, let the magic happen!
Thank you for your visit, feel free to contact me for
any information, quote or collaboration proposal. I will
be happy to answer you as soon as possible.
Did you like this article? Feel free to share it!