Compare commits

...

8 Commits

Author SHA1 Message Date
ozaki 603d27c93d
Merge ee4a5f8c09 into 5bc5c90dc7 2025-12-24 19:27:16 -08:00
Sébastien Lorber 5bc5c90dc7
chore(website): upgrade to DocSearch 4.4.0 + fix little website theming issues (#11626)
Some checks failed
Argos CI / take-screenshots (push) Has been cancelled
Build Hash Router / Build Hash Router (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Continuous Releases / Continuous Releases (push) Has been cancelled
E2E Tests / E2E — Yarn v1 (20) (push) Has been cancelled
E2E Tests / E2E — Yarn v1 (20.0) (push) Has been cancelled
E2E Tests / E2E — Yarn v1 (22) (push) Has been cancelled
E2E Tests / E2E — Yarn v1 (24) (push) Has been cancelled
E2E Tests / E2E — Yarn v1 (25.1) (push) Has been cancelled
E2E Tests / E2E — Yarn v1 Windows (push) Has been cancelled
E2E Tests / E2E — Yarn Berry (node-modules, -s) (push) Has been cancelled
E2E Tests / E2E — Yarn Berry (node-modules, -st) (push) Has been cancelled
E2E Tests / E2E — Yarn Berry (pnp, -s) (push) Has been cancelled
E2E Tests / E2E — Yarn Berry (pnp, -st) (push) Has been cancelled
E2E Tests / E2E — npm (push) Has been cancelled
E2E Tests / E2E — pnpm (push) Has been cancelled
2025-12-23 16:29:00 +01:00
dependabot[bot] ee9dfd5d0b
chore(deps): bump preactjs/compressed-size-action from 2.8.0 to 2.9.0 - pin all remaining GitHub actions (#11625)
Some checks are pending
Argos CI / take-screenshots (push) Waiting to run
Build Hash Router / Build Hash Router (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Continuous Releases / Continuous Releases (push) Waiting to run
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
2025-12-23 11:10:37 +01:00
ozakione ee4a5f8c09 refactor review 2024-08-26 15:13:41 +02:00
ozaki 1686134d1c
Merge branch 'main' into ozaki/randomImageURL 2024-08-23 17:36:25 +02:00
ozakione 391f429463 refactor 2024-08-22 16:46:03 +02:00
ozakione 0066de5e08 grey generated image 2024-08-21 15:00:41 +02:00
ozakione 1a3042697a feat: poc generated image 2024-08-20 21:22:49 +02:00
10 changed files with 92 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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';

View File

@ -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>
);
}

View File

@ -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) && (

View File

@ -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;
}

View File

@ -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

View File

@ -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);

View File

@ -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"