This is a Next.js (App Router) based website template designed to integrate seamlessly with your Substack publication. It automatically fetches and displays your Substack posts while providing a modern, customizable landing page with built-in responsive design.
- Substack Integration: Automatically syncs and displays posts from your Substack newsletter using the Substack API (
src/lib/substack.ts). - Modern UI: Built with Tailwind CSS and
shadcn/uifor beautiful, accessible components. - Type-Safe: Developed with TypeScript for robust code quality and easy maintainability.
- Performance Optimized: Uses Next.js App Router, optimized Next.js images, and dynamic font loading.
- Configurable: Easily update site information, social links, and theme settings via a centralized
src/data/site.jsonfile. - MDX Support: Create and manage content pages like "About Us" easily using MDX.
- Clone this repository.
- Install dependencies:
bun install
- Open
src/data/site.jsonand set yoursubstackUrl(e.g.,https://yourpublication.substack.com), along with your other site details. - Run the development server:
bun dev
Open http://localhost:3000 with your browser to see the result.
All site-wide settings (Site name, address, contact info, social media links) are managed in src/data/site.json. Just update the values there, and the site will reflect the changes across the header, footer, and contact sections.
Copy env.sample to .env and configure the necessary variables:
SUBSTACK_SID: If your Substack publication requires authentication or if you want to bypass strict rate limits, you can provide your Substack Session ID (SID) cookie value here.
src/app: Contains Next.js App Router pages and layouts, including internationalized routing ([locale]).src/components: UI components organized intocommon(shared pieces),feature(domain-specific pieces), andui(shadcn/ui primitives).src/data: Holds thesite.jsonconfiguration file, which defines site metadata, internationalization, and navigation.src/lib: Core utility functions, configuration resolvers, and Substack API integrations.src/i18n: Internationalization dictionaries (en.json,tr.json, etc.) and configuration logic.src/assets: Source images for automated asset generation.
The template supports multiple languages natively. To add a new language:
- Open
src/data/site.jsonand add the new language configuration underi18n.locales(e.g.,"fr": { "enabled": true, "label": "Français", "direction": "ltr" }). - Provide the localized values in
src/data/site.jsonundercontent(e.g.,siteName.fr,navigation.header.fr). - Create a new dictionary file in
src/i18n/dictionaries/(e.g.,fr.json) with your translated strings. - If you have MDX pages, create the localized versions (e.g.,
src/content/about-fr.mdx). - Map any tags and static pages for this locale under
sources.substack.tags.frandsources.substack.pages.about.frinsite.json.
- MDX: You can create fully localized markdown pages (like "About Us") in the
src/content/directory. Use theMdxSectioncomponent to embed them within feature pages (likehome.tsx). - Contact Form: The template includes a built-in Contact Form powered by Web3Forms. It is currently passive. To activate it, simply provide your access key under
shared.web3formsAccessKeyinsite.jsonand enable the<Web3FormsContact>component incontact-section.tsx.
To dynamically categorize and filter your Substack posts on the website:
- Ensure your posts on Substack are tagged.
- Update
src/data/site.jsonundersources.substack.tags.[locale]with an array of the tag slugs you want to display (e.g.,["news"]). - You can easily add these tags to your header navigation by updating
content.navigation.header.[locale]insite.jsonwith a link format oftag:[your-tag-name]. - Posts displayed on the homepage and
/postspage will automatically filter based on these valid localized tags.
You can easily generate all necessary site icons and Open Graph images:
- Place your base SVG images in the
assets/folder in the project root:favicon.svg,icon.svg(for icon and apple-icon), andog-image.svg. - Run the script:
bun run generate-assets
- The script automatically resizes and processes these images into the
public/directory (favicon.ico,apple-icon.png,icon.png,opengraph-image.png). It ensures your logos fit perfectly without being cropped or distorted.
- Next.js (App Router)
- React
- TypeScript
- Tailwind CSS
- shadcn/ui
- Substack
At uyguLama, we are happy to provide the right services tailored to your needs. For your solution requirements, you can get in touch with us via uygulama.net.