This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Allow adding links to logos #278
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2b4fce2
allow link to logos
yathomasi 139c7fa
add more links
aguschin e9a6bd9
border aorund boxes on hover
yathomasi f1e6faf
use css grid to have same box-height
yathomasi cca1cf7
remove white backgrounds
yathomasi ebe9985
fix format
yathomasi e319ed7
remove some links
aguschin 96be5c9
remove link for rabbitmq
aguschin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,22 @@ import scikitLearnLogo from '../../../images/logo/scikit-learn.png' | |
import streamlitLogo from '../../../images/logo/streamlit.png' | ||
import tensorflowLogo from '../../../images/logo/tensorflow.png' | ||
import * as styles from './index.module.css' | ||
import Link from '@dvcorg/gatsby-theme-iterative/src/components/Link' | ||
|
||
interface ITypedRef { | ||
reset: () => void | ||
destroy: () => void | ||
} | ||
|
||
interface ILogo { | ||
src: string | ||
widthSm: number | ||
widthMd: number | ||
widthLg: number | ||
alt: string | ||
link?: string | ||
} | ||
|
||
const cliCaptionData: Array<{ bold: string; text: string }> = [ | ||
{ | ||
bold: 'Save your ML model with a Python call.', | ||
|
@@ -53,54 +63,54 @@ const cliCaptionData: Array<{ bold: string; text: string }> = [ | |
} | ||
] | ||
|
||
const logosData: Array<{ | ||
src: string | ||
widthSm: number | ||
widthMd: number | ||
widthLg: number | ||
alt: string | ||
}> = [ | ||
const logosData: Array<ILogo> = [ | ||
{ | ||
widthSm: 66, | ||
widthMd: 88, | ||
widthLg: 136, | ||
widthSm: 74, | ||
widthMd: 96, | ||
widthLg: 144, | ||
src: fastapiLogo, | ||
alt: 'FastAPI logo' | ||
alt: 'FastAPI logo', | ||
link: '/doc/user-guide/serving/fastapi' | ||
}, | ||
{ | ||
widthSm: 66, | ||
widthMd: 88, | ||
widthLg: 124, | ||
src: dockerLogo, | ||
alt: 'Docker logo' | ||
alt: 'Docker logo', | ||
link: '/doc/user-guide/building/docker' | ||
}, | ||
{ | ||
widthSm: 66, | ||
widthMd: 88, | ||
widthLg: 124, | ||
src: streamlitLogo, | ||
alt: 'Streamlit logo' | ||
alt: 'Streamlit logo', | ||
link: '/doc/user-guide/serving/streamlit' | ||
}, | ||
{ | ||
widthSm: 66, | ||
widthMd: 88, | ||
widthLg: 124, | ||
src: herokuLogo, | ||
alt: 'Heroku logo' | ||
alt: 'Heroku logo', | ||
link: '/doc/user-guide/deploying/heroku' | ||
}, | ||
{ | ||
widthSm: 55, | ||
widthMd: 75, | ||
widthLg: 108, | ||
src: kubernetesLogo, | ||
alt: 'Kubernetes logo' | ||
alt: 'Kubernetes logo', | ||
link: '/doc/user-guide/deploying/kubernetes' | ||
}, | ||
{ | ||
widthSm: 66, | ||
widthMd: 88, | ||
widthLg: 124, | ||
src: sagemakerLogo, | ||
alt: 'Sagemaker logo' | ||
alt: 'Sagemaker logo', | ||
link: '/doc/user-guide/deploying/sagemaker' | ||
}, | ||
{ | ||
widthSm: 66, | ||
|
@@ -121,14 +131,16 @@ const logosData: Array<{ | |
widthMd: 88, | ||
widthLg: 124, | ||
src: pythonLogo, | ||
alt: 'Python logo' | ||
alt: 'Python logo', | ||
link: '/doc/user-guide/building/pip' | ||
aguschin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
{ | ||
widthSm: 66, | ||
widthMd: 78, | ||
widthLg: 110, | ||
src: condaLogo, | ||
alt: 'Conda logo' | ||
alt: 'Conda logo', | ||
link: '/doc/user-guide/building/conda' | ||
}, | ||
{ | ||
widthSm: 66, | ||
|
@@ -163,7 +175,8 @@ const logosData: Array<{ | |
widthMd: 50, | ||
widthLg: 71, | ||
src: scikitLearnLogo, | ||
alt: 'scikit learn logo' | ||
alt: 'scikit learn logo', | ||
link: '/doc/get-started' | ||
}, | ||
{ | ||
widthSm: 66, | ||
|
@@ -191,17 +204,42 @@ const logosData: Array<{ | |
widthMd: 78, | ||
widthLg: 120, | ||
src: numpyLogo, | ||
alt: 'Numpy logo' | ||
alt: 'Numpy logo', | ||
link: '/doc/user-guide/data' | ||
}, | ||
{ | ||
widthSm: 66, | ||
widthMd: 78, | ||
widthLg: 110, | ||
src: pandasLogo, | ||
alt: 'Pandas logo' | ||
alt: 'Pandas logo', | ||
link: '/doc/user-guide/data' | ||
} | ||
] | ||
|
||
const LogoImage = ({ | ||
widthSm, | ||
widthMd, | ||
widthLg, | ||
src, | ||
alt, | ||
className | ||
}: ILogo & { className?: string }) => ( | ||
<img | ||
alt={alt} | ||
src={src} | ||
className={cn(styles.header__logo, className)} | ||
width={widthMd} | ||
style={ | ||
{ | ||
'--width-sm': `${widthSm}px`, | ||
'--width-md': `${widthMd}px`, | ||
'--width-lg': `${widthLg}px` | ||
} as React.CSSProperties | ||
} | ||
/> | ||
) | ||
|
||
interface ITerminalSlideData { | ||
allTerminalSlide: { | ||
nodes: [{ lines: [{ text: string; promptString: string }] }] | ||
|
@@ -369,24 +407,24 @@ const Header: React.FC = () => { | |
</div> | ||
</div> | ||
<ul className={styles.header__logos}> | ||
{logosData.map(({ widthSm, widthMd, widthLg, src, alt }, i) => ( | ||
<li key={i}> | ||
<img | ||
alt={alt} | ||
src={src} | ||
className={styles.header__logo} | ||
width={widthMd} | ||
height={35} | ||
style={ | ||
{ | ||
'--width-sm': `${widthSm}px`, | ||
'--width-md': `${widthMd}px`, | ||
'--width-lg': `${widthLg}px` | ||
} as React.CSSProperties | ||
} | ||
/> | ||
</li> | ||
))} | ||
{logosData.map((logoDetails, i) => | ||
logoDetails?.link ? ( | ||
<Link | ||
href={logoDetails.link} | ||
key={i} | ||
className={cn( | ||
styles.header__list, | ||
'hover:border-purple-800 active:bg-gray-200 transition-colors' | ||
)} | ||
> | ||
<LogoImage {...logoDetails} /> | ||
</Link> | ||
) : ( | ||
<li key={i} className={cn(styles.header__list)}> | ||
<LogoImage {...logoDetails} /> | ||
</li> | ||
) | ||
)} | ||
Comment on lines
+410
to
+427
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Theoretically if any |
||
</ul> | ||
</header> | ||
) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @yathomasi! I see the border is around logos, can we make them around boxes for logos maybe? Otherwise it looks inconsistent somehow
and
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, great suggestion. I have updated it a bit. Let me how you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks much better! Could we also make them always the same height? Now this is how it looks for me:
and
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a ton! Works as expected now! Now I need to get feedback from @iterative/mlem and update "Working with models" page.