Skip to content

Commit

Permalink
feat: Add BlogImage component
Browse files Browse the repository at this point in the history
  • Loading branch information
luigieai committed Mar 8, 2023
1 parent daabadb commit f1a31c8
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 44 deletions.
6 changes: 4 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';

import tailwind from "@astrojs/tailwind";

// https://astro.build/config
import image from "@astrojs/image";

// https://astro.build/config
export default defineConfig({
site: 'https://astro-modern-personal-website.netlify.app',
integrations: [mdx(), sitemap(), tailwind()]
integrations: [mdx(), sitemap(), tailwind(), image()]
});
148 changes: 107 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/image": "^0.16.0",
"@astrojs/mdx": "^0.11.1",
"@astrojs/rss": "^1.0.1",
"@astrojs/sitemap": "^1.0.0",
"@astrojs/tailwind": "^3.0.0",
"astro": "^2.0.0",
"astro": "^2.1.0",
"daisyui": "^2.27.0"
},
"devDependencies": {
Expand Down
12 changes: 12 additions & 0 deletions src/components/BlogImage.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
import { Image } from '@astrojs/image/components';
const { src, description, width } = Astro.props;
---

<div class="hero bg-base-100">
<div class="hero-content flex-col">
<Image alt={description} src={src} format='jpg' width={width ? width : 250} />
<p class="text-base italic" >{description}</p>
</div>
</div>

0 comments on commit f1a31c8

Please sign in to comment.