coralite-plugin-aggregation 0.7.2 → 0.8.0

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.
Files changed (2) hide show
  1. package/lib/index.js +5 -4
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createPlugin } from 'coralite'
1
+ import { definePlugin } from 'coralite'
2
2
  import path from 'node:path'
3
3
 
4
4
  /**
@@ -88,7 +88,7 @@ async function aggregationMethod (options, contextInstance) {
88
88
  if (limit) {
89
89
  if (pagination) {
90
90
  const segment = pagination.segment || 'page'
91
- const urlPathname = contextValues.$urlPathname || ''
91
+ const urlPathname = contextValues.page_url_pathname || ''
92
92
 
93
93
  const escapedSegment = segment.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
94
94
 
@@ -225,7 +225,7 @@ async function aggregationMethod (options, contextInstance) {
225
225
  const paginationTemplateId = pagination.template || 'coralite-pagination'
226
226
 
227
227
  // Construct baseUrl and urlPrefix for template
228
- const urlPathname = contextValues.$urlPathname
228
+ const urlPathname = contextValues.page_url_pathname
229
229
  let baseUrl = urlPathname
230
230
  let urlPrefix = ''
231
231
 
@@ -275,10 +275,11 @@ async function aggregationMethod (options, contextInstance) {
275
275
  return resultNodes
276
276
  }
277
277
 
278
- export const aggregation = createPlugin({
278
+ export const aggregation = definePlugin({
279
279
  name: 'aggregation',
280
280
  method: aggregationMethod,
281
281
  components: [
282
+ // @ts-ignore
282
283
  path.join(import.meta.dirname, 'templates/coralite-pagination.html')
283
284
  ]
284
285
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coralite-plugin-aggregation",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "A Coralite plugin for dynamically collecting, filtering, sorting, and displaying content across multiple sources. Build database-free Coralite websites with automated content aggregation.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -40,13 +40,13 @@
40
40
  "types"
41
41
  ],
42
42
  "peerDependencies": {
43
- "coralite": "^0.29.0"
43
+ "coralite": "^0.32.0"
44
44
  },
45
45
  "license": "AGPL-3.0-only",
46
46
  "devDependencies": {
47
47
  "@stylistic/eslint-plugin-js": "^4.2.0",
48
48
  "@stylistic/eslint-plugin-plus": "^4.2.0",
49
- "coralite": "0.29.0"
49
+ "coralite": "^0.32.0"
50
50
  },
51
51
  "scripts": {
52
52
  "test": "node --test ./tests/index.spec.js"