Construction du titre à partir des méta données
This commit is contained in:
+23
-4
@@ -1,4 +1,3 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
@@ -7,6 +6,24 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<script crossorigin="anonymous" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.19.2/moment.js"></script>
|
||||
<title>Journal d'un formateur en bootcamp</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
color: black;
|
||||
}
|
||||
#journaux {
|
||||
margin: 2rem;
|
||||
}
|
||||
|
||||
section h1{
|
||||
margin-top: 4rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
section {
|
||||
text-align: justify;
|
||||
}
|
||||
</style>
|
||||
|
||||
<main id=journaux>
|
||||
</main>
|
||||
@@ -28,17 +45,19 @@ const afficheLaListeDesJournaux = () => {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
const MiseEnFormeDe = (journal) => {
|
||||
const sectionJournal = document.createElement('section');
|
||||
sectionJournal.innerHTML = journal.body;
|
||||
|
||||
const titreJournal = document.createElement('h1');
|
||||
titreJournal.textContent = journal.meta.titre;
|
||||
var titreJournal = document.createElement('h1');
|
||||
titreJournal.id = journal.meta.title;
|
||||
titreJournal.textContent = journal.meta.title;
|
||||
sectionJournal.prepend(titreJournal);
|
||||
|
||||
return sectionJournal;
|
||||
}
|
||||
|
||||
afficheLaListeDesJournaux();
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user