2 Commits

Author SHA1 Message Date
Jules Neny
090fb581ee feat(v1.6): ajout LinkedIn API V2 comme 3e source journal
- Node Fetch-linkedin (LinkedIn REST API v2/posts, OAuth2 predefined credential)
- Parser parseLinkedIn() dans Normalise : extrait commentary + UGC text, URL post, thumbnail
- Fonction safeJson() parallèle à safeText() pour payloads JSON (vs XML)
- Variable LINKEDIN_MEMBER_ID (env n8n) dans l'URL du endpoint
- .env.example documenté avec LINKEDIN_MEMBER_ID + comment récupération
- counts.linkedin ajouté dans le payload journal.json

Prerequis L.1 bloquants (humain Jules) :
- Redirect URL n8n dans LinkedIn Developer Portal
- Credential LinkedIn OAuth2 créé dans n8n UI
- Member ID Jules récupéré via /v2/me et stocké dans env n8n

Branche depuis feat/v1.5-E-rsshub (V1.5 pas encore mergé sur main).
Pas de modif Astro/Vue — JournalFeed (JournalList.vue) déjà platform-agnostic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 08:37:47 +02:00
Jules Neny
458a152525 V1.5-E RSSHub journal feed (E.1-E.8)
Bascule Behold -> RSSHub self-host (rss.trans-former.fr) :

- InstaFeed.vue : consomme PUBLIC_JOURNAL_URL (journal unifie n8n)
  au lieu de feeds.behold.so direct. Filtre platform=instagram +
  account dans l'url. Plus de feedId Behold a passer.
- ColInsta.astro : supprime props feedId, passe seulement account
  handle (aep.politique, julesneny) pour filtrage cote client.
- .env.example : PUBLIC_BEHOLD_* deprecies (conservees pour compat),
  PUBLIC_JOURNAL_URL note V1.5-E source RSSHub.
