Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5fa176888 | ||
|
|
fa88bd0a65 | ||
|
|
ae365326a9 | ||
|
|
f642160d4b | ||
|
|
d58911a7e8 | ||
|
|
5a4a8fbc2b | ||
|
|
aa819600f5 | ||
|
|
11499a147c | ||
|
|
7e7ddfbfbf |
@@ -1,15 +1,14 @@
|
|||||||
# Kit (ex-ConvertKit) - newsletter infolettre
|
# Kit (ex-ConvertKit) - newsletter infolettre
|
||||||
KIT_API_SECRET_V4=kit_xxx
|
KIT_API_SECRET_V4=kit_xxx
|
||||||
|
|
||||||
# Behold.so : DEPRECATED V1.5-E — remplace par RSSHub self-host (rss.trans-former.fr).
|
# Behold.so feed IDs (voir docs/BEHOLD-SETUP.md)
|
||||||
# InstaFeed.vue consomme desormais PUBLIC_JOURNAL_URL (filtre platform=instagram).
|
# 1) Inscris-toi sur https://behold.so/dashboard
|
||||||
# Les 2 vars ci-dessous ne sont plus lues ; conservees pour compat.env.local existant.
|
# 2) Connecte les 2 comptes Insta (@aep.politique + @julesneny)
|
||||||
|
# 3) Recupere les feed IDs et copie ce fichier vers .env.local puis remplis ci-dessous
|
||||||
PUBLIC_BEHOLD_AEP=
|
PUBLIC_BEHOLD_AEP=
|
||||||
PUBLIC_BEHOLD_JULESNENY=
|
PUBLIC_BEHOLD_JULESNENY=
|
||||||
|
|
||||||
# Journal unifie (PC6 + V1.5-E) - URL JSON agrege par n8n cron 4h UTC
|
# Journal unifie (PC6) - URL JSON agrege par n8n cron nocturne
|
||||||
# Sources : RSSHub self-host (Insta @aep.politique + @julesneny + Substack @julesneny)
|
|
||||||
# + Atom Gitea natif (git.trans-former.fr/jules.atom)
|
|
||||||
# Override en local : pointer vers un mock /public/data/journal.json par exemple
|
# Override en local : pointer vers un mock /public/data/journal.json par exemple
|
||||||
PUBLIC_JOURNAL_URL=https://data.trans-former.fr/journal.json
|
PUBLIC_JOURNAL_URL=https://data.trans-former.fr/journal.json
|
||||||
|
|
||||||
|
|||||||
@@ -1,139 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "journal-aggregate-v2-rsshub",
|
|
||||||
"_notes": "V1.5-E (2026-05-13) — remplace Behold par RSSHub self-host (rss.trans-former.fr) + ajoute Substack natif. Cron decale a 4h UTC (anti-rate-limit Insta). Si /instagram/user/* renvoie 503 (config Insta absente), le node tombe gracefully et le JSON final aura 0 item insta — ColInsta affichera fallbackBio. A importer dans n8n via UI (Workflows -> Import from File) ou API.",
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"parameters": {
|
|
||||||
"rule": {
|
|
||||||
"interval": [
|
|
||||||
{
|
|
||||||
"field": "cronExpression",
|
|
||||||
"expression": "0 4 * * *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "schedule-trigger",
|
|
||||||
"name": "Cron-4h-UTC",
|
|
||||||
"type": "n8n-nodes-base.scheduleTrigger",
|
|
||||||
"typeVersion": 1.1,
|
|
||||||
"position": [240, 320]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"parameters": {
|
|
||||||
"url": "https://git.trans-former.fr/jules.atom",
|
|
||||||
"options": {
|
|
||||||
"response": { "response": { "responseFormat": "text" } },
|
|
||||||
"timeout": 15000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "fetch-gitea",
|
|
||||||
"name": "Fetch-gitea",
|
|
||||||
"type": "n8n-nodes-base.httpRequest",
|
|
||||||
"typeVersion": 4.1,
|
|
||||||
"position": [460, 160]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"parameters": {
|
|
||||||
"url": "https://julesneny.substack.com/feed",
|
|
||||||
"options": {
|
|
||||||
"response": { "response": { "responseFormat": "text" } },
|
|
||||||
"timeout": 15000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "fetch-substack",
|
|
||||||
"name": "Fetch-substack-natif",
|
|
||||||
"type": "n8n-nodes-base.httpRequest",
|
|
||||||
"typeVersion": 4.1,
|
|
||||||
"position": [460, 280]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"parameters": {
|
|
||||||
"url": "https://rss.trans-former.fr/instagram/user/aep.politique",
|
|
||||||
"options": {
|
|
||||||
"response": { "response": { "neverError": true, "responseFormat": "text" } },
|
|
||||||
"timeout": 20000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "fetch-rsshub-aep",
|
|
||||||
"name": "Fetch-rsshub-insta-aep",
|
|
||||||
"type": "n8n-nodes-base.httpRequest",
|
|
||||||
"typeVersion": 4.1,
|
|
||||||
"position": [460, 400]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"parameters": {
|
|
||||||
"url": "https://rss.trans-former.fr/instagram/user/julesneny",
|
|
||||||
"options": {
|
|
||||||
"response": { "response": { "neverError": true, "responseFormat": "text" } },
|
|
||||||
"timeout": 20000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "fetch-rsshub-julesneny",
|
|
||||||
"name": "Fetch-rsshub-insta-julesneny",
|
|
||||||
"type": "n8n-nodes-base.httpRequest",
|
|
||||||
"typeVersion": 4.1,
|
|
||||||
"position": [460, 520]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"parameters": {
|
|
||||||
"jsCode": "// V1.5-E : Normalisation 4 sources -> JSON unifie\n// Sources : Gitea Atom (XML), Substack natif (RSS XML), RSSHub Insta x2 (Atom/RSS XML)\n\nconst items = [];\n\n// ---- Helper parse Atom (Gitea) ----\nfunction parseAtomGitea(xml) {\n const out = [];\n if (!xml || typeof xml !== 'string') return out;\n const entries = xml.split(/<entry>/i).slice(1);\n for (const raw of entries) {\n const block = '<entry>' + raw.split(/<\\/entry>/i)[0] + '</entry>';\n const title = (block.match(/<title>([\\s\\S]*?)<\\/title>/i) || [])[1] || '';\n const updated = (block.match(/<updated>([^<]+)<\\/updated>/i) || [])[1] || '';\n const link = (block.match(/<link[^>]*href=\"([^\"]+)\"/i) || [])[1] || '';\n const summary = (block.match(/<summary[^>]*>([\\s\\S]*?)<\\/summary>/i) || [])[1] || '';\n const id = (block.match(/<id>([^<]+)<\\/id>/i) || [])[1] || link || updated;\n if (!updated) continue;\n const decode = (s) => s\n .replace(/</g, '<').replace(/>/g, '>')\n .replace(/"/g, '\"').replace(/"/g, '\"')\n .replace(/
/g, ' ').replace(/&/g, '&')\n .replace(/<[^>]+>/g, ' ').replace(/\\s+/g, ' ').trim();\n out.push({\n id: 'gitea-' + (id.slice(0, 80) || updated),\n platform: 'gitea',\n hashtag: '#stack',\n date: new Date(updated).toISOString(),\n titre: decode(title).slice(0, 140),\n extrait: decode(summary).slice(0, 280),\n url: link,\n thumbnail: null,\n });\n }\n return out;\n}\n\n// ---- Helper parse RSS 2.0 (Substack, RSSHub) ----\nfunction parseRss(xml, platform, hashtag, fallbackUrl) {\n const out = [];\n if (!xml || typeof xml !== 'string') return out;\n const items = xml.split(/<item[\\s>]/i).slice(1);\n for (const raw of items) {\n const block = '<item ' + raw.split(/<\\/item>/i)[0] + '</item>';\n const cdata = (re) => {\n const m = block.match(re);\n if (!m) return '';\n let s = m[1] || '';\n s = s.replace(/<!\\[CDATA\\[([\\s\\S]*?)\\]\\]>/g, '$1');\n return s;\n };\n const title = cdata(/<title[^>]*>([\\s\\S]*?)<\\/title>/i);\n const link = cdata(/<link[^>]*>([\\s\\S]*?)<\\/link>/i).trim();\n const guid = cdata(/<guid[^>]*>([\\s\\S]*?)<\\/guid>/i).trim();\n const desc = cdata(/<description[^>]*>([\\s\\S]*?)<\\/description>/i);\n const pub = cdata(/<pubDate[^>]*>([\\s\\S]*?)<\\/pubDate>/i).trim();\n if (!pub && !title) continue;\n const decode = (s) => s\n .replace(/</g, '<').replace(/>/g, '>')\n .replace(/"/g, '\"').replace(/"/g, '\"')\n .replace(/&/g, '&')\n .replace(/<[^>]+>/g, ' ').replace(/\\s+/g, ' ').trim();\n const enclosure = (block.match(/<enclosure[^>]+url=\"([^\"]+)\"/i) || [])[1] || null;\n const mediaThumb = (block.match(/<media:thumbnail[^>]+url=\"([^\"]+)\"/i) || [])[1] || null;\n out.push({\n id: platform + '-' + (guid || link || pub).slice(0, 80),\n platform,\n hashtag,\n date: pub ? new Date(pub).toISOString() : new Date().toISOString(),\n titre: decode(title).slice(0, 140) || platform,\n extrait: decode(desc).slice(0, 280),\n url: link || fallbackUrl,\n thumbnail: mediaThumb || enclosure,\n });\n }\n return out;\n}\n\n// ---- Recupere payloads ----\nfunction safeText(nodeName) {\n try {\n const its = $(nodeName).all();\n if (!its.length || !its[0].json) return '';\n const j = its[0].json;\n return String(j.data || j.body || '');\n } catch (e) {\n console.log(nodeName + ' missing:', e.message);\n return '';\n }\n}\n\nconst giteaXml = safeText('Fetch-gitea');\nconst subXml = safeText('Fetch-substack-natif');\nconst rsshubAepXml = safeText('Fetch-rsshub-insta-aep');\nconst rsshubJnXml = safeText('Fetch-rsshub-insta-julesneny');\n\nfor (const it of parseAtomGitea(giteaXml)) items.push(it);\nfor (const it of parseRss(subXml, 'substack', '#substack', 'https://julesneny.substack.com')) items.push(it);\nfor (const it of parseRss(rsshubAepXml, 'instagram', '#aep-politique', 'https://instagram.com/aep.politique')) items.push(it);\nfor (const it of parseRss(rsshubJnXml, 'instagram', '#peinture', 'https://instagram.com/julesneny')) items.push(it);\n\n// ---- Dedup par id, tri desc, cap top 100 ----\nconst seen = new Set();\nconst uniq = items.filter((it) => {\n if (seen.has(it.id)) return false;\n seen.add(it.id);\n return true;\n});\nuniq.sort((a, b) => b.date.localeCompare(a.date));\nconst top = uniq.slice(0, 100);\n\nconst counts = {\n total: top.length,\n gitea: top.filter((i) => i.platform === 'gitea').length,\n substack: top.filter((i) => i.platform === 'substack').length,\n instagram: top.filter((i) => i.platform === 'instagram').length,\n};\n\nreturn [{ json: { generatedAt: new Date().toISOString(), items: top, counts } }];"
|
|
||||||
},
|
|
||||||
"id": "normalise",
|
|
||||||
"name": "Normalise",
|
|
||||||
"type": "n8n-nodes-base.code",
|
|
||||||
"typeVersion": 2,
|
|
||||||
"position": [720, 340]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"parameters": {
|
|
||||||
"operation": "toJson",
|
|
||||||
"fieldName": "data",
|
|
||||||
"options": { "format": true }
|
|
||||||
},
|
|
||||||
"id": "to-json",
|
|
||||||
"name": "To-json-string",
|
|
||||||
"type": "n8n-nodes-base.set",
|
|
||||||
"typeVersion": 3.4,
|
|
||||||
"position": [940, 340]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"parameters": {
|
|
||||||
"operation": "write",
|
|
||||||
"fileName": "/home/node/.n8n/journal/journal.json",
|
|
||||||
"dataPropertyName": "data",
|
|
||||||
"options": {}
|
|
||||||
},
|
|
||||||
"id": "write-file",
|
|
||||||
"name": "Write-journal-json",
|
|
||||||
"type": "n8n-nodes-base.readWriteFile",
|
|
||||||
"typeVersion": 1,
|
|
||||||
"position": [1160, 340]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"connections": {
|
|
||||||
"Cron-4h-UTC": {
|
|
||||||
"main": [[
|
|
||||||
{ "node": "Fetch-gitea", "type": "main", "index": 0 },
|
|
||||||
{ "node": "Fetch-substack-natif", "type": "main", "index": 0 },
|
|
||||||
{ "node": "Fetch-rsshub-insta-aep", "type": "main", "index": 0 },
|
|
||||||
{ "node": "Fetch-rsshub-insta-julesneny", "type": "main", "index": 0 }
|
|
||||||
]]
|
|
||||||
},
|
|
||||||
"Fetch-gitea": { "main": [[{ "node": "Normalise", "type": "main", "index": 0 }]] },
|
|
||||||
"Fetch-substack-natif": { "main": [[{ "node": "Normalise", "type": "main", "index": 0 }]] },
|
|
||||||
"Fetch-rsshub-insta-aep": { "main": [[{ "node": "Normalise", "type": "main", "index": 0 }]] },
|
|
||||||
"Fetch-rsshub-insta-julesneny": { "main": [[{ "node": "Normalise", "type": "main", "index": 0 }]] },
|
|
||||||
"Normalise": { "main": [[{ "node": "To-json-string", "type": "main", "index": 0 }]] },
|
|
||||||
"To-json-string": { "main": [[{ "node": "Write-journal-json", "type": "main", "index": 0 }]] }
|
|
||||||
},
|
|
||||||
"settings": {
|
|
||||||
"executionOrder": "v1",
|
|
||||||
"saveExecutionProgress": true,
|
|
||||||
"saveManualExecutions": true
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
{ "name": "page-cerveau" },
|
|
||||||
{ "name": "V1.5-E" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
# statut: gestation (draft/en cours) | edite (publie)
|
# statut: gestation (draft/en cours) | edite (publie)
|
||||||
# nature: essai (texte politique) | projet (projet archi)
|
# nature: essai (texte politique) | projet (projet archi)
|
||||||
# niveau: 0 (centre) | 1 (concepts force) | 2 (thematiques/projets)
|
# niveau: 0 (centre) | 1 (concepts force) | 2 (thematiques/projets)
|
||||||
|
# problematique (optionnel) : accroche affichee au survol du node (une tension, pas une definition)
|
||||||
|
# BROUILLON MOE 29/09 : les 17 textes sont a valider par Jules
|
||||||
# domain (optionnel) : domaine plateforme source pour logo Brandfetch CDN
|
# domain (optionnel) : domaine plateforme source pour logo Brandfetch CDN
|
||||||
# - affiche logo en bas-droite du node si zoom > 1.5x
|
# - affiche logo en bas-droite du node si zoom > 1.5x
|
||||||
# - V1.2 par defaut : substack.com pour tous les essais AEP
|
# - V1.2 par defaut : substack.com pour tous les essais AEP
|
||||||
@@ -16,6 +18,7 @@ centre:
|
|||||||
niveau: 0
|
niveau: 0
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Diagnostiquer avant de prescrire : où le corps social bloque-t-il, et quelle aiguille le débloque ?"
|
||||||
resume: "Manifeste central AEP : inventer un nouveau contrat social et diagnostiquer/soigner les pathologies du corps social."
|
resume: "Manifeste central AEP : inventer un nouveau contrat social et diagnostiquer/soigner les pathologies du corps social."
|
||||||
|
|
||||||
concepts_force: []
|
concepts_force: []
|
||||||
@@ -26,90 +29,105 @@ thematiques:
|
|||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Tout se tient : c'est pour ça qu'on ne répare rien en traitant les problèmes un par un."
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "pratiques-collectives"
|
- id: "pratiques-collectives"
|
||||||
label: "Pratiques collectives"
|
label: "Pratiques collectives"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Seul, chacun a raison et reste impuissant. Qu'est-ce qui fait passer du « je » au « nous » ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "art-narration"
|
- id: "art-narration"
|
||||||
label: "Art & narration"
|
label: "Art & narration"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "On ne quitte pas un monde qu'on n'arrive pas à raconter autrement."
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "pouvoir-domination"
|
- id: "pouvoir-domination"
|
||||||
label: "Rapport au pouvoir"
|
label: "Rapport au pouvoir"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Le pouvoir des pires n'est pas un accident : c'est une mécanique. Laquelle démonter ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "medias-critique"
|
- id: "medias-critique"
|
||||||
label: "Medias & pensee critique"
|
label: "Medias & pensee critique"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "S'informer tous les jours et comprendre de moins en moins : à qui profite le bruit ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "justice-securite"
|
- id: "justice-securite"
|
||||||
label: "Justice & securite"
|
label: "Justice & securite"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Dure pour les faibles, douce pour les puissants : punir plus, ou réparer mieux ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "sante-globale"
|
- id: "sante-globale"
|
||||||
label: "Sante globale"
|
label: "Sante globale"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Le burn-out est-il une maladie à soigner, ou le symptôme d'un travail à changer ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "agriculture"
|
- id: "agriculture"
|
||||||
label: "Agriculture"
|
label: "Agriculture"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Le sol vivant est une infrastructure à entretenir, pas un stock à vider."
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "post-croissance"
|
- id: "post-croissance"
|
||||||
label: "Post-croissance"
|
label: "Post-croissance"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Performants jusqu'à casser : et si la robustesse valait mieux que la croissance ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "anthropocene"
|
- id: "anthropocene"
|
||||||
label: "Anthropocene & effondrement"
|
label: "Anthropocene & effondrement"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Quand tout se dérègle en même temps, que protège-t-on en premier ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "education"
|
- id: "education"
|
||||||
label: "Education a la transformation"
|
label: "Education a la transformation"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Former des esprits qui doutent, ou des rouages qui tiennent le rang ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "urbanisme"
|
- id: "urbanisme"
|
||||||
label: "Urbanisme"
|
label: "Urbanisme"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Couler du béton neuf, ou transformer ce qui est déjà là ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "geopolitique"
|
- id: "geopolitique"
|
||||||
label: "Geopolitique & decolonisation"
|
label: "Geopolitique & decolonisation"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Notre confort repose sur un empire qui n'a jamais vraiment pris fin. Qui paie l'addition ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "ia-technologie"
|
- id: "ia-technologie"
|
||||||
label: "IA & technologie"
|
label: "IA & technologie"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Un outil qui pense à notre place nous rend-il plus libres, ou plus dépendants ?"
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
- id: "spiritualite"
|
- id: "spiritualite"
|
||||||
label: "Spiritualite"
|
label: "Spiritualite"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "Retrouver du sens sans retomber dans le dogme, ni dans le développement personnel."
|
||||||
domain: "substack.com"
|
domain: "substack.com"
|
||||||
|
|
||||||
projets:
|
projets:
|
||||||
@@ -118,6 +136,7 @@ projets:
|
|||||||
niveau: 2
|
niveau: 2
|
||||||
nature: projet
|
nature: projet
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
problematique: "7,6 millions de maisons périurbaines : une impasse, ou le plus grand chantier de transformation du pays ?"
|
||||||
resume: "Transport, mobilite, industrie, politique - projet archi. Exemple de projet archi relie aux thematiques AEP."
|
resume: "Transport, mobilite, industrie, politique - projet archi. Exemple de projet archi relie aux thematiques AEP."
|
||||||
# V1.3-D : lien explicite au noeud central (pont vision <-> pratique)
|
# V1.3-D : lien explicite au noeud central (pont vision <-> pratique)
|
||||||
lien_central: true
|
lien_central: true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": "1.1",
|
"version": "1.1",
|
||||||
"generatedAt": "2026-05-12T22:53:33.094Z",
|
"generatedAt": "2026-10-20T22:14:08.516Z",
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"id": "contrat-social-medecine-corps-social",
|
"id": "contrat-social-medecine-corps-social",
|
||||||
@@ -10,7 +10,8 @@
|
|||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": "Manifeste central AEP : inventer un nouveau contrat social et diagnostiquer/soigner les pathologies du corps social.",
|
"resume": "Manifeste central AEP : inventer un nouveau contrat social et diagnostiquer/soigner les pathologies du corps social.",
|
||||||
"radius": 30,
|
"radius": 30,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"problematique": "Diagnostiquer avant de prescrire : où le corps social bloque-t-il, et quelle aiguille le débloque ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "systemique",
|
"id": "systemique",
|
||||||
@@ -21,7 +22,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Tout se tient : c'est pour ça qu'on ne répare rien en traitant les problèmes un par un."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "pratiques-collectives",
|
"id": "pratiques-collectives",
|
||||||
@@ -32,7 +34,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Seul, chacun a raison et reste impuissant. Qu'est-ce qui fait passer du « je » au « nous » ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "art-narration",
|
"id": "art-narration",
|
||||||
@@ -43,7 +46,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "On ne quitte pas un monde qu'on n'arrive pas à raconter autrement."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "pouvoir-domination",
|
"id": "pouvoir-domination",
|
||||||
@@ -54,7 +58,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Le pouvoir des pires n'est pas un accident : c'est une mécanique. Laquelle démonter ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "medias-critique",
|
"id": "medias-critique",
|
||||||
@@ -65,7 +70,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "S'informer tous les jours et comprendre de moins en moins : à qui profite le bruit ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "justice-securite",
|
"id": "justice-securite",
|
||||||
@@ -76,7 +82,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Dure pour les faibles, douce pour les puissants : punir plus, ou réparer mieux ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "sante-globale",
|
"id": "sante-globale",
|
||||||
@@ -87,7 +94,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Le burn-out est-il une maladie à soigner, ou le symptôme d'un travail à changer ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "agriculture",
|
"id": "agriculture",
|
||||||
@@ -98,7 +106,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Le sol vivant est une infrastructure à entretenir, pas un stock à vider."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "post-croissance",
|
"id": "post-croissance",
|
||||||
@@ -109,7 +118,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Performants jusqu'à casser : et si la robustesse valait mieux que la croissance ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "anthropocene",
|
"id": "anthropocene",
|
||||||
@@ -120,7 +130,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Quand tout se dérègle en même temps, que protège-t-on en premier ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "education",
|
"id": "education",
|
||||||
@@ -131,7 +142,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Former des esprits qui doutent, ou des rouages qui tiennent le rang ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "urbanisme",
|
"id": "urbanisme",
|
||||||
@@ -142,7 +154,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Couler du béton neuf, ou transformer ce qui est déjà là ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "geopolitique",
|
"id": "geopolitique",
|
||||||
@@ -153,7 +166,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Notre confort repose sur un empire qui n'a jamais vraiment pris fin. Qui paie l'addition ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ia-technologie",
|
"id": "ia-technologie",
|
||||||
@@ -164,7 +178,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Un outil qui pense à notre place nous rend-il plus libres, ou plus dépendants ?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "spiritualite",
|
"id": "spiritualite",
|
||||||
@@ -175,7 +190,8 @@
|
|||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 12,
|
"radius": 12,
|
||||||
"family": "concept",
|
"family": "concept",
|
||||||
"domain": "substack.com"
|
"domain": "substack.com",
|
||||||
|
"problematique": "Retrouver du sens sans retomber dans le dogme, ni dans le développement personnel."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "tmip",
|
"id": "tmip",
|
||||||
@@ -185,7 +201,8 @@
|
|||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": "Transport, mobilite, industrie, politique - projet archi. Exemple de projet archi relie aux thematiques AEP.",
|
"resume": "Transport, mobilite, industrie, politique - projet archi. Exemple de projet archi relie aux thematiques AEP.",
|
||||||
"radius": 18,
|
"radius": 18,
|
||||||
"family": "ressource"
|
"family": "ressource",
|
||||||
|
"problematique": "7,6 millions de maisons périurbaines : une impasse, ou le plus grand chantier de transformation du pays ?"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"edges": [
|
"edges": [
|
||||||
|
|||||||
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 118 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 80 KiB |
@@ -59,6 +59,8 @@ async function main() {
|
|||||||
}
|
}
|
||||||
// V1.2-O : propage le champ optionnel domain (logo plateforme via Brandfetch CDN)
|
// V1.2-O : propage le champ optionnel domain (logo plateforme via Brandfetch CDN)
|
||||||
if (obj.domain) node.domain = obj.domain
|
if (obj.domain) node.domain = obj.domain
|
||||||
|
// P3 §3 : accroche problematisee affichee au survol (une tension, pas une definition)
|
||||||
|
if (obj.problematique) node.problematique = obj.problematique
|
||||||
nodes.push(node)
|
nodes.push(node)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
// V1.3-D : ChatbotV2 retire du DOM (backlog V2). Pour reactivation -> reintroduire le tab + panel.
|
// V1.3-D : ChatbotV2 retire du DOM (backlog V2). Pour reactivation -> reintroduire le tab + panel.
|
||||||
// V1.4-C : cadre Carte O + bouton toggle desktop + drag fix (window listeners) + preview hydration (client:load) + transitions.
|
// V1.4-C : cadre Carte O + bouton toggle desktop + drag fix (window listeners) + preview hydration (client:load) + transitions.
|
||||||
import CarteOWrapper from '../vue/CarteOWrapper.vue';
|
import CarteOWrapper from '../vue/CarteOWrapper.vue';
|
||||||
import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
// Maquette 2026-10 : EmbedDynamique (carte AEP seule) remplacé par EmbedOnglets (AEP + rénovation).
|
||||||
|
import EmbedOnglets from '../vue/EmbedOnglets.vue';
|
||||||
import PreviewArticle from '../vue/PreviewArticle.vue';
|
import PreviewArticle from '../vue/PreviewArticle.vue';
|
||||||
---
|
---
|
||||||
<!--
|
<!--
|
||||||
@@ -121,7 +122,7 @@ import PreviewArticle from '../vue/PreviewArticle.vue';
|
|||||||
style="min-height: 0; flex: 1 1 67%; transition: flex-basis 0.3s ease;"
|
style="min-height: 0; flex: 1 1 67%; transition: flex-basis 0.3s ease;"
|
||||||
>
|
>
|
||||||
<div class="h-full min-h-[60vh] md:min-h-[400px]">
|
<div class="h-full min-h-[60vh] md:min-h-[400px]">
|
||||||
<EmbedDynamique client:visible />
|
<EmbedOnglets client:visible />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,22 +1,35 @@
|
|||||||
---
|
---
|
||||||
import InstaFeed from '../vue/InstaFeed.vue';
|
// Maquette 2026-10 : le feed Instagram (InstaFeed.vue, gardé dans le repo) est remplacé
|
||||||
|
// par le site art.trans-former.fr en iframe. Le site est en staging noindex : l'embed n'attend
|
||||||
// V1.5-E : Behold remplacé par RSSHub self-host. InstaFeed lit désormais
|
// pas sa mise en ligne publique, mais le bouton Boutique reste désactivé jusqu'au go catalogue.
|
||||||
// le journal unifié (PUBLIC_JOURNAL_URL → data.trans-former.fr/journal.json)
|
const ART_URL = 'https://art.trans-former.fr/';
|
||||||
// agrégé par n8n depuis rss.trans-former.fr. Plus de feedId Behold à passer.
|
|
||||||
---
|
---
|
||||||
<div class="h-full overflow-y-auto">
|
<section class="h-full flex flex-col">
|
||||||
<InstaFeed
|
<header class="shrink-0 px-4 py-2 flex items-center justify-between gap-3 border-b border-neutral-200">
|
||||||
client:visible
|
<a href={ART_URL} target="_blank" rel="noopener" class="font-medium text-sm hover:underline">
|
||||||
account="aep.politique"
|
Jules Neny, peintures
|
||||||
accountUrl="https://www.instagram.com/aep.politique/"
|
</a>
|
||||||
fallbackBio="Carrousels manifeste AEP ; pensee politique eco-architecture"
|
<div class="flex items-center gap-3 text-xs">
|
||||||
/>
|
<a href="https://www.instagram.com/julesneny/" target="_blank" rel="noopener" class="text-neutral-500 hover:underline hover:text-neutral-800">Instagram</a>
|
||||||
|
<a href={ART_URL} target="_blank" rel="noopener" class="text-neutral-500 hover:underline hover:text-neutral-800">Ouvrir ↗</a>
|
||||||
<InstaFeed
|
</div>
|
||||||
client:visible
|
</header>
|
||||||
account="julesneny"
|
<div class="flex-1 min-h-0 relative bg-neutral-50">
|
||||||
accountUrl="https://www.instagram.com/julesneny/"
|
<iframe
|
||||||
fallbackBio="Peinture, poesie, Corse ; archives visuelles personnelles"
|
src={ART_URL}
|
||||||
/>
|
title="Jules Neny, peintures"
|
||||||
</div>
|
class="absolute inset-0 w-full h-full border-0"
|
||||||
|
loading="lazy"
|
||||||
|
sandbox="allow-scripts allow-same-origin allow-popups allow-forms"
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
<div class="shrink-0 px-2 py-1">
|
||||||
|
<span
|
||||||
|
class="block text-center px-3 py-1 bg-neutral-200 text-neutral-400 rounded text-xs cursor-not-allowed"
|
||||||
|
aria-disabled="true"
|
||||||
|
title="Boutique — bientôt disponible"
|
||||||
|
>
|
||||||
|
Boutique
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
---
|
---
|
||||||
import JournalList from '../vue/JournalList.vue';
|
import JournalList from '../vue/JournalList.vue';
|
||||||
|
import { articlesManifeste } from '../../data/articles-manifeste';
|
||||||
|
|
||||||
|
const formatDate = (iso: string) => {
|
||||||
|
const [a, m, j] = iso.split('-');
|
||||||
|
return `${j}/${m}/${a.slice(2)}`;
|
||||||
|
};
|
||||||
|
|
||||||
// V1.4-bis FIX 5 : couleurs pills actives attenuees (60% color + 40% papier).
|
// V1.4-bis FIX 5 : couleurs pills actives attenuees (60% color + 40% papier).
|
||||||
// Active = fill couleur ATTENUEE (muted) + texte encre #0F172A (contraste WCAG ≥4.5:1).
|
// Active = fill couleur ATTENUEE (muted) + texte encre #0F172A (contraste WCAG ≥4.5:1).
|
||||||
@@ -121,6 +127,31 @@ const categories = [
|
|||||||
</a>
|
</a>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<!-- Articles du manifeste (maquette 2026-10) : liste statique, src/data/articles-manifeste.ts -->
|
||||||
|
<section class="border-t border-neutral-200 pt-4" aria-labelledby="articles-titre">
|
||||||
|
<h2 id="articles-titre" class="font-semibold mb-3 flex items-center justify-between">
|
||||||
|
<span>Articles</span>
|
||||||
|
<a
|
||||||
|
href="https://manifeste.trans-former.fr/"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
class="text-xs text-neutral-400 font-normal hover:text-neutral-700 hover:underline"
|
||||||
|
>
|
||||||
|
manifeste ↗
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
<ul class="space-y-2 text-sm">
|
||||||
|
{articlesManifeste.map((a) => (
|
||||||
|
<li>
|
||||||
|
<a href={a.url} target="_blank" rel="noopener" class="block group">
|
||||||
|
<time datetime={a.date} class="block text-[11px] text-neutral-500">{formatDate(a.date)}</time>
|
||||||
|
<span class="block text-neutral-900 group-hover:text-neutral-600 leading-snug">{a.titre}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- Journal chrono -->
|
<!-- Journal chrono -->
|
||||||
<section class="border-t border-neutral-200 pt-4 flex-1 overflow-y-auto">
|
<section class="border-t border-neutral-200 pt-4 flex-1 overflow-y-auto">
|
||||||
<h2 class="font-semibold mb-3 flex items-center justify-between">
|
<h2 class="font-semibold mb-3 flex items-center justify-between">
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ interface CarteNode {
|
|||||||
theme?: string
|
theme?: string
|
||||||
path?: string
|
path?: string
|
||||||
domain?: string // V1.2-O : domaine plateforme source (logo Brandfetch CDN)
|
domain?: string // V1.2-O : domaine plateforme source (logo Brandfetch CDN)
|
||||||
|
problematique?: string // P3 §3 : accroche au survol (validees par Jules le 20/10)
|
||||||
}
|
}
|
||||||
|
|
||||||
// V1.2-O : logos plateforme via Brandfetch CDN (visible zoom > 1.5x seulement)
|
// V1.2-O : logos plateforme via Brandfetch CDN (visible zoom > 1.5x seulement)
|
||||||
@@ -364,7 +365,7 @@ function render() {
|
|||||||
|
|
||||||
// Tooltip <title>
|
// Tooltip <title>
|
||||||
nodeGroups.append('title')
|
nodeGroups.append('title')
|
||||||
.text(d => `${d.label}\n[${d.family}]\n${truncate(d.resume || d.intention || '', 200)}`)
|
.text(d => `${d.label}\n[${d.family}]\n${truncate(d.problematique || d.resume || d.intention || '', 200)}`)
|
||||||
|
|
||||||
// V1.3-D : Simulation force-directed fit-cadre + animation continue subtile
|
// V1.3-D : Simulation force-directed fit-cadre + animation continue subtile
|
||||||
// - link distance/strength differencies : TMIP (central) court/fort, autres essais souples
|
// - link distance/strength differencies : TMIP (central) court/fort, autres essais souples
|
||||||
|
|||||||
@@ -0,0 +1,219 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||||
|
|
||||||
|
// Centre BAS (maquette 2026-10) : deux sites embarqués en onglets.
|
||||||
|
// Onglets cliquables + défilement lent automatique (barre de progression sous l'onglet actif),
|
||||||
|
// arrêt au survol / au focus / onglet navigateur caché ; un clic de l'utilisateur arrête
|
||||||
|
// définitivement le défilement. prefers-reduced-motion : pas de défilement automatique.
|
||||||
|
// Téléphone (< 768 px) : une carte-lien par site, pas d'iframe (illisible à l'échelle 0,27).
|
||||||
|
|
||||||
|
interface Onglet {
|
||||||
|
id: string
|
||||||
|
label: string
|
||||||
|
titre: string
|
||||||
|
description: string
|
||||||
|
url: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const onglets: Onglet[] = [
|
||||||
|
{
|
||||||
|
id: 'aep',
|
||||||
|
label: 'AEP',
|
||||||
|
titre: "Architecture d'écologie politique",
|
||||||
|
description: "La carte et les outils d'AEP.",
|
||||||
|
url: 'https://aep.trans-former.fr/',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'renovation',
|
||||||
|
label: 'Rénovation',
|
||||||
|
titre: 'Rénovation des maisons individuelles',
|
||||||
|
description: 'Une maison des années 50-90 à transformer par étapes.',
|
||||||
|
url: 'https://renovation-energetique.trans-former.fr/',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const DUREE_MS = 20000
|
||||||
|
const VIEWPORT_W = 1440
|
||||||
|
|
||||||
|
const actif = ref(0)
|
||||||
|
const montes = ref<boolean[]>(onglets.map((_, i) => i === 0))
|
||||||
|
const charges = ref<boolean[]>(onglets.map(() => false))
|
||||||
|
const enPause = ref(false)
|
||||||
|
const arrete = ref(false)
|
||||||
|
const progression = ref(0) // 0 → 1
|
||||||
|
const mobile = ref(false)
|
||||||
|
const scale = ref(0.42)
|
||||||
|
const wrapperRef = ref<HTMLDivElement | null>(null)
|
||||||
|
const rootRef = ref<HTMLDivElement | null>(null)
|
||||||
|
// La page monte chaque colonne deux fois (grille bureau + SwipeContainer mobile caché) :
|
||||||
|
// pas d'iframe tant que cette copie n'est pas affichée, sinon AEP se charge deux fois.
|
||||||
|
const affiche = ref(false)
|
||||||
|
|
||||||
|
let raf = 0
|
||||||
|
let dernier = 0
|
||||||
|
let resizeObs: ResizeObserver | null = null
|
||||||
|
let mqlMobile: MediaQueryList | null = null
|
||||||
|
|
||||||
|
const iframeStyle = computed(() => ({
|
||||||
|
width: VIEWPORT_W + 'px',
|
||||||
|
height: 100 / scale.value + '%',
|
||||||
|
transform: `scale(${scale.value})`,
|
||||||
|
transformOrigin: '0 0',
|
||||||
|
}))
|
||||||
|
|
||||||
|
const updateScale = () => {
|
||||||
|
const w = wrapperRef.value?.clientWidth ?? 0
|
||||||
|
if (w > 0) scale.value = w / VIEWPORT_W
|
||||||
|
}
|
||||||
|
|
||||||
|
const activer = (i: number) => {
|
||||||
|
actif.value = i
|
||||||
|
montes.value[i] = true
|
||||||
|
progression.value = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
const choisir = (i: number) => {
|
||||||
|
arrete.value = true
|
||||||
|
activer(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
const tick = (t: number) => {
|
||||||
|
if (dernier && !enPause.value && !arrete.value && !document.hidden) {
|
||||||
|
progression.value += (t - dernier) / DUREE_MS
|
||||||
|
if (progression.value >= 1) activer((actif.value + 1) % onglets.length)
|
||||||
|
}
|
||||||
|
dernier = t
|
||||||
|
raf = requestAnimationFrame(tick)
|
||||||
|
}
|
||||||
|
|
||||||
|
const majAffiche = () => {
|
||||||
|
affiche.value = !!rootRef.value && rootRef.value.offsetParent !== null
|
||||||
|
}
|
||||||
|
|
||||||
|
const onMqlMobile = () => {
|
||||||
|
mobile.value = !!mqlMobile?.matches
|
||||||
|
majAffiche()
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
mqlMobile = window.matchMedia('(max-width: 767px)')
|
||||||
|
onMqlMobile()
|
||||||
|
mqlMobile.addEventListener('change', onMqlMobile)
|
||||||
|
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) arrete.value = true
|
||||||
|
if (wrapperRef.value && typeof ResizeObserver !== 'undefined') {
|
||||||
|
updateScale()
|
||||||
|
resizeObs = new ResizeObserver(updateScale)
|
||||||
|
resizeObs.observe(wrapperRef.value)
|
||||||
|
}
|
||||||
|
// Le second site se charge en arrière-plan après quelques secondes, pour que le passage soit sans attente.
|
||||||
|
setTimeout(() => montes.value.forEach((_, i) => (montes.value[i] = true)), 4000)
|
||||||
|
window.addEventListener('resize', majAffiche)
|
||||||
|
raf = requestAnimationFrame(tick)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
cancelAnimationFrame(raf)
|
||||||
|
resizeObs?.disconnect()
|
||||||
|
mqlMobile?.removeEventListener('change', onMqlMobile)
|
||||||
|
window.removeEventListener('resize', majAffiche)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
ref="rootRef"
|
||||||
|
class="embed-onglets h-full flex flex-col"
|
||||||
|
@mouseenter="enPause = true"
|
||||||
|
@mouseleave="enPause = false"
|
||||||
|
@focusin="enPause = true"
|
||||||
|
@focusout="enPause = false"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="!mobile"
|
||||||
|
role="tablist"
|
||||||
|
aria-label="Sites embarqués"
|
||||||
|
class="shrink-0 flex items-stretch border-b border-neutral-200 bg-white"
|
||||||
|
style="font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
v-for="(o, i) in onglets"
|
||||||
|
:key="o.id"
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
:id="`onglet-${o.id}`"
|
||||||
|
:aria-selected="actif === i"
|
||||||
|
:aria-controls="`panneau-${o.id}`"
|
||||||
|
class="relative px-4 py-2 text-xs cursor-pointer transition-colors"
|
||||||
|
:class="actif === i ? 'text-neutral-900' : 'text-neutral-500 hover:text-neutral-800'"
|
||||||
|
@click="choisir(i)"
|
||||||
|
>
|
||||||
|
{{ o.label }}
|
||||||
|
<span
|
||||||
|
aria-hidden="true"
|
||||||
|
class="absolute left-0 bottom-0 h-0.5"
|
||||||
|
:style="{
|
||||||
|
width: actif === i ? (arrete ? '100%' : `${Math.min(progression, 1) * 100}%`) : '0%',
|
||||||
|
background: '#0F172A',
|
||||||
|
}"
|
||||||
|
></span>
|
||||||
|
</button>
|
||||||
|
<a
|
||||||
|
:href="onglets[actif].url"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
class="ml-auto self-center px-3 text-xs text-neutral-500 hover:text-neutral-900 hover:underline"
|
||||||
|
>
|
||||||
|
Ouvrir le site ↗
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Téléphone : cartes-liens -->
|
||||||
|
<div v-if="mobile" class="flex-1 p-3 space-y-3 overflow-y-auto">
|
||||||
|
<a
|
||||||
|
v-for="o in onglets"
|
||||||
|
:key="o.id"
|
||||||
|
:href="o.url"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
class="block border border-neutral-200 rounded p-4 hover:bg-neutral-50"
|
||||||
|
>
|
||||||
|
<span class="block text-xs text-neutral-500 font-mono">{{ o.label }}</span>
|
||||||
|
<span class="block text-base text-neutral-900 mt-1">{{ o.titre }}</span>
|
||||||
|
<span class="block text-sm text-neutral-500 mt-1">{{ o.description }}</span>
|
||||||
|
<span class="block text-xs text-neutral-700 mt-2 underline">Ouvrir le site ↗</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Bureau : iframes empilées, fondu entre les onglets -->
|
||||||
|
<div v-else ref="wrapperRef" class="relative flex-1 min-h-0 bg-neutral-100 overflow-hidden">
|
||||||
|
<div
|
||||||
|
v-for="(o, i) in onglets"
|
||||||
|
:key="o.id"
|
||||||
|
:id="`panneau-${o.id}`"
|
||||||
|
role="tabpanel"
|
||||||
|
:aria-labelledby="`onglet-${o.id}`"
|
||||||
|
:aria-hidden="actif !== i"
|
||||||
|
class="absolute inset-0 transition-opacity duration-700"
|
||||||
|
:style="{ opacity: actif === i ? 1 : 0, pointerEvents: actif === i ? 'auto' : 'none' }"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="!charges[i]"
|
||||||
|
class="absolute inset-0 flex items-center justify-center bg-neutral-50 animate-pulse"
|
||||||
|
>
|
||||||
|
<span class="text-neutral-400 text-sm">Chargement de {{ o.label }}...</span>
|
||||||
|
</div>
|
||||||
|
<iframe
|
||||||
|
v-if="montes[i] && affiche"
|
||||||
|
:src="o.url"
|
||||||
|
:title="o.titre"
|
||||||
|
class="absolute top-0 left-0 border-0"
|
||||||
|
:style="iframeStyle"
|
||||||
|
:tabindex="actif === i ? 0 : -1"
|
||||||
|
loading="lazy"
|
||||||
|
sandbox="allow-scripts allow-same-origin allow-popups allow-forms"
|
||||||
|
@load="charges[i] = true"
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,91 +1,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
defineProps<{
|
||||||
|
|
||||||
// V1.5-E : on consomme désormais le journal unifié agrégé par n8n
|
|
||||||
// (sources RSSHub self-host → data.trans-former.fr/journal.json),
|
|
||||||
// au lieu de l'API Behold directe (rate-limit, plafond 6 posts gratuit).
|
|
||||||
interface JournalItem {
|
|
||||||
id: string;
|
|
||||||
platform: string;
|
|
||||||
date: string;
|
|
||||||
titre: string;
|
|
||||||
extrait?: string;
|
|
||||||
url: string;
|
|
||||||
thumbnail: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface JournalPayload {
|
|
||||||
generatedAt: string;
|
|
||||||
items: JournalItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InstaPost {
|
|
||||||
id: string;
|
|
||||||
permalink: string;
|
|
||||||
thumbnailUrl: string | null;
|
|
||||||
caption: string;
|
|
||||||
timestamp: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
/** handle Instagram sans @ (ex: 'aep.politique', 'julesneny') — sert à filtrer le journal */
|
|
||||||
account: string;
|
account: string;
|
||||||
accountUrl: string;
|
accountUrl: string;
|
||||||
fallbackBio?: string;
|
secondAccount: string;
|
||||||
/** nombre max de posts affichés (défaut 6, parité avec ancien Behold) */
|
secondAccountUrl: string;
|
||||||
max?: number;
|
feedImages: string[]; // ordonné du plus récent (haut) au plus ancien (bas)
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const posts = ref<InstaPost[]>([]);
|
|
||||||
const loading = ref(true);
|
|
||||||
const error = ref<string | null>(null);
|
|
||||||
|
|
||||||
const JOURNAL_URL =
|
|
||||||
(import.meta as unknown as { env: Record<string, string | undefined> }).env
|
|
||||||
.PUBLIC_JOURNAL_URL || 'https://data.trans-former.fr/journal.json';
|
|
||||||
|
|
||||||
const accountHandle = (props.account || '').replace(/^@/, '').toLowerCase();
|
|
||||||
const limit = props.max ?? 6;
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
try {
|
|
||||||
const controller = new AbortController();
|
|
||||||
const timeoutId = setTimeout(() => controller.abort(), 8000);
|
|
||||||
const res = await fetch(JOURNAL_URL, {
|
|
||||||
signal: controller.signal,
|
|
||||||
cache: 'no-store',
|
|
||||||
});
|
|
||||||
clearTimeout(timeoutId);
|
|
||||||
if (!res.ok) throw new Error(`Journal returned ${res.status}`);
|
|
||||||
const data = (await res.json()) as JournalPayload;
|
|
||||||
const all = Array.isArray(data?.items) ? data.items : [];
|
|
||||||
posts.value = all
|
|
||||||
.filter(
|
|
||||||
(it) =>
|
|
||||||
it.platform === 'instagram' &&
|
|
||||||
typeof it.url === 'string' &&
|
|
||||||
it.url.toLowerCase().includes(`/${accountHandle}`),
|
|
||||||
)
|
|
||||||
.slice(0, limit)
|
|
||||||
.map((it) => ({
|
|
||||||
id: it.id,
|
|
||||||
permalink: it.url,
|
|
||||||
thumbnailUrl: it.thumbnail ?? null,
|
|
||||||
caption: it.titre || it.extrait || '',
|
|
||||||
timestamp: it.date,
|
|
||||||
}));
|
|
||||||
if (!posts.value.length) error.value = 'no-posts';
|
|
||||||
} catch (e) {
|
|
||||||
error.value = (e as Error).message || 'fetch-error';
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="border-b border-neutral-200 last:border-b-0">
|
<section class="h-full flex flex-col border-b border-neutral-200 last:border-b-0">
|
||||||
<header class="px-4 py-3 flex items-center justify-between">
|
<header class="shrink-0 px-4 py-2 flex items-center justify-between gap-3">
|
||||||
<a
|
<a
|
||||||
:href="accountUrl"
|
:href="accountUrl"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@@ -94,52 +19,62 @@ onMounted(async () => {
|
|||||||
>
|
>
|
||||||
{{ account }}
|
{{ account }}
|
||||||
</a>
|
</a>
|
||||||
<span v-if="loading" class="text-xs text-neutral-400">...</span>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div v-if="loading" class="grid grid-cols-2 gap-1 p-1">
|
|
||||||
<div
|
|
||||||
v-for="i in 4"
|
|
||||||
:key="i"
|
|
||||||
class="aspect-square bg-neutral-100 animate-pulse"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else-if="posts.length" class="grid grid-cols-2 gap-1 p-1">
|
|
||||||
<a
|
<a
|
||||||
v-for="post in posts"
|
:href="secondAccountUrl"
|
||||||
:key="post.id"
|
|
||||||
:href="post.permalink"
|
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
class="block aspect-square overflow-hidden group bg-neutral-100"
|
class="font-medium text-sm text-neutral-500 hover:underline hover:text-neutral-800"
|
||||||
>
|
>
|
||||||
<img
|
{{ secondAccount }}
|
||||||
v-if="post.thumbnailUrl"
|
|
||||||
:src="post.thumbnailUrl"
|
|
||||||
:alt="post.caption?.slice(0, 80) || account"
|
|
||||||
loading="lazy"
|
|
||||||
class="w-full h-full object-cover group-hover:scale-105 transition-transform"
|
|
||||||
/>
|
|
||||||
<span
|
|
||||||
v-else
|
|
||||||
class="w-full h-full flex items-center justify-center text-[10px] text-neutral-400 p-2 text-center"
|
|
||||||
>
|
|
||||||
{{ post.caption?.slice(0, 60) || account }}
|
|
||||||
</span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</header>
|
||||||
|
|
||||||
<div v-else class="p-4 text-sm text-neutral-600">
|
<div class="insta-feed-scroll flex-1 min-h-0">
|
||||||
<p v-if="fallbackBio" class="mb-3">{{ fallbackBio }}</p>
|
|
||||||
<a
|
<a
|
||||||
:href="accountUrl"
|
:href="accountUrl"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
class="inline-block px-3 py-2 bg-neutral-900 text-white rounded-lg text-sm"
|
:aria-label="`Voir le compte Instagram ${account}`"
|
||||||
>
|
>
|
||||||
Voir sur Instagram →
|
<img
|
||||||
|
v-for="(src, i) in feedImages"
|
||||||
|
:key="i"
|
||||||
|
:src="src"
|
||||||
|
alt=""
|
||||||
|
loading="lazy"
|
||||||
|
class="block w-full feed-img"
|
||||||
|
/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="shrink-0 px-2 py-1">
|
||||||
|
<span
|
||||||
|
class="block text-center px-3 py-1 bg-neutral-200 text-neutral-400 rounded text-xs cursor-not-allowed"
|
||||||
|
aria-disabled="true"
|
||||||
|
title="Boutique — bientôt disponible"
|
||||||
|
>
|
||||||
|
Boutique
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.insta-feed-scroll {
|
||||||
|
overflow-y: auto;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
}
|
||||||
|
.insta-feed-scroll::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
.insta-feed-scroll::-webkit-scrollbar-thumb {
|
||||||
|
background: rgba(0, 0, 0, 0.25);
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.insta-feed-scroll::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.feed-img + .feed-img {
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Articles publiés sur manifeste.trans-former.fr, du plus récent au plus ancien.
|
||||||
|
// Source : flux RSS du site vivant (relevé le 2026-10-21), version française seulement.
|
||||||
|
// Les liens du flux pointent vers /<slug>/fr/ qui renvoie 404 : on lie /<slug>/ (200).
|
||||||
|
// Le site vivant fait foi : 4 de ces articles ne sont pas sur astro-site master.
|
||||||
|
export interface ArticleManifeste {
|
||||||
|
titre: string
|
||||||
|
date: string // ISO AAAA-MM-JJ
|
||||||
|
url: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const BASE = 'https://manifeste.trans-former.fr'
|
||||||
|
|
||||||
|
export const articlesManifeste: ArticleManifeste[] = [
|
||||||
|
{ date: '2026-07-26', titre: 'AEP, conclusion saison 1 : on sait tout et on ne bouge pas', url: `${BASE}/on-sait-tout-et-on-ne-bouge-pas/` },
|
||||||
|
{ date: '2026-07-04', titre: 'Chantier ouvert au public - S2', url: `${BASE}/s2-de-la-peur-a-l-elan/` },
|
||||||
|
{ date: '2026-06-20', titre: 'Échelle S — faire le saut vers ses projets', url: `${BASE}/echelle-s-faire-le-saut/` },
|
||||||
|
{ date: '2026-05-22', titre: 'Bilan phase M - structuration communautaire', url: `${BASE}/bilan-phase-m/` },
|
||||||
|
{ date: '2026-05-18', titre: 'IA : le vélo ou la fusée ?', url: `${BASE}/ia-velo-ou-fusee/` },
|
||||||
|
{ date: '2026-05-10', titre: "40k€ pour démarrer la construction de notre réseau d'entraide", url: `${BASE}/40k-pour-monter-notre-commu/` },
|
||||||
|
{ date: '2026-05-03', titre: "Sortir la tête de l'eau, ensemble", url: `${BASE}/aep-m7-codev-fete/` },
|
||||||
|
{ date: '2026-04-27', titre: "Visibiliser le réseau d'entraide déjà existant", url: `${BASE}/aep-m7-carto-participative/` },
|
||||||
|
{ date: '2026-04-27', titre: "AEP M7 - Structurer l'entraide collective", url: `${BASE}/aep-m7-entraide/` },
|
||||||
|
{ date: '2026-04-12', titre: 'Résistance et régénération', url: `${BASE}/aep-m6-resistance/` },
|
||||||
|
{ date: '2026-02-15', titre: "Anatomie d'une société en crise — échelle XL (3/8)", url: `${BASE}/aep-m3-echxl/` },
|
||||||
|
{ date: '2026-01-25', titre: 'Architecture, anatomie d’individus sous l’eau 2/8', url: `${BASE}/aep-m2-echs/` },
|
||||||
|
{ date: '2025-11-30', titre: "Architecture, anatomie d'une profession sous l'eau 1/8", url: `${BASE}/aep-m1-echm/` },
|
||||||
|
]
|
||||||
@@ -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' },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||