-
Notifications
You must be signed in to change notification settings - Fork 12
Allow adding links to logos #278
Changes from 2 commits
2b4fce2
139c7fa
e9a6bd9
f1e6faf
cca1cf7
ebe9985
e319ed7
96be5c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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, | ||
|
@@ -114,94 +124,130 @@ const logosData: Array<{ | |
widthMd: 88, | ||
widthLg: 124, | ||
src: rabbitmqLogo, | ||
alt: 'RabbitMQ logo' | ||
alt: 'RabbitMQ logo', | ||
link: '/doc/user-guide/serving/rabbitmq' | ||
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. This page is empty. Maybe not add a link at all? https://mlem.ai/doc/user-guide/serving/rabbitmq 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. 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. I would add a link once there is a bit more content (like linking to a working example and some explanations of how it works and how to build an app with it) |
||
}, | ||
{ | ||
widthSm: 66, | ||
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, | ||
widthMd: 88, | ||
widthLg: 124, | ||
src: onnxLogo, | ||
alt: 'ONNX logo' | ||
alt: 'ONNX logo', | ||
link: '/doc/user-guide/models' | ||
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. I think we need to add mentions of all ML frameworks to https://mlem.ai/doc/user-guide/models 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. Agree, the existing model object-references pages e.g. https://mlem.ai/doc/object-reference/model/onnx are pretty useless as far as user docs go and not worth linking to from the front page |
||
}, | ||
{ | ||
widthSm: 66, | ||
widthMd: 88, | ||
widthLg: 124, | ||
src: tensorflowLogo, | ||
alt: 'Tensorflow logo' | ||
alt: 'Tensorflow logo', | ||
link: '/doc/user-guide/models' | ||
}, | ||
{ | ||
widthSm: 60, | ||
widthMd: 79, | ||
widthLg: 112, | ||
src: pytorchLogo, | ||
alt: 'PyTorch logo' | ||
alt: 'PyTorch logo', | ||
link: '/doc/user-guide/models' | ||
}, | ||
{ | ||
widthSm: 48, | ||
widthMd: 64, | ||
widthLg: 90, | ||
src: dmlcXgboostLogo, | ||
alt: 'dmlc xgboost logo' | ||
alt: 'dmlc xgboost logo', | ||
link: '/doc/user-guide/models' | ||
}, | ||
{ | ||
widthSm: 38, | ||
widthMd: 50, | ||
widthLg: 71, | ||
src: scikitLearnLogo, | ||
alt: 'scikit learn logo' | ||
alt: 'scikit learn logo', | ||
link: '/doc/user-guide/models' | ||
}, | ||
{ | ||
widthSm: 66, | ||
widthMd: 78, | ||
widthLg: 110, | ||
src: lightGbmLogo, | ||
alt: 'Light GBM logo' | ||
alt: 'Light GBM logo', | ||
link: '/doc/user-guide/models' | ||
}, | ||
{ | ||
widthSm: 54, | ||
widthMd: 64, | ||
widthLg: 90, | ||
src: kerasLogo, | ||
alt: 'Keras logo' | ||
alt: 'Keras logo', | ||
link: '/doc/user-guide/models' | ||
}, | ||
{ | ||
widthSm: 81, | ||
widthMd: 96, | ||
widthLg: 135, | ||
src: catboostLogo, | ||
alt: 'Catboost logo' | ||
alt: 'Catboost logo', | ||
link: '/doc/user-guide/models' | ||
}, | ||
{ | ||
widthSm: 66, | ||
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,22 +415,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 | ||
} | ||
/> | ||
{logosData.map((logoDetails, i) => ( | ||
<li | ||
key={i} | ||
className={cn( | ||
styles.header__list, | ||
'flex items-center justify-center' | ||
)} | ||
> | ||
{logoDetails?.link ? ( | ||
<Link href={logoDetails.link} className="group"> | ||
<LogoImage | ||
{...logoDetails} | ||
className="p-1 inline-block rounded-4 md:rounded-6 lg:rounded-8 border border-solid border-transparent group-hover:border-purple-800 group-active:bg-gray-200 transition-colors " | ||
/> | ||
</Link> | ||
) : ( | ||
<LogoImage {...logoDetails} /> | ||
)} | ||
</li> | ||
))} | ||
</ul> | ||
|
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.