@brillout/docpress 0.10.7 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Layout.tsx
CHANGED
|
@@ -58,7 +58,7 @@ function Layout({ children }: { children: React.ReactNode }) {
|
|
|
58
58
|
return (
|
|
59
59
|
<div
|
|
60
60
|
style={{
|
|
61
|
-
['--bg-color']: '#
|
|
61
|
+
['--bg-color']: '#f5f5f5',
|
|
62
62
|
['--block-margin']: `${blockMargin}px`,
|
|
63
63
|
['--icon-text-padding']: '8px',
|
|
64
64
|
// ['--nav-head-height']: `${isLandingPage ? 70 : 60}px`,
|
|
@@ -484,7 +484,7 @@ function NavLogo({ className }: { className: string }) {
|
|
|
484
484
|
href="/"
|
|
485
485
|
>
|
|
486
486
|
<img
|
|
487
|
-
src={pageContext.meta.
|
|
487
|
+
src={pageContext.meta.logoUrl}
|
|
488
488
|
height={iconSize}
|
|
489
489
|
width={iconSize}
|
|
490
490
|
onContextMenu={(ev) => {
|
|
@@ -24,7 +24,6 @@ function resolvePageContext(pageContext: PageContextOriginal) {
|
|
|
24
24
|
|
|
25
25
|
const config = getConfig()
|
|
26
26
|
const {
|
|
27
|
-
faviconUrl,
|
|
28
27
|
algolia,
|
|
29
28
|
tagline,
|
|
30
29
|
twitterHandle,
|
|
@@ -32,11 +31,12 @@ function resolvePageContext(pageContext: PageContextOriginal) {
|
|
|
32
31
|
websiteUrl,
|
|
33
32
|
projectInfo: { projectName },
|
|
34
33
|
} = config
|
|
34
|
+
const logoUrl = config.logoUrl ?? config.faviconUrl
|
|
35
35
|
objectAssign(pageContextResolved, {
|
|
36
36
|
urlPathname: pageContext.urlPathname, // TODO: remove
|
|
37
37
|
meta: {
|
|
38
38
|
projectName,
|
|
39
|
-
|
|
39
|
+
logoUrl,
|
|
40
40
|
twitterHandle,
|
|
41
41
|
bannerUrl,
|
|
42
42
|
websiteUrl,
|
|
@@ -21,7 +21,7 @@ declare function resolvePageContext(pageContext: PageContextOriginal): {
|
|
|
21
21
|
urlPathname: string;
|
|
22
22
|
meta: {
|
|
23
23
|
projectName: string;
|
|
24
|
-
|
|
24
|
+
logoUrl: string | undefined;
|
|
25
25
|
twitterHandle: string;
|
|
26
26
|
bannerUrl: string | undefined;
|
|
27
27
|
websiteUrl: string;
|
|
@@ -3,15 +3,17 @@ import { objectAssign } from '../utils/server';
|
|
|
3
3
|
import { getConfig } from './getConfig';
|
|
4
4
|
import { resolveHeadingsData } from './resolveHeadingsData';
|
|
5
5
|
function resolvePageContext(pageContext) {
|
|
6
|
+
var _a;
|
|
6
7
|
var pageContextResolved = {};
|
|
7
8
|
objectAssign(pageContextResolved, resolveHeadingsData(pageContext));
|
|
8
9
|
var config = getConfig();
|
|
9
|
-
var
|
|
10
|
+
var algolia = config.algolia, tagline = config.tagline, twitterHandle = config.twitterHandle, bannerUrl = config.bannerUrl, websiteUrl = config.websiteUrl, projectName = config.projectInfo.projectName;
|
|
11
|
+
var logoUrl = (_a = config.logoUrl) !== null && _a !== void 0 ? _a : config.faviconUrl;
|
|
10
12
|
objectAssign(pageContextResolved, {
|
|
11
13
|
urlPathname: pageContext.urlPathname, // TODO: remove
|
|
12
14
|
meta: {
|
|
13
15
|
projectName: projectName,
|
|
14
|
-
|
|
16
|
+
logoUrl: logoUrl,
|
|
15
17
|
twitterHandle: twitterHandle,
|
|
16
18
|
bannerUrl: bannerUrl,
|
|
17
19
|
websiteUrl: websiteUrl,
|
package/dist/types/Config.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brillout/docpress",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@brillout/picocolors": "^1.0.10",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@mdx-js/react": "3.0.1",
|
|
11
11
|
"@mdx-js/rollup": "3.0.1",
|
|
12
12
|
"@shikijs/transformers": "1.2.0",
|
|
13
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
13
|
+
"@vitejs/plugin-react-swc": "^3.7.2",
|
|
14
14
|
"rehype-pretty-code": "0.13.0",
|
|
15
15
|
"remark-gfm": "4.0.0",
|
|
16
16
|
"shiki": "1.2.0"
|
|
@@ -21,11 +21,13 @@ Promise<Awaited<ReturnType<OnRenderHtmlAsync>>> => {
|
|
|
21
21
|
|
|
22
22
|
const pageHtml = ReactDOMServer.renderToString(page)
|
|
23
23
|
|
|
24
|
+
const faviconUrl = pageContextResolved.config.faviconUrl ?? pageContextResolved.config.logoUrl
|
|
25
|
+
|
|
24
26
|
return escapeInject`<!DOCTYPE html>
|
|
25
27
|
<html>
|
|
26
28
|
<head>
|
|
27
29
|
<meta charset="UTF-8" />
|
|
28
|
-
<link rel="icon" href="${
|
|
30
|
+
<link rel="icon" href="${faviconUrl}" />
|
|
29
31
|
<title>${pageContextResolved.documentTitle}</title>
|
|
30
32
|
${descriptionTag}
|
|
31
33
|
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
|