notes-to-strapi-export-article-ai 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,11 +8,13 @@ Strapi Exporter is a game-changing Obsidian plugin that streamlines your content
8
8
 
9
9
  ## ✨ Features
10
10
 
11
- - 🖼️ Automatically upload images from your notes to Strapi
11
+ - 🗒️ Automatically upload images from your notes to Strapi
12
12
  - 🎨 Generate SEO-friendly alt text and captions for images using AI
13
- - 📝 Create SEO-optimized article content based on your notes
13
+ - 😎 Create SEO-optimized article content based on your notes
14
14
  - 🔧 Customize the JSON template for the article fields in Strapi
15
15
  - ⚙️ Easy configuration for Strapi API URL, token, and content attribute name
16
+ - 📷 Supports both single images and image galleries
17
+ - 🔗 Additional API route for creating content in a different Strapi content type
16
18
 
17
19
  ## 🛠️ Installation
18
20
 
@@ -143,6 +145,28 @@ To get started with Strapi Exporter, you'll need to configure the following sett
143
145
  - 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)
144
146
  - **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.
145
147
 
148
+ ### Image Settings (main), optional
149
+ - **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.
150
+ - **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`).
151
+
152
+ - **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.
153
+ - **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`).
154
+ -
155
+ ### Additional API Route Settings
156
+ ⚠️ Warning: When enabling the additional API route feature, you'll need to restart Obsidian to see the additional button in the ribbon menu.
157
+ - **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.
158
+ - **Additional JSON Template**: Enter the JSON template for the fields needed for the additional API route.
159
+ - **Additional API JSON Template Description**: Enter the description for each field in the additional API JSON template.
160
+ - **Additional API URL**: Enter the URL to create content for the additional API route (e.g., `https://your-strapi-url/api/additional-content`).
161
+ - **Additional API Content Attribute Name**: Enter the attribute name for the content field for the additional API route.
162
+
163
+ ### Image Settings (additional), optional
164
+ - **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.
165
+ - **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`).
166
+
167
+ - **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.
168
+ - **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`).
169
+
146
170
  ## 🚀 Usage
147
171
 
148
172
  1. Open a Markdown file in Obsidian.
@@ -155,6 +179,15 @@ To get started with Strapi Exporter, you'll need to configure the following sett
155
179
  - 🌐 Publishing the article to Strapi with the generated content and images
156
180
  4. Enjoy your freshly exported article in Strapi!
157
181
 
182
+ For the plugin to detect images and galleries, ensure the following folder structure:
183
+
184
+ - Article file (e.g., `article.md`)
185
+ - Main image folder (name: `image`)
186
+ - Main gallery folder (name: `gallery`)
187
+
188
+ The plugin will detect images in the `image` and `gallery` folders and upload them to Strapi.
189
+
190
+
158
191
  ## 🤝 Contributing
159
192
 
160
193
  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!
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "notes-to-strapi-export-article-ai",
3
3
  "name": "Strapi Exporter, Notes to Strapi article AI enhanced",
4
- "version": "1.0.14",
4
+ "version": "1.0.16",
5
5
  "minAppVersion": "1.5.0",
6
6
  "description": "Effortlessly export your notes to Strapi CMS with AI-powered image handling and SEO optimization. Replace all the images in your notes by uploaded images in Strapi, and add SEO metadata to uploaded images.",
7
7
  "author": "Cinquin Andy",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notes-to-strapi-export-article-ai",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Effortlessly export your Obsidian notes to Strapi CMS with AI-powered image handling and SEO optimization. Replace all the images in your notes by uploaded images in Strapi, and add SEO metadata to uploaded images.",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -275,10 +275,13 @@ export async function processMarkdownContent(
275
275
  'Check your API content now, the article is created & uploaded! 🎉'
276
276
  )
277
277
  } else {
278
- new Notice('Failed to create article in Strapi.')
278
+ const errorData = await response.json()
279
+ new Notice(
280
+ `Failed to create article in Strapi. Error: ${errorData.error.message}`
281
+ )
279
282
  }
280
283
  } catch (error) {
281
- new Notice('Error creating article in Strapi.')
284
+ new Notice(`Error creating article in Strapi. Error: ${error.message}`)
282
285
  }
283
286
  }
284
287
 
@@ -47,10 +47,15 @@ export async function uploadImagesToStrapi(
47
47
  id: data[0].id,
48
48
  }
49
49
  } else {
50
- new Notice(`Failed to upload image: ${imageDescription.name}`)
50
+ const errorData = await response.json()
51
+ new Notice(
52
+ `Failed to upload image: ${imageDescription.name}. Error: ${errorData.error.message}`
53
+ )
51
54
  }
52
55
  } catch (error) {
53
- new Notice(`Error uploading image: ${imageDescription.name}`)
56
+ new Notice(
57
+ `Error uploading image: ${imageDescription.name}. Error: ${error.message}`
58
+ )
54
59
  }
55
60
  }
56
61
 
@@ -105,10 +110,15 @@ export async function uploadGalleryImagesToStrapi(
105
110
  data: data[0],
106
111
  }
107
112
  } else {
108
- new Notice(`Failed to upload gallery image: ${imageBlob.name}`)
113
+ const errorData = await response.json()
114
+ new Notice(
115
+ `Failed to upload gallery image: ${imageBlob.name}. Error: ${errorData.error.message}`
116
+ )
109
117
  }
110
118
  } catch (error) {
111
- new Notice(`Error uploading gallery image: ${imageBlob.name}`)
119
+ new Notice(
120
+ `Error uploading gallery image: ${imageBlob.name}. Error: ${error.message}`
121
+ )
112
122
  }
113
123
  }
114
124
 
package/versions.json CHANGED
@@ -10,5 +10,7 @@
10
10
  "1.0.11": "1.5.0",
11
11
  "1.0.12": "1.5.0",
12
12
  "1.0.13": "1.5.0",
13
- "1.0.14": "1.5.0"
13
+ "1.0.14": "1.5.0",
14
+ "1.0.15": "1.5.0",
15
+ "1.0.16": "1.5.0"
14
16
  }