Repository with sources and generator of https://larlet.fr/david/ https://larlet.fr/david/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

profil.html 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. {% extends "base_2020.html" %}
  2. {% block lang %}fr{% endblock %}
  3. {% block title %}Accueil{% endblock %}
  4. {% block content %}
  5. <article>
  6. <h1>Bienvenue</h1>
  7. <p>
  8. Voici l’espace personnel de David Larlet sur le Web.
  9. Il se veut modeste, accueillant et pérenne.
  10. Il fixe mes pensées et parfois engage des échanges.
  11. J’essaye de tenir et lier des propos bienveillants.
  12. Je vous souhaite une jolie promenade.
  13. </p>
  14. <p lang="en">
  15. For an English profile, check out
  16. <a href="http://larlet.com" data-instant>this page 🇨🇦</a>.
  17. </p>
  18. <h2>Publication récentes</h2>
  19. <nav>
  20. <ul>
  21. {% for page in page_list %}
  22. <li><a href="{{ page.url }}">{{ page.title }}</a> ({{ page.date }})</li>
  23. {% endfor %}
  24. </ul>
  25. </nav>
  26. <h2>Publications anciennes</h2>
  27. <p>
  28. Vous pouvez consulter les différents
  29. <a href="/david/blog/">billets de blog</a> qui ont été rédigés de 2004 à 2019
  30. ou les <a href="/david/stream/">entrées de journaux</a> relativement
  31. régulières entre 2009 et 2019.
  32. </p>
  33. <p>
  34. <em>
  35. Notez qu’avec un tel historique, certaines informations sont obsolètes et/ou
  36. plus cautionnées.
  37. </em>
  38. </p>
  39. <h2>Me contacter</h2>
  40. <p>
  41. Je réponds à <em>presque</em> tous les courriels reçus, exception faite de ceux que j’assimile à de la publicité ou du <code>spam</code>. Vous pouvez <a href="mailto:david%40larlet.fr" title="Envoyer un courriel">m’écrire</a> sans trop de civilités et me tutoyer, je répondrai probablement de même. Si vous souhaitez correspondre de manière chiffrée, voici <a href="/static/david/david-larlet-pgp-public-key-1359EA98.asc" title="Clé publique de chiffrement">ma clé publique</a>.
  42. </p>
  43. </article>
  44. {% endblock content %}
  45. {% block extra_bottom %}
  46. <template id="theme-selector">
  47. <form>
  48. <fieldset>
  49. <legend>Thème</legend>
  50. <label>
  51. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  52. </label>
  53. <label>
  54. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  55. </label>
  56. <label>
  57. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  58. </label>
  59. </fieldset>
  60. </form>
  61. </template>
  62. <script type="text/javascript">
  63. /* This is a work in progress with Anthony https://ricaud.me */
  64. // TODISCUSS:
  65. // 1. give a way for the user to close that chooser?
  66. // 2. store preferences? (in a cookie or localstorage or sessionStorage)
  67. // 3. create the template from scratch in JS?
  68. // 4. how to make it generic? (no need for forced-dark/light existing rules)
  69. // Results from a Poll: https://mastodon.social/@dav/104093540923157521
  70. // Avoir un moyen de changer de thème d'un site à la main :
  71. // 49% => Utile
  72. // 23% => Pas utile
  73. // 9% => So 2000
  74. // 19% => Je veux le même
  75. // After 24 hours and 43 votes
  76. // A bit hard to interpret, I guess people wanting it found it useful too!
  77. function loadThemeForm(templateName) {
  78. const themeSelectorTemplate = document.querySelector(templateName)
  79. const clone = themeSelectorTemplate.content.cloneNode(true)
  80. const form = document.body.insertAdjacentElement(
  81. 'afterbegin',
  82. clone.firstElementChild
  83. )
  84. form.addEventListener('change', (e) => {
  85. const chosenColorScheme = e.target.value
  86. document.body.classList.toggle(
  87. 'forced-dark',
  88. chosenColorScheme === 'dark'
  89. )
  90. document.body.classList.toggle(
  91. 'forced-light',
  92. chosenColorScheme === 'light'
  93. )
  94. })
  95. }
  96. const mediaQueryTest = '(prefers-color-scheme: dark)'
  97. window.addEventListener('load', () => {
  98. let mediaRules = []
  99. let ruleFound = false
  100. for (const styleSheet of Array.from(document.styleSheets)) {
  101. for (const cssRule of styleSheet.cssRules) {
  102. if (cssRule.type !== CSSRule.MEDIA_RULE) continue
  103. // WARNING: Safari does not have/supports `conditionText`.
  104. if (cssRule.conditionText) {
  105. if (cssRule.conditionText !== mediaQueryTest) continue
  106. } else {
  107. if (cssRule.cssText.startsWith(mediaQueryTest)) continue
  108. }
  109. // At that point, only a media cssRule matching our media query
  110. // test should remain, hence the renaming.
  111. const mediaRule = cssRule
  112. for (const innerCssRule of mediaRule.cssRules) {
  113. mediaRules.push(innerCssRule)
  114. ruleFound = true
  115. }
  116. }
  117. // WARNING: do not try to insert a Rule to a styleSheet you are
  118. // currently iterating on, otherwise the browser will be stuck
  119. // in a infinite loop…
  120. for (const mediaRule of mediaRules) {
  121. styleSheet.insertRule(mediaRule.cssText)
  122. }
  123. mediaRules = []
  124. }
  125. if (ruleFound) loadThemeForm('#theme-selector')
  126. })
  127. </script>
  128. {% endblock extra_bottom %}