mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 11:32:39 +02:00
New version of the website.
- More categories are displayed - Change the URL Scheme for categories - Add a view for weeknotes, readings and code.
This commit is contained in:
parent
84eef3e989
commit
91159ecc80
27 changed files with 646 additions and 65 deletions
|
@ -1,4 +1,8 @@
|
|||
# L'Ère de la critique
|
||||
---
|
||||
title: L'Ère de la critique
|
||||
tags: Savoir-Être
|
||||
headline: Je réalise combien mes attentes élevées et mon désir de perfection peuvent me priver de joie et engendrer une pression nuisible, pour moi et pour ceux dont je critique les œuvres ; je dois donc questionner ces attentes, sortir de la compétition, considérer l'impact de mes critiques et rechercher le plaisir sincère et constructif dans mes appréciations.
|
||||
---
|
||||
|
||||
Au détour d'[une discussion sur mastodon](https://tutut.delire.party/@almet/108257053355480866) je viens de retrouver ce bout de texte écrit mais jamais publié.
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
# Réveil difficile
|
||||
---
|
||||
title: Réveil difficile
|
||||
tags: Poésie
|
||||
---
|
||||
|
||||
*Je viens de remettre la main sur un texte écrit durant Artfèvre 2020, et je lui donne beaucoup plus de sens avec du recul. Je crois que ça parle de ma prise de conscience des oppressions de classe (sexisme, racisme), toute fraîche à l'époque.*
|
||||
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
# Tolérance, empathie et limites
|
||||
---
|
||||
title: Tolérance, empathie et limites
|
||||
tags: Limites, Savoir-Être
|
||||
headline: Je lutte contre la « peur de comprendre », et potentiellement d'accorder de l'empathie à ceux qui, selon moi, perpétuent l'injustice, tout en questionnant les limites de ma tolérance et ma volonté de dialogue ouvert.
|
||||
---
|
||||
|
||||
Suite à un message de Yannick sur mastodon, je me suis rendu compte que j'avais une réaction que je ne comprennais pas. Son message :
|
||||
|
||||
|
@ -9,12 +13,10 @@ Suite à un message de Yannick sur mastodon, je me suis rendu compte que j'avais
|
|||
> Se dire que j'aurais aimé l'entendre s'exprimer sur les retraites ...
|
||||
> — [Yannick François: "Dans la voiture bar d'un train…" - Framapiaf](https://framapiaf.org/@yaf/109916074251295047)
|
||||
|
||||
Auquel j'ai répondu que
|
||||
Auquel j'ai répondu
|
||||
|
||||
> Je suis pas sur que tu aurais aimé l'entendre 😧
|
||||
|
||||
---
|
||||
|
||||
J'essaye d'analyser pourquoi l'idée me fait réagir et ce que ça vient chercher chez moi.
|
||||
|
||||
D'un côté j'ai une envie de justice : je veux confronter ces personnes au monde qu'il créent et dont ils profitent, d'un autre côté ça me fait peur.
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
# Séparation travail et loisirs
|
||||
---
|
||||
title: Séparation travail et loisirs
|
||||
tags: Travail, Facilitation, Savoir-Être
|
||||
headline: Bien que nécessaire pour certains pour se protéger de l'exploitation, cette séparation ne risque-elle pas de déshumaniser le travail et d'empêcher la construction de relations authentiques entre collègues ?
|
||||
---
|
||||
|
||||
> Plus sérieusement, le boulot est le boulot et les loisirs sont aussi la liberté des salariés de faire strictement ce qu’ils veulent de leur temps libre.
|
||||
> Les trucs « conviviaux » des boites « cool », c’est un moyen très calculé de brouiller la perception travail/loisir et d’induire en fait du présentéisme forcené qui n’est rémunéré que de manière très symbolique.
|
||||
> Et qué s’apelerio exploitation.
|
||||
>
|
||||
> — [Le Monolecte, sur framapiaf](https://framapiaf.org/@Monolecte/109924605965899629)
|
||||
|
||||
Je me questionne sur le double rôle des barrières de protection mises en place au travail, peuvent-elles nous empêcher de créer le monde que l’on veut voir advenir ?
|
||||
|
|
|
@ -5,7 +5,7 @@ hésitons à continuer à nous entêter avec notre propre solution de
|
|||
stockage/synchronisation.**
|
||||
|
||||
Comme nous l'écrivions [dans l'article
|
||||
précédent]({filename}/Technologie/2015-04-01-service-de-nuages.rst), nous
|
||||
précédent]({filename}/technologie/2015-04-01-service-de-nuages.rst), nous
|
||||
souhaitons construire une solution de stockage générique. On refait
|
||||
[Daybed](http://daybed.readthedocs.org) chez Mozilla \!
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ Obtenir la liste des "principals" d'un ACE
|
|||
d'une ACL (e.g. *modifier un enregistrement*).
|
||||
|
||||
Avec le `système de permissions choisi
|
||||
<{filename}/Technologie/2015-05-01-cliquet-permissions.rst>`_, les permissions d'un
|
||||
<{filename}/technologie/2015-05-01-cliquet-permissions.rst>`_, les permissions d'un
|
||||
objet héritent de celle de l'objet parent.
|
||||
|
||||
Par exemple, avoir le droit d'écriture sur un *bucket* permet la
|
||||
|
|
|
@ -18,7 +18,7 @@ Les origines
|
|||
============
|
||||
|
||||
L'objectif pour le premier trimestre 2015 était de construire un service de
|
||||
stockage et de `synchronisation de listes de lecture <{filename}/Technologie/2015-04-01-service-de-nuages.rst>`_.
|
||||
stockage et de `synchronisation de listes de lecture <{filename}/technologie/2015-04-01-service-de-nuages.rst>`_.
|
||||
|
||||
Au démarrage du projet, nous avons tenté de rassembler toutes les bonnes pratiques
|
||||
et recommandations, venant de différentes équipes et surtout des derniers projets déployés.
|
||||
|
@ -145,7 +145,7 @@ Dans un monde idéal, ce protocole serait versionné, et formalisé dans une RFC
|
|||
En rêve, il existerait même plusieurs implémentations avec des technologies différentes
|
||||
(Python, Go, Node, etc.). [#]_
|
||||
|
||||
.. [#] Voir notre `article dédié sur les permissions <{filename}/Technologie/2015-05-01-cliquet-permissions.rst>`_
|
||||
.. [#] Voir notre `article dédié sur les permissions <{filename}/technologie/2015-05-01-cliquet-permissions.rst>`_
|
||||
.. [#] Rappel: nous sommes une toute petite équipe !
|
||||
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ est de chiffrer les messages avec la clé du destinataire et de le mettre dans
|
|||
un *pot commun*. Tout le monde essaye de déchiffrer tous les messages, mais ne
|
||||
peut déchiffrer que les siens.
|
||||
|
||||
Cela permet de ne **pas** fuiter de méta-données, [à l'inverse de PGP]({filename}/Technologie/2015-05-25-pgp-problemes.md).
|
||||
Cela permet de ne **pas** fuiter de méta-données, [à l'inverse de PGP]({filename}/technologie/2015-05-25-pgp-problemes.md).
|
||||
|
||||
Je n'ai en fait pas de réponse claire à donner à cette question: l'auteur de
|
||||
ZeroNet me disait que 10MB (la limite de taille d'un site, par défaut)
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
# Installation de Mosquitto, InfluxDB, Telegraf et Grafana
|
||||
---
|
||||
title: Installation de Mosquitto, InfluxDB, Telegraf et Grafana
|
||||
tags: Administration Système
|
||||
---
|
||||
|
||||
Récemment, on a m'a demandé un petit coup de main pour aider à l'installation d'une pile logicielle qui permet de stocker des données temporelles et en faire des graphiques.
|
||||
|
||||
|
|
57
content/code/2023-08-16.md
Normal file
57
content/code/2023-08-16.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
tags: django, pytest
|
||||
---
|
||||
# Profiling and speeding up Django and Pytest
|
||||
|
||||
[Éloi](https://yaal.coop/) made [a pull request on
|
||||
IHateMoney](https://github.com/spiral-project/ihatemoney/issues/1214) to
|
||||
speedup the tests, with some great tooling for pytest that I wasn't aware of:
|
||||
|
||||
- [pytest-xdist](https://pypi.org/project/pytest-xdist/) allows to run tests in
|
||||
parallel, using `-n auto`
|
||||
- [pytest-profiling](https://pypi.org/project/pytest-profiling/) makes it easy
|
||||
to get the call stack and time the function calls that take most of the time.
|
||||
- You can them analyse the `.prof` files with
|
||||
[Snakeviz](https://pypi.org/project/snakeviz/)
|
||||
|
||||
So, I spent some time using these on the tests for [La
|
||||
Chariotte](https://chariotte.fr), because they were slow.
|
||||
|
||||
I found two things :
|
||||
|
||||
- Login calls are costly in the test, and it's possible to speed things up ;
|
||||
- On my machine, calls to resolve my hostname were slow, using 5s during the
|
||||
tests for a lookup that wasn't even useful.
|
||||
|
||||
## Changing the hashing algorithm to speedup tests
|
||||
|
||||
By default, Django uses a slow (but secure !) hashing mechanism for checking
|
||||
the user credentials. In the tests, we don't need this security, but we need
|
||||
the speed.
|
||||
|
||||
Changing them to use MD5 turns out to be a way to greatly speed them up! Here
|
||||
is how to do it with a pytest fixture :
|
||||
|
||||
```python
|
||||
@pytest.fixture(autouse=True)
|
||||
def password_hasher_setup(settings):
|
||||
# Use a weaker password hasher during tests, for speed
|
||||
settings.PASSWORD_HASHERS = [
|
||||
"django.contrib.auth.hashers.MD5PasswordHasher",
|
||||
]
|
||||
```
|
||||
|
||||
## Speeding DNS lookups
|
||||
|
||||
I'm currently using a MacOSX machine, and for for whatever reason, the local
|
||||
lookup was not configured properly on my machine. I don't think I did anything
|
||||
specific to get this wrong, so it might be your case too. Calls to resolve the
|
||||
local domain were tooking 5s.
|
||||
|
||||
If the answer to `scutil --get LocalHostName`, `hostname` and `scutil --get
|
||||
HostName` differ, then you might be in this case. Here is the fix :
|
||||
|
||||
```bash
|
||||
sudo scutil --set HostName <YourHostName>
|
||||
```
|
||||
|
42
content/code/2023-08-17.md
Normal file
42
content/code/2023-08-17.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
tags: python, packaging, zsh
|
||||
---
|
||||
|
||||
# Python packaging with Hatch, pipx and Zsh environment variables
|
||||
|
||||
|
||||
It's been a while I didn't packaged something new. I recently remembered an old
|
||||
package of mine that needed some attention :
|
||||
[debts](https://gitlab.com/almet/debts). It's now time to package it, so I
|
||||
discovered [hatch](https://hatch.pypa.io/)
|
||||
|
||||
hatch new --init
|
||||
|
||||
This does the heavy-lifting for you, actually porting the `setup.py` files to the
|
||||
new way of packaging with python (with a `pyproject.toml` file)
|
||||
|
||||
Then `hatch shell` will create a development environment, install dependencies,
|
||||
check the `pyproject.toml` file in one command, and give you a shell to test
|
||||
whatever you need to test.
|
||||
|
||||
## Isolating system packages
|
||||
|
||||
I discovered that [pipx](https://github.com/pypa/pipx) is a convenient way to
|
||||
install user-facing applications on my system. I use multiple virtual
|
||||
environments for my different projects, but not for the install that are used
|
||||
system-wide.
|
||||
|
||||
pipx seems to solve this, and avoid using `sudo pip install x`.
|
||||
|
||||
## Manipulating env variables with Zsh
|
||||
|
||||
I use [Zsh](https://www.zsh.org/) as my main shell for years, and I just
|
||||
discovered that it's possible to manipulate environment variables in an easy way.
|
||||
|
||||
If you're like me, you never remember how to add something to your path. You
|
||||
can actually use `+=`, like this:
|
||||
|
||||
```zsh
|
||||
path+=('/Users/alexis/.local/bin')
|
||||
export PATH
|
||||
```
|
18
content/code/2023-08-18.md
Normal file
18
content/code/2023-08-18.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
tags: arch-linux
|
||||
---
|
||||
# ArchLinux et mise à jour du keyring
|
||||
|
||||
Pour les mises à jour Arch, j'utilise [yay](https://github.com/Jguer/yay). Je
|
||||
ne fais les mises à jour que de manière semi-régulière, et parfois après une
|
||||
longue période je me retrouve avec des soucis de clé qui ne sont plus à jour ou
|
||||
manquantes.
|
||||
|
||||
Avec une utilisation fréquente du système, aucun problème ne se pose car un
|
||||
service s'occupe de faire la mise à jour des clés de manière automatique.
|
||||
|
||||
Pour résoudre le souci, il suffit de mettre à jour le paquet
|
||||
`archlinux-keyring`, comme décrit [dans la page Wiki qui va
|
||||
bien](https://wiki.archlinux.org/title/Pacman/Package_signing).
|
||||
|
||||
sudo pacman -S archlinux-keyring
|
145
content/code/2023-08-19.md
Normal file
145
content/code/2023-08-19.md
Normal file
|
@ -0,0 +1,145 @@
|
|||
---
|
||||
tags: gitlab, docker
|
||||
---
|
||||
# Running the Gitlab CI locally
|
||||
|
||||
Sometimes, I need to change how the continuous integration is setup, and I find
|
||||
myself pushing to a branch to test if my changes are working. Oftentimes, it
|
||||
takes me multiple commits to find the correct configuration, which is…
|
||||
suboptimal.
|
||||
|
||||
I discovered today [Gitlab CI
|
||||
local](https://github.com/firecow/gitlab-ci-local) which makes it possible to
|
||||
run the CI actions locally, without having to push to the remote CI. The same
|
||||
thing exists for [Microsoft Github](https://github.com/nektos/act).
|
||||
|
||||
Under the hood, it's using Docker, so you need to have it running on your
|
||||
system, but once it's done, you just have to issue a simple command to see the
|
||||
results. Very helpful :-)
|
||||
|
||||
Here is an example :
|
||||
|
||||
```bash
|
||||
$ gitlab-ci-local test
|
||||
parsing and downloads finished in 41 ms
|
||||
test starting python:3.8-alpine (test)
|
||||
test copied to docker volumes in 4.05 s
|
||||
test $ apk update && apk add make libsass gcc musl-dev g++
|
||||
test > fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/aarch64/APKINDEX.tar.gz
|
||||
test > fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/aarch64/APKINDEX.tar.gz
|
||||
test > v3.18.3-55-g2ee93b9273a [https://dl-cdn.alpinelinux.org/alpine/v3.18/main]
|
||||
test > v3.18.3-56-g4a3b0382caa [https://dl-cdn.alpinelinux.org/alpine/v3.18/community]
|
||||
test > OK: 19939 distinct packages available
|
||||
test > (1/17) Installing libgcc (12.2.1_git20220924-r10)
|
||||
test > (2/17) Installing libstdc++ (12.2.1_git20220924-r10)
|
||||
test > (3/17) Installing libstdc++-dev (12.2.1_git20220924-r10)
|
||||
test > (4/17) Installing zstd-libs (1.5.5-r4)
|
||||
test > (5/17) Installing binutils (2.40-r7)
|
||||
test > (6/17) Installing libgomp (12.2.1_git20220924-r10)
|
||||
test > (7/17) Installing libatomic (12.2.1_git20220924-r10)
|
||||
test > (8/17) Installing gmp (6.2.1-r3)
|
||||
test > (9/17) Installing isl26 (0.26-r1)
|
||||
test > (10/17) Installing mpfr4 (4.2.0_p12-r0)
|
||||
test > (11/17) Installing mpc1 (1.3.1-r1)
|
||||
test > (12/17) Installing gcc (12.2.1_git20220924-r10)
|
||||
test > (13/17) Installing musl-dev (1.2.4-r1)
|
||||
test > (14/17) Installing libc-dev (0.7.2-r5)
|
||||
test > (15/17) Installing g++ (12.2.1_git20220924-r10)
|
||||
test > (16/17) Installing libsass (3.6.5-r0)
|
||||
test > (17/17) Installing make (4.4.1-r1)
|
||||
test > Executing busybox-1.36.1-r2.trigger
|
||||
test > OK: 246 MiB in 55 packages
|
||||
test $ pip install -r requirements.txt
|
||||
test > Collecting pelican
|
||||
test > Downloading pelican-4.8.0-py3-none-any.whl (1.4 MB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 539.9 kB/s eta 0:00:00
|
||||
test > Collecting markdown
|
||||
test > Downloading Markdown-3.4.4-py3-none-any.whl (94 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 94.2/94.2 kB 540.1 kB/s eta 0:00:00
|
||||
test > Collecting typogrify
|
||||
test > Downloading typogrify-2.0.7.tar.gz (12 kB)
|
||||
test > Preparing metadata (setup.py): started
|
||||
test > Preparing metadata (setup.py): finished with status 'done'
|
||||
test > Collecting pelican-search
|
||||
test > Downloading pelican_search-1.1.0-py3-none-any.whl (6.6 kB)
|
||||
test > Collecting pelican-neighbors
|
||||
test > Downloading pelican_neighbors-1.2.0-py3-none-any.whl (16 kB)
|
||||
test > Collecting pelican-webassets
|
||||
test > Downloading pelican_webassets-2.0.0-py3-none-any.whl (5.8 kB)
|
||||
test > Collecting libsass
|
||||
test > Downloading libsass-0.22.0.tar.gz (316 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 316.3/316.3 kB 552.1 kB/s eta 0:00:00
|
||||
test > Preparing metadata (setup.py): started
|
||||
test > Preparing metadata (setup.py): finished with status 'done'
|
||||
test > Collecting docutils>=0.16
|
||||
test > Downloading docutils-0.20.1-py3-none-any.whl (572 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 572.7/572.7 kB 549.2 kB/s eta 0:00:00
|
||||
test > Collecting rich>=10.1
|
||||
test > Downloading rich-13.5.2-py3-none-any.whl (239 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 239.7/239.7 kB 485.3 kB/s eta 0:00:00
|
||||
test > Collecting jinja2>=2.7
|
||||
test > Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 342.6 kB/s eta 0:00:00
|
||||
test > Collecting pytz>=2020.1
|
||||
test > Downloading pytz-2023.3-py2.py3-none-any.whl (502 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 502.3/502.3 kB 547.3 kB/s eta 0:00:00
|
||||
test > Collecting pygments>=2.6
|
||||
test > Downloading Pygments-2.16.1-py3-none-any.whl (1.2 MB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 551.4 kB/s eta 0:00:00
|
||||
test > Collecting unidecode>=1.1
|
||||
test > Downloading Unidecode-1.3.6-py3-none-any.whl (235 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 235.9/235.9 kB 554.2 kB/s eta 0:00:00
|
||||
test > Collecting blinker>=1.4
|
||||
test > Downloading blinker-1.6.2-py3-none-any.whl (13 kB)
|
||||
test > Collecting python-dateutil>=2.8
|
||||
test > Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 235.7 kB/s eta 0:00:00
|
||||
test > Collecting feedgenerator>=1.9
|
||||
test > Downloading feedgenerator-2.1.0-py3-none-any.whl (21 kB)
|
||||
test > Collecting importlib-metadata>=4.4
|
||||
test > Downloading importlib_metadata-6.8.0-py3-none-any.whl (22 kB)
|
||||
test > Collecting smartypants>=1.8.3
|
||||
test > Downloading smartypants-2.0.1-py2.py3-none-any.whl (9.9 kB)
|
||||
test > Collecting rtoml<0.10.0,>=0.9.0
|
||||
test > Downloading rtoml-0.9.0-cp38-cp38-musllinux_1_1_aarch64.whl (846 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 846.2/846.2 kB 503.7 kB/s eta 0:00:00
|
||||
test > Collecting webassets<3.0,>=2.0
|
||||
test > Downloading webassets-2.0-py3-none-any.whl (142 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 142.9/142.9 kB 551.8 kB/s eta 0:00:00
|
||||
test > Collecting zipp>=0.5
|
||||
test > Downloading zipp-3.16.2-py3-none-any.whl (7.2 kB)
|
||||
test > Collecting MarkupSafe>=2.0
|
||||
test > Downloading MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_aarch64.whl (30 kB)
|
||||
test > Collecting six>=1.5
|
||||
test > Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
|
||||
test > Collecting markdown-it-py>=2.2.0
|
||||
test > Downloading markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
|
||||
test > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 87.5/87.5 kB 561.7 kB/s eta 0:00:00
|
||||
test > Collecting typing-extensions<5.0,>=4.0.0
|
||||
test > Downloading typing_extensions-4.7.1-py3-none-any.whl (33 kB)
|
||||
test > Collecting mdurl~=0.1
|
||||
test > Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB)
|
||||
test > Building wheels for collected packages: typogrify, libsass
|
||||
test > Building wheel for typogrify (setup.py): started
|
||||
test > Building wheel for typogrify (setup.py): finished with status 'done'
|
||||
test > Created wheel for typogrify: filename=typogrify-2.0.7-py2.py3-none-any.whl size=13452 sha256=4ce329903e807671102eab7fd2bc49765b6efc3a4ae68c82053318b62789083c
|
||||
test > Stored in directory: /root/.cache/pip/wheels/0b/e9/98/c888501e8dd2166da059e4f8418694de9b50b48a7192712be9
|
||||
test > Building wheel for libsass (setup.py): started
|
||||
test > Building wheel for libsass (setup.py): still running...
|
||||
test > Building wheel for libsass (setup.py): finished with status 'done'
|
||||
test > Created wheel for libsass: filename=libsass-0.22.0-cp38-abi3-linux_aarch64.whl size=13710320 sha256=3dcb4ce97c1aafc179a6343e0f312c17df88e56c4eb647ab54b09ead5ee00b92
|
||||
test > Stored in directory: /root/.cache/pip/wheels/95/64/fa/47638d5037df216387cdc168e9871d5d9851fc995d636bd108
|
||||
test > Successfully built typogrify libsass
|
||||
test > Installing collected packages: webassets, smartypants, pytz, zipp, unidecode, typogrify, typing-extensions, six, rtoml, pygments, mdurl, MarkupSafe, libsass, feedgenerator, docutils, blinker, python-dateutil, markdown-it-py, jinja2, importlib-metadata, rich, markdown, pelican, pelican-webassets, pelican-search, pelican-neighbors
|
||||
test > Successfully installed MarkupSafe-2.1.3 blinker-1.6.2 docutils-0.20.1 feedgenerator-2.1.0 importlib-metadata-6.8.0 jinja2-3.1.2 libsass-0.22.0 markdown-3.4.4 markdown-it-py-3.0.0 mdurl-0.1.2 pelican-4.8.0 pelican-neighbors-1.2.0 pelican-search-1.1.0 pelican-webassets-2.0.0 pygments-2.16.1 python-dateutil-2.8.2 pytz-2023.3 rich-13.5.2 rtoml-0.9.0 six-1.16.0 smartypants-2.0.1 typing-extensions-4.7.1 typogrify-2.0.7 unidecode-1.3.6 webassets-2.0 zipp-3.16.2
|
||||
test > WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
|
||||
test >
|
||||
test > [notice] A new release of pip is available: 23.0.1 -> 23.2.1
|
||||
test > [notice] To update, run: pip install --upgrade pip
|
||||
test $ make publish
|
||||
test > "pelican" "/gcl-builds/content" -o "/gcl-builds/public" -s "/gcl-builds/publishconf.py"
|
||||
test > Done: Processed 5 articles, 0 drafts, 0 hidden articles, 2 pages, 0 hidden pages
|
||||
test > and 0 draft pages in 0.50 seconds.
|
||||
test finished in 6 min
|
||||
PASS test
|
||||
```
|
60
content/code/2023-09-12.md
Normal file
60
content/code/2023-09-12.md
Normal file
|
@ -0,0 +1,60 @@
|
|||
# Découverte de nouveaux outils pour le développement: LLM, Helix et plus
|
||||
|
||||
## LLM
|
||||
|
||||
- [LocalAI](https://localai.io/model-compatibility/) permet de faire tourner des modèles en local avec la même API HTTP que celle d'OpenAI
|
||||
- [Le modèle Vigogne](https://github.com/bofenghuang/vigogne) est un modèle entrainé (*fine-tuned*) avec des données en Français. Notamment [ce modèle](https://huggingface.co/bofenghuang/vigogne-2-7b-chat/tree/v1.0)qui prends LLAMA2 en entrée.
|
||||
- [LangChain](https://python.langchain.com/docs/get_started/introduction.html) semble être un framework pour travailler avec les différents concepts utiles. A voir.
|
||||
|
||||
Pour la première fois, j'ai commencé à utiliser un peu plus l'outil [llm](https://llm.datasette.io) pour m'aider dans les tâches de programmation.
|
||||
|
||||
!! warning
|
||||
J'utilise actuellement par défaut le modèle en ligne d'OpenAI "GTP4", à travers leur API. Cela me pose des problèmes éthiques, mais mon approche est pour le moment de voir le type de résultats que j'obtiens pour ensuite comparer avec des modèles locaux type LLAMA2.
|
||||
|
||||
Deux choses que j'ai trouvées utiles :
|
||||
|
||||
```bash
|
||||
git diff | llm "write me a commit message"
|
||||
git diff | llm "find a branch name"
|
||||
```
|
||||
|
||||
Qui peuvent faciliter la vie plutôt que de chercher à décrire des choses manuellement (le "branch-name", je le trouve particulièrement utile)
|
||||
|
||||
J'ai aussi trouvé l'idée intéressante d'automatiser l'écrite de tests, avec pytest. Bien sur ça ne fait pas tout, mais ça donne un template de départ qui est intéressant :
|
||||
|
||||
```bash
|
||||
cat code/test_file.py | llm "write tests for this, using pytest"
|
||||
```
|
||||
|
||||
J'ai par exemple demandé à llm de me lister 20 titres pour cet article :
|
||||
|
||||
```bash
|
||||
cat ~/dev/til.notmyidea.org/content/$(date +%F).md | llm "Liste moi 20 titres pour cet article. Quelque chose de simple"
|
||||
1. "Découverte de nouveaux outils pour le développement: LLM, Helix et plus"
|
||||
2. "Explorer les modèles LLM pour la génération de code"
|
||||
3. "L'amélioration du développement grâce à LLM et Helix"
|
||||
4. "Introduction à l'éditeur Helix et à LLM"
|
||||
5. "Boostez votre productivité de développement avec LLM et Helix"
|
||||
6. "Comment j'intègre LLM et Helix dans mon flux de travail de développement"
|
||||
7. "Les avantages de l'utilisation de LLM pour la programmation"
|
||||
8. "Approches innovantes pour le développement de code avec LLM"
|
||||
9. "L'avenir du développement de code avec LLM et Helix"
|
||||
10. "Optimisation des tâches de programmation avec LLM"
|
||||
11. "Ouvrir de nouvelles possibilités de codage avec LLM et Helix"
|
||||
12. "Utiliser des modèles LLM pour améliorer la qualité du code"
|
||||
```
|
||||
|
||||
## Helix
|
||||
|
||||
Je me mets à tester un peu plus l'éditeur Helix. Je suis un habitué de Vim pour toutes les petites modifications que je fais depuis mon terminal, et Helix semble intéressant.
|
||||
|
||||
- `x`pour sélectionner une ligne (`xd` pour sélectionner et supprimer)
|
||||
- `ma` pour sélectionner "around" quelque chose. `maw` pour sélectionner le mot
|
||||
- `c` pour effacer la sélection et passer en mode insertion.
|
||||
|
||||
## Divers
|
||||
|
||||
> J’ai fait confiance, j’ai appris.
|
||||
> — [Thomas](https://d%C3%A9tour.studio)
|
||||
|
||||
J'aime beaucoup ce que ça dit. Faire confiance est peut-être nécessaire, même si on est déçu au final, on aura au moins appris. Ça me touche.
|
7
content/code/2023-09-13.md
Normal file
7
content/code/2023-09-13.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Conversion d'un fichier svg en favicon.ico
|
||||
|
||||
Il y a plusieurs sites qui permettent de faire ça automatiquement, mais j'aime bien faire les choses depuis mon terminal, voici donc une commande qui permet de faire ça simplement, en utilisant [ImageMagick](https://imagemagick.org/). Merci à [ce gist](https://gist.github.com/azam/3b6995a29b9f079282f3)
|
||||
|
||||
```bash
|
||||
convert -density 256x256 -background transparent favicon.svg -define icon:auto-resize -colors 256 favicon.ico
|
||||
```
|
47
content/code/2023-09-17.md
Normal file
47
content/code/2023-09-17.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Creating an online space to share markdown files
|
||||
|
||||
I wanted to create a space on my server where I can upload markdown files and have them rendered directly, for them to be shared with other people.
|
||||
|
||||
I stumbled on [the markdown module for nginx](https://github.com/ukarim/ngx_markdown_filter_module) which does exactly what I want, but seemed to ask for compilation of nginx, which wasn't exactly what I wanted in terms of maintainability (it would make it complicated to update it)
|
||||
|
||||
I then thought that the [Caddy](https://caddyserver.com/) server does that by default, and so I've tested it out. Turns out it's not, but it offers ways to do this thanks to its template mecanism.
|
||||
|
||||
It also, [setups automatically and transparently SSL certificates](https://caddyserver.com/docs/automatic-https) for you (using Let's Encrypt!), so I wanted to have a look.
|
||||
|
||||
Here is the Caddy configuration file I'm now using :
|
||||
|
||||
```Caddyfile
|
||||
md.notmyidea.org {
|
||||
root * /home/caddy/md.notmyidea.org
|
||||
rewrite * /index.html
|
||||
file_server
|
||||
templates
|
||||
encode zstd gzip
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
And the template:
|
||||
|
||||
```HTML
|
||||
{{$pathParts := splitList "/" .OriginalReq.URL.Path}}
|
||||
{{$markdownFilename := default "index" (slice $pathParts 1 | join "/")}}
|
||||
|
||||
{{if not (fileExists $markdownFilename)}}
|
||||
{{httpError 404}}
|
||||
{{end}}
|
||||
|
||||
{{$markdownFile := (include $markdownFilename | splitFrontMatter)}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ $markdownFilename }}</title>
|
||||
</head>
|
||||
<body>
|
||||
{{ markdown $markdownFile.Body }}
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
This is a minimalistic version, but it works :-)
|
47
content/code/2023-09-18.md
Normal file
47
content/code/2023-09-18.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Creating a simple command line to post snippets on Gitlab
|
||||
|
||||
I'm trying to get away from Github, and one thing that I find useful is the [gist](https://gist.github.com) utility they're providing. Seems that gitlab provides a similar tool.
|
||||
|
||||
You can use it using [python-gitlab](https://python-gitlab.readthedocs.io/):
|
||||
|
||||
```bash
|
||||
|
||||
pipx install python-gitlab
|
||||
```
|
||||
|
||||
And then :
|
||||
|
||||
```bash
|
||||
gitlab snippet create --title="youpi" --file-name="snip.py" --content snip.py --visibility="public"
|
||||
```
|
||||
|
||||
I now wanted a small bash script which will just get the name of the file and infer all the parameters. I asked GPT-4, and iterated on its answer.
|
||||
|
||||
Here's the resulting bash script:
|
||||
|
||||
```bash
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Please provide a filename"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
file="$1"
|
||||
base=$(basename "$file")
|
||||
title="$base"
|
||||
visibility="public"
|
||||
|
||||
# Use `cat` to fetch the content of the file
|
||||
content=$(cat "$file")
|
||||
|
||||
result=$(gitlab snippet create --title="$title" --file-name="$title" --content="$content" --visibility="$visibility")
|
||||
|
||||
id=$(echo "$result" | awk '/id: / { print $2 }')
|
||||
echo "https://gitlab.com/-/snippets/$id"
|
||||
|
||||
```
|
||||
|
||||
I can now do `snip README.md` and that will create the snippet for me :-)
|
16
content/code/2023-09-22.md
Normal file
16
content/code/2023-09-22.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
tags: llm
|
||||
---
|
||||
# How to run the vigogne model locally
|
||||
|
||||
[Vigogne](https://github.com/bofenghuang/vigogne) is a LLM model based on LLAMA2, but trained with french data. As I'm working mostly in french, it might be useful. The current models that I can get locally are in english.
|
||||
|
||||
The information I've found online are scarse and not so easy to follow, so here is a step by step tutorial you can follow. I'm using [pipenv](https://pipenv.pypa.io/en/latest/) almost everywhere now, it's so easy :-)
|
||||
|
||||
```bash
|
||||
|
||||
llm install -U llm-llama-cpp
|
||||
wget https://huggingface.co/TheBloke/Vigogne-2-7B-Chat-GGUF/resolve/main/vigogne-2-7b-chat.Q4_K_M.gguf
|
||||
llm llama-cpp add-model vigogne-2-7b-chat.Q4_K_M.gguf -a vigogne
|
||||
llm models default vigogne
|
||||
```
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
save_as: index.html
|
||||
slug: index
|
||||
---
|
||||
# Alexis Métaireau
|
||||
|
||||
|
@ -11,9 +12,7 @@ Si vous souhaitez me contacter, envoyez moi un email sur ``alexis``
|
|||
|
||||
---
|
||||
|
||||
## Informatique
|
||||
|
||||
Tombé dans le chaudron étant petit, j'ai pu <del>jouer avec</del> travailler sur plusieurs projets au fil des années.
|
||||
Tombé dans le chaudron de l'informatique étant petit, j'ai pu <del>jouer avec</del> travailler sur plusieurs projets au fil des années.
|
||||
Voici quelques logiciels pour lesquels j'ai participé de façon significative.
|
||||
Vous pouvez aussi aller faire un tour sur ma page
|
||||
[Github](https://github.com/almet) ou [Gitlab](https://gitlab.com/almet) pour
|
||||
|
|
41
content/weeknotes/2023-38.md
Normal file
41
content/weeknotes/2023-38.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
date: 2023-09-24
|
||||
---
|
||||
# 2023, Semaine 38
|
||||
|
||||
Un début de semaine bien rempli, une fin de semaine malade.
|
||||
|
||||
## Ce qui s'est passé
|
||||
|
||||
Framasoft
|
||||
: J'ai eu confirmation que j'allais pouvoir commencer à travailler sur une mission pour [Framasoft](https://framasoft.org), pour faire un outil qui aide à la supervision de leurs services Web. C'est la première fois que je vais travailler en tant qu'indépendant et je trouve ça assez exitant.
|
||||
|
||||
Le Groupe, le jeu
|
||||
: On s'est vu avec [Sam](https://www.samuelgenin.fr/) pour commencer à bosser sur une idée de petit jeu textuel. Une session de travail sur tableau blanc le matin pour mettre nos idées au clair, suivie d'une après-midi à travailler sur des « prompts » pour des [LLM](https://fr.wikipedia.org/wiki/Grand_mod%C3%A8le_de_langage). C'était vraiment un bon moment, et on a bien avancé. J'ai aussi passé un peu de temps en fin de semaine à mettre en place un projet en Elm avec Vite. Je suis content que ce projet me fasse réutiliser ces technos.
|
||||
|
||||
Notmyidea
|
||||
: Il va me falloir une structure juridique pour pouvoir émettre factures et devis. J'ai participé à une présentation de la CAE [Astrolabe](https://astrolabe.coop), qui me permette de mieux comprendre le fonctionnement de ce type de structures. Je ne suis pas encore décidé sur le type de structure que je vais adopter.
|
||||
: J'ai aussi passé du temps à remettre à jour mon site web perso.
|
||||
: J'ai migré mes mails vers [Nubo](https://nubo.coop), un hébergeur coopératif.
|
||||
|
||||
## Des joies
|
||||
|
||||
- J'ai pris le temps de faire plusieurs siestes au soleil. J'aime avoir la possibilité d'écouter mon rythme.
|
||||
- Choisir de ne pas aller à l'AG d'une association dont l'objet me semble intéressant, mais pour laquelle je n'ai pas beaucoup de temps à donner. Je suis content de faire ce choix.
|
||||
- Dépanner des ami·es sans que cela ne me coûte d'énergie. Je suis content de retrouver une certaine quiétude au quotidien.
|
||||
- Avoir au téléphone de vieilles connaissances et sentir que la relation est toujours intéressante.
|
||||
- Aller me poser à la bibliothèque pour travailler.
|
||||
|
||||
## Des peines
|
||||
|
||||
- Devoir annuler plusieurs rendez-vous qui me tenaient à cœur à cause de la maladie.
|
||||
- Je me suis couché trop tard, et mon rythme est décallé.
|
||||
|
||||
## Vu, lu, écouté
|
||||
|
||||
- ▶︎ [Une présentation](https://www.youtube.com/watch?v=kMb4TmhTlbk&list=PL8uoeex94UhFcwvAfWHybD7SfNgIUBRo-&index=135) de ce qu'il est possible de faire avec les LLM et les dernèières avancées en machine learning dans le domaine de la musique. J'ai trouvé ça bluffant.
|
||||
- 📖 J'ai terminé la lecture de « Eloge de l'amitié » de Geoffroy de Lagasnerie. Beaucoup de choses intéressantes. J'ai publié [quelques notes de lecture ici](https://notes.notmyidea.org/notes-litteraires/livres/geoffroy-de-lasganerie-eloge-de-l-amitie/).
|
||||
- 📖 Commencé « Le conflit n'est pas une agression » de Sarah Schulmann. Je sens que ça va faire bouger certaines choses chez moi.
|
||||
- 📖 Commencé « Quelqu'un à qui manquer » de Yohan Boniface. J'aime beaucoup l'univers et le ton jusqu'ici.
|
||||
- 🎮 Commencé « Baba is you », un petit jeu vidéo de logique. Divertissant :-)
|
||||
- 🕸️ Un super article qui explique [comment fonctionnent les CRDT (Conflit-free Replicated Data Types)](https://jzhao.xyz/posts/bft-json-crdt), de manière très didactique.
|
|
@ -11,22 +11,19 @@
|
|||
@import url("pygment.css");
|
||||
|
||||
:root {
|
||||
--main-bg-color: #fff;
|
||||
--main-bg-color: #f5f2e9;
|
||||
--border-color: #ACACAC;
|
||||
--code-bg-color: #e5e5e2;
|
||||
--link-color:
|
||||
#BB7DD4
|
||||
;
|
||||
--link-color: #BB7DD4;
|
||||
--text-color: #2d2d2d;
|
||||
--menu-color:
|
||||
#7971D0
|
||||
;
|
||||
--link-color-menu:
|
||||
#36194D
|
||||
;
|
||||
--menu-color: #7971D0;
|
||||
--link-color-menu: #36194D;
|
||||
--headers-color: #000;
|
||||
--citation-bold-color: #bb7dd49a
|
||||
|
||||
--citation-bold-color: #bb7dd49a;
|
||||
--highlight: #8f9fa926;
|
||||
--highlight-hover: #84a59d;
|
||||
--gray: #ACACAC;
|
||||
--lightgray: #e0dcd3;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
|
@ -161,12 +158,23 @@ a {
|
|||
color: inherit;
|
||||
text-decoration-color: var(--link-color);
|
||||
text-decoration-thickness: 3px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--link-color);
|
||||
}
|
||||
|
||||
a.tag {
|
||||
background-color: var(--highlight);
|
||||
border-radius: 5px;
|
||||
padding: 0 .1rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.tag:hover {
|
||||
color: var(--highlight-hover);
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
padding: .5em 0em 1em 3.2em;
|
||||
|
@ -335,6 +343,23 @@ table td {
|
|||
}
|
||||
|
||||
hr {
|
||||
border: 0;
|
||||
padding: 1em;
|
||||
background-color: var(--lightgray);
|
||||
color: var(--gray);
|
||||
text-align: center;
|
||||
border: none;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
margin: 3rem auto;
|
||||
border-color: var(--gray);
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
|
||||
hr::after {
|
||||
content: "* * *";
|
||||
margin: -1em 0 .5em;
|
||||
padding: .5em 1em;
|
||||
font-size: 1.5em;
|
||||
display: inline-block;
|
||||
background-color: var(--main-bg-color);
|
||||
}
|
||||
|
|
|
@ -2,17 +2,15 @@
|
|||
{% block title %}{{ article.title }} - {{ super() }}{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<header>
|
||||
{% if article.category == "Lectures" %}
|
||||
<h3>Notes de lecture</h3>
|
||||
<h1 class="post-title">« {{ article.title }} » par {{ article.author }}</h1>
|
||||
<time datetime="{{ article.date.isoformat() }}">Lu le {{ article.locale_date }}</time>
|
||||
{% else %}
|
||||
<h1 class="post-title">{{ article.title }}</h1>
|
||||
{% if article.headline %}
|
||||
<p><em>{{ article.headline }}</em></p>
|
||||
{% endif %}
|
||||
<time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
|
||||
{% endif %}
|
||||
|
||||
|
@ -25,7 +23,7 @@
|
|||
{% for tag in article.tags %}
|
||||
<a href="{{ SITEURL }}/{{ tag.url }}">#{{ tag }}</a>{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
- Posted in the <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a> category
|
||||
- Posté dans la catégorie <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</article>
|
||||
|
|
|
@ -16,15 +16,14 @@
|
|||
|
||||
<body>
|
||||
<section id="links">
|
||||
<li><a class="{% if page and page.slug == 'alexis-metaireau' %}selected{% endif %}" href="{{ SITEURL }}/">
|
||||
Alexis Métaireau</a></li>
|
||||
<li>
|
||||
<a class="{% if page_name == 'articles' %}selected{% endif %}" href="{{ SITEURL }}/articles.html"
|
||||
id="site-title">Articles</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://til.notmyidea.org">Code, etc.</a>
|
||||
</li>
|
||||
{% for (title, url, selected) in MENU %}
|
||||
<li><a class="{%
|
||||
if page_name == selected
|
||||
or (category and category.name == selected)
|
||||
or (page and page.slug == selected)
|
||||
%}selected{% endif %}"
|
||||
href="{{SITEURL}}{{ url }}">{{ title }}</a></li>
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% include 'github.html' %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,13 +1,39 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1>{{ category }}</h1>
|
||||
{% if articles %}
|
||||
{% for article in articles | selectattr("category", "eq", "journal") %}
|
||||
<section class="section index">
|
||||
<time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
|
||||
<h1><a href="{{ SITEURL }}/{{ article.url }}" id="page-title">{{ article.title }}</a></h1>
|
||||
{{ article.content|striptags|truncate(200) }}
|
||||
</section>
|
||||
{% endfor %}
|
||||
{% if category in CATEGORIES_DESCRIPTION.keys() %}
|
||||
<h1>{{ CATEGORIES_DESCRIPTION[category][0] }}</h1>
|
||||
<p>{{ CATEGORIES_DESCRIPTION[category][1] }}</p>
|
||||
{% else %}
|
||||
|
||||
<h1> {{ category }}</h1>
|
||||
{% endif %}
|
||||
<section class="section index">
|
||||
|
||||
{% for article in articles | batch(10) | first %}
|
||||
<section class="section index">
|
||||
{% if not HIDE_DATE %}
|
||||
<time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
|
||||
{% endif %}
|
||||
|
||||
<h1><a href="{{ SITEURL }}/{{ article.url }}" id="page-title">{{ article.title }}</a></h1>
|
||||
{% if article.headline %}
|
||||
{{ article.headline }}
|
||||
{% else %}
|
||||
{{ article.summary }}
|
||||
{% endif %}
|
||||
<br />
|
||||
{% for tag in article.tags %}
|
||||
<a class='tag' href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
<ul>
|
||||
{% for article in articles | batch(10) %}
|
||||
{% if not loop.first %}
|
||||
<li><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{
|
||||
article.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% endblock %}
|
|
@ -2,13 +2,21 @@
|
|||
{% block content %}
|
||||
<h1>{% block pagetitle %}{% endblock %}</h1>
|
||||
{% if articles %}
|
||||
{% for article in articles[0:10] %}
|
||||
{% for article in articles | rejectattr("category", "in", ['weeknotes']) | batch(10) | first %}
|
||||
<section class="section index">
|
||||
{% if not HIDE_DATE %}
|
||||
<time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
|
||||
{% endif %}
|
||||
|
||||
{% for tag in article.tags %}
|
||||
<a class='tag' href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
<h1><a href="{{ SITEURL }}/{{ article.url }}" id="page-title">{{ article.title }}</a></h1>
|
||||
{{ article.content|striptags|truncate(200) }}
|
||||
{% if article.headline %}
|
||||
{{ article.headline }}
|
||||
{% else %}
|
||||
{{ article.summary }}
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
<ul>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
PATH = "content"
|
||||
AUTHOR = u""
|
||||
SITENAME = u"Alexis Métaireau"
|
||||
AUTHOR = ""
|
||||
SITENAME = "Alexis Métaireau"
|
||||
THEME = "mnmlist"
|
||||
DISQUS_SITENAME = "notmyidea"
|
||||
DEFAULT_PAGINATION = 3
|
||||
|
@ -26,3 +26,33 @@ CACHE_OUTPUT_DIRECTORY = "cache"
|
|||
CACHE_DOMAIN = "/cache/"
|
||||
TYPOGRIFY = True
|
||||
INDEX_SAVE_AS = "articles.html"
|
||||
|
||||
CATEGORY_SAVE_AS = "{slug}/index.html"
|
||||
CATEGORY_URL = "{slug}/"
|
||||
|
||||
MENU = [
|
||||
("Alexis Métaireau", "/", "index"),
|
||||
("Journal", "/journal/index.html", "journal"),
|
||||
("Code, etc.", "/code/", "code"),
|
||||
("Notes hebdo", "/weeknotes/", "weeknotes"),
|
||||
("Lectures", "/lectures/", "lectures"),
|
||||
]
|
||||
|
||||
CATEGORIES_DESCRIPTION = {
|
||||
"weeknotes": (
|
||||
"Notes hebdo",
|
||||
"Chaque semaine, je fais un petit résumé de ce qui s'est passé. Cela m'aide à garder le fil de mes idées et de mes différents projets. Un bon moyen de faire un pause et d'observer la semaine sous un autre angle.",
|
||||
),
|
||||
"lectures": (
|
||||
"Notes de lecture",
|
||||
"Quelques notes prises au détour d'une lecture, plutôt pour ne pas les oublier, et me remémorer le livre quand j'en ai besoin.",
|
||||
),
|
||||
"code": (
|
||||
"Code, etc.",
|
||||
"Des bouts de trucs liés au code, que je trouve utiles de stocker quelque part (en anglais)",
|
||||
),
|
||||
"journal": (
|
||||
"Journal",
|
||||
"Quelques pensées partagées, bien souvent sur le monde du travail ou de la technologie.",
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
from pelican import signals
|
||||
from pelican.readers import MarkdownReader, Category, Markdown, pelican_open
|
||||
from pelican.utils import get_date, slugify
|
||||
|
||||
from markdown.preprocessors import Preprocessor
|
||||
from datefinder import find_dates
|
||||
|
||||
import os.path
|
||||
from datetime import datetime
|
||||
|
||||
from datefinder import find_dates
|
||||
from markdown.preprocessors import Preprocessor
|
||||
from pelican import signals
|
||||
from pelican.readers import Category, Markdown, MarkdownReader, pelican_open
|
||||
from pelican.utils import get_date, slugify
|
||||
|
||||
|
||||
class BlockquotesPreprocessor(Preprocessor):
|
||||
def run(self, lines):
|
||||
|
|
Loading…
Reference in a new issue