mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-19 05:09:41 +02:00
fix favicon in generated files
This commit is contained in:
parent
c668ab1579
commit
4d94180244
1 changed files with 7 additions and 0 deletions
|
@ -13,6 +13,7 @@ import fse from 'fs-extra';
|
|||
import appConfig from './utils/appConfig.js';
|
||||
import Aliases from './controllers/aliases.js';
|
||||
import Pages from './controllers/pages.js';
|
||||
import { downloadFavicon } from './utils/downloadFavicon.js';
|
||||
|
||||
/**
|
||||
* Build static pages from database
|
||||
|
@ -82,12 +83,18 @@ export default async function buildStatic(): Promise<void> {
|
|||
const previousPage = await PagesFlatArray.getPageBefore(pageId);
|
||||
const nextPage = await PagesFlatArray.getPageAfter(pageId);
|
||||
const menu = createMenuTree(parentIdOfRootPages, allPages, pagesOrder, 2);
|
||||
const favicon = appConfig.favicon ? await downloadFavicon(appConfig.favicon, distPath) : {
|
||||
destination: '/favicon.png',
|
||||
type: 'image/png',
|
||||
};
|
||||
|
||||
const result = await renderTemplate('./views/pages/page.twig', {
|
||||
page,
|
||||
pageParent,
|
||||
previousPage,
|
||||
nextPage,
|
||||
menu,
|
||||
favicon,
|
||||
config: appConfig.frontend,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue