mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 19:41:02 +08:00
refactor!: separate config and constants
This commit is contained in:
+3
-139
@@ -1,6 +1,4 @@
|
|||||||
import type { Site, SocialObjects } from "./types";
|
export const SITE = {
|
||||||
|
|
||||||
export const SITE: Site = {
|
|
||||||
website: "https://astro-paper.pages.dev/", // replace this with your deployed domain
|
website: "https://astro-paper.pages.dev/", // replace this with your deployed domain
|
||||||
author: "Sat Naing",
|
author: "Sat Naing",
|
||||||
profile: "https://satnaing.dev/",
|
profile: "https://satnaing.dev/",
|
||||||
@@ -9,147 +7,13 @@ export const SITE: Site = {
|
|||||||
ogImage: "astropaper-og.jpg",
|
ogImage: "astropaper-og.jpg",
|
||||||
lightAndDarkMode: true,
|
lightAndDarkMode: true,
|
||||||
postPerIndex: 4,
|
postPerIndex: 4,
|
||||||
postPerPage: 3,
|
postPerPage: 4,
|
||||||
scheduledPostMargin: 15 * 60 * 1000, // 15 minutes
|
scheduledPostMargin: 15 * 60 * 1000, // 15 minutes
|
||||||
showArchives: true,
|
showArchives: true,
|
||||||
|
showBackButton: true, // show back button in post detail
|
||||||
editPost: {
|
editPost: {
|
||||||
url: "https://github.com/satnaing/astro-paper/edit/main/src/content/blog",
|
url: "https://github.com/satnaing/astro-paper/edit/main/src/content/blog",
|
||||||
text: "Suggest Changes",
|
text: "Suggest Changes",
|
||||||
appendFilePath: true,
|
appendFilePath: true,
|
||||||
},
|
},
|
||||||
};
|
|
||||||
|
|
||||||
export const LOCALE = {
|
|
||||||
lang: "en", // html lang code. Set this empty and default will be "en"
|
|
||||||
langTag: ["en-EN"], // BCP 47 Language Tags. Set this empty [] to use the environment default
|
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const LOGO_IMAGE = {
|
|
||||||
enable: false,
|
|
||||||
svg: true,
|
|
||||||
width: 216,
|
|
||||||
height: 46,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const SOCIALS: SocialObjects = [
|
|
||||||
{
|
|
||||||
name: "Github",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: ` ${SITE.title} on Github`,
|
|
||||||
active: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Facebook",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Facebook`,
|
|
||||||
active: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Instagram",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Instagram`,
|
|
||||||
active: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "LinkedIn",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on LinkedIn`,
|
|
||||||
active: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Mail",
|
|
||||||
href: "mailto:yourmail@gmail.com",
|
|
||||||
linkTitle: `Send an email to ${SITE.title}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "X",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on X`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Twitch",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Twitch`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "YouTube",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on YouTube`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "WhatsApp",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on WhatsApp`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Snapchat",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Snapchat`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Pinterest",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Pinterest`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "TikTok",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on TikTok`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "CodePen",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on CodePen`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Discord",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Discord`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "GitLab",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on GitLab`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Reddit",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Reddit`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Skype",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Skype`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Steam",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Steam`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Telegram",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Telegram`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Mastodon",
|
|
||||||
href: "https://github.com/satnaing/astro-paper",
|
|
||||||
linkTitle: `${SITE.title} on Mastodon`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
import IconMail from "@/assets/icons/IconMail.svg";
|
||||||
|
import IconGitHub from "@/assets/icons/IconGitHub.svg";
|
||||||
|
import IconBrandX from "@/assets/icons/IconBrandX.svg";
|
||||||
|
import IconLinkedin from "@/assets/icons/IconLinkedin.svg";
|
||||||
|
import IconWhatsapp from "@/assets/icons/IconWhatsapp.svg";
|
||||||
|
import IconFacebook from "@/assets/icons/IconFacebook.svg";
|
||||||
|
import IconTelegram from "@/assets/icons/IconTelegram.svg";
|
||||||
|
import IconPinterest from "@/assets/icons/IconPinterest.svg";
|
||||||
|
import { SITE } from "@/config";
|
||||||
|
|
||||||
|
export const LOCALE = {
|
||||||
|
lang: "en", // html lang code. Set this empty and default will be "en"
|
||||||
|
langTag: ["en-EN"], // BCP 47 Language Tags. Set this empty [] to use the environment default
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export const SOCIALS = [
|
||||||
|
{
|
||||||
|
name: "Github",
|
||||||
|
href: "https://github.com/satnaing/astro-paper",
|
||||||
|
linkTitle: ` ${SITE.title} on Github`,
|
||||||
|
icon: IconGitHub,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "X",
|
||||||
|
href: "https://x.com/username",
|
||||||
|
linkTitle: `${SITE.title} on X`,
|
||||||
|
icon: IconBrandX,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "LinkedIn",
|
||||||
|
href: "https://www.linkedin.com/in/username/",
|
||||||
|
linkTitle: `${SITE.title} on LinkedIn`,
|
||||||
|
icon: IconLinkedin,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Mail",
|
||||||
|
href: "mailto:yourmail@gmail.com",
|
||||||
|
linkTitle: `Send an email to ${SITE.title}`,
|
||||||
|
icon: IconMail,
|
||||||
|
},
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export const SHARE_LINKS = [
|
||||||
|
{
|
||||||
|
name: "WhatsApp",
|
||||||
|
href: "https://wa.me/?text=",
|
||||||
|
linkTitle: `Share this post via WhatsApp`,
|
||||||
|
icon: IconWhatsapp,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Facebook",
|
||||||
|
href: "https://www.facebook.com/sharer.php?u=",
|
||||||
|
linkTitle: `Share this post on Facebook`,
|
||||||
|
icon: IconFacebook,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "X",
|
||||||
|
href: "https://x.com/intent/post?url=",
|
||||||
|
linkTitle: `Share this post on X`,
|
||||||
|
icon: IconBrandX,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Telegram",
|
||||||
|
href: "https://t.me/share/url?url=",
|
||||||
|
linkTitle: `Share this post via Telegram`,
|
||||||
|
icon: IconTelegram,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Pinterest",
|
||||||
|
href: "https://pinterest.com/pin/create/button/?url=",
|
||||||
|
linkTitle: `Share this post on Pinterest`,
|
||||||
|
icon: IconPinterest,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Mail",
|
||||||
|
href: "mailto:?subject=See%20this%20post&body=",
|
||||||
|
linkTitle: `Share this post via email`,
|
||||||
|
icon: IconMail,
|
||||||
|
},
|
||||||
|
] as const;
|
||||||
Vendored
-2
@@ -1,2 +0,0 @@
|
|||||||
/// <reference path="../.astro/types.d.ts" />
|
|
||||||
/// <reference types="astro/client" />
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import type socialIcons from "@assets/socialIcons";
|
|
||||||
|
|
||||||
export type Site = {
|
|
||||||
website: string;
|
|
||||||
author: string;
|
|
||||||
profile: string;
|
|
||||||
desc: string;
|
|
||||||
title: string;
|
|
||||||
ogImage?: string;
|
|
||||||
lightAndDarkMode: boolean;
|
|
||||||
postPerIndex: number;
|
|
||||||
postPerPage: number;
|
|
||||||
scheduledPostMargin: number;
|
|
||||||
showArchives?: boolean;
|
|
||||||
editPost?: {
|
|
||||||
url?: URL["href"];
|
|
||||||
text?: string;
|
|
||||||
appendFilePath?: boolean;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export type SocialObjects = {
|
|
||||||
name: keyof typeof socialIcons;
|
|
||||||
href: string;
|
|
||||||
active: boolean;
|
|
||||||
linkTitle: string;
|
|
||||||
}[];
|
|
||||||
Reference in New Issue
Block a user