mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00

* feat: rootpath for static assets and links1 * fix: static asset handler respects root path * fix: use rootPath for links * tests: fix the tests after adding consuctor params * feat: change matchregex instead of stored URLs * feat: baseUrl for handlebar engine and templates * feat: full baseUrl passed to templates * test: fix integration tests + templates * chore: implement requested changes * docs: Describe TemplateEngine interface changes Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
33 lines
912 B
Plaintext
33 lines
912 B
Plaintext
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8"/>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||
<title><%= extractTitle(htmlBody) %></title>
|
||
<link rel="stylesheet" href="<%= baseUrl -%>.well-known/css/styles/main.css" type="text/css">
|
||
<script type="text/javascript" src="<%= baseUrl -%>.well-known/css/scripts/util.js"></script>
|
||
</head>
|
||
<body>
|
||
<header>
|
||
<a href="<%= baseUrl %>"><img src="<%= baseUrl -%>.well-known/css/images/solid.svg" alt="[Solid logo]" /></a>
|
||
<h1>Community Solid Server</h1>
|
||
</header>
|
||
<main>
|
||
<%- htmlBody %>
|
||
</main>
|
||
<footer>
|
||
<p>
|
||
©2019–2022 <a href="https://inrupt.com/">Inrupt Inc.</a>
|
||
and <a href="https://www.imec-int.com/">imec</a>
|
||
</p>
|
||
</footer>
|
||
</body>
|
||
</html>
|
||
|
||
<%
|
||
function extractTitle(body) {
|
||
const match = /^<h1[^>]*>([^<]*)<\/h1>/u.exec(body);
|
||
return match ? match[1] : 'Solid';
|
||
}
|
||
%>
|