Skip to content

Commit 70025ef

Browse files
save file
1 parent 3cd68f0 commit 70025ef

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

code-dev/index.html

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@
7070

7171

7272
a
73-
{display:flex;align-items:center;cursor:pointer;gap:20px}
73+
{display:flex;align-items:center;cursor:pointer;gap:20px;padding:10px}
74+
a:hover
75+
{background:lightyellow}
76+
7477
a>img
7578
{width:30px;height:30px;margin-left:20px}
7679

@@ -212,7 +215,9 @@ <h1 class=title>
212215
$(a,'.date').textContent = date;
213216
var i = href.lastIndexOf('/');
214217
var fn = href.slice(i+1);
215-
$(a,'.title').textContent = fn;
218+
219+
var str = title(fn);
220+
$(a,'.title').textContent = str;
216221

217222
var svg = jdenticon.toSvg(href,30);
218223
var dataurl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
@@ -231,6 +236,29 @@ <h1 class=title>
231236
}//initdom
232237

233238

239+
240+
function title(fn){
241+
242+
var ext
243+
var str = fn;
244+
245+
var i = fn.lastIndexOf('.');
246+
if(i!=-1){
247+
ext = fn.slice(i+1);
248+
str = fn.slice(0,i);
249+
}
250+
251+
str = str.replaceAll('-',' ');
252+
str = str.replaceAll('_',' ');
253+
254+
return str;
255+
256+
}//fn
257+
258+
259+
260+
261+
234262
//:
235263

236264

0 commit comments

Comments
 (0)