Skip to content

Commit

Permalink
Add blog component.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlex94 committed Oct 16, 2023
1 parent 5ce145f commit cb022c7
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
18 changes: 17 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import { defineConfig } from 'astro/config';
import blog from 'starlight-blog';

// https://astro.build/config
export default defineConfig({
integrations: [
blog({
authors: {
alex: {
name: 'Alex Kontos',
title: 'Founder',
picture: '/alex.jpg', // Images in the `public` directory are supported.
url: 'https://uk.linkedin.com/in/alex-kontos',
},
}
}),
starlight({
components: {
MarkdownContent: 'starlight-blog/overrides/MarkdownContent.astro',
Sidebar: 'starlight-blog/overrides/Sidebar.astro',
ThemeSelect: 'starlight-blog/overrides/ThemeSelect.astro',
},
title: 'My Docs',
social: {
github: 'https://github.com/withastro/starlight',
Expand Down
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dependencies": {
"@astrojs/starlight": "^0.11.1",
"astro": "^3.2.3",
"sharp": "^0.32.5"
"sharp": "^0.32.5",
"starlight-blog": "^0.4.0"
},
"devDependencies": {
"prettier": "^3.0.3",
Expand Down
Binary file added public/alex.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { i18nSchema } from '@astrojs/starlight/schema';
import { defineCollection } from 'astro:content';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
import { docsAndBlogSchema } from 'starlight-blog/schema';

export const collections = {
docs: defineCollection({ schema: docsSchema() }),
docs: defineCollection({ schema: docsAndBlogSchema }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
};
9 changes: 9 additions & 0 deletions src/content/docs/blog/first.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
author: Alex
date: 2023-07-24
title: My first blog post
---

## Hello

Hello world!

0 comments on commit cb022c7

Please sign in to comment.