forked from mirrored/github-readme-stats
make image_preview optional
This commit is contained in:
@@ -74,6 +74,7 @@ const renderRepoCard = (repo, options = {}) => {
|
||||
border_radius,
|
||||
border_color,
|
||||
locale,
|
||||
show_image = false,
|
||||
} = options;
|
||||
|
||||
const lineHeight = 10;
|
||||
@@ -142,7 +143,7 @@ const renderRepoCard = (repo, options = {}) => {
|
||||
height,
|
||||
border_radius,
|
||||
colors,
|
||||
imageUrl: openGraphImageUrl,
|
||||
imageUrl: show_image ? openGraphImageUrl : "",
|
||||
});
|
||||
|
||||
card.disableAnimations();
|
||||
|
||||
Vendored
+1
@@ -32,6 +32,7 @@ export type StatCardOptions = CommonOptions & {
|
||||
|
||||
export type RepoCardOptions = CommonOptions & {
|
||||
show_owner: boolean;
|
||||
show_image: boolean;
|
||||
};
|
||||
|
||||
export type TopLangOptions = CommonOptions & {
|
||||
|
||||
@@ -209,6 +209,9 @@ class Card {
|
||||
`;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {string} Renders social preview image
|
||||
*/
|
||||
renderImage = () => {
|
||||
if (!this.imageUrl) {
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user