Replace underscore with space to trick search engines into indexing

This commit is contained in:
NielsAD
2018-09-14 10:21:01 +02:00
parent 3930884a62
commit 4f3d14d0f3
3 changed files with 10 additions and 7 deletions

View File

@@ -8,15 +8,15 @@
<meta name=keywords content="archive, download, files, toom">
<title>Archive - toom.io</title>
<link rel="shortcut icon" href="/favicon.ico?201809121" />
<link rel="stylesheet" type="text/css" href="/style.css?201809121">
<script src="/script.js?201809121"></script>
<link rel="stylesheet" type="text/css" href="/style.css?201809141">
<script src="/script.js?201809141"></script>
</head>
<body class=loading>
<header>
<ul id=path><li><a href="/">Archive</a></li></ul>
<ul id=path><li><a href="/">archive.toom.io</a></li><li></li></ul>
<form id=search><input type=text placeholder="Search.." id=q name=q><button type=submit><span>🔎</span></button></form>
</header>
<main><ul id=files></ul></main>
<main><ul id=files><li><a href="/" class="u">..</a></li></ul></main>
<footer><a href="https://www.toom.io">toom.io</a></footer>
</body>
</html>

View File

@@ -11,11 +11,11 @@ function setPath(crumbs, files, q, path, query) {
function a(sp, href, text, cls, rel) {
let r = document.createElement("a");
r.appendChild(document.createTextNode(text));
r.appendChild(document.createTextNode(text.replace(/_/g, " ")));
r.setAttribute("href", href);
if (rel) r.setAttribute("rel", rel);
if (cls) r.classList.add(cls);
if (sp) r.addEventListener( 'click', function(e){
if (sp) r.addEventListener("click", function(e){
e.preventDefault();
setPath(crumbs, files, q, href, "");
});

View File

@@ -94,7 +94,10 @@ header {
#files li { padding: 5px 15px; }
#files li:nth-child(even) { background-color: #eee9; }
#files li:last-child { border-radius: 0 0 10px 10px; }
#files li a { font-family: monospace; }
#files li a {
font-family: monospace;
white-space: pre;
}
.u:before { content: "⬆️"; }
.d:before { content: "📁"; }
.f:before { content: "📄"; }