Strapi Exporter is a game-changing Obsidian plugin that streamlines your content creation process by seamlessly exporting your notes to Strapi CMS. With its AI-powered image handling and SEO optimization features, you can take your content to the next level with just a few clicks.
- 🗒️ Automatically upload images from your notes to Strapi
- 🎨 Generate SEO-friendly alt text and captions for images using AI
- 😎 Create SEO-optimized article content based on your notes
- 🔧 Customize the JSON template for the article fields in Strapi
- ⚙️ Easy configuration for Strapi API URL, token, and content attribute name
- 📷 Supports both single images and image galleries
- 🔗 Additional API route for creating content in a different Strapi content type
- Download the latest release from the releases page
- Download the
main.js
file &manifest.json
from the latest release. - Create a folder named
notes-to-strapi-export-article-ai
in your Obsidian plugins folder (usually located at<vault>/.obsidian/plugins/
). - Move the
main.js
file &manifest.json
to your Obsidian plugins folder (usually located at<vault>/.obsidian/plugins/
). - Restart Obsidian
- Enable the plugin in Obsidian's settings under "Community plugins".
- Configure the necessary settings (see the Configuration section below).
- Enjoy!
To install Strapi Exporter, follow these steps (coming soon to the Obsidian plugin marketplace):
- Clone this repository into your Obsidian plugins folder (usually located at
<vault>/.obsidian/plugins/
). - Run
npm install
to install the dependencies - Run
npm run build
to build the plugin - Restart Obsidian
- Enable the plugin in Obsidian's settings under "Community plugins".
- Configure the necessary settings (see the Configuration section below).
- Install the plugin in a new fresh vault
- Go in community plugin (parameters -> community plugins)
- Install a random plugin, and enable plugin
- Go in the plugin folder in your obsidian folder vault (.obisian/plugins)
- Clone the repo there, and enable the plugin
- Don't forgot to install the plugin https://github.com/pjeby/hot-reload/ too
- (Download the zip, and extract the folder in /plugins folder)
- Enable both plugins
- Press ctrl + shift + i to enable the dev console
- Go in hotkeys configuration, search "reload" and enable the hotkey "Reload app without saving". (with ctrl+r)
- Close & Reopen // ctrl + r your vault
- Go in the plugin folder & run "npm run dev"
To get started with Strapi Exporter, you'll need to configure the following settings:
- Strapi URL: The URL of your Strapi instance (e.g.,
https://your-strapi-url
). - Strapi API Token: Your Strapi API token for authentication. You can create an API token in your Strapi admin panel under "Settings" > "API Tokens".
- You need, at least, to have the following permissions:
- OpenAI API Key: Your OpenAI API key for using GPT-3 to generate SEO-friendly content. You can get your API key from the OpenAI website.
- JSON Template: The JSON template for the article fields in Strapi. Customize this according to your Strapi content type structure. You can find the JSON template in your Strapi API documentation (Swagger).
{
"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"
}
}
- then, you can copy this JSON template in the settings of the plugin
- and copy that, to describe each field in the other JSON description setting
- JSON Template Description: A description for each field in the JSON template to help GPT-3 understand the structure. Follow the same schema as the JSON template to provide descriptions for each field.
{
"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": [
{
"id": "<Unique identifier for the link, as a number>",
"label": "<Display text for the link, as a short string>",
"url": "<URL the link points to, as a string>"
}
],
"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": [
{
"id": "<Unique identifier for the tag, as a number>",
"name": "<Name of the tag, as a short string>"
}
],
"locale": "<Locale or language code, as a short string>"
}
}
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
⚠️
⚠️ **Important:** Remove the `content` (or the attribute name that correspond to the main content of the article)
⚠️ field from the JSON template and specify it separately in the "Strapi Content Attribute Name" setting.
⚠️ ( i do that to avoid changes on the main content by chat gpt )
⚠️
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
- Strapi Article Create URL: The URL to create articles in Strapi (e.g.,
https://your-strapi-url/api/articles
).- to get the URL, you can go to the documentation of your Strapi API, and copy the URL of the article creation
- it should look like this:
https://{api_url}/documentation/v1.0.0
- then, go to the article creation, and copy the URL
- Strapi Content Attribute Name: The attribute name for the content field in Strapi (e.g.,
content
).- to get the attribute name, you can go to the documentation of your Strapi API, and copy the attribute name of the article creation, (it need to be the name of the attribute that contain the main content of the article, for me it's "content", but it can be different for you)
- Additional Prompt (optional): Additional prompt to provide context for GPT-3 when generating content. You can use this field to specify additional information or instructions for the AI model. Like your langage, the tone of the article, etc.
-
Enable Additional Call API Image: Toggle this option to enable the image feature for the additional API route. The plugin will look for an image in the
image
folder next to your article file and upload it to Strapi. -
Additional Call API Image Full Path Property: Specify the full path to the image property for the additional API route in your Strapi API (e.g.,
image_presentation
). -
Enable Additional Call API Gallery: Toggle this option to enable the gallery feature for the additional API route. The plugin will look for images in the
gallery
folder next to your article file and upload them to Strapi. -
Additional Call API Gallery Full Path Property: Specify the full path to the gallery property for the additional API route in your Strapi API (e.g.,
gallery
).
- Enable Additional Call API: Toggle this option to enable the additional API route feature. This will display a new icon in the ribbon menu for creating content in a different Strapi content type.
- Additional JSON Template: Enter the JSON template for the fields needed for the additional API route.
- Additional API JSON Template Description: Enter the description for each field in the additional API JSON template.
- Additional API URL: Enter the URL to create content for the additional API route (e.g.,
https://your-strapi-url/api/additional-content
). - Additional API Content Attribute Name: Enter the attribute name for the content field for the additional API route.
-
Enable Additional Call API Image: Toggle this option to enable the image feature for the additional API route. The plugin will look for an image in the
image
folder next to your article file and upload it to Strapi. -
Additional Call API Image Full Path Property: Specify the full path to the image property for the additional API route in your Strapi API (e.g.,
image_presentation
). -
Enable Additional Call API Gallery: Toggle this option to enable the gallery feature for the additional API route. The plugin will look for images in the
gallery
folder next to your article file and upload them to Strapi. -
Additional Call API Gallery Full Path Property: Specify the full path to the gallery property for the additional API route in your Strapi API (e.g.,
gallery
).
- Open a Markdown file in Obsidian.
- Click on the plugin's ribbon icon to start the magic.
- Sit back and relax while Strapi Exporter does the heavy lifting:
- 🖼️ Extracting and uploading images to Strapi
- 🎨 Generating SEO-friendly alt text and captions for images
- 📝 Creating SEO-optimized article content based on your notes
- 🌐 Publishing the article to Strapi with the generated content and images
- Enjoy your freshly exported article in Strapi!
For the plugin to detect images and galleries, ensure the following folder structure:
- Article file (e.g.,
article.md
) - Main image folder (name:
image
) - Main gallery folder (name:
gallery
)
The plugin will detect images in the image
and gallery
folders and upload them to Strapi.
We welcome contributions from the community! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Let's make Strapi Exporter even better together!
This project is licensed under the MIT License. See the LICENSE file for details.
🌟 Elevate your content workflow with Strapi Exporter and unleash the full potential of your Obsidian notes! 🌟