Skip to content

Commit

Permalink
fix: external links
Browse files Browse the repository at this point in the history
  • Loading branch information
jktrn committed Oct 7, 2024
1 parent e3e29ae commit dc05cb2
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
8 changes: 8 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@shikijs/transformers'
import { defineConfig } from 'astro/config'
import rehypeKatex from 'rehype-katex'
import rehypeExternalLinks from 'rehype-external-links'
import rehypePrettyCode from 'rehype-pretty-code'
import remarkEmoji from 'remark-emoji'
import remarkMath from 'remark-math'
Expand All @@ -33,6 +34,13 @@ export default defineConfig({
markdown: {
syntaxHighlight: false,
rehypePlugins: [
[
rehypeExternalLinks,
{
target: '_blank',
rel: ['nofollow', 'noreferrer', 'noopener'],
},
],
rehypeHeadingIds,
rehypeKatex,
// @ts-expect-error
Expand Down
33 changes: 31 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "astro-erudite",
"type": "module",
"version": "1.1.6",
"version": "1.1.7",
"private": true,
"scripts": {
"dev": "astro dev",
Expand Down Expand Up @@ -39,6 +39,7 @@
"lucide-react": "^0.441.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rehype-external-links": "^3.0.0",
"rehype-katex": "^7.0.0",
"rehype-pretty-code": "^0.14.0",
"remark-emoji": "^5.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tags/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function getStaticPaths() {
<div class="flex flex-wrap items-center gap-2">
<h1 class="text-3xl font-semibold">Posts tagged with</h1>
<span
class="flex items-center gap-x-1 rounded-full bg-secondary px-4 py-2 text-2xl font-bold"
class="flex items-center gap-x-1 rounded-full bg-secondary px-4 py-2 text-2xl font-semibold"
>
<Icon name="lucide:hash" class="size-6 -translate-x-0.5" />{tag}
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

@layer components {
article {
@apply prose-headings:scroll-mt-20 prose-headings:break-words prose-p:break-words prose-a:!break-words prose-a:!decoration-muted-foreground prose-a:underline-offset-[3px] prose-a:transition-colors hover:prose-a:!decoration-foreground prose-pre:!px-0 prose-img:mx-auto;
@apply prose-headings:scroll-mt-20 prose-headings:break-words first:prose-headings:mt-0 prose-p:break-words prose-a:!break-words prose-a:!decoration-muted-foreground prose-a:underline-offset-[3px] prose-a:transition-colors hover:prose-a:!decoration-foreground prose-pre:!px-0 prose-img:mx-auto;

.katex-display {
@apply overflow-x-auto overflow-y-hidden py-4;
Expand Down

0 comments on commit dc05cb2

Please sign in to comment.