Skip to content

Commit

Permalink
feat: add open source footer info and fix code block
Browse files Browse the repository at this point in the history
  • Loading branch information
CaliCastle committed Jun 10, 2023
1 parent 574e6c2 commit 476ba26
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/(main)/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Link from 'next/link'
import React from 'react'

import { CursorClickIcon, UsersIcon } from '~/assets'
import { PeekabooLink } from '~/components/links/PeekabooLink'
import { Container } from '~/components/ui/Container'
import { kvKeys } from '~/config/kv'
import { navigationItems } from '~/config/nav'
Expand Down Expand Up @@ -100,7 +101,10 @@ export function Footer() {
<Container.Inner>
<div className="flex flex-col items-center justify-between gap-6 sm:flex-row">
<p className="text-sm text-zinc-500/80 dark:text-zinc-400/80">
&copy; 1995 - {new Date().getFullYear()} Cali Castle.
&copy; {new Date().getFullYear()} Cali Castle. 网站已开源:
<PeekabooLink href="https://github.com/CaliCastle/cali.so">
GitHub
</PeekabooLink>
</p>
<Links />
</div>
Expand Down
14 changes: 14 additions & 0 deletions app/prism.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
--tw-prose-pre-bg: rgba(245, 245, 245, .05);
--tw-prose-pre-code: theme('colors.zinc.600');
background: linear-gradient(to top, rgba(235, 235, 235, .3) 0%, rgba(255, 255, 255, 0.1) 100%);
font-size: 12px;
padding: 1rem;
@apply antialiased;
}

[data-blockid]:not([data-filename]) > .prismjs {
@apply rounded-t-3xl;
}

@screen md {
.prismjs {
font-size: 0.875rem;
padding: 1.5rem;
}
}

.dark {
Expand Down
5 changes: 3 additions & 2 deletions components/portable-text/PortableTextCodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ export function PortableTextCodeBlock({
return (
<div
data-blockid={value._key}
className="group relative overflow-hidden rounded-3xl border border-[--tw-prose-pre-border] dark:bg-zinc-800/80"
data-filename={value.filename}
className="group relative rounded-3xl border border-[--tw-prose-pre-border] dark:bg-zinc-800/80"
>
<ClientOnly>
<Commentable blockId={value._key} />
</ClientOnly>
<ClientOnly>
<>
<div className="relative flex text-xs leading-6 text-slate-400">
{value.filename && (
{Boolean(value.filename) && (
<>
<div className="mt-2 flex flex-none items-center border-b border-t border-b-emerald-700 border-t-transparent px-4 py-1 font-medium text-emerald-700 dark:border-b-emerald-200 dark:text-emerald-200">
{value.filename}
Expand Down

0 comments on commit 476ba26

Please sign in to comment.