andy-note-nuxt 0.3.0 → 0.4.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.
@@ -0,0 +1,37 @@
1
+ <script setup lang="ts">
2
+ // Override `<img>` rendered from markdown via @nuxt/content's Prose components.
3
+ // Default ProseImg emits a plain `<img>`; we swap to `<NuxtImg>` so consumers
4
+ // get @nuxt/image's lazy loading, responsive `srcset`, format negotiation, and
5
+ // (for SSG builds) pre-rendered optimized variants under .output/public.
6
+ //
7
+ // Surface kept identical to the default ProseImg so existing markdown — both
8
+ // in this layer's `content/` and in consumer projects' content — continues to
9
+ // work without changes. Authors write `![alt](/path.png)` and get an
10
+ // optimized, lazy-loaded image at the cost of nothing.
11
+ //
12
+ // External URLs (http*) pass through @nuxt/image's `remote` provider path;
13
+ // relative paths under `/public` get rewritten to the IPX-served route during
14
+ // dev and pre-rendered into static variants during `nuxt generate`.
15
+
16
+ defineProps<{
17
+ src?: string
18
+ alt?: string
19
+ width?: string | number
20
+ height?: string | number
21
+ title?: string
22
+ }>()
23
+ </script>
24
+
25
+ <template>
26
+ <NuxtImg
27
+ :src="src"
28
+ :alt="alt"
29
+ :width="width"
30
+ :height="height"
31
+ :title="title"
32
+ loading="lazy"
33
+ decoding="async"
34
+ format="webp"
35
+ densities="x1 x2"
36
+ />
37
+ </template>
package/nuxt.config.ts CHANGED
@@ -33,6 +33,7 @@ export default defineNuxtConfig({
33
33
  modules: [
34
34
  'vite-plugin-ai-annotator/nuxt',
35
35
  '@nuxt/content',
36
+ '@nuxt/image',
36
37
  '@nuxtjs/tailwindcss',
37
38
  // Toast notifications. Auto-registers `<Toaster />` (client-only) and a
38
39
  // plugin exposing `$toast` / the imported `toast()` helper from `vue-sonner`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "andy-note-nuxt",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Brutalist-terminal Nuxt Content theme for personal notes, guides, and second-brain knowledge bases. Use as a Nuxt layer.",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -48,6 +48,7 @@
48
48
  "@fontsource/literata": "^5.2.8",
49
49
  "@fontsource/space-grotesk": "^5.2.10",
50
50
  "@nuxt/content": "^3.12.0",
51
+ "@nuxt/image": "^2.0.0",
51
52
  "@nuxtjs/tailwindcss": "^6.14.0",
52
53
  "nuxt": "^4.4.6",
53
54
  "rehype-raw": "^7.0.0",