Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd4b16d2

Browse files
make image_preview optional
1 parent5bfccb0 commitd4b16d2

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

‎api/pin.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default async (req, res) => {
2424
locale,
2525
border_radius,
2626
border_color,
27+
show_image,
2728
}=req.query;
2829

2930
res.setHeader("Content-Type","image/svg+xml");
@@ -80,6 +81,7 @@ export default async (req, res) => {
8081
border_color,
8182
show_owner:parseBoolean(show_owner),
8283
locale:locale ?locale.toLowerCase() :null,
84+
show_image:parseBoolean(show_image),
8385
}),
8486
);
8587
}catch(err){

‎src/cards/repo-card.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const renderRepoCard = (repo, options = {}) => {
7474
border_radius,
7575
border_color,
7676
locale,
77+
show_image=false,
7778
}=options;
7879

7980
constlineHeight=10;
@@ -142,7 +143,7 @@ const renderRepoCard = (repo, options = {}) => {
142143
height,
143144
border_radius,
144145
colors,
145-
imageUrl:openGraphImageUrl,
146+
imageUrl:show_image ?openGraphImageUrl :"",
146147
});
147148

148149
card.disableAnimations();

‎src/cards/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export type StatCardOptions = CommonOptions & {
3232

3333
exporttypeRepoCardOptions=CommonOptions&{
3434
show_owner:boolean;
35+
show_image:boolean;
3536
};
3637

3738
exporttypeTopLangOptions=CommonOptions&{

‎src/common/Card.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ class Card {
209209
`;
210210
};
211211

212+
/**
213+
*@returns {string} Renders social preview image
214+
*/
212215
renderImage=()=>{
213216
if(!this.imageUrl){
214217
return"";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp