mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-23 15:09:41 +00:00
Replaces PostCSS-based styling with Tailwind CSS v4 via Vite plugin Converts all .js files to .ts with proper type annotations Adds comprehensive type definitions for Telegram data structures Extracts reusable UI components and standardizes class utilities Improves maintainability by eliminating custom CSS in favor of Tailwind utilities and design tokens Enhances type safety across Telegram parsing, env access, and API routes Centralizes agent guidelines in AGENTS.md following repository standards Upgrades iconography to astro-icon with Remix Icon integration Expands accessible HTML patterns including ARIA labels, semantic navigation, and keyboard interaction support Refactors static proxy logic into shared utility functions Consolidates modal and image preview markup for consistency
42 lines
835 B
Plaintext
42 lines
835 B
Plaintext
---
|
|
import Layout from '../layouts/base.astro'
|
|
import Header from '../components/header.astro'
|
|
import TagCloudSection from '../components/TagCloudSection.astro'
|
|
import { getChannelInfo } from '../lib/telegram'
|
|
import { getEnv } from '../lib/env'
|
|
|
|
const channel = await getChannelInfo(Astro)
|
|
|
|
channel.seo = {
|
|
title: 'Links',
|
|
}
|
|
|
|
const links = (getEnv(import.meta.env, Astro, 'LINKS') || '')
|
|
.split(';')
|
|
.filter(Boolean)
|
|
.map((link) => {
|
|
link = link.split(',')
|
|
return {
|
|
title: link[0],
|
|
href: link[1],
|
|
}
|
|
})
|
|
|
|
if (!links.length) {
|
|
return Astro.redirect('/')
|
|
}
|
|
|
|
const items = links.map((link) => ({
|
|
href: link.href,
|
|
label: link.title,
|
|
title: link.title,
|
|
external: true,
|
|
}))
|
|
---
|
|
|
|
<Layout channel={channel}>
|
|
<Header channel={channel} />
|
|
|
|
<TagCloudSection title="Links" items={items} />
|
|
</Layout>
|