@brillout/docpress 0.10.7 → 0.10.9
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,9 +484,12 @@ function NavLogo({ className }: { className: string }) {
|
|
|
484
484
|
href="/"
|
|
485
485
|
>
|
|
486
486
|
<img
|
|
487
|
-
src={pageContext.meta.
|
|
488
|
-
|
|
489
|
-
|
|
487
|
+
src={pageContext.meta.logoUrl}
|
|
488
|
+
style={{
|
|
489
|
+
height: iconSize,
|
|
490
|
+
width: iconSize,
|
|
491
|
+
...pageContext.config.navLogoStyle,
|
|
492
|
+
}}
|
|
490
493
|
onContextMenu={(ev) => {
|
|
491
494
|
if (!pageContext.config.pressKit) return // no /press page
|
|
492
495
|
if (window.location.pathname === '/press') return
|
|
@@ -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
|
@@ -10,7 +10,8 @@ type Config = {
|
|
|
10
10
|
discordInvite?: string;
|
|
11
11
|
twitterProfile: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
logoUrl?: string;
|
|
14
|
+
faviconUrl?: string;
|
|
14
15
|
algolia: null | {
|
|
15
16
|
appId: string;
|
|
16
17
|
apiKey: string;
|
|
@@ -29,5 +30,6 @@ type Config = {
|
|
|
29
30
|
sponsorGithubAccount?: string;
|
|
30
31
|
navMaxWidth?: number;
|
|
31
32
|
navLogoSize?: number;
|
|
33
|
+
navLogoStyle?: React.CSSProperties;
|
|
32
34
|
navLogoTextStyle?: React.CSSProperties;
|
|
33
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brillout/docpress",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.9",
|
|
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" />
|
package/types/Config.ts
CHANGED
|
@@ -12,7 +12,8 @@ type Config = {
|
|
|
12
12
|
discordInvite?: string
|
|
13
13
|
twitterProfile: string
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
logoUrl?: string
|
|
16
|
+
faviconUrl?: string
|
|
16
17
|
algolia: null | {
|
|
17
18
|
appId: string
|
|
18
19
|
apiKey: string
|
|
@@ -31,5 +32,6 @@ type Config = {
|
|
|
31
32
|
sponsorGithubAccount?: string
|
|
32
33
|
navMaxWidth?: number
|
|
33
34
|
navLogoSize?: number
|
|
35
|
+
navLogoStyle?: React.CSSProperties
|
|
34
36
|
navLogoTextStyle?: React.CSSProperties
|
|
35
37
|
}
|