Other Integrations
Other integrations that help improve your site
medium-zoom
Checkout medium-zoom ↗ for more.
export const integ: IntegrationUserConfig = {
// ...
// A lightbox library that can add zoom effect
mediumZoom: {
enable: true, // disable it will not load the whole library
selector: '.prose .zoomable',
options: {
className: 'zoomable'
}
}
}
This theme has integrated it in BlogPost.astro
by default, which means any content in src/content/blog
doesn’t need to import. If you want to use it in any other layout or page, you can use the following code:
---
import { MediumZoom } from '../../../theme/components/advanced'
---
<div class="prose">
<img src="/path/to/image.jpg" class="zoomable" />
</div>
<MediumZoom />
{/* Or with configs */}
<MediumZoom
selector=".prose .zoomable"
background="rgba(0, 0, 0, 0.7)"
/>
import { MediumZoom } from '../../../theme/components/advanced'
// .zoomable class will automatically added using remark plugin

<MediumZoom />
// Or with configs
<MediumZoom
selector=".prose .zoomable"
background="rgba(0, 0, 0, 0.7)"
/>
@playform/compress
Checkout playform/compress ↗ for more.
@unocss/preset-typography
Configure typography; configs are in uno.config.ts
.
const typographyConfig = {
cssExtend: { // [!code highlight:3]
// ...
}
}
And it will be applied to class list configuration:
export const integ: IntegrationUserConfig = {
// ...
typography: {
class: 'prose text-base text-muted-foreground' // [!code highlight]
}
}
Checkout Typography preset ↗ for more.
Friend-Circle-Lite
See Friend Links #Integrated with Friend-Circle-Lite
.
LateX support
In case any time in the future this theme removes default support for LateX, there’s a tutorial to help you add support for it.
Rendering LaTeX in Astro.js enriches your markdown files with mathematical expressions, making your content both engaging and informative. The following steps outline the necessary steps to integrate LaTeX into Astro.js and addresses potential pitfalls along with their solutions.
-
Install Necessary Packages
Begin by installing
remark-math
andrehype-katex
. These packages parse and render LaTeX respectively. Use the install commands:bun install remark-math rehype-katex
-
Configure Astro
Modify your Astro configuration to use these plugins. Add the plugins to the markdown configuration section in your astro.config.mjs:
import { defineConfig } from 'astro/config'; import remarkMath from 'remark-math'; import rehypeKatex from 'rehype-katex'; export default defineConfig({ // ... markdown: { remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex], }, });
-
Include KaTeX CSS
To ensure that LaTeX formulas are styled correctly, include the KaTeX CSS in your HTML layout (in this theme it would be in the
BlogPost.astro
file). Add the following css resources:--- import 'katex/dist/katex.min.css' ---
Or use CDN to fasten speed:
--- import config from '@/site-config' --- <link rel="stylesheet" href={`${config.npmCDN}/[email protected]/dist/katex.min.css`}>
Common Pitfalls and Solutions:
-
CSS Styling Issues
Problem: LaTeX formulas might not render with the correct styles if the KaTeX CSS isn’t loaded.
Solution: Confirm the KaTeX stylesheet link is correctly placed in the HTML head and is loading without issues. Check for network errors or restrictions that might prevent the CSS from loading.
-
Build Errors
Problem: Errors during build time when processing LaTeX syntax.
Solution: Ensure that your LaTeX is correctly formatted and that there are no syntax errors in your markdown files. LaTeX syntax errors can break the parser and cause build failures.