~~NOCACHE~~ =====Dokuwiki===== ====Edition==== ===Vidéo=== * Pas d'aperçu : ajouter au lien ''?linkonly''. Exemple : ''%%{{video.mp4?linkonly | Vidéo}}%%''. ===Personnalisation des pages=== * ''dokuwiki/conf/tpl/dokuwiki/style.ini'' Ici, on peut personnaliser des variables du template : {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/css/dokuwiki/style.ini}} * ''dokuwiki/conf/userstyle.css'' Ici, on personnalise directement le CSS des pages. Par exemple, pour ajouter une icône à un type de paragraphe : {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/css/dokuwiki/userstyle.css}} ===fetch=== Empêcher le référencement des pages téléchargeables. Dans le fichier ''robots.txt'' : user-agent: * disallow: /lib/exe/fetch.php?* Dans le ''/inc/fetch.functions.php'', ajouter une ligne: header('X-Robots-Tag: noindex'); [[https://developers.google.com/search/docs/advanced/crawling/block-indexing?hl=fr|Bloquer l'indexation dans la recherche avec la directive "noindex"]] {{ :prog:dokuwiki:bloquer_l_indexation_dans_la_recherche_avec_la_directive_noindex_google_search_central_2021-08-19_20_04_29_.html |Archive du 13/08/2021 le 19/08/2021}} =====Plugins===== ====gh==== ===Description=== Afficher du code source depuis github. [[https://github.com/splitbrain/dokuwiki-plugin-gh|Source]] {{ :prog:dokuwiki:dokuwiki-plugin-gh-master.zip |Archive du 06/03/2018 le 30/06/2020}} ===Hack=== * Modification de l'utilisation du cache Normalement, on affiche le cache si la date de modification de la page du wiki est inférieure à celle du cache (à un facteur 2 prêt). Sinon, on affiche la page de github. Moi, je charge la page github. Et en cas d'échec, j'affiche la page du cache. Pour cela, il faut commenter : /* if($tcache && $tpage && !$INPUT->bool('purge')) { $now = time(); if($now - $tcache < ($now - $tpage) * 2) { // use cache when it's younger than twice the age of the page $text = io_readFile($cache); } } */ Et ajouter dans chaque page utilisant le plugin ''gh'' : ''%%~~NOCACHE~~%%''. Avec ce mot clé, le changement dans dokuwiki est pris en compte au bout d'une minute environ. * Support des extensions : Ajouter 'yml' => 'yaml', à la variable ''$ext2lang''. * Support de la lecture depuis le bas du fichier : Objectif : ''gh'' doit supporter la syntaxe ''%%{{gh>file -6}}%%'' pour afficher les 6 dernières lignes du fichier. Dans la fonction ''public function handle'', remplacer : $data = array( 'from' => (int) $from, 'to' => (int) $to ); par if($from=='' && is_numeric($to)) { $data = array( 'from' => -((int) $to), 'to' => 0 ); } else { $data = array( 'from' => (int) $from, 'to' => (int) $to ); }