chore: format code
This commit is contained in:
parent
23af739ee4
commit
92fe3d8c0a
5 changed files with 21 additions and 21 deletions
|
@ -1,4 +1,4 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import { defineConfig } from 'astro/config'
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({});
|
||||
export default defineConfig({})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import GithubStats from '../../../';
|
||||
import GithubStats from '../../../'
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
|
|
6
index.ts
6
index.ts
|
@ -1,3 +1,3 @@
|
|||
import GithubStats from './src/GithubStats.astro';
|
||||
export default GithubStats;
|
||||
export * from './src/GithubStats.astro';
|
||||
import GithubStats from './src/GithubStats.astro'
|
||||
export default GithubStats
|
||||
export * from './src/GithubStats.astro'
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
---
|
||||
export interface Props {
|
||||
username: string;
|
||||
topLanguages?: boolean;
|
||||
repo?: string;
|
||||
showIcons?: boolean;
|
||||
altText?: string;
|
||||
username: string
|
||||
topLanguages?: boolean
|
||||
repo?: string
|
||||
showIcons?: boolean
|
||||
altText?: string
|
||||
}
|
||||
const { username, repo, topLanguages, showIcons, altText } = Astro.props;
|
||||
const baseUrl = 'https://github-readme-stats.vercel.app/api/';
|
||||
let url = `${baseUrl}?username=${username}&show_icons=${!!showIcons}`;
|
||||
const { username, repo, topLanguages, showIcons, altText } = Astro.props
|
||||
const baseUrl = 'https://github-readme-stats.vercel.app/api/'
|
||||
let url = `${baseUrl}?username=${username}&show_icons=${!!showIcons}`
|
||||
|
||||
let alt = `GitHub stats for account: ${username}`;
|
||||
let alt = `GitHub stats for account: ${username}`
|
||||
|
||||
if (repo) {
|
||||
url = `${baseUrl}/pin/?username=${username}&repo=${repo}`;
|
||||
alt = `GitHub stats for repository: ${username}/${repo}`;
|
||||
url = `${baseUrl}/pin/?username=${username}&repo=${repo}`
|
||||
alt = `GitHub stats for repository: ${username}/${repo}`
|
||||
}
|
||||
|
||||
if (topLanguages) {
|
||||
url = `${baseUrl}top-langs?username=${username}`;
|
||||
alt = `GitHub top languages for account: ${username}`;
|
||||
url = `${baseUrl}top-langs?username=${username}`
|
||||
alt = `GitHub top languages for account: ${username}`
|
||||
}
|
||||
|
||||
alt = altText || alt;
|
||||
alt = altText || alt
|
||||
---
|
||||
|
||||
<img src={url} alt={alt} />
|
||||
|
|
Loading…
Reference in a new issue