diff --git a/README.md b/README.md index 94f0d59bcf10e362514d9bb7ed9321c486032a15..f75d12e5d2c344259dca62a7520c186fe019f6aa 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,13 @@ Dans le fichier `mkdocs.yml`, trois configurations importantes sont définies po Dans ce projet, les configurations sont définies comme suit : -<pre><div class="bg-black rounded-md mb-4"><div class="flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md"><span>yaml</span><button class="flex ml-auto gap-2"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="h-4 w-4" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg>Copy code</button></div><div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-yaml">repo_url: https://gitlab-forge.din.developpement-durable.gouv.fr/pub/numeco/mkdocs-dsfr/ -edit_uri: blob/main/docs/ -edit_text: Éditer dans Gitlab Forge -</code></div></div></pre> +`repo_url: https://gitlab-forge.din.developpement-durable.gouv.fr/pub/numeco/mkdocs-dsfr/` +`edit_uri: blob/main/docs/` ### Comment cela fonctionne * `repo_url` pointe vers le dépôt GitLab où se trouve le code source de la documentation. * `edit_uri` indique le chemin relatif vers les fichiers Markdown dans ce dépôt. -* `edit_text` spécifie le texte qui sera affiché pour le lien d'édition. Si l'une de ces variables n'est pas remplie, le lien d'édition n'apparaîtra pas. @@ -45,6 +42,7 @@ votre site en utilisant l'exemple suivant : theme: menulateral: true + button_edit_label: "Modifier la page" intitule: "Intitulé" include_search_page: true show_revision_date: true @@ -78,6 +76,10 @@ La locale pour le thème. Il est défini sur 'fr' pour le français. Le répertoire du thème personnalisé. Il doit être défini sur 'dsfr/'. +### `button_edit_label` + +Permet de personnaliser le libellé de bouton de modification. + ### `menulateral` Valeur booléenne pour afficher ou masquer le menu latéral. Définissez-le sur `true` ou `false`. diff --git a/dsfr/nav.html b/dsfr/nav.html index 021469c0178ff1bf0650f80333abe0496bc4850b..779020f0714e4daa9a689bb33695b26595cea5ae 100644 --- a/dsfr/nav.html +++ b/dsfr/nav.html @@ -23,7 +23,7 @@ </ul> {% if page.file and config.repo_url and config.edit_uri %} <a href="{{ config.repo_url }}{{ config.edit_uri }}{{ page.file.src_path }}" target="_blank" rel="noopener"> - {{ config.edit_text }} + {{ config.theme.button_edit_label }} </a> {% endif %} diff --git a/mkdocs.yml b/mkdocs.yml index 7725740c58b3c8d97448ec88a5298c8139d1d7c1..ccba04e849e8be529766b7442ad75ba9f7753dc2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,11 +5,11 @@ site_author: MkDocs Team repo_url: https://gitlab-forge.din.developpement-durable.gouv.fr/pub/numeco/mkdocs-dsfr/ edit_uri: blob/main/docs/ -edit_text: Éditer dans Gitlab Forge theme: name: mkdocs + button_edit_label: Éditer dans Gitlab Forge locale: fr custom_dir: 'dsfr/' menulateral: true