astro-loader-pocketbase 2.8.0-next.1 → 2.8.0-next.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.
package/README.md CHANGED
@@ -83,7 +83,7 @@ const blog = defineCollection({
83
83
 
84
84
  Since the goal of the `render` function is to render the content as HTML, it's recommended to use a field of type `editor` (rich text) in PocketBase as content.
85
85
 
86
- If you specify an array of fields, the loader will wrap the content of these fields in a `<section>` and concatenate them.
86
+ If you specify an array of fields, the loader will wrap the content of these fields in a `<section>` and concatenate them; each section will have an `id` attribute matching the content field name.
87
87
 
88
88
  ### Images and files
89
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-loader-pocketbase",
3
- "version": "2.8.0-next.1",
3
+ "version": "2.8.0-next.2",
4
4
  "description": "A content loader for Astro that uses the PocketBase API",
5
5
  "keywords": [
6
6
  "astro",
@@ -74,8 +74,7 @@ export async function parseEntry(
74
74
  } else {
75
75
  // Multiple fields are used as content, wrap each block in a section and concatenate them
76
76
  content = contentFields
77
- .map((field) => entry[field])
78
- .map((block) => `<section>${block}</section>`)
77
+ .map((field) => `<section id="${field}">${entry[field]}</section>`)
79
78
  .join("");
80
79
  }
81
80
 
@@ -49,7 +49,7 @@ export function parseLiveEntry<TEntry extends PocketBaseEntry>(
49
49
  } else {
50
50
  // If multiple content fields are provided, concatenate them with `<section>` tags
51
51
  content = options.contentFields
52
- .map((field) => `<section>${entry[field]}</section>`)
52
+ .map((field) => `<section id="${field}">${entry[field]}</section>`)
53
53
  .join("");
54
54
  }
55
55