Some changes for the default theme
parent
f8e33d101b
commit
0c930877d1
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 175 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 174 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 180 KiB |
|
|
@ -1,7 +1,30 @@
|
|||
<#import "./main.html.ftl" as main>
|
||||
|
||||
<@main.librecms>
|
||||
<h1>Index page</h1>
|
||||
<div class="container">
|
||||
<div class="bg-light mb-4 rounded-3">
|
||||
<div class="container-fluid py-5">
|
||||
<h1 class="display-5 fw-bold">
|
||||
LibreCMS
|
||||
</h1>
|
||||
<p>
|
||||
No index item has been defined.
|
||||
</p>
|
||||
<a class="btn btn-primary btn-lg"
|
||||
href="https://www.libreccm.org"
|
||||
type="button">
|
||||
Find out more
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<#if CmsPagesCategorizedItemModel.contentItem??>
|
||||
Category has an index item
|
||||
<#else>
|
||||
Category has no index item
|
||||
</#if>
|
||||
|
||||
<h2>Index page</h2>
|
||||
<p>This theme works.</p>
|
||||
<dl>
|
||||
<dt>application</dt>
|
||||
|
|
@ -11,4 +34,6 @@
|
|||
<dt>view</dt>
|
||||
<dd>${view!""}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
</@main.librecms>
|
||||
|
|
@ -7,9 +7,43 @@
|
|||
<title>Default Template</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<#nested>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-lg navbar-expand navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand"
|
||||
href="/pages">
|
||||
<img class="theme-logo img-fluid"
|
||||
src="${themeUrl}/images/librecms.svg" />
|
||||
</a>
|
||||
<button aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
class="navbar-toggler"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#navbar-items"
|
||||
type="button">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse"
|
||||
id="navbar-items">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<#list CmsPagesCategoryModel.categoryTree.subCategories as category>
|
||||
<li ${category.selected?then("aria-selected=\"page\"","")}
|
||||
class="nav-item ${category.selected?then( "active","")}">
|
||||
<a class="nav-link"
|
||||
href="${category.categoryPath}">
|
||||
${category.title}
|
||||
</a>
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<#nested>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
</#macro>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
a.navbar-brand {
|
||||
max-width: 15%;
|
||||
}
|
||||
|
|
@ -6,6 +6,8 @@ import * as fsPromises from "fs/promises";
|
|||
import * as mime from "mime-types";
|
||||
import { fileTypeFromFile, FileTypeResult } from "file-type";
|
||||
|
||||
const AMBIGOUS_FILE_TYPES = ["application/xml"];
|
||||
|
||||
console.log("Static Theme Builder");
|
||||
|
||||
if (process.argv.length < 3) {
|
||||
|
|
@ -143,7 +145,10 @@ function mapFileTypeResultToMimeType(
|
|||
fileTypeResult: FileTypeResult | undefined
|
||||
): string {
|
||||
if (fileTypeResult) {
|
||||
if (fileTypeResult.mime) {
|
||||
if (
|
||||
fileTypeResult.mime &&
|
||||
!AMBIGOUS_FILE_TYPES.includes(fileTypeResult.mime)
|
||||
) {
|
||||
return fileTypeResult.mime;
|
||||
} else {
|
||||
const result = mime.lookup(name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue