@interware/content-generator 0.2.0 → 0.2.2

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.
@@ -3141,7 +3141,7 @@ const service = ({ strapi }) => {
3141
3141
  throw new Error(`Artículo con ID ${articleId} no encontrado.`);
3142
3142
  }
3143
3143
  const hashtags = article.keywords.map(
3144
- (k) => `#${k.trim().replace(/\s+/g, "").replace(/[^\w]/g, "")}`
3144
+ (keyword) => `#${keyword.name.trim().replace(/\s+/g, "").replace(/[^\w]/g, "")}`
3145
3145
  // limpia caracteres raros
3146
3146
  ).join(" ");
3147
3147
  const postBody = {
@@ -3158,29 +3158,11 @@ ${hashtags}`
3158
3158
  },
3159
3159
  shareMediaCategory: "ARTICLE",
3160
3160
  media: [
3161
- // Imagen del artículo
3162
- ...article.image ? [
3163
- {
3164
- status: "READY",
3165
- description: {
3166
- text: article.descripcion
3167
- },
3168
- media: `https://api.interware.com.mx${article.image.formats.small.url}`,
3169
- title: {
3170
- text: article.titulo
3171
- }
3172
- }
3173
- ] : [],
3174
- // URL del artículo
3175
3161
  {
3176
3162
  status: "READY",
3177
3163
  originalUrl: `https://interware.com.mx/blog/${article.slug}`,
3178
- title: {
3179
- text: article.titulo
3180
- },
3181
- description: {
3182
- text: article.descripcion
3183
- }
3164
+ title: { text: article.titulo },
3165
+ description: { text: article.descripcion }
3184
3166
  }
3185
3167
  ]
3186
3168
  }
@@ -3251,7 +3233,7 @@ ${hashtags}`
3251
3233
  }
3252
3234
  const articleUrl = `https://interware.com.mx/blog/${article.slug}`;
3253
3235
  const hashtags = article.keywords.map(
3254
- (keyword) => `#${keyword.trim().replace(/\s+/g, "").replace(/[^\w]/g, "")}`
3236
+ (keyword) => `#${keyword.name.trim().replace(/\s+/g, "").replace(/[^\w]/g, "")}`
3255
3237
  // quita caracteres raros
3256
3238
  ).join(" ");
3257
3239
  const postBody = {
@@ -3140,7 +3140,7 @@ const service = ({ strapi }) => {
3140
3140
  throw new Error(`Artículo con ID ${articleId} no encontrado.`);
3141
3141
  }
3142
3142
  const hashtags = article.keywords.map(
3143
- (k) => `#${k.trim().replace(/\s+/g, "").replace(/[^\w]/g, "")}`
3143
+ (keyword) => `#${keyword.name.trim().replace(/\s+/g, "").replace(/[^\w]/g, "")}`
3144
3144
  // limpia caracteres raros
3145
3145
  ).join(" ");
3146
3146
  const postBody = {
@@ -3157,29 +3157,11 @@ ${hashtags}`
3157
3157
  },
3158
3158
  shareMediaCategory: "ARTICLE",
3159
3159
  media: [
3160
- // Imagen del artículo
3161
- ...article.image ? [
3162
- {
3163
- status: "READY",
3164
- description: {
3165
- text: article.descripcion
3166
- },
3167
- media: `https://api.interware.com.mx${article.image.formats.small.url}`,
3168
- title: {
3169
- text: article.titulo
3170
- }
3171
- }
3172
- ] : [],
3173
- // URL del artículo
3174
3160
  {
3175
3161
  status: "READY",
3176
3162
  originalUrl: `https://interware.com.mx/blog/${article.slug}`,
3177
- title: {
3178
- text: article.titulo
3179
- },
3180
- description: {
3181
- text: article.descripcion
3182
- }
3163
+ title: { text: article.titulo },
3164
+ description: { text: article.descripcion }
3183
3165
  }
3184
3166
  ]
3185
3167
  }
@@ -3250,7 +3232,7 @@ ${hashtags}`
3250
3232
  }
3251
3233
  const articleUrl = `https://interware.com.mx/blog/${article.slug}`;
3252
3234
  const hashtags = article.keywords.map(
3253
- (keyword) => `#${keyword.trim().replace(/\s+/g, "").replace(/[^\w]/g, "")}`
3235
+ (keyword) => `#${keyword.name.trim().replace(/\s+/g, "").replace(/[^\w]/g, "")}`
3254
3236
  // quita caracteres raros
3255
3237
  ).join(" ");
3256
3238
  const postBody = {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.0",
2
+ "version": "0.2.2",
3
3
  "keywords": [],
4
4
  "type": "commonjs",
5
5
  "publishConfig": {