Made default template a little more reasonable and added support for dark themes too

This commit is contained in:
m455 2023-02-03 23:37:35 -05:00
parent 758352c8cd
commit 9098d8e2ee

View file

@ -7,15 +7,21 @@
<link rel="icon" href="data:," />
<meta name="description" content="{{ repository_description }}" />
<style>
body { margin: 0 auto; max-width: 700px }
pre, code { background-color: #ffd9df }
body {
font-family: sans-serif;
margin: 0 auto;
max-width: 700px;
line-height: 1.5;
}
pre, code { background-color: #eeeeee }
pre { overflow: scroll; padding: 15px 20px; white-space: pre }
a { color: blue }
nav a { margin-right: 10px }
hr { border: 0; border-bottom: 1px solid black; margin-top: 16px }
hr { border: 0; border-bottom: 1px solid black }
th { text-align: left }
td { padding: 0 1em 0 0; vertical-align: top; }
td { padding: 0 1em 0 0; vertical-align: top }
footer { font-size: small; text-align: right }
img { max-width: 100% }
/* permalinks */
h1 a[href^="#"]::after, h2 a[href^="#"]::after, h3 a[href^="#"]::after, h4 a[href^="#"]::after, h5 a[href^="#"]::after, h6 a[href^="#"]::after { content: "¶"; opacity: 0; margin-left: .5em; }
h1:hover a[href^="#"]::after, h2:hover a[href^="#"]::after, h3:hover a[href^="#"]::after, h4:hover a[href^="#"]::after, h5:hover a[href^="#"]::after, h6:hover a[href^="#"]::after { opacity: 100; }
@ -30,6 +36,19 @@
.line:target {
background-color: yellow;
}
@media (prefers-color-scheme: dark) {
body {
color: white;
background-color: black;
}
a {
color: cyan;
}
pre, code {
background-color: #222222;
}
.line:target { background-color: darkgreen; }
}
</style>
</head>
<body>
@ -37,7 +56,7 @@
<h2>{{ repository_path_parent }}
{% if repository_path_parent %} / {% endif %}
{{ repository_name }}</h2>
<p>clone url: git://git.example.com/{{ repository_path }}</p>
<p><strong>clone url</strong>: <code>git://git.example.com/{{ repository_path }}</code></p>
<nav>
{% if readme_file %}
<a href="{{ relative_root }}{{ readme_file }}.html">about</a>
@ -67,4 +86,6 @@
{{ repo2html_version }} using
<a href="http://wiki.call-cc.org/eggref/5/ersatz"
title="the ersatz Jinja2-like templating library by Ivan Raikov"
>ersatz</a> templates</p></footer></html>
>ersatz</a> templates</p>
</footer>
</html>