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'
}
}
}
tsThis 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 'astro-pure/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)"
/>
astroimport { MediumZoom } from 'astro-pure/advanced'
// .zoomable class will automatically added using remark plugin
![](path/to/image.jpg)
<MediumZoom />
// Or with configs
<MediumZoom
selector=".prose .zoomable"
background="rgba(0, 0, 0, 0.7)"
/>
tsx@playform/compress
#
Checkout playform/compress ↗ for more.
@tailwindcss/typography
#
Configure typography; configs are in tailwind.config.mjs
.
const typographyConfig = ({ theme }) => ({
pure: {
css: {
// ...
}
}
})
jsAnd it will be applied to class list configuration:
export const integ: IntegrationUserConfig = {
// ...
typography: {
class: 'prose prose-pure dark:prose-invert dark:prose-pure prose-headings:font-medium'
}
}
tsCheckout tailwindcss-typography ↗ 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:
shellbun 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:
astro.config.mjs
jsimport { 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:src/layouts/BlogPost.astro
astro--- import 'katex/dist/katex.min.css' ---
Or use CDN to fasten speed:
src/layouts/BlogPost.astro
astro--- import config from '@/site-config' --- <link rel="stylesheet" href={`${config.npmCDN}/katex@0.16.15/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.
See more docs