Compare commits
7 Commits
d01301e40b
...
feat/aep-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e7ddfbfbf | ||
|
|
36feace21f | ||
|
|
0e65156fa0 | ||
|
|
020cf0a162 | ||
|
|
1c4dce2fa4 | ||
|
|
cde95cdf61 | ||
|
|
f099463636 |
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/package*.json ./
|
||||
EXPOSE 3000
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=3000
|
||||
CMD ["node", "./dist/server/entry.mjs"]
|
||||
@@ -3,14 +3,22 @@ import { defineConfig } from 'astro/config';
|
||||
import vue from '@astrojs/vue';
|
||||
import node from '@astrojs/node';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import sitemap from '@astrojs/sitemap';
|
||||
|
||||
// PC7 — bascule SSR (mode 'server' Astro 6) pour endpoint /api/chatbot proxy.
|
||||
// Toutes les pages publiques restent statiques via `export const prerender = true`.
|
||||
// Coolify deploy (PC8) : `node ./dist/server/entry.mjs` (Node adapter standalone).
|
||||
// PC8 — sitemap auto-genere + site URL pour canonical + redirects SEO.
|
||||
export default defineConfig({
|
||||
site: 'https://trans-former.fr',
|
||||
output: 'server',
|
||||
adapter: node({ mode: 'standalone' }),
|
||||
integrations: [vue()],
|
||||
integrations: [
|
||||
vue(),
|
||||
sitemap({
|
||||
filter: (page) => !page.includes('/api/'),
|
||||
}),
|
||||
],
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
},
|
||||
|
||||
67
package-lock.json
generated
67
package-lock.json
generated
@@ -9,6 +9,7 @@
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@astrojs/node": "^10.1.0",
|
||||
"@astrojs/sitemap": "^3.7.2",
|
||||
"@astrojs/vue": "^6.0.1",
|
||||
"@fontsource-variable/roboto-condensed": "^5.2.8",
|
||||
"@tailwindcss/vite": "^4.2.4",
|
||||
@@ -98,6 +99,17 @@
|
||||
"node": ">=22.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/sitemap": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.7.2.tgz",
|
||||
"integrity": "sha512-PqkzkcZTb5ICiyIR8VoKbIAP/laNRXi5tw616N1Ckk+40oNB8Can1AzVV56lrbC5GKSZFCyJYUVYqVivMisvpA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"sitemap": "^9.0.0",
|
||||
"stream-replace-string": "^2.0.0",
|
||||
"zod": "^4.3.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/telemetry": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.3.2.tgz",
|
||||
@@ -2661,6 +2673,24 @@
|
||||
"@types/unist": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.12.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.4.tgz",
|
||||
"integrity": "sha512-GUUEShf+PBCGW2KaXwcIt3Yk+e3pkKwWKb9GSyM9WQVE+ep2jzmHdGsHzu4wgcZy5fN9FBdVzjpBQsYlpfpgLA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/sax": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz",
|
||||
"integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/unist": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
|
||||
@@ -2936,6 +2966,12 @@
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/arg": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
|
||||
"integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
@@ -6982,6 +7018,25 @@
|
||||
"integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sitemap": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/sitemap/-/sitemap-9.0.1.tgz",
|
||||
"integrity": "sha512-S6hzjGJSG3d6if0YoF5kTyeRJvia6FSTBroE5fQ0bu1QNxyJqhhinfUsXi9fH3MgtXODWvwo2BDyQSnhPQ88uQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "^24.9.2",
|
||||
"@types/sax": "^1.2.1",
|
||||
"arg": "^5.0.0",
|
||||
"sax": "^1.4.1"
|
||||
},
|
||||
"bin": {
|
||||
"sitemap": "dist/esm/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.19.5",
|
||||
"npm": ">=10.8.2"
|
||||
}
|
||||
},
|
||||
"node_modules/slash": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
|
||||
@@ -7040,6 +7095,12 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/stream-replace-string": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz",
|
||||
"integrity": "sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/stringify-entities": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz",
|
||||
@@ -7222,6 +7283,12 @@
|
||||
"integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/unicorn-magic": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.0.tgz",
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/node": "^10.1.0",
|
||||
"@astrojs/sitemap": "^3.7.2",
|
||||
"@astrojs/vue": "^6.0.1",
|
||||
"@fontsource-variable/roboto-condensed": "^5.2.8",
|
||||
"@tailwindcss/vite": "^4.2.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "1.1",
|
||||
"generatedAt": "2026-05-11T22:48:32.388Z",
|
||||
"generatedAt": "2026-05-12T09:28:20.972Z",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "contrat-social-medecine-corps-social",
|
||||
|
||||
46
public/llms.txt
Normal file
46
public/llms.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
# trans-former.fr
|
||||
|
||||
> Page-cerveau de Jules NENY. Architecture, ecologie, politique : un commun a
|
||||
> construire ensemble. Manifeste et infrastructure vivante.
|
||||
|
||||
## A propos
|
||||
|
||||
Jules NENY est architecte, ecrivain, penseur politique. Il porte le projet AEP
|
||||
(Agences d'Ecologie Politique) - reseau de structures locales pour articuler
|
||||
ecologie, social et politique au niveau du territoire.
|
||||
|
||||
Ce site est l'epicentre de son ecosysteme : manifeste, journal cross-platform,
|
||||
carte AEP des bifurcations, mindmap des thematiques de la pensee AEP.
|
||||
|
||||
## Sections
|
||||
|
||||
- / : page-cerveau (hub : journal + mindmap + Insta)
|
||||
- /manifeste : manifeste fondateur (V1)
|
||||
- /manifeste/commander : pre-inscription version imprimee
|
||||
- /a-propos : parcours et intention
|
||||
- /mentions-legales : mentions legales
|
||||
|
||||
## Ecosysteme
|
||||
|
||||
- aep.trans-former.fr : cartes AEP (cartobifurcation + trouver du taf)
|
||||
- manifeste.trans-former.fr : ancien blog (archives 2024-2026)
|
||||
- automate.trans-former.fr : workflows n8n (journal cross-platform)
|
||||
- podcast.trans-former.fr : podcast Castopod
|
||||
- calculs.trans-former.fr : simulateurs autonomie energetique
|
||||
|
||||
## Reseaux
|
||||
|
||||
- Substack : julesneny.substack.com (Architecture d'ecologie politique)
|
||||
- Instagram @aep.politique : carousels manifeste
|
||||
- Instagram @julesneny : peinture / poesie / Corse
|
||||
- LinkedIn : journal pro / building public
|
||||
- Gitea : git.trans-former.fr/jules (code open source)
|
||||
|
||||
## Politique d'usage
|
||||
|
||||
Le contenu du site est explicitement ouvert a l'indexation et a la citation
|
||||
par les LLMs (GPTBot, ClaudeBot, Google-Extended, Applebot-Extended, PerplexityBot).
|
||||
|
||||
L'auteur souhaite que la pensee AEP soit largement diffusee.
|
||||
|
||||
Pour citer ce site : "Jules NENY, trans-former.fr, [date d'acces]"
|
||||
19
public/robots.txt
Normal file
19
public/robots.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
User-agent: GPTBot
|
||||
Allow: /
|
||||
|
||||
User-agent: ClaudeBot
|
||||
Allow: /
|
||||
|
||||
User-agent: Google-Extended
|
||||
Allow: /
|
||||
|
||||
User-agent: Applebot-Extended
|
||||
Allow: /
|
||||
|
||||
User-agent: PerplexityBot
|
||||
Allow: /
|
||||
|
||||
Sitemap: https://trans-former.fr/sitemap-index.xml
|
||||
@@ -6,12 +6,63 @@ import SiteHeader from '../components/astro/SiteHeader.astro';
|
||||
interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
ogImage?: string;
|
||||
canonical?: string;
|
||||
/** Article JSON-LD : passer true sur les pages articles (manifeste, etc.) */
|
||||
isArticle?: boolean;
|
||||
articleDate?: string;
|
||||
articleDescription?: string;
|
||||
}
|
||||
|
||||
const {
|
||||
title = 'trans-former.fr',
|
||||
description = "Architecture d'ecologie politique - journal, carte conceptuelle, manifeste",
|
||||
title,
|
||||
description,
|
||||
ogImage,
|
||||
canonical,
|
||||
isArticle = false,
|
||||
articleDate,
|
||||
articleDescription,
|
||||
} = Astro.props;
|
||||
|
||||
const SITE_NAME = 'trans-former.fr';
|
||||
const SITE_URL = 'https://trans-former.fr';
|
||||
const DEFAULT_DESC = "Architecture, ecologie, politique : un commun a construire ensemble. Manifeste et infrastructure vivante de Jules NENY.";
|
||||
const DEFAULT_OG = '/og-default.png';
|
||||
|
||||
const fullTitle = title ? `${title} - ${SITE_NAME}` : SITE_NAME;
|
||||
const finalDesc = description || DEFAULT_DESC;
|
||||
const finalCanonical = canonical || new URL(Astro.url.pathname, SITE_URL).href;
|
||||
const finalOg = ogImage || DEFAULT_OG;
|
||||
const finalOgAbsolute = finalOg.startsWith('http') ? finalOg : `${SITE_URL}${finalOg}`;
|
||||
|
||||
const websiteSchema = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"name": SITE_NAME,
|
||||
"url": SITE_URL,
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "Jules NENY",
|
||||
"url": `${SITE_URL}/a-propos`,
|
||||
"sameAs": [
|
||||
"https://www.instagram.com/julesneny/",
|
||||
"https://www.instagram.com/aep.politique/",
|
||||
"https://julesneny.substack.com",
|
||||
"https://git.trans-former.fr/jules"
|
||||
]
|
||||
},
|
||||
"description": DEFAULT_DESC
|
||||
};
|
||||
|
||||
const articleSchema = isArticle ? {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
"headline": title || SITE_NAME,
|
||||
"author": { "@type": "Person", "name": "Jules NENY" },
|
||||
"datePublished": articleDate || "2026-05-01",
|
||||
"publisher": { "@type": "Organization", "name": SITE_NAME },
|
||||
"description": articleDescription || finalDesc
|
||||
} : null;
|
||||
---
|
||||
<!doctype html>
|
||||
<html lang="fr" class="h-screen">
|
||||
@@ -20,14 +71,38 @@ const {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:type" content="website" />
|
||||
|
||||
<!-- SEO primaire -->
|
||||
<title>{fullTitle}</title>
|
||||
<meta name="description" content={finalDesc} />
|
||||
<link rel="canonical" href={finalCanonical} />
|
||||
<meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large" />
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:type" content={isArticle ? "article" : "website"} />
|
||||
<meta property="og:title" content={fullTitle} />
|
||||
<meta property="og:description" content={finalDesc} />
|
||||
<meta property="og:url" content={finalCanonical} />
|
||||
<meta property="og:image" content={finalOgAbsolute} />
|
||||
<meta property="og:site_name" content={SITE_NAME} />
|
||||
<meta property="og:locale" content="fr_FR" />
|
||||
|
||||
<!-- Twitter Card -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta name="twitter:title" content={fullTitle} />
|
||||
<meta name="twitter:description" content={finalDesc} />
|
||||
<meta name="twitter:image" content={finalOgAbsolute} />
|
||||
|
||||
<!-- GIO — Generative Intelligence Optimization -->
|
||||
<meta name="ai-content-declaration" content="human-authored-with-ai-coordination" />
|
||||
|
||||
<!-- Schema.org WebSite -->
|
||||
<script type="application/ld+json" set:html={JSON.stringify(websiteSchema)} />
|
||||
|
||||
<!-- Schema.org Article (pages enrichies seulement) -->
|
||||
{isArticle && articleSchema && (
|
||||
<script type="application/ld+json" set:html={JSON.stringify(articleSchema)} />
|
||||
)}
|
||||
</head>
|
||||
<body class="m-0 bg-white text-neutral-900 antialiased h-screen flex flex-col overflow-hidden">
|
||||
<div class="flex-shrink-0">
|
||||
|
||||
196
src/pages/api/aep-perso.ts
Normal file
196
src/pages/api/aep-perso.ts
Normal file
@@ -0,0 +1,196 @@
|
||||
import type { APIRoute } from 'astro'
|
||||
|
||||
export const prerender = false
|
||||
|
||||
const KIT_API_BASE = 'https://api.kit.com/v4'
|
||||
const TAG_NAME = 'AEP - sans perso'
|
||||
|
||||
function htmlPage(title: string, heading: string, message: string): string {
|
||||
return `<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>${title} — trans-former.fr</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
<body class="bg-neutral-50 text-neutral-900 min-h-screen flex items-center justify-center p-6">
|
||||
<main class="max-w-md w-full bg-white rounded-xl shadow-sm border border-neutral-200 p-8 text-center">
|
||||
<h1 class="text-2xl font-semibold mb-4">${heading}</h1>
|
||||
<p class="text-neutral-600 leading-relaxed">${message}</p>
|
||||
<a href="https://www.trans-former.fr"
|
||||
class="mt-6 inline-block text-sm text-neutral-500 underline underline-offset-2 hover:text-neutral-900">
|
||||
← Retour sur trans-former.fr
|
||||
</a>
|
||||
</main>
|
||||
</body>
|
||||
</html>`
|
||||
}
|
||||
|
||||
async function getSubscriberByEmail(email: string, apiKey: string): Promise<string | null> {
|
||||
const url = `${KIT_API_BASE}/subscribers?email_address=${encodeURIComponent(email)}`
|
||||
const res = await fetch(url, {
|
||||
headers: { 'X-Kit-Api-Key': apiKey },
|
||||
signal: AbortSignal.timeout(10000),
|
||||
})
|
||||
if (!res.ok) return null
|
||||
const data = await res.json()
|
||||
if (!data?.subscribers?.length) return null
|
||||
return String(data.subscribers[0].id)
|
||||
}
|
||||
|
||||
async function getTagId(apiKey: string): Promise<number | null> {
|
||||
const url = `${KIT_API_BASE}/tags`
|
||||
const res = await fetch(url, {
|
||||
headers: { 'X-Kit-Api-Key': apiKey },
|
||||
signal: AbortSignal.timeout(10000),
|
||||
})
|
||||
if (!res.ok) return null
|
||||
const data = await res.json()
|
||||
const tag = data?.tags?.find((t: any) => t.name === TAG_NAME)
|
||||
return tag?.id ?? null
|
||||
}
|
||||
|
||||
async function tagSubscriber(subscriberId: string, tagId: number, apiKey: string): Promise<boolean> {
|
||||
const url = `${KIT_API_BASE}/tags/${tagId}/subscribers`
|
||||
const res = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Kit-Api-Key': apiKey,
|
||||
},
|
||||
body: JSON.stringify({ id: subscriberId }),
|
||||
signal: AbortSignal.timeout(10000),
|
||||
})
|
||||
return res.ok || res.status === 409
|
||||
}
|
||||
|
||||
async function untagSubscriber(subscriberId: string, tagId: number, apiKey: string): Promise<boolean> {
|
||||
const url = `${KIT_API_BASE}/tags/${tagId}/subscribers/${subscriberId}`
|
||||
const res = await fetch(url, {
|
||||
method: 'DELETE',
|
||||
headers: { 'X-Kit-Api-Key': apiKey },
|
||||
signal: AbortSignal.timeout(10000),
|
||||
})
|
||||
return res.ok || res.status === 404
|
||||
}
|
||||
|
||||
export const GET: APIRoute = async ({ url }) => {
|
||||
const KIT_API_KEY = import.meta.env.KIT_API_SECRET_V4
|
||||
if (!KIT_API_KEY) {
|
||||
return new Response(htmlPage(
|
||||
'Erreur',
|
||||
'Configuration manquante',
|
||||
'Le service de désinscription n\'est pas configuré. Contacte-moi à <a href="mailto:julesneny8@gmail.com" class="underline">julesneny8@gmail.com</a>.'
|
||||
), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
const email = (url.searchParams.get('email') || '').trim().toLowerCase()
|
||||
const action = url.searchParams.get('action')
|
||||
|
||||
if (!email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
||||
return new Response(htmlPage(
|
||||
'Lien invalide',
|
||||
'Lien invalide',
|
||||
'Le lien que tu as suivi est incomplet ou mal formé. Essaye de copier-coller l\'URL complète depuis l\'email.'
|
||||
), {
|
||||
status: 400,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
if (action !== 'unsubscribe' && action !== 'resubscribe') {
|
||||
return new Response(htmlPage(
|
||||
'Action inconnue',
|
||||
'Action inconnue',
|
||||
'Le lien que tu as suivi ne correspond à aucune action connue.'
|
||||
), {
|
||||
status: 400,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
const subscriberId = await getSubscriberByEmail(email, KIT_API_KEY)
|
||||
if (!subscriberId) {
|
||||
return new Response(htmlPage(
|
||||
'Email inconnu',
|
||||
'Email inconnu',
|
||||
'Cet email n\'est pas abonné à la newsletter. Si tu penses qu\'il s\'agit d\'une erreur, écris-moi à <a href="mailto:julesneny8@gmail.com" class="underline">julesneny8@gmail.com</a>.'
|
||||
), {
|
||||
status: 404,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
const tagId = await getTagId(KIT_API_KEY)
|
||||
if (!tagId) {
|
||||
return new Response(htmlPage(
|
||||
'Erreur',
|
||||
'Configuration manquante',
|
||||
'Le tag de désinscription est introuvable. Contacte-moi à <a href="mailto:julesneny8@gmail.com" class="underline">julesneny8@gmail.com</a>.'
|
||||
), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
if (action === 'unsubscribe') {
|
||||
const result = await tagSubscriber(subscriberId, tagId, KIT_API_KEY)
|
||||
if (!result) {
|
||||
return new Response(htmlPage(
|
||||
'Erreur',
|
||||
'Erreur technique',
|
||||
'Une erreur est survenue lors de la désinscription. Réessaie ou écris-moi à <a href="mailto:julesneny8@gmail.com" class="underline">julesneny8@gmail.com</a>.'
|
||||
), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
return new Response(htmlPage(
|
||||
'Désinscription réussie',
|
||||
'Tu es désinscrit·e',
|
||||
'Tu ne recevras plus les lettres « perso » de l\'infolettre <em>Architecture d\'Écologie Politique</em>. Tu continues à recevoir les textes de fond.<br><br>Si tu changes d\'avis, un lien de réabonnement est disponible dans chaque email de fond.'
|
||||
), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
if (action === 'resubscribe') {
|
||||
const result = await untagSubscriber(subscriberId, tagId, KIT_API_KEY)
|
||||
if (!result) {
|
||||
return new Response(htmlPage(
|
||||
'Erreur',
|
||||
'Erreur technique',
|
||||
'Une erreur est survenue lors du réabonnement. Réessaie ou écris-moi à <a href="mailto:julesneny8@gmail.com" class="underline">julesneny8@gmail.com</a>.'
|
||||
), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
return new Response(htmlPage(
|
||||
'Réabonnement réussi',
|
||||
'Tu es de nouveau abonné·e',
|
||||
'Tu recevras à nouveau les lettres « perso » de l\'infolettre <em>Architecture d\'Écologie Politique</em>. Merci de ton intérêt !'
|
||||
), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
return new Response(null, { status: 400 })
|
||||
} catch (e) {
|
||||
return new Response(htmlPage(
|
||||
'Erreur',
|
||||
'Erreur technique',
|
||||
'Une erreur inattendue est survenue. Réessaie ou écris-moi à <a href="mailto:julesneny8@gmail.com" class="underline">julesneny8@gmail.com</a>.'
|
||||
), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@ import HamburgerMenu from '../components/astro/HamburgerMenu.astro';
|
||||
<BaseLayout
|
||||
title="Manifeste - Architecture d'Ecologie Politique"
|
||||
description="Manifeste AEP : un commun vivant pour une architecture d'ecologie politique. Architectes, allie-es, habitant-es."
|
||||
isArticle={true}
|
||||
articleDate="2026-05-01"
|
||||
articleDescription="Manifeste fondateur des Agences d'Ecologie Politique - un commun vivant pour bifurquer ensemble."
|
||||
>
|
||||
<HamburgerMenu />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user