1
Fork 0

chore: remove more slop

This commit is contained in:
enscribe 2024-09-10 11:56:46 -07:00
parent 5d9940eddf
commit b9561ad2d0
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
22 changed files with 237 additions and 587 deletions

View file

@ -1,23 +0,0 @@
---
export interface Props {
institution: string
time: string
job_title: string
location: string
description: string
}
const { institution, time, job_title, location, description } = Astro.props
---
<div class="px-8 py-5">
<div class="flex justify-between text-sm font-bold md:text-lg">
<div>{institution}</div>
<div>{location}</div>
</div>
<div class="flex justify-between text-xs md:text-base">
<div class="italic">{job_title}</div>
<div>{time}</div>
</div>
<p class="mt-2 text-xs">{description}</p>
</div>

View file

@ -2,7 +2,6 @@
import Container from '@components/Container.astro'
import Link from '@components/Link.astro'
import { SITE } from '@consts'
import ProgressBar from './ProgressBar.astro'
---
<header transition:persist>
@ -18,11 +17,7 @@ import ProgressBar from './ProgressBar.astro'
<span>
{`/`}
</span>
<Link href="/publications">research</Link>
<span>
{`/`}
</span>
<Link href="/cv">cv</Link>
<Link href="/authors">authors</Link>
<span>
{`/`}
</span>
@ -34,25 +29,6 @@ import ProgressBar from './ProgressBar.astro'
<span>
{`/`}
</span>
<button
id="magnifying-glass"
aria-label="Search"
class="flex items-center rounded border border-black/15 bg-neutral-100 px-2 py-1 text-xs transition-colors duration-300 ease-in-out hover:bg-black/5 hover:text-black focus-visible:bg-black/5 focus-visible:text-black dark:border-white/20 dark:bg-neutral-900 dark:hover:bg-white/5 dark:hover:text-white dark:focus-visible:bg-white/5 dark:focus-visible:text-white"
>
<svg
height="16"
stroke-linejoin="round"
viewBox="0 0 16 16"
width="16"
style="color: currentcolor;"
><path
fill-rule="evenodd"
clip-rule="evenodd"
d="M3.5 7C3.5 5.067 5.067 3.5 7 3.5C8.933 3.5 10.5 5.067 10.5 7C10.5 7.88461 10.1718 8.69256 9.63058 9.30876L9.30876 9.63058C8.69256 10.1718 7.88461 10.5 7 10.5C5.067 10.5 3.5 8.933 3.5 7ZM9.96544 11.0261C9.13578 11.6382 8.11014 12 7 12C4.23858 12 2 9.76142 2 7C2 4.23858 4.23858 2 7 2C9.76142 2 12 4.23858 12 7C12 8.11014 11.6382 9.13578 11.0261 9.96544L14.0303 12.9697L14.5607 13.5L13.5 14.5607L12.9697 14.0303L9.96544 11.0261Z"
fill="currentColor"></path></svg
>
&nbsp;Search
</button>
</nav>
</div>
</Container>

View file

@ -0,0 +1,29 @@
---
import type { CollectionEntry } from "astro:content";
import { Image } from "astro:assets";
type Props = {
member: CollectionEntry<"authors">;
};
const { member } = Astro.props;
const { name, avatar, bio } = member.data;
---
<div
class="animate not-prose flex flex-col sm:flex-row size-full sm:items-center gap-4 overflow-hidden rounded-xl border border-foreground bg-background p-6 hover:bg-secondary"
>
<Image
src={avatar}
alt={`Avatar of ${name}`}
width={256}
height={256}
class="aspect-square size-32 rounded-md object-cover"
/>
<div class="flex flex-col justify-between">
<a href={`/authors/${member.slug}`}>
<h3 class="mb-2 text-3xl text-foreground">{name}</h3>
<p class="mb-4 text-sm text-foreground">{bio}</p>
</a>
</div>
</div>

View file

@ -1,8 +0,0 @@
<div class="fixed z-50 h-[2px] w-full bg-neutral-300 dark:bg-slate-900">
<div class="h-full bg-cyan-500 dark:bg-orange-500"></div>
</div>
<script>
import { initializeProgressBar } from '../scripts/progress-bar.js'
initializeProgressBar()
</script>

View file

@ -1,106 +0,0 @@
---
import type { CollectionEntry } from 'astro:content'
import { Image } from 'astro:assets'
type Props = {
entry: CollectionEntry<'publications'>
}
const { entry } = Astro.props as {
entry: CollectionEntry<'publications'>
}
const splitStr = (authors: string | undefined, targetAuthor: string) => {
if (!authors) return []
const parts = authors.split(new RegExp(`(${targetAuthor})`, 'g'))
return parts
}
const decomposeURL = (URL: string | undefined) => {
if (!URL) return { text: '', url: '' }
const parts = URL.split(': ')
return { text: parts[0], url: parts[1] }
}
const dataLink = decomposeURL(entry.data.dataURL)
const paperLink = decomposeURL(entry.data.paperURL)
const codeLink = decomposeURL(entry.data.codeURL)
const webLink = decomposeURL(entry.data.webURL)
---
<div
class="not-prose grid-cols-auto group relative grid w-full items-center gap-4 rounded-lg border border-black/15 px-4 py-3 transition-colors duration-300 ease-in-out hover:bg-black/5 hover:text-black focus-visible:bg-black/5 focus-visible:text-black dark:border-white/20 dark:hover:bg-white/5 dark:hover:text-white dark:focus-visible:bg-white/5 dark:focus-visible:text-white md:grid-cols-[204px_auto]"
>
<Image
src={entry.data.img ?? ''}
alt={entry.data.imgAlt ?? ''}
width={640}
height={480}
class="hidden rounded-md shadow-sm transition hover:opacity-80 sm:mr-6 sm:h-[135px] sm:w-[240px] md:flex"
loading="eager"
/>
<div class="flex h-full items-center">
<div class="flex flex-col">
<div class="w-full">
<div class="text-md w-full font-semibold">
{entry.data.title}
</div>
<div class="w-full text-sm">
{entry.data.authors}
</div>
<div class="w-full text-sm">
{
paperLink.url != '' && (
<a
class="text-orange-500 underline transition-colors duration-300 ease-in-out visited:text-indigo-400 hover:text-cyan-500 dark:hover:text-cyan-500"
target="_blank"
href={paperLink.url}
>
{paperLink.text}
</a>
)
}
{
codeLink.url != '' && (
<a
class="text-orange-500 underline transition-colors duration-300 ease-in-out visited:text-indigo-400 hover:text-cyan-500 dark:hover:text-cyan-500"
target="_blank"
href={codeLink.url}
>
{codeLink.text}
</a>
)
}
{
webLink.url != '' && (
<a
class="text-orange-500 underline transition-colors duration-300 ease-in-out visited:text-indigo-400 hover:text-cyan-500 dark:hover:text-cyan-500"
target="_blank"
href={webLink.url}
>
{webLink.text}
</a>
)
}
{
dataLink.url != '' && (
<a
class="text-orange-500 underline transition-colors duration-300 ease-in-out visited:text-indigo-400 hover:text-cyan-500 dark:hover:text-cyan-500"
target="_blank"
href={dataLink.url}
>
{dataLink.text}
</a>
)
}
</div>
<div class="text-sm">
In <div class="inline italic">{entry.data.pub}</div>
</div>
</div>
<p class="mt-2 break-words text-sm">
{entry.data.description}
</p>
</div>
</div>
</div>