Server MD with Rust

This commit is contained in:
Jarek Rozanski 2026-01-28 20:56:35 +01:00
commit 3899ecce2f
14 changed files with 2823 additions and 0 deletions

135
sample/layout/default.hbs Normal file
View file

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
:root {
--primary-color: #2c3e50;
--secondary-color: #3498db;
--bg-color: #f9f9f9;
--text-color: #333;
--code-bg: #f5f5f5;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
min-height: 100vh;
}
.container {
max-width: 1000px;
margin: 0 auto;
padding: 2rem;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
margin-top: 2rem;
margin-bottom: 2rem;
}
header {
background-color: var(--primary-color);
color: white;
padding: 1rem;
text-align: center;
margin-bottom: 1rem;
border-radius: 8px 8px 0 0;
}
h1, h2, h3 {
color: var(--primary-color);
margin-bottom: 1rem;
}
h1 {
font-size: 2.2rem;
}
h2 {
font-size: 1.8rem;
margin-top: 2rem;
border-bottom: 2px solid var(--secondary-color);
padding-bottom: 0.5rem;
}
h3 {
font-size: 1.4rem;
margin-top: 1.5rem;
}
pre {
background: var(--code-bg);
padding: 1rem;
border-radius: 5px;
overflow-x: auto;
margin: 1rem 0;
border-left: 4px solid var(--secondary-color);
}
code {
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
font-size: 0.9em;
background: var(--code-bg);
padding: 0.2rem 0.4rem;
border-radius: 3px;
}
ul, ol {
margin: 1rem 0;
padding-left: 2rem;
}
li {
margin: 0.5rem 0;
}
a {
color: var(--secondary-color);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
footer {
text-align: center;
margin-top: 2rem;
padding: 1rem;
color: #666;
font-size: 0.9rem;
}
.breadcrumb {
color: #666;
font-size: 0.9rem;
margin-bottom: 1rem;
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>Markdown Server</h1>
<div class="breadcrumb">Path: {{path}}</div>
</header>
<main>
{{{content}}}
</main>
</div>
<footer>
Powered by Mhmm Content | Template: default
</footer>
</body>
</html>

26
sample/layout/minimal.hbs Normal file
View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
pre {
background: #f0f0f0;
padding: 10px;
overflow-x: auto;
}
</style>
</head>
<body>
<h1>{{title}}</h1>
<div>{{{content}}}</div>
<footer>
<small>Template: minimal | Path: {{path}}</small>
</footer>
</body>
</html>