Commit e076471b by PLN (Algolia)

feat: Poem tiers, +1talk

parent ef81dc59
......@@ -6,6 +6,7 @@ words: 122
chars: 748
language: "Français"
original_file: "notes.carnet/Berg.sqd"
tier: "C"
---
L'avenir appartient à ceux qui se lèvent tôt
......
......@@ -8,6 +8,7 @@ lines: 108
words: 382
chars: 2260
original_file: "notes.carnet/carnet_archive/Haïkus - Courts .sqd"
tier: "D"
---
Grimpant en haut d'un arbre
......
......@@ -8,6 +8,7 @@ lines: 108
words: 382
chars: 2260
original_file: "notes.carnet/carnet_archive/Haïkus - Courts .sqd"
tier: "A"
---
C'est une trop petite fenêtre 
......
......@@ -7,6 +7,7 @@ lines: 19
words: 65
chars: 419
original_file: "notes.carnet/carnet_archive/Jardin botanique .sqd"
tier: "C"
---
Vue à en perdre le souffle
......
......@@ -8,6 +8,7 @@ lines: 44
words: 301
chars: 1687
original_file: "notes.carnet/carnet_archive/Ligne de base - dire pourquoi .sqd"
tier: 2
---
Ligne de base tracée là dans le sable
......
......@@ -3,6 +3,7 @@ title: "🌃 L'obsession"
date: "2025-03-16 00:13:37"
language: "Français"
original_file: "???"
tier: "A"
---
# 🌃
......
......@@ -6,6 +6,7 @@ words: 172
chars: 958
language: "Français"
original_file: "notes.carnet/carnet_archive/Villanelle du Temps .sqd"
tier: 2
---
Les doigts sur la guitare répètent la vieille danse,
......
---
title: "La French Stack: Search Relevance et GenAI"
description: "Tu viens de peaufiner la pertinence de recherche pour tes utilisateurs humains, et juste quand tu crois en avoir fini, voilà qu'il faut recommencer pour les robots ? Bienvenue à l'ère du RAG : on renvoie des résultats pertinents, non plus à un humain, mais à un LLM. Qu'est-ce que ça change ? Peut-on réutiliser ce qu'on sait déjà sur la pertinence d'un résultat de recherche ? On va voir que la pertinence pour les LLMs n'est pas si différente des critères humains, et que la plupart de ton travail acharné peut être réutilisé !"
date: '2025-02-25'
slides: https://alg.li/la-french-stack
video: https://www.youtube.com/watch?v=_shhFLLau60&t=5105s
context: "SearchParty Meetup - Feb 2025"
event: https://lu.ma/dce6ggba
---
import {getAllContentData, getAllContentIds, getContentData} from './utils'
export function getPoemsData(sortBy = 'date', sortOrder = 'desc') {
export function getPoemsData(sortBy = 'tier', sortOrder = 'desc') {
const poems = getAllContentData('poems', false);
// Default sort is by date
// Default sort is by DECREASING tier
// Top is tier S, then A, then B, C, D, E, F, and finally tierless
let sortedPoems = [...poems].sort((a, b) => {
if (a.date < b.date) return sortOrder === 'desc' ? 1 : -1;
if (a.date > b.date) return sortOrder === 'desc' ? -1 : 1;
// Equal
if (a.tier === b.tier) return 0;
// Tierless
if (a.tier === undefined) return sortOrder === 'desc' ? 1 : -1;
if (b.tier === undefined) return sortOrder === 'desc' ? -1 : 1;
// S is the best tier
if (a.tier === 'S') return sortOrder === 'desc' ? -1 : 1;
if (b.tier === 'S') return sortOrder === 'desc' ? 1 : -1;
// A is the second best tier
if (a.tier === 'A') return sortOrder === 'desc' ? -1 : 1;
if (b.tier === 'A') return sortOrder === 'desc' ? 1 : -1;
// B is the third best tier
if (a.tier === 'B') return sortOrder === 'desc' ? -1 : 1;
if (a.tier < b.tier) return sortOrder === 'desc' ? -1 : 1;
return 0;
});
// Additional sorting options
if (sortBy === 'date') {
sortedPoems = [...poems].sort((a, b) => {
if (a.tier < b.tier) return sortOrder === 'desc' ? 1 : -1;
if (a.tier > b.tier) return sortOrder === 'desc' ? -1 : 1;
return 0;
});
}
if (sortBy === 'wordcount') {
sortedPoems.sort((a, b) => {
const aWords = a.contentHtml?.split(/\s+/).length || 0;
const bWords = b.contentHtml?.split(/\s+/).length || 0;
......
......@@ -116,7 +116,7 @@ export default function Home({ posts, talks }) {
</section>
<section className={`${utilStyles.headingMd} ${utilStyles.padding1px}`}>
<Link href="/parvagues/" className={utilStyles.sectionLink}>
<span>code into <em>music</em></span>
<h3>code into <em>music</em></h3>
</Link>
<p className="description">
As <Link href="/parvagues/" className={utilStyles.inlineLink}>ParVagues</Link>, I write patterns that
......@@ -126,7 +126,7 @@ export default function Home({ posts, talks }) {
</section>
<section className={`${utilStyles.headingMd} ${utilStyles.padding1px}`}>
<Link href="/hydra/" className={utilStyles.sectionLink}>
<span>code into <em>animated pixelscapes</em></span>
<h3>code into <em>animated pixelscapes</em></h3>
</Link>
<p className="description">
Using <Link href="/hydra/" className={utilStyles.inlineLink}>Hydra</Link>, I create animations that
......@@ -146,7 +146,7 @@ export default function Home({ posts, talks }) {
</section>
<section className={`${utilStyles.headingMd} ${utilStyles.padding1px}`}>
<Link href="/poesie/" className={utilStyles.sectionLink}>
<span>…words into <em>poems</em></span>
<h3>…words into <em>poems</em></h3>
</Link>
<p className="description">
A selection of texts scattered across note books and note apps.
......@@ -154,7 +154,7 @@ export default function Home({ posts, talks }) {
</section>
<section className={`${utilStyles.headingMd} ${utilStyles.padding1px}`}>
<Link href="/talks/" className={utilStyles.sectionLink}>
<span>…ideas into <em>talks</em></span>
<h3>…ideas into <em>talks</em></h3>
</Link>
<p className="description">
I <Link href="/talks/" className={utilStyles.inlineLink}>speak</Link> about topics I care about: from
......
......@@ -16,7 +16,7 @@ export async function getStaticProps() {
}
export default function Poems({ poems }) {
const [sortBy, setSortBy] = useState('date');
const [sortBy, setSortBy] = useState('tier');
const [sortOrder, setSortOrder] = useState('desc');
const [filterLanguage, setFilterLanguage] = useState('Français');
const [filterTags, setFilterTags] = useState('all');
......@@ -122,6 +122,8 @@ export default function Poems({ poems }) {
}}
aria-label="Sort options"
>
<option value="tier-desc">Best first</option>
<option value="tier-asc">Worst first</option>
<option value="date-desc">Newest first</option>
<option value="date-asc">Oldest first</option>
<option value="wordcount-desc">Longest first</option>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment