Skip to content

Instantly share code, notes, and snippets.

@Davis-3450
Last active June 19, 2026 07:43
Show Gist options
  • Select an option

  • Save Davis-3450/694d453458e2b78ce54d4d548fce5de6 to your computer and use it in GitHub Desktop.

Select an option

Save Davis-3450/694d453458e2b78ce54d4d548fce5de6 to your computer and use it in GitHub Desktop.
astro content generators examples
import { defineAstroPaperConfig } from "./src/types/config";
export default defineAstroPaperConfig({
site: {
url: "https://astro-paper.pages.dev/",
title: "AstroPaper",
description: "A minimal, responsive and SEO-friendly Astro blog theme.",
author: "Sat Naing",
profile: "https://satna.ing",
ogImage: "default-og.jpg",
lang: "en",
timezone: "Asia/Bangkok",
dir: "ltr",
},
posts: {
perPage: 4,
perIndex: 4,
scheduledPostMargin: 15 * 60 * 1000,
},
features: {
lightAndDarkMode: true,
dynamicOgImage: true,
showArchives: true,
showBackButton: true,
editPost: {
enabled: true,
url: "https://github.com/satnaing/astro-paper/edit/main/",
},
search: "pagefind",
},
socials: [
{ name: "github", url: "https://github.com/satnaing/astro-paper" },
{ name: "x", url: "https://x.com/username" },
{ name: "linkedin", url: "https://www.linkedin.com/in/username/" },
{ name: "mail", url: "mailto:yourmail@gmail.com" },
],
shareLinks: [
{ name: "whatsapp", url: "https://wa.me/?text=" },
{ name: "facebook", url: "https://www.facebook.com/sharer.php?u=" },
{ name: "x", url: "https://x.com/intent/post?url=" },
{ name: "telegram", url: "https://t.me/share/url?url=" },
{ name: "pinterest", url: "https://pinterest.com/pin/create/button/?url=" },
{ name: "mail", url: "mailto:?subject=See%20this%20post&body=" },
],
});
// astro paper
/**
* Internal resolved configuration used throughout the codebase.
*
* Prefer editing `astro-paper.config.ts` instead of this file. This module exists to
* apply defaults and expose a fully-resolved config shape (`ResolvedAstroPaperConfig`).
*/
import userConfig from "@/astro-paper.config";
import type { ResolvedAstroPaperConfig } from "./types/config";
import { PUBLIC_GOOGLE_SITE_VERIFICATION } from "astro:env/client";
const DEFAULT_OG_IMAGE = "default-og.jpg";
const config: ResolvedAstroPaperConfig = {
site: {
...userConfig.site,
ogImage: userConfig.site.ogImage ?? DEFAULT_OG_IMAGE,
lang: userConfig.site.lang ?? "en",
timezone: userConfig.site.timezone ?? "UTC",
dir: userConfig.site.dir ?? "ltr",
googleVerification:
userConfig.site.googleVerification || PUBLIC_GOOGLE_SITE_VERIFICATION,
},
posts: {
perPage: userConfig.posts?.perPage ?? 4,
perIndex: userConfig.posts?.perIndex ?? 4,
scheduledPostMargin:
userConfig.posts?.scheduledPostMargin ?? 15 * 60 * 1000,
},
features: {
lightAndDarkMode: userConfig.features?.lightAndDarkMode ?? true,
dynamicOgImage: userConfig.features?.dynamicOgImage ?? true,
showArchives: userConfig.features?.showArchives ?? true,
showBackButton: userConfig.features?.showBackButton ?? true,
editPost: userConfig.features?.editPost ?? { enabled: false },
search: userConfig.features?.search ?? "pagefind",
},
socials: userConfig.socials ?? [],
shareLinks: userConfig.shareLinks ?? [],
};
export default config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment