chore: remove junk

This commit is contained in:
enscribe 2024-09-10 11:10:15 -07:00
parent 8f6872f739
commit 5d9940eddf
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
16 changed files with 15 additions and 118 deletions

View file

@ -11,8 +11,6 @@ Micro Academics adds features like tags, and blog math support and also inherits
Micro Academics still comes with everything great about Micro and Nano — full type safety, a sitemap, an RSS feed, and Markdown + MDX support. Styled with TailwindCSS and preconfigured with system, light, and dark themes. Micro Academics still comes with everything great about Micro and Nano — full type safety, a sitemap, an RSS feed, and Markdown + MDX support. Styled with TailwindCSS and preconfigured with system, light, and dark themes.
![teaser](./assets/teaser-1.png)
## News ## News
✨ I've got a detailed blog about building and deploying your website using this template! Check it out [here](https://jingwu2121.github.io/blog/01-build-deploy-website/) ✨ I've got a detailed blog about building and deploying your website using this template! Check it out [here](https://jingwu2121.github.io/blog/01-build-deploy-website/)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 KiB

View file

@ -1,20 +0,0 @@
<div class="giscus"></div>
<script
is:inline
data-astro-rerun
src="https://giscus.app/client.js"
data-repo="trevortylerlee/astro-micro"
data-repo-id="R_kgDOL_6l9Q"
data-category="Announcements"
data-category-id="DIC_kwDOL_6l9c4Cfk55"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="preferred_color_scheme"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async></script>

View file

@ -57,7 +57,6 @@ const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props
animate() animate()
updateThemeButtons() updateThemeButtons()
addCopyCodeButtons() addCopyCodeButtons()
setGiscusTheme()
const backToTop = document.getElementById('back-to-top') const backToTop = document.getElementById('back-to-top')
backToTop?.addEventListener('click', (event) => scrollToTop(event)) backToTop?.addEventListener('click', (event) => scrollToTop(event))
@ -178,8 +177,6 @@ const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props
window.getComputedStyle(css).opacity window.getComputedStyle(css).opacity
document.head.removeChild(css) document.head.removeChild(css)
setGiscusTheme()
} }
function preloadTheme() { function preloadTheme() {
@ -229,18 +226,6 @@ const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props
} }
} }
const setGiscusTheme = () => {
const giscus = document.querySelector('.giscus-frame')
const isDark = document.documentElement.classList.contains('dark')
if (giscus) {
const url = new URL(giscus.src)
url.searchParams.set('theme', isDark ? 'dark' : 'light')
giscus.src = url.toString()
}
}
document.addEventListener('DOMContentLoaded', () => init()) document.addEventListener('DOMContentLoaded', () => init())
document.addEventListener('astro:after-swap', () => init()) document.addEventListener('astro:after-swap', () => init())
preloadTheme() preloadTheme()

View file

@ -1,7 +1,6 @@
--- ---
import type { CollectionEntry } from 'astro:content' import type { CollectionEntry } from 'astro:content'
import { Image } from 'astro:assets' import { Image } from 'astro:assets'
import { HIGHLIGHTAUTHOR } from '@consts'
type Props = { type Props = {
entry: CollectionEntry<'publications'> entry: CollectionEntry<'publications'>
@ -26,7 +25,6 @@ const dataLink = decomposeURL(entry.data.dataURL)
const paperLink = decomposeURL(entry.data.paperURL) const paperLink = decomposeURL(entry.data.paperURL)
const codeLink = decomposeURL(entry.data.codeURL) const codeLink = decomposeURL(entry.data.codeURL)
const webLink = decomposeURL(entry.data.webURL) const webLink = decomposeURL(entry.data.webURL)
const authorsParts = splitStr(entry.data.authors, HIGHLIGHTAUTHOR)
--- ---
<div <div
@ -48,17 +46,7 @@ const authorsParts = splitStr(entry.data.authors, HIGHLIGHTAUTHOR)
{entry.data.title} {entry.data.title}
</div> </div>
<div class="w-full text-sm"> <div class="w-full text-sm">
{ {entry.data.authors}
authorsParts.map((part: any) =>
part === HIGHLIGHTAUTHOR ? (
<u>
<strong>{part}</strong>
</u>
) : (
part
),
)
}
</div> </div>
<div class="w-full text-sm"> <div class="w-full text-sm">
{ {

View file

@ -1,4 +1,4 @@
import type { Metadata, Site } from '@types' import type { Site } from '@types'
export const SITE: Site = { export const SITE: Site = {
TITLE: 'Astro Micro Academics', TITLE: 'Astro Micro Academics',
@ -8,36 +8,3 @@ export const SITE: Site = {
NUM_PUBLICATIONS_ON_HOMEPAGE: 3, NUM_PUBLICATIONS_ON_HOMEPAGE: 3,
SITEURL: 'https://astro-micro-academic.vercel.app', // Update here to link the RSS icon to your website rss SITEURL: 'https://astro-micro-academic.vercel.app', // Update here to link the RSS icon to your website rss
} }
export const HIGHLIGHTAUTHOR = 'John B'
export const HOME: Metadata = {
TITLE: 'Home',
DESCRIPTION: 'Astro Micro is an accessible theme for Astro.',
}
export const BLOG: Metadata = {
TITLE: 'Blog',
DESCRIPTION: 'A collection of articles on topics I am passionate about.',
}
export const RESEARCH: Metadata = {
TITLE: 'Publications',
DESCRIPTION:
'A collection of my publications with links to paper, repositories and live demos.',
}
export const CV: Metadata = {
TITLE: 'CV',
DESCRIPTION: 'your cv',
}
export const TAGS: Metadata = {
TITLE: 'TAGS',
DESCRIPTION: 'blog tag filter',
}
export const ABOUT: Metadata = {
TITLE: 'ABOUT',
DESCRIPTION: 'A self-intro',
}

View file

@ -2,11 +2,10 @@
import { getCollection } from 'astro:content' import { getCollection } from 'astro:content'
import Layout from '@layouts/Layout.astro' import Layout from '@layouts/Layout.astro'
import Container from '@components/Container.astro' import Container from '@components/Container.astro'
import { ABOUT } from '@consts'
import { Image } from 'astro:assets' import { Image } from 'astro:assets'
--- ---
<Layout title={ABOUT.TITLE} description={ABOUT.DESCRIPTION}> <Layout title="About" description="About">
<Container> <Container>
<aside data-pagefind-ignore> <aside data-pagefind-ignore>
<div class="space-y-10"> <div class="space-y-10">

View file

@ -7,7 +7,6 @@ import { readingTime } from '@lib/utils'
import BackToPrevious from '@components/BackToPrevious.astro' import BackToPrevious from '@components/BackToPrevious.astro'
import PostNavigation from '@components/PostNavigation.astro' import PostNavigation from '@components/PostNavigation.astro'
import TableOfContents from '@components/TableOfContents.astro' import TableOfContents from '@components/TableOfContents.astro'
import Giscus from '@components/Giscus.astro'
export async function getStaticPaths() { export async function getStaticPaths() {
const posts = (await getCollection('blog')) const posts = (await getCollection('blog'))
@ -91,9 +90,6 @@ const { Content, headings } = await post.render()
<div class="mt-24"> <div class="mt-24">
<PostNavigation prevPost={prevPost} nextPost={nextPost} /> <PostNavigation prevPost={prevPost} nextPost={nextPost} />
</div> </div>
<div class="mt-24">
<Giscus />
</div>
</article> </article>
</Container> </Container>
</Layout> </Layout>

View file

@ -3,7 +3,6 @@ import { type CollectionEntry, getCollection } from 'astro:content'
import Layout from '@layouts/Layout.astro' import Layout from '@layouts/Layout.astro'
import Container from '@components/Container.astro' import Container from '@components/Container.astro'
import ArrowCard from '@components/ArrowCard.astro' import ArrowCard from '@components/ArrowCard.astro'
import { BLOG } from '@consts'
const data = (await getCollection('blog')) const data = (await getCollection('blog'))
.filter((post) => !post.data.draft) .filter((post) => !post.data.draft)
@ -25,7 +24,7 @@ const posts = data.reduce((acc: Acc, post) => {
const years = Object.keys(posts).sort((a, b) => parseInt(b) - parseInt(a)) const years = Object.keys(posts).sort((a, b) => parseInt(b) - parseInt(a))
--- ---
<Layout title={BLOG.TITLE} description={BLOG.DESCRIPTION}> <Layout title="Blog" description="Blog">
<Container> <Container>
<aside data-pagefind-ignore> <aside data-pagefind-ignore>
<div class="space-y-10"> <div class="space-y-10">

View file

@ -2,7 +2,6 @@
import { getCollection } from 'astro:content' import { getCollection } from 'astro:content'
import Layout from '@layouts/Layout.astro' import Layout from '@layouts/Layout.astro'
import Container from '@components/Container.astro' import Container from '@components/Container.astro'
import { CV } from '@consts'
import CVCard from '@components/CVCard.astro' import CVCard from '@components/CVCard.astro'
// TO Modify // TO Modify
@ -33,7 +32,7 @@ const educations = [
] ]
--- ---
<Layout title={CV.TITLE} description={CV.DESCRIPTION}> <Layout title="CV" description="CV">
<Container> <Container>
<aside data-pagefind-ignore> <aside data-pagefind-ignore>
<div class="space-y-2 md:space-y-10"> <div class="space-y-2 md:space-y-10">

View file

@ -1,7 +1,7 @@
--- ---
import Layout from '@layouts/Layout.astro' import Layout from '@layouts/Layout.astro'
import Container from '@components/Container.astro' import Container from '@components/Container.astro'
import { SITE, HOME } from '@consts' import { SITE } from '@consts'
import ArrowCard from '@components/ArrowCard.astro' import ArrowCard from '@components/ArrowCard.astro'
import Link from '@components/Link.astro' import Link from '@components/Link.astro'
import { getCollection } from 'astro:content' import { getCollection } from 'astro:content'
@ -21,7 +21,7 @@ const publications: CollectionEntry<'publications'>[] = (
.slice(0, SITE.NUM_PUBLICATIONS_ON_HOMEPAGE) .slice(0, SITE.NUM_PUBLICATIONS_ON_HOMEPAGE)
--- ---
<Layout title={HOME.TITLE} description={HOME.DESCRIPTION}> <Layout title="Home" description="Home">
<Container> <Container>
<aside data-pagefind-ignore> <aside data-pagefind-ignore>
<h1 class="animate font-semibold text-black dark:text-white"> <h1 class="animate font-semibold text-black dark:text-white">

View file

@ -2,7 +2,6 @@
import { getCollection } from 'astro:content' import { getCollection } from 'astro:content'
import Layout from '@layouts/Layout.astro' import Layout from '@layouts/Layout.astro'
import Container from '@components/Container.astro' import Container from '@components/Container.astro'
import { RESEARCH } from '@consts'
import PublicationCard from '@components/PublicationCard.astro' import PublicationCard from '@components/PublicationCard.astro'
// import PublicationCard from "@components/PublicationCard"; // import PublicationCard from "@components/PublicationCard";
@ -11,7 +10,7 @@ const publications = (await getCollection('publications')).sort(
) )
--- ---
<Layout title={RESEARCH.TITLE} description={RESEARCH.DESCRIPTION}> <Layout title="Research" description="Research">
<Container> <Container>
<aside data-pagefind-ignore> <aside data-pagefind-ignore>
<div class="space-y-10"> <div class="space-y-10">

View file

@ -1,36 +1,30 @@
import rss from '@astrojs/rss' import rss from '@astrojs/rss'
import { SITE } from '@consts' import { SITE } from '@consts'
import { getCollection } from 'astro:content' import { getCollection } from 'astro:content'
import type { APIContext } from 'astro'
export async function GET(context) { export async function GET(context: APIContext) {
// const publications = (await getCollection("publications")).filter(
// (publication) => !publication.data.draft,
// );
// const items = [...blog, ...publications].sort(
// (a, b) => new Date(b.data.date).valueOf() - new Date(a.data.date).valueOf(),
// );
try { try {
const blog = (await getCollection('blog')).filter( const blog = (await getCollection('blog')).filter(
(post) => !post.data.draft, (post) => !post.data.draft
) )
// Filter posts by tag 'rss-feed' // Filter posts by tag 'rss-feed'
const filteredBlogs = blog.filter( const filteredBlogs = blog.filter(
(post) => post.data.tags && post.data.tags.includes('rss-feed'), (post) => post.data.tags && post.data.tags.includes('rss-feed')
) )
// Sort posts by date // Sort posts by date
const items = [...filteredBlogs].sort( const items = [...filteredBlogs].sort(
(a, b) => (a, b) =>
new Date(b.data.date).valueOf() - new Date(a.data.date).valueOf(), new Date(b.data.date).valueOf() - new Date(a.data.date).valueOf()
) )
// Return RSS feed // Return RSS feed
return rss({ return rss({
title: SITE.TITLE, title: SITE.TITLE,
description: SITE.DESCRIPTION, description: SITE.DESCRIPTION,
site: context.site, site: context.site ?? SITE.SITEURL,
items: items.map((item) => ({ items: items.map((item) => ({
title: item.data.title, title: item.data.title,
description: item.data.description, description: item.data.description,

View file

@ -3,7 +3,6 @@ import { type CollectionEntry, getCollection } from 'astro:content'
import Layout from '@layouts/Layout.astro' import Layout from '@layouts/Layout.astro'
import Container from '@components/Container.astro' import Container from '@components/Container.astro'
import ArrowCard from '@components/ArrowCard.astro' import ArrowCard from '@components/ArrowCard.astro'
import { TAGS } from '@consts'
type BlogPost = CollectionEntry<'blog'> type BlogPost = CollectionEntry<'blog'>

View file

@ -2,7 +2,6 @@
import { getCollection } from 'astro:content' import { getCollection } from 'astro:content'
import Layout from '@layouts/Layout.astro' import Layout from '@layouts/Layout.astro'
import Container from '@components/Container.astro' import Container from '@components/Container.astro'
import { TAGS } from '@consts'
import Image from 'astro/components/Image.astro' import Image from 'astro/components/Image.astro'
const blog = (await getCollection('blog')).filter((post) => !post.data.draft) const blog = (await getCollection('blog')).filter((post) => !post.data.draft)
@ -12,7 +11,7 @@ const tags = blog
.filter((tag, index, self) => self.indexOf(tag) === index) .filter((tag, index, self) => self.indexOf(tag) === index)
--- ---
<Layout title={TAGS.TITLE} description={TAGS.DESCRIPTION}> <Layout title="Tags" description="Tags">
<Container> <Container>
<aside data-pagefind-ignore> <aside data-pagefind-ignore>
<div class="space-y-10"> <div class="space-y-10">

View file

@ -6,8 +6,3 @@ export type Site = {
NUM_PUBLICATIONS_ON_HOMEPAGE: number NUM_PUBLICATIONS_ON_HOMEPAGE: number
SITEURL: string SITEURL: string
} }
export type Metadata = {
TITLE: string
DESCRIPTION: string
}