fixed prior merge conflic causing double'd embed, added readme parser with full markdown, added readme render to HTML, renamed filepath to fpath to use FilePath.Join for case insensitivity, fixed ident in html src (inline css), added readme css with proper accents
This commit is contained in:
parent
cf03c723d0
commit
245d6e0fa0
4 changed files with 270 additions and 133 deletions
|
|
@ -1,82 +1,157 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Files in {{.Name}}</title>
|
||||
<style>
|
||||
html {
|
||||
background: #101010;
|
||||
color: #f0f0f0;
|
||||
font-family: 'Monaspace Argon', monospace;
|
||||
font-size: 16px;
|
||||
}
|
||||
html {
|
||||
background: #101010;
|
||||
color: #f0f0f0;
|
||||
font-family: "Monaspace Argon", monospace;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
body {
|
||||
width: min(calc(100% - 1em), 1000px);
|
||||
margin: 0 auto;
|
||||
}
|
||||
body {
|
||||
width: min(calc(100% - 1em), 1000px);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
tr:hover {
|
||||
background-color: #80808040;
|
||||
}
|
||||
tr:hover {
|
||||
background-color: #80808040;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
td {
|
||||
width: 1%;
|
||||
max-width: 500px;
|
||||
padding: .2em 0;
|
||||
}
|
||||
td {
|
||||
width: 1%;
|
||||
max-width: 500px;
|
||||
padding: 0.2em 0;
|
||||
}
|
||||
|
||||
table a {
|
||||
display: block;
|
||||
line-break: anywhere;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
table a {
|
||||
display: block;
|
||||
line-break: anywhere;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #b7fd49;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a {
|
||||
color: #b7fd49;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
footer {
|
||||
padding: 1em 0;
|
||||
}
|
||||
.readme {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 700px) {
|
||||
body {
|
||||
font-size: 12px;
|
||||
}
|
||||
.readme h1,
|
||||
.readme h2,
|
||||
.readme h3,
|
||||
.readme h4,
|
||||
.readme h5,
|
||||
.readme h6 {
|
||||
color: #f0f0f0;
|
||||
margin-top: 1.2rem;
|
||||
}
|
||||
|
||||
td {
|
||||
width: auto;
|
||||
}
|
||||
.readme p,
|
||||
.readme li {
|
||||
line-height: 1.7;
|
||||
color: #d0d0d0;
|
||||
}
|
||||
|
||||
td:last-of-type,
|
||||
th:last-of-type {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.readme a {
|
||||
color: #b7fd49;
|
||||
}
|
||||
|
||||
.readme a:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.readme code {
|
||||
background: #1e1e1e;
|
||||
border: 1px solid #333;
|
||||
border-radius: 3px;
|
||||
padding: 0.1em, 0.4em;
|
||||
font-family: "Monaspace Argon", monospace;
|
||||
font-size: 0.9em;
|
||||
color: #b7fd79;
|
||||
}
|
||||
|
||||
.readme pre {
|
||||
background: #1e1e1e;
|
||||
border: 3px solid #333;
|
||||
border-radius: 6px;
|
||||
padding: 1em;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.readme pre code {
|
||||
border: none;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.readme blockquote {
|
||||
border-left: 3px solid #b7fd49;
|
||||
margin: 0;
|
||||
padding-left: 1em;
|
||||
color: #a0a0a0;
|
||||
}
|
||||
|
||||
.readme hr {
|
||||
border-color: #333;
|
||||
}
|
||||
|
||||
.readme table {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.readme table td,
|
||||
.readme table th {
|
||||
border: 1px solid #333;
|
||||
padding: 0.3em 0.6em;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
footer {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 700px) {
|
||||
body {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
td {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
td:last-of-type,
|
||||
th:last-of-type {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Files in {{.Name}}</h1>
|
||||
<hr>
|
||||
<hr />
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
|
|
@ -89,8 +164,7 @@ footer {
|
|||
<td>—</td>
|
||||
<td>—</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{range .Files}}
|
||||
{{end}} {{range .Files}}
|
||||
<tr>
|
||||
<td><a href="{{.URI}}">{{.Name}}</a></td>
|
||||
<td>{{if .IsDir}}—{{else}}{{.Size}}{{end}}</td>
|
||||
|
|
@ -98,10 +172,24 @@ footer {
|
|||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
<hr>
|
||||
<hr />
|
||||
{{if .Readme}}
|
||||
<article class="readme">
|
||||
<h2>README</h2>
|
||||
<hr />
|
||||
{{.Readme}}
|
||||
</article>
|
||||
{{end}}
|
||||
</main>
|
||||
<footer>
|
||||
<em>made with <span aria-label="love">♥</span> by ari, 2025 <a href="https://forge.arimelody.space/ari/indir" target="_blank">[source]</a></em>
|
||||
<em
|
||||
>made with <span aria-label="love">♥</span> by ari, 2025
|
||||
<a
|
||||
href="https://forge.arimelody.space/ari/indir"
|
||||
target="_blank"
|
||||
>[source]</a
|
||||
></em
|
||||
>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue