Cleaned up link code for projects and added git vs web links
All checks were successful
Docker Deploy / build-and-push (push) Successful in 5m7s
All checks were successful
Docker Deploy / build-and-push (push) Successful in 5m7s
This commit is contained in:
@@ -95,15 +95,29 @@ const { project } = Astro.props;
|
||||
|
||||
<div class="card-actions justify-center gap-2 mt-4">
|
||||
{
|
||||
project.link && (
|
||||
project.webLink && (
|
||||
<a
|
||||
href={project.link}
|
||||
href={project.webLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="btn btn-sm gap-2 bg-accent-content text-accent hover:bg-accent-content/90"
|
||||
aria-label={`Visit ${project.name}`}
|
||||
aria-label={`Visit ${project.name} website`}
|
||||
>
|
||||
<Icon name="mdi:link" class="w-4 h-4" />
|
||||
<Icon name="mdi:web" class="w-4 h-4" />
|
||||
Website
|
||||
</a>
|
||||
)
|
||||
}
|
||||
{
|
||||
project.gitLink && (
|
||||
<a
|
||||
href={project.gitLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="btn btn-sm gap-2 bg-accent-content text-accent hover:bg-accent-content/90"
|
||||
aria-label={`View ${project.name} source code`}
|
||||
>
|
||||
<Icon name="simple-icons:gitea" class="w-4 h-4" />
|
||||
Source
|
||||
</a>
|
||||
)
|
||||
|
||||
@@ -23,8 +23,12 @@ function isGiteaDomain(url: string): boolean {
|
||||
|
||||
const projectsWithGiteaInfo = await Promise.all(
|
||||
config.projects.map(async (project) => {
|
||||
if (project.link && !project.giteaInfo && isGiteaDomain(project.link)) {
|
||||
const giteaInfo = await fetchGiteaInfoFromUrl(project.link);
|
||||
if (
|
||||
project.gitLink &&
|
||||
!project.giteaInfo &&
|
||||
isGiteaDomain(project.gitLink)
|
||||
) {
|
||||
const giteaInfo = await fetchGiteaInfoFromUrl(project.gitLink);
|
||||
if (giteaInfo) {
|
||||
return { ...project, giteaInfo } as Project;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user