mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-25 17:22:50 +00:00
Compare commits
8 Commits
a359a4cb27
...
603d27c93d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
603d27c93d | ||
|
|
5bc5c90dc7 | ||
|
|
ee9dfd5d0b | ||
|
|
ee4a5f8c09 | ||
|
|
1686134d1c | ||
|
|
391f429463 | ||
|
|
0066de5e08 | ||
|
|
1a3042697a |
|
|
@ -50,14 +50,14 @@ jobs:
|
|||
path: website/build
|
||||
|
||||
#- name: Upload Website Pages artifact
|
||||
# uses: actions/upload-pages-artifact@v4
|
||||
# uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
|
||||
# with:
|
||||
# path: website/build
|
||||
|
||||
# Deploy to https://facebook.github.io/docusaurus/
|
||||
- name: Deploy to GitHub Pages
|
||||
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }}
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: website/build
|
||||
|
|
@ -81,4 +81,4 @@ jobs:
|
|||
# steps:
|
||||
# - name: Deploy to GitHub Pages
|
||||
# id: deployment
|
||||
# uses: actions/deploy-pages@v4
|
||||
# uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ jobs:
|
|||
node-version: lts/*
|
||||
cache: yarn
|
||||
- name: Track build size changes
|
||||
uses: preactjs/compressed-size-action@946a292cd35bd1088e0d7eb92b69d1a8d5b5d76a # v2
|
||||
uses: preactjs/compressed-size-action@8518045ed95e94e971b83333085e1cb99aa18aa8 # v2.9.0
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
build-script: build:website:fast
|
||||
|
|
|
|||
|
|
@ -42,6 +42,6 @@ jobs:
|
|||
- name: Print Diff
|
||||
run: git diff
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v7
|
||||
- uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
|
||||
with:
|
||||
commit_message: 'refactor: apply lint autofix'
|
||||
|
|
|
|||
|
|
@ -221,6 +221,16 @@ declare module '@theme/Blog/Components/Author/Socials' {
|
|||
export default function BlogAuthorSocials(props: Props): ReactNode;
|
||||
}
|
||||
|
||||
declare module '@theme/Blog/Components/Author/GeneratedImage' {
|
||||
export interface Props {
|
||||
readonly name: string;
|
||||
readonly link?: string;
|
||||
readonly className?: string;
|
||||
}
|
||||
|
||||
export default function GeneratedImage(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/BlogListPaginator' {
|
||||
import type {ReactNode} from 'react';
|
||||
import type {BlogPaginatedMetadata} from '@docusaurus/plugin-content-blog';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import type {Props} from '@theme/Blog/Components/Author/GeneratedImage';
|
||||
|
||||
export default function GeneratedImage({name, className}: Props): JSX.Element {
|
||||
return (
|
||||
<div className={clsx('avatar__photo', className)}>
|
||||
{name[0]?.toLocaleUpperCase()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ import Link, {type Props as LinkProps} from '@docusaurus/Link';
|
|||
import AuthorSocials from '@theme/Blog/Components/Author/Socials';
|
||||
import type {Props} from '@theme/Blog/Components/Author';
|
||||
import Heading from '@theme/Heading';
|
||||
import GeneratedImage from '@theme/Blog/Components/Author/GeneratedImage';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
function MaybeLink(props: LinkProps): ReactNode {
|
||||
|
|
@ -69,7 +70,7 @@ export default function BlogAuthor({
|
|||
className,
|
||||
styles[`author-as-${as}`],
|
||||
)}>
|
||||
{imageURL && (
|
||||
{imageURL ? (
|
||||
<MaybeLink href={link} className="avatar__photo-link">
|
||||
<img
|
||||
className={clsx('avatar__photo', styles.authorImage)}
|
||||
|
|
@ -77,6 +78,14 @@ export default function BlogAuthor({
|
|||
alt={name}
|
||||
/>
|
||||
</MaybeLink>
|
||||
) : (
|
||||
<MaybeLink href={link} className="avatar__photo-link">
|
||||
<GeneratedImage
|
||||
name={name!}
|
||||
link={link}
|
||||
className={clsx(styles.authorImage, styles.authorGeneratedImage)}
|
||||
/>
|
||||
</MaybeLink>
|
||||
)}
|
||||
|
||||
{(name || title) && (
|
||||
|
|
|
|||
|
|
@ -7,12 +7,34 @@
|
|||
|
||||
.authorImage {
|
||||
--ifm-avatar-photo-size: 3.6rem;
|
||||
background: var(--ifm-color-emphasis-200);
|
||||
}
|
||||
|
||||
.author-as-h1 .authorImage {
|
||||
--ifm-avatar-photo-size: 7rem;
|
||||
}
|
||||
|
||||
.authorGeneratedImage {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: var(--ifm-color-emphasis-0);
|
||||
font-size: 2rem;
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
var(--ifm-color-emphasis-700) 0%,
|
||||
var(--ifm-color-emphasis-1000) 100%
|
||||
);
|
||||
}
|
||||
|
||||
[data-theme='dark'] .authorGeneratedImage {
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
var(--ifm-color-emphasis-800) 0%,
|
||||
var(--ifm-color-emphasis-200) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.author-as-h2 .authorImage {
|
||||
--ifm-avatar-photo-size: 5.4rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,3 +11,11 @@ slorber:
|
|||
ozaki:
|
||||
name: ozaki
|
||||
page: {permalink: '/custom/ozaki/permalink'}
|
||||
|
||||
john:
|
||||
name: John Doe
|
||||
page: true
|
||||
|
||||
bob:
|
||||
name: Bob Smith
|
||||
page: true
|
||||
|
|
|
|||
|
|
@ -110,6 +110,9 @@ html[data-theme='dark'] {
|
|||
--docsearch-container-background: rgb(94 100 112 / 70%);
|
||||
/* Modal */
|
||||
--docsearch-modal-background: var(--ifm-color-secondary-lighter);
|
||||
/* Button */
|
||||
--docsearch-search-button-background: var(--ifm-color-secondary);
|
||||
--docsearch-search-button-text-color: var(--docsearch-muted-color);
|
||||
/* Search box */
|
||||
--docsearch-searchbox-background: var(--ifm-color-secondary);
|
||||
--docsearch-searchbox-focus-background: var(--ifm-color-white);
|
||||
|
|
@ -127,6 +130,9 @@ html[data-theme='dark'] {
|
|||
--docsearch-container-background: rgb(47 55 69 / 70%);
|
||||
/* Modal */
|
||||
--docsearch-modal-background: var(--ifm-background-color);
|
||||
/* Button */
|
||||
--docsearch-search-button-background: var(--ifm-background-color);
|
||||
--docsearch-search-button-text-color: var(--docsearch-muted-color);
|
||||
/* Search box */
|
||||
--docsearch-searchbox-background: var(--ifm-background-color);
|
||||
--docsearch-searchbox-focus-background: var(--ifm-color-black);
|
||||
|
|
|
|||
26
yarn.lock
26
yarn.lock
|
|
@ -2069,25 +2069,25 @@
|
|||
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
|
||||
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
|
||||
|
||||
"@docsearch/core@4.3.1":
|
||||
version "4.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@docsearch/core/-/core-4.3.1.tgz#88a97a6fe4d4025269b6dee8b9d070b76758ad82"
|
||||
integrity sha512-ktVbkePE+2h9RwqCUMbWXOoebFyDOxHqImAqfs+lC8yOU+XwEW4jgvHGJK079deTeHtdhUNj0PXHSnhJINvHzQ==
|
||||
"@docsearch/core@4.4.0":
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@docsearch/core/-/core-4.4.0.tgz#206c0df38ee08cf0d6e33c4eaee140706931b311"
|
||||
integrity sha512-kiwNo5KEndOnrf5Kq/e5+D9NBMCFgNsDoRpKQJ9o/xnSlheh6b8AXppMuuUVVdAUIhIfQFk/07VLjjk/fYyKmw==
|
||||
|
||||
"@docsearch/css@4.3.2":
|
||||
version "4.3.2"
|
||||
resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-4.3.2.tgz#d47d25336c9516b419245fa74e8dd5ae84a17492"
|
||||
integrity sha512-K3Yhay9MgkBjJJ0WEL5MxnACModX9xuNt3UlQQkDEDZJZ0+aeWKtOkxHNndMRkMBnHdYvQjxkm6mdlneOtU1IQ==
|
||||
"@docsearch/css@4.4.0":
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-4.4.0.tgz#b8eebd21a1f79720bf037fda5242b910367f157e"
|
||||
integrity sha512-e9vPgtih6fkawakmYo0Y6V4BKBmDV7Ykudn7ADWXUs5b6pmtBRwDbpSG/WiaUG63G28OkJDEnsMvgIAnZgGwYw==
|
||||
|
||||
"@docsearch/react@^3.9.0 || ^4.3.2":
|
||||
version "4.3.2"
|
||||
resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-4.3.2.tgz#450b8341cb5cca03737a00075d4dfd3a904a3e3e"
|
||||
integrity sha512-74SFD6WluwvgsOPqifYOviEEVwDxslxfhakTlra+JviaNcs7KK/rjsPj89kVEoQc9FUxRkAofaJnHIR7pb4TSQ==
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-4.4.0.tgz#f69bd533305a07247f4850ee74af11e784b99658"
|
||||
integrity sha512-z12zeg1mV7WD4Ag4pKSuGukETJLaucVFwszDXL/qLaEgRqxEaVacO9SR1qqnCXvZztlvz2rt7cMqryi/7sKfjA==
|
||||
dependencies:
|
||||
"@ai-sdk/react" "^2.0.30"
|
||||
"@algolia/autocomplete-core" "1.19.2"
|
||||
"@docsearch/core" "4.3.1"
|
||||
"@docsearch/css" "4.3.2"
|
||||
"@docsearch/core" "4.4.0"
|
||||
"@docsearch/css" "4.4.0"
|
||||
ai "^5.0.30"
|
||||
algoliasearch "^5.28.0"
|
||||
marked "^16.3.0"
|
||||
|
|
|
|||
Loading…
Reference in New Issue