Porting my LaTeX diagrams site from Saber to Nextra

My LaTeX diagrams site was built with Saber, a static site generator that renders Markdown pages with Vue. Saber is an older framework, and I had to rely on hacks to get search, analytics and Google AdSense working. I moved the site to Nextra, a Next.js-based framework for documentation sites written in MDX, to get those features with less glue code and improve the site overall.
Next.js config
Section titled “Next.js config”Nextra plugs into Next.js as a config wrapper. This is my next.config.js:
const withNextra = require('nextra')({ theme: 'nextra-theme-docs', themeConfig: './theme.config.tsx',})
module.exports = withNextra({ images: { unoptimized: true, },})require('nextra')(...)takes Nextra’s own options and returns a function that wraps your Next.js config.theme: 'nextra-theme-docs'selects the docs theme (sidebar, search, dark mode toggle).themeConfigpoints at the file that customises that theme.images.unoptimizedis a Next.js option, so it goes in the object passed towithNextra(), not in the Nextra options. It turns off Next.js image optimization and serves images as-is. It’s also required if you later switch to a fully staticoutput: 'export'build.
Theme config
Section titled “Theme config”theme.config.tsx sets the logo, repository links and footer:
import React from 'react'import { DocsThemeConfig } from 'nextra-theme-docs'
const config: DocsThemeConfig = { logo: <span>Latex Diagrams</span>, project: { link: 'https://github.com/FriendlyUser/LatexDiagrams', }, chat: { link: 'https://discord.com', }, docsRepositoryBase: 'https://github.com/FriendlyUser/LatexDiagrams', footer: { text: 'Nextra Docs Template', },}
export default configlogois any React element and shows in the top-left of the navbar.project.linkandchat.linkadd GitHub and chat icons to the navbar. The chat link here is still the template’s placeholder.docsRepositoryBaseis used to build the “Edit this page” links.footer.textis the footer content. In Nextra 3 this becamefooter.content, and in Nextra 4 the footer is a<Footer>component.
Migration steps
Section titled “Migration steps”To move the site from Saber to Nextra I had to:
- Convert all the Markdown files to MDX. Nextra renders pages from
.mdx(and.md) files, and MDX lets you drop React components into the content. - Change the generation script to use relative paths for images.
- Deploy the Nextra site to Vercel.
Vercel builds Next.js projects without extra configuration, so deployment was mostly connecting the GitHub repository.
References
Section titled “References”© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)