@paris-ias/list 1.0.96 → 1.0.97

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@paris-ias/list",
3
3
  "configKey": "list",
4
- "version": "1.0.96",
4
+ "version": "1.0.97",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.0",
7
7
  "unbuild": "3.5.0"
@@ -25,26 +25,28 @@
25
25
  :slug="item.id"
26
26
  :loading="loading"
27
27
  />
28
- <a
28
+ <nuxt-link
29
29
  class="mt-6 pl-0 text-h5 text-md-h4 font-weight-medium sliding-item-title cursor-pointer"
30
- :href="
31
- localePath('activities-events-slug', {
32
- slug: item.id,
30
+ :to="
31
+ localePath({
32
+ name: 'activities-events-slug',
33
+ params: { slug: item.slug[locale] },
33
34
  })
34
35
  "
35
36
  >
36
37
  {{ item.name }}
37
- </a>
38
+ </nuxt-link>
38
39
  </div>
39
40
  </v-sheet>
40
41
  </template>
41
42
 
42
43
  <script setup>
43
44
  import { useDisplay } from "vuetify";
44
- import { useLocalePath } from "#imports";
45
+ import { useLocalePath, useI18n } from "#imports";
46
+ const { locale } = useI18n();
45
47
  const { name } = useDisplay();
46
48
  const localePath = useLocalePath();
47
- const props = defineProps({
49
+ defineProps({
48
50
  item: { type: Object, required: true },
49
51
  loading: { type: Boolean, required: true, default: false }
50
52
  });
@@ -281,7 +281,7 @@
281
281
  <v-divider class="mb-1" />
282
282
  <v-divider />
283
283
  </v-responsive>
284
- <!-- <MiscAtomsSlidingCarousel
284
+ <MiscAtomsSlidingCarousel
285
285
  v-if="!loading && item && item.gallery && item.gallery.length"
286
286
  ref="MiscAtomsImage"
287
287
  key="MiscAtomsImage"
@@ -293,7 +293,7 @@
293
293
  <div :class="mdAndUp ? 'text-h5' : 'text-h6'">
294
294
  {{ $t("gallery") }}
295
295
  </div>
296
- </MiscAtomsSlidingCarousel> -->
296
+ </MiscAtomsSlidingCarousel>
297
297
  <v-responsive class="mx-auto my-9" width="120">
298
298
  <v-divider class="mb-1" />
299
299
  <v-divider />
@@ -124,7 +124,7 @@
124
124
  <v-divider />
125
125
  </v-responsive>
126
126
 
127
- <!-- <MiscAtomsSlidingCarousel
127
+ <MiscAtomsSlidingCarousel
128
128
  v-if="item && item.fellows && item.fellows.length"
129
129
  key="people"
130
130
  ref="fellows"
@@ -136,7 +136,7 @@
136
136
  <div :class="mdAndUp ? 'text-h5' : 'text-h6'">
137
137
  {{ $t("this-fellowship-alumni") }}
138
138
  </div>
139
- </MiscAtomsSlidingCarousel> -->
139
+ </MiscAtomsSlidingCarousel>
140
140
  </div>
141
141
  </v-col>
142
142
  <MiscMoleculesRelated
@@ -68,7 +68,7 @@
68
68
  ]
69
69
  "
70
70
  >
71
- <MDC :value="item.summary" />
71
+ <MDC :value="processedSummary" />
72
72
  </div>
73
73
  <v-btn
74
74
  class="mt-4"
@@ -105,7 +105,7 @@
105
105
  ]
106
106
  "
107
107
  >
108
- <MDC :value="item.summary" />
108
+ <MDC :value="processedSummary" />
109
109
  </div>
110
110
  <br />
111
111
  <v-btn
@@ -135,7 +135,13 @@
135
135
  <script setup>
136
136
  import { useDisplay } from "vuetify";
137
137
  import { useRootStore } from "../../stores/root";
138
- import { useNuxtApp, useI18n, useLocalePath, computed } from "#imports";
138
+ import {
139
+ useNuxtApp,
140
+ useI18n,
141
+ useLocalePath,
142
+ computed,
143
+ useRouter
144
+ } from "#imports";
139
145
  const { $stores } = useNuxtApp();
140
146
  const { locale } = useI18n();
141
147
  const localePath = useLocalePath();
@@ -158,4 +164,21 @@ const props = defineProps({
158
164
  required: true
159
165
  }
160
166
  });
167
+ const processedSummary = computed(() => {
168
+ const raw = props.item.summary || "";
169
+ const slugPath = localePath({
170
+ name: "news-slug",
171
+ params: { slug: props.item.slug[locale.value] }
172
+ });
173
+ console.log("Raw summary:", raw);
174
+ console.log("Slug path:", slugPath);
175
+ return replaceMarkdownLinksWithSlug(raw, slugPath);
176
+ });
177
+ function replaceMarkdownLinksWithSlug(markdownText, slugPath) {
178
+ const regex = /\[([^\]]+)\]\(([^)]+)\)/g;
179
+ return markdownText.replace(regex, (_match, text, url) => {
180
+ const encodedUrl = encodeURIComponent(url);
181
+ return `[${text}](${slugPath}?redirect=${encodedUrl})`;
182
+ });
183
+ }
161
184
  </script>
@@ -131,7 +131,7 @@
131
131
  <v-divider class="mb-1" />
132
132
  <v-divider />
133
133
  </v-responsive>
134
- <!-- <MiscAtomsSlidingCarousel
134
+ <MiscAtomsSlidingCarousel
135
135
  v-if="item && item.gallery && item.gallery.length"
136
136
  ref="MiscAtomsImage"
137
137
  key="MiscAtomsImage"
@@ -143,7 +143,7 @@
143
143
  <div :class="mdAndUp ? 'text-h5' : 'text-h6'">
144
144
  {{ $t("gallery") }}
145
145
  </div>
146
- </MiscAtomsSlidingCarousel> -->
146
+ </MiscAtomsSlidingCarousel>
147
147
  <!-- DIVIDERS -->
148
148
  <v-responsive class="mx-auto my-9" width="120">
149
149
  <v-divider class="mb-1" />
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "AGPL-3.0-only",
3
3
  "main": "./dist/module.mjs",
4
- "version": "1.0.96",
4
+ "version": "1.0.97",
5
5
  "name": "@paris-ias/list",
6
6
  "repository": {
7
7
  "url": "git+https://github.com/IEA-Paris/list.git",