diff --git a/package-lock.json b/package-lock.json index 08b64978..2f339458 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "22.3.8", + "version": "22.3.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "22.3.8", + "version": "22.3.9", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.5.0", @@ -24,7 +24,7 @@ "@supabase/supabase-js": "^2.45.1", "dotenv-flow": "^4.1.0", "ics": "^3.7.6", - "liquidjs": "^10.16.1", + "liquidjs": "^10.16.2", "luxon": "^3.5.0", "markdown-it": "^14.1.0", "markdown-it-anchor": "^9.0.1", @@ -2278,9 +2278,9 @@ } }, "node_modules/liquidjs": { - "version": "10.16.1", - "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.16.1.tgz", - "integrity": "sha512-1JFL/Y7ONoajrfwav37yuz5yQHU3+Pgz1XWsg9E/2T8Fp65KalNfMF8QZ3+tNETqGUIB66waOSLOi64niYZE9A==", + "version": "10.16.2", + "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.16.2.tgz", + "integrity": "sha512-Lix6l2tO1nd4ua3RyTENOqzdzkIwRaX5fHiDX8DMOQz+VzT0/fXE0si526mqwSG18bh5YuUygpx26fbQeIt3+A==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index e4387810..651be4c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "22.3.8", + "version": "22.3.9", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "scripts": { @@ -39,7 +39,7 @@ "@supabase/supabase-js": "^2.45.1", "dotenv-flow": "^4.1.0", "ics": "^3.7.6", - "liquidjs": "^10.16.1", + "liquidjs": "^10.16.2", "luxon": "^3.5.0", "markdown-it": "^14.1.0", "markdown-it-anchor": "^9.0.1", diff --git a/src/includes/partials/feeds/json.liquid b/src/includes/partials/feeds/json.liquid index b2ce78d1..5ffe354a 100644 --- a/src/includes/partials/feeds/json.liquid +++ b/src/includes/partials/feeds/json.liquid @@ -15,10 +15,15 @@ {%- assign entries = data | normalizeEntries: 20 -%} {%- for entry in entries -%} {%- assign summary = entry.content | strip_html | normalize_whitespace | escape -%} + {%- assign utm_parameters = "utm_source=rss&utm_medium=feed&utm_campaign=" | append: utm_campaign -%} { "id": "{{ entry.url | encodeAmp | escape }}", "title": "{{ entry.title | escape }}{% if entry.authors %} via {{ entry.authors.name | escape }}{% endif %}{% if entry.rating %} ({{ entry.rating | escape }}){% endif %}", - "url": "{{ entry.url | encodeAmp | escape }}", + {%- if utm_campaign -%} + "url": "{{ entry.url | append: '?' | append: utm_parameters }}", + {%- else -%} + "url": "{{ entry.url | encodeAmp }}", + {%- endif -%} "content_html": "{{ summary }}", "summary": "{{ summary }}", {%- if entry.author -%} diff --git a/src/includes/partials/feeds/rss.liquid b/src/includes/partials/feeds/rss.liquid index 6a33a479..feb74d30 100644 --- a/src/includes/partials/feeds/rss.liquid +++ b/src/includes/partials/feeds/rss.liquid @@ -22,9 +22,14 @@ {%- if entry.authors %} via {{ entry.authors.name }}{%- endif -%} {%- if rating %} ({{ rating }}){%- endif -%} {%- endcapture -%} + {%- assign utm_parameters = "utm_source=rss&utm_medium=feed&utm_campaign=" | append: utm_campaign -%} <![CDATA[{{ entryTitle }}]]> + {%- if utm_campaign -%} + {{ entry.url | append: '?' | append: utm_parameters | encodeAmp }} + {%- else -%} {{ entry.url | encodeAmp }} + {%- endif -%} {{ entry.date | stringToRFC822Date }} {{ entry.url | encodeAmp }} {%- if entry.image -%} diff --git a/src/pages/feeds/json/all.liquid b/src/pages/feeds/json/all.liquid index ea7e6a69..169ecde9 100644 --- a/src/pages/feeds/json/all.liquid +++ b/src/pages/feeds/json/all.liquid @@ -9,4 +9,5 @@ permalink: "/feeds/all.json" globals:globals data:collections.allContent updated:collections.allContent[0].date + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/json/books.liquid b/src/pages/feeds/json/books.liquid index 03666518..e99230c0 100644 --- a/src/pages/feeds/json/books.liquid +++ b/src/pages/feeds/json/books.liquid @@ -10,4 +10,6 @@ permalink: "/feeds/books.json" globals:globals data:bookData updated:bookData[0].date + utm_campaign:"books_json_feed" + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/json/links.liquid b/src/pages/feeds/json/links.liquid index 785312f3..1a780be2 100644 --- a/src/pages/feeds/json/links.liquid +++ b/src/pages/feeds/json/links.liquid @@ -9,4 +9,5 @@ permalink: "/feeds/links.json" globals:globals data:links updated:links[0].date + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/json/movies.liquid b/src/pages/feeds/json/movies.liquid index 829a367d..bc00588a 100644 --- a/src/pages/feeds/json/movies.liquid +++ b/src/pages/feeds/json/movies.liquid @@ -9,4 +9,6 @@ permalink: "/feeds/movies.json" globals:globals data:movies.recentlyWatched updated:movies.recentlyWatched[0].lastWatched + utm_campaign:"movies_json_feed" + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/json/posts.liquid b/src/pages/feeds/json/posts.liquid index b9fede3a..2e02bd2e 100644 --- a/src/pages/feeds/json/posts.liquid +++ b/src/pages/feeds/json/posts.liquid @@ -9,4 +9,6 @@ permalink: "/feeds/posts.json" globals:globals data:posts updated:posts[0].date + utm_campaign:"posts_json_feed" + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/rss/all.liquid b/src/pages/feeds/rss/all.liquid index 65172ab0..7d2d5a7c 100644 --- a/src/pages/feeds/rss/all.liquid +++ b/src/pages/feeds/rss/all.liquid @@ -9,4 +9,5 @@ permalink: "/feeds/all" globals:globals data:collections.allContent updated:collections.allContent[0].date + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/rss/books.liquid b/src/pages/feeds/rss/books.liquid index 4df39f78..e45f3719 100644 --- a/src/pages/feeds/rss/books.liquid +++ b/src/pages/feeds/rss/books.liquid @@ -10,4 +10,6 @@ permalink: "/feeds/books" globals:globals data:bookData updated:bookData[0].date + utm_campaign:"books_feed" + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/rss/links.liquid b/src/pages/feeds/rss/links.liquid index 992af611..cbb99388 100644 --- a/src/pages/feeds/rss/links.liquid +++ b/src/pages/feeds/rss/links.liquid @@ -9,4 +9,5 @@ permalink: "/feeds/links" globals:globals data:links updated:links[0].date + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/rss/movies.liquid b/src/pages/feeds/rss/movies.liquid index 3f39f7b0..1d5d77c1 100644 --- a/src/pages/feeds/rss/movies.liquid +++ b/src/pages/feeds/rss/movies.liquid @@ -9,4 +9,6 @@ permalink: "/feeds/movies" globals:globals data:movies.recentlyWatched updated:movies.recentlyWatched[0].lastWatched + utm_campaign:"movies_feed" + appVersion:appVersion %} \ No newline at end of file diff --git a/src/pages/feeds/rss/posts.liquid b/src/pages/feeds/rss/posts.liquid index 1f3b7fcd..8bca875e 100644 --- a/src/pages/feeds/rss/posts.liquid +++ b/src/pages/feeds/rss/posts.liquid @@ -9,4 +9,6 @@ permalink: "/feeds/posts" globals:globals data:posts updated:posts[0].date + utm_campaign:"posts_feed" + appVersion:appVersion %} \ No newline at end of file