Skip to content

Commit

Permalink
feat: citations
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-bouvier committed Nov 25, 2024
1 parent 4994742 commit bf29392
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ export default function (eleventyConfig) {
.sort((a, b) => a.data.title.localeCompare(b.data.title));
});

eleventyConfig.addCollection("citations", function (collectionApi) {
let filteredByGlob = collectionApi.getFilteredByGlob(["citation/*.md", "citation/*.html"]);
return filteredByGlob
.sort((a, b) => a.data.title.compare((b.data.title)))
.sort((a, b) => a.data.citation_auteur.compare((b.data.citation_auteur)));
});

eleventyConfig.addCollection("kata-logue", function (collectionApi) {
return collectionApi.getFilteredByGlob(["kata-logue/*.md", "kata-logue/*.html"]);
});
Expand Down
47 changes: 47 additions & 0 deletions _includes/citation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: layout.html
title: Citation
description: "Citation"
category: Citation
---

<h2>{{title}}</h2>

<!--{% if category %}-->
<!--{{ category }}-->
<!--{% endif %}-->

{% if tags %}
<ul class="tags">
{% for tag in tags %}
<li><a href="/tags/{{tag}}">{{tag}}</a></li>
{% endfor %}
</ul>
{% endif %}

{% if stub %}
<p>
<span class="bold">Note :</span> ceci est une ébauche de citation qui sera complétée dans le futur.
Elle a été créée dans le but de résoudre les liens avec d’autres articles.
<!-- N’hésite pas à jeter un œil aux liens ci-dessous pour trouver les pages associées.-->
</p>
{% endif %}
{% if description %}<p>{{description}}</p>{% endif %}

<blockquote cite="{{citation_source_href}}">
{{content}}
</blockquote>
<p>
{%if citation_auteur %}
— {{citation_auteur}},
{% endif %}
<cite><a href="{{citation_source_href}}">{{citation_source}}</a></cite>
({{citation_source_annee}})
{%if citation_source_auteur %}
{{citation_source_auteur}}
{% endif %}
{%if citation_source_page %}
, page {{citation_source_page}}
{% endif %}
</cite>
</p>
10 changes: 6 additions & 4 deletions _includes/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ <h1 style="margin: .25rem .5rem;"><a href="/">Baldir</a></h1>
<a href="/a-propos" role="menuitem">À propos</a>
<a href="/notes" role="menuitem">Notes</a>
<a href="/glossaire" role="menuitem">Glossaire</a>
<a href="/citations" role="menuitem">Citations</a>
<a href="/making-of" role="menuitem">Making of</a>
</nav>
<link href="/public/css/pagefind-baldir-fr-ui.css" rel="stylesheet">
Expand All @@ -38,15 +39,16 @@ <h1 style="margin: .25rem .5rem;"><a href="/">Baldir</a></h1>
</header>
<main id="skip-content">
{{content}}
<aside>
Tu veux en savoir plus ? Prenons <a href="https://calendly.com/baldir-fr">30 minutes pour en parler !</a>
</aside>
</main>
<hr/>
<aside>
Tu veux en savoir plus ? Prenons <a href="https://calendly.com/baldir-fr">30 minutes pour en parler !</a>
</aside>
<footer>
<a class="modify-from-sources"
href="https://github.com/marc-bouvier/next.baldir.fr/blob/main/{{ page.inputPath }}"
target="_blank">
Modifier cette page sur GitHub
Voir cette page sur GitHub
</a>
</footer>
</body>
Expand Down
4 changes: 4 additions & 0 deletions citation/citation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"layout": "citation.html",
"category": "Citation"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.
description: "Joe Armstrong au sujet du manque de réutilisation de code qui selon lui vient des langages orientés objet"
citation_auteur: Joe Armstrong
citation_source: "Coders at Work: Reflections on the Craft of Programming"
citation_source_auteur: Peter Seibel
citation_source_annee: "2009"
citation_source_page: "213"
citation_source_href: https://www.goodreads.com/book/show/6713575-coders-at-work
---

**Seibel:** So you started out saying software reuse is “appallingly bad,” but opening up every black box and fiddling with it all hardly seems like movement toward reusing software.

**Armstrong:** I think the lack of reusability comes in object-oriented languages, not in functional languages. Because the problem with object-oriented languages is they've got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.”
12 changes: 12 additions & 0 deletions citations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: default.html
title: Citations
description: "Citations"
eleventyImport:
collections: ["citations"]
---
{% for citation in collections.citations %}
- [{{ citation.data.title }}]({{citation.url}}) - {{ citation.data.citation_auteur }}
{% endfor %}


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"test": "vitest"
},
"devDependencies": {
"pagefind": "^1.2.0",
"@11ty/eleventy": "^3.0.0",
"@11ty/eleventy-img": "^5.0.0",
"@11ty/eleventy-plugin-rss": "^2.0.2",
Expand All @@ -24,6 +23,7 @@
"ical-generator": "^8.0.1",
"js-yaml": "^4.1.0",
"markdown-it": "^14.1.0",
"pagefind": "^1.2.0",
"vitest": "^2.1.5"
}
}

0 comments on commit bf29392

Please sign in to comment.