- docs/n8n-workflow-journal-aggregate-v2-rsshub.json : workflow V2
  a importer dans n8n. Remplace 3 nodes Behold par : Substack natif
  (julesneny.substack.com/feed) + RSSHub Insta x2 (rss.trans-former.fr/
  instagram/user/*). Cron 3h -> 4h UTC (anti-rate-limit). Parser RSS
  ajoute (CDATA, dedup par GUID).
- carte-o.json : regen prebuild auto.

Ops VPS realisees hors repo (E.1-E.3, E.8 conf) :
- docker pull diygod/rsshub:latest (image officielle, pas rsshub/rsshub)
- /opt/rsshub/docker-compose.yml : RSSHub + Redis cache, port 3006 local
- Caddy : bloc rss.trans-former.fr -> reverse_proxy 127.0.0.1:3006

CHECKPOINT E.4 BLOQUANT : DNS OVH 'rss' IN A 178.104.106.195 a pousser
manuellement par Jules. Sans DNS, rss.trans-former.fr inaccessible.

LIMITE FONCTIONNELLE detectee : RSSHub /instagram/* requiert config
Instagram cookie (ConfigNotFoundError 503). Tant que les env vars
INSTAGRAM_USERNAME/PASSWORD ou cookie ne sont pas fournis a RSSHub,
les routes Insta retourneront vide. Le journal aura 0 item insta et
ColInsta affichera fallbackBio. Substack et Gitea sources OK.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 00:56:36 +02:00
9 changed files with 476 additions and 139 deletions

View File

@@ -1,17 +1,24 @@
# Kit (ex-ConvertKit) - newsletter infolettre
KIT_API_SECRET_V4=kit_xxx
# Behold.so feed IDs (voir docs/BEHOLD-SETUP.md)
# 1) Inscris-toi sur https://behold.so/dashboard
# 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
# Behold.so : DEPRECATED V1.5-E — remplace par RSSHub self-host (rss.trans-former.fr).
# InstaFeed.vue consomme desormais PUBLIC_JOURNAL_URL (filtre platform=instagram).
# Les 2 vars ci-dessous ne sont plus lues ; conservees pour compat.env.local existant.
PUBLIC_BEHOLD_AEP=
PUBLIC_BEHOLD_JULESNENY=
# Journal unifie (PC6) - URL JSON agrege par n8n cron nocturne
# Journal unifie (V1.6) - URL JSON agrege par n8n cron 4h UTC
# Sources : RSSHub self-host (Insta @aep.politique + @julesneny) + Substack natif
# + Atom Gitea natif (git.trans-former.fr/jules.atom) + LinkedIn API V2
# Override en local : pointer vers un mock /public/data/journal.json par exemple
PUBLIC_JOURNAL_URL=https://data.trans-former.fr/journal.json
# LinkedIn (V1.6) - Member ID du profil Jules (format numerique, sans urn: prefix)
# Recuperer via curl -H "Authorization: Bearer TOKEN" https://api.linkedin.com/v2/me | jq .id
# Stocke comme variable d'env n8n (Settings -> Variables) sous le nom LINKEDIN_MEMBER_ID
# Le workflow l'utilise comme : urn:li:person:${LINKEDIN_MEMBER_ID}
LINKEDIN_MEMBER_ID=
# Chatbot upstream (PC7) - URL backend chatbot AEP
# V1 : chatbot AEP classique (Mistral Small + 120 fiches)
# V1.5 : switch vers LightRAG-PE (1 ligne)

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"version": "1.1",
"generatedAt": "2026-05-12T09:28:20.972Z",
"generatedAt": "2026-05-12T22:53:33.094Z",
"nodes": [
{
"id": "contrat-social-medecine-corps-social",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -1,23 +1,21 @@
---
import InstaFeed from '../vue/InstaFeed.vue';
// Feed IDs Behold a remplir apres inscription Behold (voir docs/BEHOLD-SETUP.md)
const FEED_AEP = import.meta.env.PUBLIC_BEHOLD_AEP || 'PLACEHOLDER_AEP';
const FEED_JULESNENY = import.meta.env.PUBLIC_BEHOLD_JULESNENY || 'PLACEHOLDER_JULESNENY';
// V1.5-E : Behold remplacé par RSSHub self-host. InstaFeed lit désormais
// le journal unifié (PUBLIC_JOURNAL_URL → data.trans-former.fr/journal.json)
// agrégé par n8n depuis rss.trans-former.fr. Plus de feedId Behold à passer.
---
<div class="h-full overflow-y-auto">
<InstaFeed
client:visible
feedId={FEED_AEP}
account="@aep.politique"
account="aep.politique"
accountUrl="https://www.instagram.com/aep.politique/"
fallbackBio="Carrousels manifeste AEP ; pensee politique eco-architecture"
/>
<InstaFeed
client:visible
feedId={FEED_JULESNENY}
account="@julesneny"
account="julesneny"
accountUrl="https://www.instagram.com/julesneny/"
fallbackBio="Peinture, poesie, Corse ; archives visuelles personnelles"
/>

View File

@@ -1,23 +1,28 @@
---
// Footer.astro - V1.5-C.4 : footer 2 lignes au lieu de 3.
// Ligne 1 (centree, plein cadre) : label Courier 12px #475569 + form subscribe (input + bouton)
// Ligne 2 : gauche = nav (Manifeste / A propos / Mentions legales) ; droite = 5 logos RS monochrome #475569.
// Palette V1.3 figee : encre #0F172A, encre douce #475569, papier #FAFAF7
// Footer.astro - V1.4-F : 1 ligne 3 zones (nav / subscribe / logos RS).
// Alignement vertical centre + padding-y reduit (py-2) pour profil plus fin.
// Subscribe input/button compact (py-1) cale sur baseline des autres elements.
---
<footer class="border-t border-neutral-200 px-6 py-3 bg-[#FAFAF7] text-[#0F172A]">
<footer class="border-t border-neutral-200 px-6 py-2 bg-[#FAFAF7] text-[#0F172A]">
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-6">
<!-- LIGNE 1 : label + subscribe form, centre plein cadre -->
<div class="flex flex-col items-center gap-1 mb-3">
<p class="footer-label text-[12px] text-[#475569] leading-none">
Reçois le journal AEP — un envoi par mois, sans bullshit
</p>
<form id="subscribe-form" class="flex gap-2 items-center w-full max-w-[320px]">
<!-- ZONE GAUCHE : liens nav -->
<nav class="flex gap-4 text-xs items-center justify-center md:justify-start">
<a href="/manifeste" data-manifeste-link class="opacity-60 hover:opacity-100 transition-opacity">Manifeste</a>
<a href="/a-propos" class="opacity-60 hover:opacity-100 transition-opacity">A propos</a>
<a href="/mentions-legales" class="opacity-60 hover:opacity-100 transition-opacity">Mentions legales</a>
</nav>
<!-- ZONE CENTRE : subscribe form compact (endpoint /api/subscribe V1.1-I).
V1.4-F : padding-y reduit (py-1) pour caler input sur la baseline des liens + logos. -->
<div class="flex flex-col items-center gap-0.5">
<form id="subscribe-form" class="flex gap-2 items-center">
<input
type="email"
name="email"
required
placeholder="ton@email.fr"
class="flex-1 px-3 py-1 border border-neutral-300 rounded text-xs focus:outline-none focus:border-[#0F172A] bg-white leading-tight"
class="px-3 py-1 border border-neutral-300 rounded text-xs focus:outline-none focus:border-[#0F172A] bg-white leading-tight"
/>
<button
type="submit"
@@ -29,66 +34,58 @@
<p id="subscribe-msg" class="text-[10px] text-neutral-500 min-h-[0.75rem]"></p>
</div>
<!-- LIGNE 2 : nav gauche + logos RS droite -->
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-6">
<!-- ZONE GAUCHE : liens nav -->
<nav class="flex gap-4 text-xs items-center justify-center md:justify-start text-[#475569]">
<a href="/manifeste" data-manifeste-link class="opacity-100 hover:text-[#0F172A] transition-colors">Manifeste</a>
<a href="/a-propos" class="opacity-100 hover:text-[#0F172A] transition-colors">A propos</a>
<a href="/mentions-legales" class="opacity-100 hover:text-[#0F172A] transition-colors">Mentions legales</a>
</nav>
<!-- ZONE DROITE : 5 logos RS monochrome #475569 100% (V1.5-C.4 : pas les couleurs natives) -->
<div class="flex gap-4 md:gap-6 items-center justify-center md:justify-end text-[#475569]">
<!-- Instagram @aep.politique -->
<!-- ZONE DROITE : logos RS cliquables (SVG inline, fill #0F172A 60%) -->
<!-- V1.3-F : gap-4 mobile / gap-6 desktop pour espacer les logos. V1.4-F : items-center force baseline. -->
<div class="flex gap-4 md:gap-6 items-center justify-center md:justify-end text-[#0F172A]">
<!-- V1.4-bis FIX 6 : Instagram x2 (AEP politique + Jules perso) avec aria-labels distincts.
V1.4-bis FIX 7 : SVG simplifie (camera carree avec coins arrondis, lentille, point flash) — rendu propre net. -->
<a
href="https://www.instagram.com/aep.politique/"
target="_blank"
rel="noopener noreferrer"
aria-label="Instagram @aep.politique"
title="@aep.politique"
class="hover:text-[#0F172A] transition-colors"
class="opacity-60 hover:opacity-100 transition-opacity"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-[18px] h-[18px] md:w-5 md:h-5" fill="currentColor" aria-hidden="true">
<path d="M7.75 2C4.574 2 2 4.574 2 7.75v8.5C2 19.426 4.574 22 7.75 22h8.5C19.426 22 22 19.426 22 16.25v-8.5C22 4.574 19.426 2 16.25 2h-8.5zM4 7.75A3.75 3.75 0 017.75 4h8.5A3.75 3.75 0 0120 7.75v8.5A3.75 3.75 0 0116.25 20h-8.5A3.75 3.75 0 014 16.25v-8.5zM12 7a5 5 0 100 10 5 5 0 000-10zm0 2a3 3 0 110 6 3 3 0 010-6zm5.5-3.5a1 1 0 100 2 1 1 0 000-2z"/>
</svg>
</a>
<!-- Instagram @julesneny -->
<!-- Instagram @julesneny (compte perso/art) -->
<a
href="https://www.instagram.com/julesneny/"
target="_blank"
rel="noopener noreferrer"
aria-label="Instagram @julesneny"
title="@julesneny"
class="hover:text-[#0F172A] transition-colors"
class="opacity-60 hover:opacity-100 transition-opacity"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-[18px] h-[18px] md:w-5 md:h-5" fill="currentColor" aria-hidden="true">
<path d="M7.75 2C4.574 2 2 4.574 2 7.75v8.5C2 19.426 4.574 22 7.75 22h8.5C19.426 22 22 19.426 22 16.25v-8.5C22 4.574 19.426 2 16.25 2h-8.5zM4 7.75A3.75 3.75 0 017.75 4h8.5A3.75 3.75 0 0120 7.75v8.5A3.75 3.75 0 0116.25 20h-8.5A3.75 3.75 0 014 16.25v-8.5zM12 7a5 5 0 100 10 5 5 0 000-10zm0 2a3 3 0 110 6 3 3 0 010-6zm5.5-3.5a1 1 0 100 2 1 1 0 000-2z"/>
</svg>
</a>
<!-- GitHub / Gitea -->
<!-- GitHub (TODO: si 404 connu, fallback https://git.trans-former.fr/jules Gitea) -->
<a
href="https://github.com/julesneny"
target="_blank"
rel="noopener noreferrer"
aria-label="GitHub"
class="hover:text-[#0F172A] transition-colors"
class="opacity-60 hover:opacity-100 transition-opacity"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-[18px] h-[18px] md:w-5 md:h-5" fill="currentColor" aria-hidden="true">
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>
</svg>
</a>
<!-- LinkedIn -->
<!-- LinkedIn TODO: confirmer URL LinkedIn Jules -->
<a
href="https://www.linkedin.com/in/jules-neny/"
target="_blank"
rel="noopener noreferrer"
aria-label="LinkedIn"
class="hover:text-[#0F172A] transition-colors"
class="opacity-60 hover:opacity-100 transition-opacity"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-[18px] h-[18px] md:w-5 md:h-5" fill="currentColor" aria-hidden="true">
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.063 2.063 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>
@@ -101,24 +98,19 @@
target="_blank"
rel="noopener noreferrer"
aria-label="Substack"
class="hover:text-[#0F172A] transition-colors"
class="opacity-60 hover:opacity-100 transition-opacity"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-[18px] h-[18px] md:w-5 md:h-5" fill="currentColor" aria-hidden="true">
<path d="M22.539 8.242H1.46V5.406h21.08v2.836zM1.46 10.812V24L12 18.11 22.54 24V10.812H1.46zM22.54 0H1.46v2.836h21.08V0z"/>
</svg>
</a>
<!-- TODO V1.3 : ajouter logo Pinterest quand compte créé -->
</div>
</div>
</footer>
<style>
/* V1.5-C.4 : label newsletter en Courier New 12px, encre douce */
.footer-label {
font-family: 'Courier New', Courier, monospace;
}
</style>
<script>
const form = document.getElementById('subscribe-form') as HTMLFormElement | null;
const msg = document.getElementById('subscribe-msg') as HTMLParagraphElement | null;
@@ -154,12 +146,14 @@
});
// V1.3-E : intercept clics liens Manifeste depuis le footer -> preview centrale sur racine.
// Sur /a-propos, /mentions-legales, /manifeste lui-meme : navigation normale.
document.querySelectorAll<HTMLAnchorElement>('a[data-manifeste-link]').forEach((el) => {
el.addEventListener('click', (e) => {
if (window.location.pathname === '/') {
e.preventDefault();
window.dispatchEvent(new CustomEvent('preview-open', { detail: { type: 'manifeste' } }));
}
// sinon : navigation normale vers /manifeste
});
});
</script>

