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
|
// https://astro.build/config
|
||||||
export default defineConfig({});
|
export default defineConfig({})
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
import GithubStats from '../../../';
|
import GithubStats from '../../../'
|
||||||
---
|
---
|
||||||
|
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"extends": "astro/tsconfigs/strictest"
|
"extends": "astro/tsconfigs/strictest"
|
||||||
}
|
}
|
||||||
|
|
6
index.ts
6
index.ts
|
@ -1,3 +1,3 @@
|
||||||
import GithubStats from './src/GithubStats.astro';
|
import GithubStats from './src/GithubStats.astro'
|
||||||
export default GithubStats;
|
export default GithubStats
|
||||||
export * from './src/GithubStats.astro';
|
export * from './src/GithubStats.astro'
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
---
|
---
|
||||||
export interface Props {
|
export interface Props {
|
||||||
username: string;
|
username: string
|
||||||
topLanguages?: boolean;
|
topLanguages?: boolean
|
||||||
repo?: string;
|
repo?: string
|
||||||
showIcons?: boolean;
|
showIcons?: boolean
|
||||||
altText?: string;
|
altText?: string
|
||||||
}
|
}
|
||||||
const { username, repo, topLanguages, showIcons, altText } = Astro.props;
|
const { username, repo, topLanguages, showIcons, altText } = Astro.props
|
||||||
const baseUrl = 'https://github-readme-stats.vercel.app/api/';
|
const baseUrl = 'https://github-readme-stats.vercel.app/api/'
|
||||||
let url = `${baseUrl}?username=${username}&show_icons=${!!showIcons}`;
|
let url = `${baseUrl}?username=${username}&show_icons=${!!showIcons}`
|
||||||
|
|
||||||
let alt = `GitHub stats for account: ${username}`;
|
let alt = `GitHub stats for account: ${username}`
|
||||||
|
|
||||||
if (repo) {
|
if (repo) {
|
||||||
url = `${baseUrl}/pin/?username=${username}&repo=${repo}`;
|
url = `${baseUrl}/pin/?username=${username}&repo=${repo}`
|
||||||
alt = `GitHub stats for repository: ${username}/${repo}`;
|
alt = `GitHub stats for repository: ${username}/${repo}`
|
||||||
}
|
}
|
||||||
|
|
||||||
if (topLanguages) {
|
if (topLanguages) {
|
||||||
url = `${baseUrl}top-langs?username=${username}`;
|
url = `${baseUrl}top-langs?username=${username}`
|
||||||
alt = `GitHub top languages for account: ${username}`;
|
alt = `GitHub top languages for account: ${username}`
|
||||||
}
|
}
|
||||||
|
|
||||||
alt = altText || alt;
|
alt = altText || alt
|
||||||
---
|
---
|
||||||
|
|
||||||
<img src={url} alt={alt} />
|
<img src={url} alt={alt} />
|
||||||
|
|
Loading…
Reference in a new issue