diff --git a/astro.config.mjs b/astro.config.mjs index 2cb8cd79642a8..13f43809f3df3 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,6 +3,7 @@ import remarkToc from "remark-toc"; import rehypeSlug from "rehype-slug"; import rehypeAutolinkHeadings from "rehype-autolink-headings"; import { remarkReadingTime } from "./remark-reading-time.mjs"; +import { remarkModifiedTime } from "./remark-modified-time.mjs"; import partytown from "@astrojs/partytown"; import sitemap from "@astrojs/sitemap"; @@ -20,7 +21,84 @@ export default defineConfig({ forward: ["dataLayer.push"], }, }), - jopSoftwarecookieconsent(), + , + jopSoftwarecookieconsent({ + categories: { + necessary: { + enabled: true, // this category is enabled by default + readOnly: true, // this category cannot be disabled + }, + analytics: {}, + }, + guiOptions: { + consentModal: { + layout: "bar inline", + position: "bottom", + flipButtons: true, + equalWeightButtons: true, + }, + preferencesModal: { + layout: "box", + // position: 'left right', + flipButtons: false, + equalWeightButtons: true, + }, + }, + language: { + default: "fr", + translations: { + fr: { + consentModal: { + title: "J'utilise quelques cookies", + description: "Description de la fenêtre modale des cookies", + acceptAllBtn: "Tout accepter", + acceptNecessaryBtn: "Tout refuser", + showPreferencesBtn: "Gérer les préférences individuelles", + }, + preferencesModal: { + title: "Gérer les préférences des cookies", + acceptAllBtn: "Tout accepter", + acceptNecessaryBtn: "Tout refuser", + savePreferencesBtn: "Accepter la sélection actuelle", + closeIconLabel: "Fermer la fenêtre modale", + sections: [ + { + title: "Performance et analyse", + description: + "Ces cookies collectent des informations sur votre utilisation de ce site web. Toutes les données sont anonymisées et ne peuvent pas être utilisées pour vous identifier.", + linkedCategory: "analytics", + }, + ], + }, + }, + + en: { + consentModal: { + title: "We use cookies", + description: "Cookie modal description", + acceptAllBtn: "Accept all", + acceptNecessaryBtn: "Reject all", + showPreferencesBtn: "Manage Individual preferences", + }, + preferencesModal: { + title: "Manage cookie preferences", + acceptAllBtn: "Accept all", + acceptNecessaryBtn: "Reject all", + savePreferencesBtn: "Accept current selection", + closeIconLabel: "Close modal", + sections: [ + { + title: "Performance and Analytics", + description: + "These cookies collect information about how you use our website. All of the data is anonymized and cannot be used to identify you.", + linkedCategory: "analytics", + }, + ], + }, + }, + }, + }, + }), ], markdown: { shikiConfig: { @@ -35,7 +113,7 @@ export default defineConfig({ wrap: true, }, // Example: Switch to use prism for syntax highlighting in Markdown - remarkPlugins: [remarkToc, remarkReadingTime], + remarkPlugins: [remarkToc, remarkReadingTime, remarkModifiedTime], rehypePlugins: [ rehypeSlug, [ diff --git a/package.json b/package.json index a46563569dd2f..79043650f20e7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "dependencies": { "@astrojs/markdown-remark": "^4.2.1", "@astrojs/sitemap": "^3.0.5", - "@jop-software/astro-cookieconsent": "^2.0.0", + "@jop-software/astro-cookieconsent": "^3.0.0", "astro": "^4.3.5", "mdast-util-to-string": "^4.0.0", "reading-time": "^1.5.0", @@ -21,11 +21,12 @@ "rehype-slug": "^6.0.0", "rehype-toc": "^3.0.2", "remark-toc": "^9.0.0", - "vanilla-cookieconsent": "^2.9.2" + "vanilla-cookieconsent": "^3.0.0" }, "devDependencies": { "@astrojs/partytown": "^2.0.4", "@typescript-eslint/parser": "^6.21.0", + "dayjs": "^1.11.10", "eslint": "^8.56.0", "eslint-plugin-astro": "^0.31.4", "eslint-plugin-jsx-a11y": "^6.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aad141685fb8d..b510a09aa4c83 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: ^3.0.5 version: 3.0.5 '@jop-software/astro-cookieconsent': - specifier: ^2.0.0 - version: 2.0.0(vanilla-cookieconsent@2.9.2) + specifier: ^3.0.0 + version: 3.0.0(vanilla-cookieconsent@3.0.0) astro: specifier: ^4.3.5 version: 4.3.5(typescript@5.3.3) @@ -39,8 +39,8 @@ dependencies: specifier: ^9.0.0 version: 9.0.0 vanilla-cookieconsent: - specifier: ^2.9.2 - version: 2.9.2 + specifier: ^3.0.0 + version: 3.0.0 devDependencies: '@astrojs/partytown': @@ -49,6 +49,9 @@ devDependencies: '@typescript-eslint/parser': specifier: ^6.21.0 version: 6.21.0(eslint@8.56.0)(typescript@5.3.3) + dayjs: + specifier: ^1.11.10 + version: 1.11.10 eslint: specifier: ^8.56.0 version: 8.56.0 @@ -652,12 +655,12 @@ packages: resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} dev: true - /@jop-software/astro-cookieconsent@2.0.0(vanilla-cookieconsent@2.9.2): - resolution: {integrity: sha512-79uY+scObfEhzfLY+KAOMxEgg0P9EeA5lJM0q+Y6WRhRvqSu4ufvuHOvWrrq8vv9FttxlnKQHCd75dsapINoyQ==} + /@jop-software/astro-cookieconsent@3.0.0(vanilla-cookieconsent@3.0.0): + resolution: {integrity: sha512-EbjaGgzqKW17Ik8JI7HqBboCPIWsz+6CUh3s6Nw3AXp+TbFpg+GVI6Hqhtw7A+8tmO2N3KGsuaKP7GQbrZyTHw==} peerDependencies: - vanilla-cookieconsent: ^2.9.1 + vanilla-cookieconsent: ^3.0.0 dependencies: - vanilla-cookieconsent: 2.9.2 + vanilla-cookieconsent: 3.0.0 dev: false /@jridgewell/gen-mapping@0.3.3: @@ -1607,6 +1610,10 @@ packages: resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} dev: true + /dayjs@1.11.10: + resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} + dev: true + /debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -4836,8 +4843,8 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - /vanilla-cookieconsent@2.9.2: - resolution: {integrity: sha512-SHAS5W0DBvvcUtjmVvvYkhmLPmTlgwKzFvViUp5mBimbZCdZKbDQzwyk/TgYq02+61RrtxmDdLGzDWNFpSbsGQ==} + /vanilla-cookieconsent@3.0.0: + resolution: {integrity: sha512-oeK7FivRDb424mt3/UT8DG98Pu5m6Uuye7JsdzO6HnYkstW5QHXhkslXyUpE3phtKz3NEeIo7hzLUtfRNRMfbQ==} dev: false /vfile-location@5.0.2: diff --git a/remark-modified-time.mjs b/remark-modified-time.mjs new file mode 100644 index 0000000000000..c230073ecaf56 --- /dev/null +++ b/remark-modified-time.mjs @@ -0,0 +1,11 @@ +import { execSync } from "child_process"; + +export function remarkModifiedTime() { + return function (tree, file) { + const filepath = file.history[0]; + const result = execSync(`git log -1 --pretty="format:%cI" "${filepath}"`); + console.log("lastModified", `${filepath} : ${result.toString()}`); + + file.data.astro.frontmatter.lastModified = result.toString(); + }; +} diff --git a/remark-reading-time.mjs b/remark-reading-time.mjs index 0670603da3fc1..e25ad47cbf8a2 100644 --- a/remark-reading-time.mjs +++ b/remark-reading-time.mjs @@ -7,6 +7,7 @@ export function remarkReadingTime() { const readingTime = getReadingTime(textOnPage); // readingTime.text will give us minutes read as a friendly string, // i.e. "3 min read" + console.log("readingTime", readingTime); data.astro.frontmatter.minutesRead = readingTime.text; }; } diff --git a/src/components/DateTime.astro b/src/components/DateTime.astro new file mode 100644 index 0000000000000..1340811f5fbff --- /dev/null +++ b/src/components/DateTime.astro @@ -0,0 +1,17 @@ +--- +interface Props { + date: Date; +} + +const { date } = Astro.props; +--- + + diff --git a/src/components/MainHead.astro b/src/components/MainHead.astro index 84927281a89de..02310e8cf3c64 100644 --- a/src/components/MainHead.astro +++ b/src/components/MainHead.astro @@ -24,8 +24,13 @@ const { async="async" crossorigin="anonymous" data-cookiecategory="analytics" + data-service="Google Analytics" src="https://www.googletagmanager.com/gtag/js?id=UA-71551100-1"> - diff --git a/src/content/blog/2015-12-16-get-nexttrain.md b/src/content/blog/2015-12-16-get-nexttrain.md index ab476599b5282..712f7226b2bd6 100644 --- a/src/content/blog/2015-12-16-get-nexttrain.md +++ b/src/content/blog/2015-12-16-get-nexttrain.md @@ -1,22 +1,33 @@ --- title: Get-NextTrain ! -description: "test" +description: "Découvrez comment utiliser Powershell pour interroger l'API SNCF et obtenir des informations sur les prochains trains dans votre gare locale. Facilitez-vous la vie avec l'automatisation des tâches liées aux transports en commun !" slug: 2015/12/16/get-nexttrain -tags: ["test"] +tags: + - Powershell + - SNCF + - API + - Trains + - Développement + - Programmation + - Automatisation + - Transport + - Gare + - Scripts pubDate: 2015-12-16 13:44:50 +updateDate: 2024-02-12 11:16:00 img: /assets/stock-1.jpg img_alt: "nice abstract image" --- -## Let's play with SNCF Api and Powershell +## Jouons avec l'API SNCF et Powershell -My goal was to get a list of the next train in the train station near my home, from powershell... +Mon objectif était d'obtenir une liste des prochains trains dans la gare près de chez moi, depuis Powershell... -My functions are below, feel free to leave a comment, copy it, it's free ! (Now on Github ! [git it !](https://github.com/EtienneDeneuve/Powershell/blob/master/GetNextTrain/TheScript.ps1)) +Mes fonctions sont ci-dessous, n'hésitez pas à laisser un commentaire, à les copier, c'est gratuit ! (Maintenant sur Github ! [Obtenez-le !](https://github.com/EtienneDeneuve/Powershell/blob/master/GetNextTrain/TheScript.ps1)) -Of course, it's not a serious post, but more is coming ;) +Bien sûr, ce n'est pas un post sérieux, mais d'autres choses arrivent ;) -You can try this : +Vous pouvez essayer ceci : ```powershell (Get-gare -gare "clamart").idgare | Get-TrainDirection |%{ Get-NextTrain -idgare $_.idgare -traindirection $_.direction } | FT diff --git a/src/content/blog/2016-01-11-side-loading-application-without-sccm-part-1.md b/src/content/blog/2016-01-11-side-loading-application-without-sccm-part-1.md index 421ee7635f1ff..c6232b09ffd0b 100644 --- a/src/content/blog/2016-01-11-side-loading-application-without-sccm-part-1.md +++ b/src/content/blog/2016-01-11-side-loading-application-without-sccm-part-1.md @@ -1,44 +1,55 @@ --- title: "Side loading application without SCCM - Part 1" description: "" -tags: [""] +tags: + - PowerShell + - Windows 8 + - Sideloading + - SCCM + - Automatisation + - Développement d'applications + - AppxBundle + - Signtool + - Déploiement logiciel + - Gestion de l'entreprise slug: 2016/01/11/side-loading-app pubDate: 2016-01-11 17:20:38 +updateDate: 2024-02-12 11:16:00 img: /assets/stock-2.jpg img_alt: "nice abstract image" --- -I publish my way to install side loaded application to Windows 8 and above. I looked on Internet and found nothing to install theses apps  on  computers in a company which doesn't have SCCM. I've written a powershell script which will do the work but I want to share the way I built it, instead of sharing it without any kind of explanation. This blog post is the first one of the series for passing to a long and non interesting tasks to a near complete automated one. You will need makeappx and signtool on the computer to run the script or make the process manually. It's preferable to make the process one time before launching the script. It's easier to debug something you know (yes ! ;)). +Je publie ma méthode pour installer des applications `sideload` sur Windows 8 et versions ultérieures. J'ai cherché sur Internet et n'ai rien trouvé pour installer ces applications sur des ordinateurs dans une entreprise qui n'a pas SCCM. J'ai écrit un script PowerShell qui fera le travail, mais je veux partager la manière dont je l'ai construit, au lieu de le partager sans aucune explication. Ce billet de blog est le premier d'une série visant à passer d'une tâche longue et peu intéressante à une tâche presque entièrement automatisée. Vous devrez avoir makeappx et signtool sur l'ordinateur pour exécuter le script ou effectuer le processus manuellement. Il est préférable de réaliser le processus une fois avant de lancer le script. Il est plus facile de déboguer quelque chose que l'on connaît (oui ! ;)). -## Applications for Windows Modern UI +## Applications pour l'interface utilisateur moderne de Windows -Let's start this post by a little explanation about Windows Sideloading Mechanics. When you build application with tools like Adobe DPS, you will get a "appxbundle". For side loading you need sign the appxbundle and the appx in the bundle. So, you need to "unbundle" the bundle, and then unpack the appx. Unfortunately you need to modify the AppManifest.xml and the BlockMap.xml (a file where all the hash are stored), and theses two files exist for both AppxBundle and Appx. +Commençons ce billet par une petite explication sur le fonctionnement du chargement latéral de Windows. Lorsque vous construisez une application avec des outils comme Adobe DPS, vous obtenez un "appxbundle". Pour le chargement latéral, vous devez signer l'appxbundle et l'appx dans le bundle. Ainsi, vous devez "débundler" le bundle, puis décompresser l'appx. Malheureusement, vous devez modifier le fichier AppManifest.xml et le fichier BlockMap.xml (un fichier où tous les hachages sont stockés), et ces deux fichiers existent à la fois pour AppxBundle et Appx. -The tree of an AppxBundle look like : +L'arborescence d'un AppxBundle ressemble à ceci : -- / (root of the AppxBundle) +- / (racine de l'AppxBundle) - /AppManifest - /AppManifest/AppxManifest.xml - /BlockMaps.xml - /ARM.appx - /x86.appx - /x64.appx -- (all the architectures are in the bundle, I removed the non essential files) +- (toutes les architectures sont dans le bundle, j'ai supprimé les fichiers non essentiels) -For Sideloading and changing the certificate to a good one here are the steps we need : +Pour le chargement latéral et le changement de certificat pour un bon certificat, voici les étapes dont nous avons besoin : -1. Unbundle appxbundle -2. Unpack all the appx -3. Modify the AppManifest.xml, for all of them. We need to change the "Publisher" attributes in the XML. -4. Modify the BlockMaps.xml, for all of them. We need to remove the Hash and size of the modified AppManifest.xml. -5. Pack the appx and sign it -6. Create the bundle and sign it -7. Create a powershell script to install the dependencies and the bundle. -8. Find a way to launch the Powershell Script on all our client - The part 2 is coming, soon... +1. Débundler l'appxbundle +2. Décompresser tous les appx +3. Modifier le fichier AppManifest.xml, pour chacun d'eux. Nous devons changer les attributs "Éditeur" dans le XML. +4. Modifier le fichier BlockMaps.xml, pour chacun d'eux. Nous devons supprimer le hachage et la taille du fichier AppManifest.xml modifié. +5. Compresser l'appx et le signer +6. Créer le bundle et le signer +7. Créer un script PowerShell pour installer les dépendances et le bundle. +8. Trouver un moyen de lancer le script PowerShell sur tous nos clients. + La partie 2 arrive bientôt... -Other Parts  : +Autres parties : -- [Part 2](http://etienne.deneuve.xyz/2016/01/11/side-loading-application-without-sccm-part-2/) -- [Part 3](http://etienne.deneuve.xyz/2016/01/11/side-loading-application-without-sccm-part-3/) +- [Part 2](./2016/01/11/side-loading-application-without-sccm-part-2/) +- [Part 3](./2016/01/11/side-loading-application-without-sccm-part-3/) - The full script is on my (New) Git : [Go to Git !](https://github.com/EtienneDeneuve/Powershell) diff --git a/src/content/config.ts b/src/content/config.ts index c357d0959d17c..c2ce35f4a799a 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -6,6 +6,8 @@ export const collections = { title: z.string(), description: z.string(), pubDate: z.coerce.date(), + lastModified: z.coerce.date().optional(), + minutesRead: z.string().optional(), tags: z.array(z.string()).optional(), img: z.string().optional(), img_alt: z.string().optional(), diff --git a/src/pages/index.astro b/src/pages/index.astro index 6ea932438daf2..eae2ed7b1e8d7 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -167,7 +167,8 @@ const projects = (await getCollection("blog")) aspect-ratio: calc(2.25 / var(--bg-scale)); top: 0; transform: translateY(-75%) translateX(-50%); - background: url("/assets/backgrounds/noise.png") top center/220px repeat, + background: + url("/assets/backgrounds/noise.png") top center/220px repeat, var(--hero-bg) center center / var(--bg-gradient-size) no-repeat, var(--gray-999); background-blend-mode: overlay, normal, normal, normal; diff --git a/src/styles/global.css b/src/styles/global.css index 477381860ca5d..8c7bc3707c909 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -192,6 +192,40 @@ h5 { font-size: var(--text-xl); } +.cc--darkmode { + ---cc-bg: var(--gray-999); + /** Change font **/ + --cc-font-family: var(--font-system); + --cc-modal-border-radius: 0.5rem; + /** Change button primary color to black **/ + --cc-btn-primary-bg: var(--accent-regular); + --cc-btn-primary-border-color: var(--accent-regular); + --cc-btn-primary-hover-bg: var(--accent-dark); + --cc-btn-primary-hover-border-color: var(--accent-dark); + + /** Also make toggles the same color as the button **/ + --cc-toggle-on-bg: var(--cc-btn-primary-bg); + + /** Make the buttons a bit rounder **/ + --cc-btn-border-radius: 10px; +} +#cc-main { + ---cc-bg: var(--gray-999); + /** Change font **/ + --cc-font-family: var(--font-system); + --cc-modal-border-radius: 0.5rem; + /** Change button primary color to black **/ + --cc-btn-primary-bg: var(--accent-regular); + --cc-btn-primary-border-color: var(---accent-regular); + --cc-btn-primary-hover-bg: var(--accent-light); + --cc-btn-primary-hover-border-color: var(--accent-light); + + /** Also make toggles the same color as the button **/ + --cc-toggle-on-bg: var(--cc-btn-primary-bg); + + /** Make the buttons a bit rounder **/ + --cc-btn-border-radius: 10px; +} /* Utilities */ .sr-only {