Skip to content

Commit

Permalink
add favicon to admin UI (keystonejs#7092)
Browse files Browse the repository at this point in the history
* add favicon to admin UI

* fix website build

Co-authored-by: Noviny <noviny@thinkmill.com.au>
  • Loading branch information
Noviny and Noviny authored Dec 20, 2021
1 parent 5ac8ef4 commit 1eed5d5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-wombats-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Keystone favicon is now displayed on keystone sites
4 changes: 3 additions & 1 deletion docs/components/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export function Markdown({
description: string;
title?: string;
}) {
const headings = getHeadings(children.type().props.children);
const headings = getHeadings(
(typeof children.type === 'function' ? children.type() : children).props.children
);
const firstHeading = title || headings[0]?.label;

if (!firstHeading) {
Expand Down
5 changes: 5 additions & 0 deletions packages/keystone/src/admin-ui/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export const writeAdminFiles = (
outputPath =>
({ mode: 'copy', inputPath: Path.join(pkgDir, 'static', outputPath), outputPath } as const)
),
{
mode: 'copy',
inputPath: Path.join(pkgDir, 'static', 'favicon.ico'),
outputPath: 'public/favicon.ico',
},
{ mode: 'write', src: noAccessTemplate(config.session), outputPath: 'pages/no-access.js' },
{
mode: 'write',
Expand Down
Binary file added packages/keystone/static/favicon.ico
Binary file not shown.

0 comments on commit 1eed5d5

Please sign in to comment.