1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-14 18:27:44 +02:00

Server: Fixed styling of shared note

This commit is contained in:
Laurent Cozic 2021-07-04 16:17:09 +01:00
parent 5ee4e2bf8e
commit 6c1a6b0a61
4 changed files with 35 additions and 4 deletions

View File

@ -14,6 +14,8 @@
max-width: 840px;
margin-left: auto;
margin-right: auto;
padding-left: 1.5em;
padding-right: 1.5em;
}
.page-note .last-updated {

View File

@ -51,4 +51,9 @@ table.table th .sort-button i {
.footer .content {
opacity: 0.5;
}
}
ul li {
list-style-type: disc;
}

View File

@ -16,6 +16,7 @@ export interface View {
name: string;
title: string;
path: string;
layout?: string;
navbar?: boolean;
content?: any;
partials?: string[];
@ -76,8 +77,9 @@ export default class MustacheService {
this.prefersDarkEnabled_ = v;
}
private get defaultLayoutPath(): string {
return `${config().layoutDir}/default.mustache`;
private layoutPath(name: string): string {
if (!name) name = 'default';
return `${config().layoutDir}/${name}.mustache`;
}
private get defaultLayoutOptions(): GlobalParams {
@ -142,7 +144,7 @@ export default class MustacheService {
...view.content,
};
return Mustache.render(await this.loadTemplateContent(this.defaultLayoutPath), layoutView, this.partials_);
return Mustache.render(await this.loadTemplateContent(this.layoutPath(view.layout)), layoutView, this.partials_);
}
}

View File

@ -0,0 +1,22 @@
<!doctype html>
<html>
<head>
<title>{{pageTitle}}</title>
<meta charset="utf-8">
<link rel="stylesheet" href="{{{global.baseUrl}}}/css/main.css" crossorigin="anonymous">
{{#cssFiles}}
<link rel="stylesheet" href="{{{.}}}" crossorigin="anonymous">
{{/cssFiles}}
{{#jsFiles}}
<script src="{{{.}}}"></script>
{{/jsFiles}}
</head>
<body class="page-{{{pageName}}}">
<main class="main">
<div class="container">
{{{contentHtml}}}
</div>
</main>
{{> footer}}
</body>
</html>