···1010- ✅ SEO-friendly with canonical URLs and OpenGraph data (automatically generated)
1111- ✅ Sitemap support
1212- ✅ RSS Feed support
1313-- ✅ Markdown & MDX support
1313+- ✅ Markdown support
1414- ✅ Pagination
1515- ✅ Syntax highlighting (+ copy button)
1616- ✅ Dark and light mode with toggle button or auto-detect
···29293030- [supported markdown features](https://flo-bit.dev/blog-template/posts/markdown-style-guide)
31313232-- [how to use mdx](https://flo-bit.dev/blog-template/posts/using-mdx)
3333-3432## Minimal setup with github pages
353336341. Fork this repository
37353838-2. Set up your blog info in `src/consts.ts` (most importantly set 'SITE' and 'BASE' to your corresponding values, see `src/consts.ts` for more info)
3636+2. Set up your blog info in `src/config.json` (most importantly set 'SITE' and 'BASE' to your corresponding values, see [configuring your site](https://flo-bit.dev/blog-template/posts/configuring-the-blog))
393740383. Add your blog posts in `src/content/blog/`
4139
···77import tailwind from "@astrojs/tailwind";
88import svelte from "@astrojs/svelte";
99import pagefind from "vite-plugin-pagefind";
1010-import { BASE, SITE } from "./src/consts";
1010+1111+import { BASE, SITE } from "./src/config.json"
11121213// https://astro.build/config
1314export default defineConfig({
···11---
22-import { BASE } from "../consts";
22+import { BASE } from "../config.json";
33import FormattedDate from "./FormattedDate.astro";
44import { Image } from "astro:assets";
55import type { ImageMetadata } from "astro";
···44 MANUAL_DARK_MODE,
55 SEARCH_ENABLED,
66 SITE_FAVICON,
77-} from "../consts";
77+} from "../config.json";
88import ThemeToggle from "./ThemeToggle.svelte";
99import Search from "./search/Search.svelte";
1010import HeaderLink from "./HeaderLink.astro";
···11---
22-import { BASE } from "../consts";
22+import { BASE } from "../config.json";
33import PaginationNumber from "./PaginationNumber.astro";
4455const { total, current, tag } = Astro.props;
···2121Check out all the [options you can use in the frontmatter of a blog post](../post-options).
22222323After that just write your content in markdown format (you don't need to write the title again, it will be automatically added to the page).
2424-2525-You can also use MDX to include components in your markdown files. For more information on how to use MDX, see the post about [using MDX](../using-mdx).
···11+---
22+title: "Configuring the blog"
33+description: "Learn how to configure the blog template"
44+pubDate: "Oct 25 2024"
55+heroImage: "/src/assets/blog-placeholder-1.jpg"
66+tags: ["setup"]
77+---
88+99+Change the values in `src/config.json` to configure the blog to your liking, see below for more information.
1010+1111+most importantly, set `SITE` and `BASE` to your corresponding values.
1212+1313+## SITE
1414+1515+- when deploying to github pages, set this to your site url
1616+ (e.g. "https://<your-github-username>.github.io")
1717+1818+## BASE
1919+2020+- when deploying to github pages, set this to your repo name
2121+ except if you're either using a custom domain or
2222+ your repo name is `<your-github-username>.github.io`
2323+ (in which case, set it to "")
2424+2525+## SITE_TITLE
2626+2727+- will be shown in the title and meta tags and og image
2828+2929+## SITE_DESCRIPTION
3030+3131+- will be shown in the meta tags
3232+3333+## SITE_FAVICON
3434+3535+- will be used as the icon in the header and the favicon
3636+3737+## NAME
3838+3939+- used in the footer (c) YOUR_NAME
4040+4141+## POSTS_PER_PAGE
4242+4343+- how many posts to show on per paginated page (also used for tag pages)
4444+4545+## MANUAL_DARK_MODE
4646+4747+- should we show the dark mode toggle?
4848+ (otherwise, it will be based on the user's system preferences)
4949+5050+## SEARCH_ENABLED
5151+5252+- should we show the search bar?
5353+5454+## BASE_COLOR
5555+5656+- shade of gray for the background
5757+ one of 'gray', 'neutral', 'stone', 'zinc', 'slate'
5858+5959+## ACCENT_COLOR
6060+6161+- color of links, etc.
6262+ one of 'red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal',
6363+ 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose'
6464+6565+## SOCIAL MEDIA LINKS
6666+6767+- set any of these to '' to hide the respective icon in the footer
6868+6969+- FACEBOOK_URL
7070+- TWITTER_URL
7171+- GITHUB_URL
7272+- INSTAGRAM_URL
7373+- LINKEDIN_URL
7474+- YOUTUBE_URL
7575+- SUBSTACK_URL
7676+- EMAIL
-63
src/content/blog/const-ts.md
···11----
22-title: "Configuring the blog"
33-description: "Learn how to configure the blog template"
44-pubDate: "Oct 25 2024"
55-heroImage: "/src/assets/blog-placeholder-1.jpg"
66-tags: ["setup"]
77----
88-99-a copy of `src/consts.ts` is included below for reference, change the values to configure the blog to your liking, see the comments for more information.
1010-1111-most importantly, set `SITE` and `BASE` to your corresponding values.
1212-1313-```ts
1414-import type { AccentColors, BaseColors } from "./types";
1515-1616-// when deploying to github pages, set this to your site url
1717-// (e.g. "https://<your-github-username>.github.io")
1818-export const SITE = "https://flo-bit.github.io"
1919-2020-// when deploying to github pages, set this to your repo name
2121-// except if you're either using a custom domain or
2222-// your repo name is <your-github-username>.github.io
2323-// (in which case, set it to "")
2424-export const BASE = "/blog-template";
2525-2626-// will be shown in the title and meta tags and og image
2727-export const SITE_TITLE = "Blog template";
2828-export const SITE_DESCRIPTION = "Welcome to my website!";
2929-// will be used as the icon in the header and the favicon
3030-export const SITE_FAVICON = "🙃";
3131-3232-// used in the footer (c) YOUR_NAME
3333-export const NAME = "flo-bit";
3434-3535-// how many posts to show on per paginated page (also used for tag pages)
3636-export const POSTS_PER_PAGE = 5;
3737-3838-// should we show the dark mode toggle?
3939-// (otherwise, it will be based on the user's system preferences)
4040-export const MANUAL_DARK_MODE = true;
4141-4242-// should we show the search bar?
4343-export const SEARCH_ENABLED = true;
4444-4545-// shade of gray for the background
4646-// one of 'gray', 'neutral', 'stone', 'zinc', 'slate'
4747-export const BASE_COLOR: BaseColors = "stone";
4848-4949-// color of links, etc.
5050-// one of 'red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal',
5151-// 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose'
5252-export const ACCENT_COLOR: AccentColors = "amber";
5353-5454-// set any of these to '' to hide the respective icon in the footer
5555-export const FACEBOOK_URL = "";
5656-export const TWITTER_URL = "https://x.com/flobit_dev";
5757-export const GITHUB_URL = "https://github.com/flo-bit";
5858-export const INSTAGRAM_URL = "https://www.instagram.com/flobit.dev/";
5959-export const LINKEDIN_URL = "";
6060-export const YOUTUBE_URL = "";
6161-export const SUBSTACK_URL = "https://flo-bit.substack.com";
6262-export const EMAIL = "flo.bit.dev@gmail.com";
6363-```
···1111- ✅ SEO-friendly with canonical URLs and OpenGraph data (automatically generated)
1212- ✅ Sitemap support
1313- ✅ RSS Feed support
1414-- ✅ Markdown & MDX support
1414+- ✅ Markdown support
1515- ✅ Pagination
1616- ✅ Code syntax highlighting (+ copy button)
1717- ✅ Dark and light mode with toggle button or auto-detection
···88991. Fork [the repository of this blog](https://github.com/flo-bit/blog-template)
10101111-2. Set up your blog info in `src/consts.ts` (most importantly set `SITE` and `BASE` to your corresponding values, see [`src/consts.ts`](../const-ts) for more info)
1111+2. Set up your blog info in `src/config.json` (most importantly set `SITE` and `BASE` to your corresponding values, see [`src/consts.ts`](../const-ts) for more info)
121213133. Add your blog posts in `src/content/blog/` (see [adding content](../adding-content) for more info)
141415154. Add your info in `src/content/info/`:
16161717-- `description.mdx` is used for the homepage description
1818-- `about.mdx` is used for the about page
1717+- `description.md` is used for the homepage description
1818+- `about.md` is used for the about page
191920205. In your repository settings, set up github pages to deploy using github actions
2121
-75
src/content/blog/using-mdx.mdx
···11----
22-title: "Using MDX"
33-description: "How to use MDX in your blog posts"
44-pubDate: "Jun 02 2024"
55-heroImage: "/src/assets/blog-placeholder-3.jpg"
66-hideHero: true
77-tags: ["setup", "markdown"]
88----
99-1010-import WarningAlert from '$components/alerts/WarningAlert.svelte';
1111-1212-<WarningAlert title="Doesn't work with Pages CMS" class="mt-6">
1313- MDX is currently not supported by Pages CMS. You can still use it, but you will have to manually add the content to the markdown files.
1414-</WarningAlert>
1515-1616-This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) integration installed and configured in your `astro.config.mjs` config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file.
1717-1818-## Why MDX?
1919-2020-MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts.
2121-2222-If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze.
2323-2424-## Example
2525-2626-Here is how you import and use a UI component inside of MDX.
2727-When you open this page in the browser, you should see the clickable button below.
2828-2929-import HeaderLink from "../../components/HeaderLink.astro";
3030-3131-<HeaderLink href="#" onclick="alert('clicked!')">
3232- Embedded component in MDX
3333-</HeaderLink>
3434-3535-## Included Components
3636-3737-Currently the only conponents included are `Alerts`, which you can see in the example below:
3838-3939-import SuccessAlert from '$components/alerts/SuccessAlert.svelte';
4040-4141-<SuccessAlert title="Sucess">
4242- This is a success alert
4343-</SuccessAlert>
4444-4545-import InfoAlert from '$components/alerts/InfoAlert.svelte';
4646-4747-<InfoAlert title="Info" class="mt-6">
4848- This is an info alert
4949-</InfoAlert>
5050-5151-<WarningAlert title="Warning" class="mt-6">
5252- This is a warning alert
5353-</WarningAlert>
5454-5555-import ErrorAlert from '$components/alerts/ErrorAlert.svelte';
5656-5757-<ErrorAlert title="Error" class="mt-6">
5858- This is an error alert
5959-</ErrorAlert>
6060-6161-Use them like this:
6262-6363-```tsx
6464-import SuccessAlert from '$components/alerts/SuccessAlert.svelte';
6565-6666-<SuccessAlert title="Sucess">
6767- This is a success alert
6868-</SuccessAlert>
6969-```
7070-7171-## More Links
7272-7373-- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx)
7474-- [Astro Usage Documentation](https://docs.astro.build/en/guides/markdown-content/#markdown-and-mdx-pages)
7575-- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default.
···2233Minimalistic but opinionated blog template using [astro](https://astro.build/) and [svelte](https://svelte.dev/). aims to be super easy to deploy and use, with a focus on performance and SEO, ease-of-use and design (see all [features here](posts/features)).
4455-This blog doubles as a tutorial on how to use this template, start by [setting up your github repo](posts/how-to-use), then [add some content](posts/adding-content). For more information read about [supported markdown features here](posts/markdown-style-guide) or how you can [use mdx](posts/using-mdx).55+This blog doubles as a tutorial on how to use this template, start by [setting up your github repo](posts/how-to-use), then [add some content](posts/adding-content). For more information read about [supported markdown features here](posts/markdown-style-guide).
···66import Footer from "$components/Footer.astro";
77import { Image } from "astro:assets";
88import FormattedDate from "$components/FormattedDate.astro";
99-import { BASE } from "src/consts";
99+import { BASE } from "../../config.json";
10101111export async function getStaticPaths() {
1212 const posts = await getCollection("blog");