Files
journal-d-un-formateur-en-2015/themes/journal-formateur-2015/layouts/index.html
T
Yannick Francois 979ee339fe Ajoute un lien vers le site officiel de Ruby pour chaque mot ruby.
C'est une première passe, qui semble ne pas fonctionner pour chaque cas (pourquoi ?).
Il reste à faire d'autres mots (la plupart des langages déjà, peut-être certains framework...)
2017-12-25 23:55:08 +01:00

77 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html lang=fr>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<style>
body {
font-family: Arial, sans-serif;
color: black;
}
#journaux {
margin: 2rem;
width: 30rem;
text-align: justify;
line-height: 1.2rem;
}
#journaux blockquote {
border-left: 10px solid lightgrey;
font-size: 1.2rem;
font-weight: bolder;
font-style: italic;
}
#journaux p {
margin: 1.2rem;
text-indent: 1.2rem;
}
#journaux h1 {
margin: 1.2rem 0 0 0;
padding: 2rem 0 1rem 0;
border-top: 1px solid black;
}
#journaux time {
display: block;
text-align: right;
font-style: italic;
}
</style>
<title>Journal d'un formateur en bootcamp</title>
<main id=journaux>
{{range sort .Data.Pages "FullFilePath"}}
<section>
<h1>{{ .Title }}</h1>
<time>{{.Date.Day}} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{.Date.Year}}</time>
{{ .Content }}
</section>
{{end}}
</main>
<script>
'use strict';
const linkAllRubyWord = () => {
var allP = document.querySelectorAll("p");
console.log(allP)
allP.forEach((p) => {
var base = p.innerHTML;
p.innerHTML = base.replace(/(r|R)uby/, "<a href='https://www.ruby-lang.org'>Ruby</a>");
});
console.log(allP)
}
linkAllRubyWord()
</script>
</html>