#!/usr/bin/php7.4 %s [FR] %s (%s)\n", $file, $post['title'], $post['date'] ); $outputMd = 'blog/'.$file.'.md'; $outputGmi = 'blog/'.$file; $files[] = [$outputMd, $outputGmi]; $content = sprintf("# %s \n", $post['title']); $content.= sprintf("* %s \n", $post['date']); if (!empty($post['categories'])) { $content.= sprintf("* %s \n", implode(', ', $post['categories'])); } $content.= "\n"; $content.= $post['content']; file_put_contents($outputMd, $content); } foreach ($files as $v) { shell_exec(sprintf( 'md2gemini %1$s > %2$s && rm %1$s', $v[0], $v[1] )); } $index.= "\n"; $index.= "───────────────────────────────────────────────────\n"; $index.= "Je soutiens Tinternet & cie, les Chatons et l'April\n"; $index.= "Simon Vieille - Textes libres sauf indication(s) contraire(s)\n"; file_put_contents('blog/index.gmi', $index);