fix issue link html

This commit is contained in:
p2405951
2025-06-21 11:27:52 +02:00
parent 2f1b9b2097
commit 699643741c
6 changed files with 148 additions and 372 deletions
+11 -9
View File
@@ -24,7 +24,6 @@ void Web::siteHtml()
font-family: Arial;
margin: 40px;
background-color: whitesmoke;
}
h1 {
text-align: center;
@@ -46,7 +45,7 @@ void Web::siteHtml()
transition: background-color 0.3s ease;
}
li:hover {
background-color:black;
background-color: black;
}
a {
text-decoration: none;
@@ -64,22 +63,25 @@ void Web::siteHtml()
<ul>
)";
int index = 0;
for (const Path* p : list) {
QString fileName = QString("parcours%1.html").arg(index);
QString name = p->getName();
file << " <li><a href=\"./pages/"
if (!p) continue;
// Nom de fichier sécurisé
QString safeName = p->getName().simplified().replace(" ", "_");
QString fileName = "parcours_" + safeName + ".html";
file << " <li><a href=\"pages/"
<< fileName.toStdString()
<< "\">"
<< name.toStdString()
<< p->getName().toStdString()
<< "</a></li>\n";
++index;
}
file << R"( </ul>
file << R"( </ul>
</body>
</html>
)";
file.close();
}