View File

@@ -1,11 +1,11 @@
---
// SiteHeader.astro - V1.5-C : header lowercase + mobile 1 ligne unique (truncate ellipsis)
// SiteHeader.astro - V1.3-C : header 1 ligne fine, liens cliquables, phrase intention Roboto Condensed
// Palette V1.3 figee : papier #FAFAF7, encre #0F172A, encre douce #475569, border #E5E7EB
// Composition :
// Desktop (>= md) : 1 ligne ~44px - trans-former | Jules Neny | architecture d'ecologie politique [phrase intention right-aligned, Roboto Condensed]
// Mobile (< md) : 1 SEULE ligne compacte (V1.5-C.2) - trans-former . Jules Neny . AEP, truncate ellipsis si overflow, phrase intention masquee
// Liens (V1.5-C.3 confirmes) :
// trans-former -> /
// Desktop (>= md) : 1 ligne ~44px - Trans-Former | Jules Neny | architecture d'ecologie politique [phrase intention right-aligned, Roboto Condensed]
// Mobile (< md) : 2 lignes compactes - ligne 1 Trans-Former / ligne 2 Jules Neny . AEP (cliquables) - phrase intention masquee
// Liens :
// Trans-Former -> /
// Jules Neny -> /a-propos
// architecture d'ecologie politique -> https://aep.trans-former.fr (same-tab, site frere coherent)
// Typo phrase intention : Roboto Condensed Variable @fontsource (weight 400, font-stretch 75%)
@@ -15,34 +15,37 @@ import '@fontsource-variable/roboto-condensed/wght.css';
class="site-header w-full border-b border-[#E5E7EB] bg-[#FAFAF7] text-[#0F172A] px-4 md:px-6 flex items-center"
role="banner"
>
<!-- Bloc identite (gauche) - V1.5-C.2 : 1 ligne unique mobile + desktop, truncate ellipsis si overflow -->
<!-- Bloc identite (gauche) -->
<nav
class="identite flex flex-row items-baseline gap-x-1.5 md:gap-x-2 min-w-0 flex-shrink overflow-hidden whitespace-nowrap"
class="flex flex-col md:flex-row md:items-baseline gap-x-2 gap-y-0.5 flex-shrink-0"
aria-label="identite site"
>
<!-- V1.5-C.1 : lowercase "trans-former" (retire l'effet marque corporate) -->
<!-- Ligne 1 desktop = wordmark inline ; mobile = ligne dediee -->
<a
href="/"
class="font-semibold tracking-tight text-[#0F172A] hover:text-[#0F172A] text-[15px] md:text-[16px] leading-none no-underline hover:underline underline-offset-2 decoration-1 flex-shrink-0"
class="font-semibold tracking-tight text-[#0F172A] hover:text-[#0F172A] text-[15px] md:text-[16px] leading-none no-underline hover:underline underline-offset-2 decoration-1"
aria-label="trans-former.fr - accueil"
>
trans-former
Trans-Former
</a>
<span class="text-[#94A3B8] leading-none flex-shrink-0" aria-hidden="true">·</span>
<!-- Bloc secondaire : Jules Neny . AEP (mobile : ligne 2 ; desktop : inline) -->
<span class="flex items-baseline gap-1.5 text-[#475569] leading-none">
<span class="text-[#94A3B8] hidden md:inline" aria-hidden="true">·</span>
<a
href="/a-propos"
class="text-[12px] md:text-[13px] text-[#475569] hover:text-[#0F172A] no-underline hover:underline underline-offset-2 decoration-1 leading-none flex-shrink-0"
class="text-[12px] md:text-[13px] text-[#475569] hover:text-[#0F172A] no-underline hover:underline underline-offset-2 decoration-1"
>
Jules Neny
</a>
<span class="text-[#94A3B8] leading-none flex-shrink-0" aria-hidden="true">·</span>
<span class="text-[#94A3B8]" aria-hidden="true">·</span>
<a
href="https://aep.trans-former.fr"
class="text-[12px] md:text-[13px] text-[#475569] hover:text-[#0F172A] no-underline hover:underline underline-offset-2 decoration-1 leading-none truncate min-w-0"
class="text-[12px] md:text-[13px] text-[#475569] hover:text-[#0F172A] no-underline hover:underline underline-offset-2 decoration-1"
>
architecture d'écologie politique
</a>
</span>
</nav>
<!-- Phrase intention (droite, desktop only) - Roboto Condensed allongee -->
@@ -57,11 +60,12 @@ import '@fontsource-variable/roboto-condensed/wght.css';
.site-header {
height: 44px;
}
/* V1.5-C.2 : mobile 1 ligne unique, hauteur identique desktop (44px) */
@media (max-width: 767px) {
.site-header {
height: 44px;
min-height: 44px;
height: auto;
min-height: 48px;
padding-top: 6px;
padding-bottom: 6px;
}
}
/* Phrase intention : Roboto Condensed Variable, font-stretch 75% (allongement vertical condense)

View File

@@ -1,46 +1,80 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
interface BeholdPost {
// 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;
mediaUrl: string;
thumbnailUrl?: string;
caption?: string;
mediaType: 'IMAGE' | 'VIDEO' | 'CAROUSEL_ALBUM';
thumbnailUrl: string | null;
caption: string;
timestamp: string;
}
const props = defineProps<{
feedId: string;
/** handle Instagram sans @ (ex: 'aep.politique', 'julesneny') — sert à filtrer le journal */
account: string;
accountUrl: string;
fallbackBio?: string;
/** nombre max de posts affichés (défaut 6, parité avec ancien Behold) */
max?: number;
}>();
const posts = ref<BeholdPost[]>([]);
const posts = ref<InstaPost[]>([]);
const loading = ref(true);
const error = ref<string | null>(null);
const isPlaceholder = (id: string) => !id || id.startsWith('PLACEHOLDER_');
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 () => {
if (isPlaceholder(props.feedId)) {
loading.value = false;
error.value = 'no-feed-id';
return;
}
try {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 5000);
const res = await fetch(`https://feeds.behold.so/${props.feedId}`, {
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(`Behold returned ${res.status}`);
const data = await res.json();
const items: BeholdPost[] = Array.isArray(data) ? data : (data.posts ?? []);
posts.value = items.slice(0, 6);
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 {
@@ -71,24 +105,28 @@ onMounted(async () => {
/>
</div>
<div
v-else-if="posts.length"
class="grid grid-cols-2 gap-1 p-1"
>
<div v-else-if="posts.length" class="grid grid-cols-2 gap-1 p-1">
<a
v-for="post in posts"
:key="post.id"
:href="post.permalink"
target="_blank"
rel="noopener"
class="block aspect-square overflow-hidden group"
class="block aspect-square overflow-hidden group bg-neutral-100"
>
<img
:src="post.thumbnailUrl || post.mediaUrl"
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>
</div>

View File

@@ -13,9 +13,7 @@ import HamburgerMenu from '../components/astro/HamburgerMenu.astro';
<main class="h-full overflow-y-auto bg-white">
<article class="max-w-2xl mx-auto px-6 py-16 md:py-24">
<!-- V1.5-BIO : photo Jules a droite du titre desktop, dessous mobile. max-width 320px, radius 4px, eager (above the fold). -->
<header class="mb-10 flex flex-col md:flex-row md:items-start md:gap-8">
<div class="flex-1 min-w-0">
<header class="mb-10">
<p class="text-sm uppercase tracking-widest text-neutral-500 mb-3">
A propos
</p>
@@ -25,16 +23,6 @@ import HamburgerMenu from '../components/astro/HamburgerMenu.astro';
<p class="mt-3 text-neutral-600 text-base md:text-lg">
Architecte HMONP. Ecrivain politique. Facilitateur. Bagneres-de-Bigorre, Pyrenees.
</p>
</div>
<img
src="/images/jules-profil.jpg"
alt="Jules Neny, architecte d'écologie politique"
width="320"
height="323"
loading="eager"
decoding="async"
class="w-full md:w-[200px] md:max-w-[200px] mt-6 md:mt-0 rounded-[4px] flex-shrink-0"
/>
</header>
<div class="text-neutral-800 text-[17px] leading-[1.75] space-y-6">