Skip to content

Commit b7b26b0

Browse files
added next image, updated content
1 parent cdd9078 commit b7b26b0

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

components/CustomImage.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Image from 'next/image';
2+
3+
export default function CustomImage({ src, alt, ...otherProps }) {
4+
return (
5+
<figure className="aspect-[4/3] relative">
6+
<Image
7+
className="object-cover object-top"
8+
src={src}
9+
alt={alt || ''}
10+
fill={true}
11+
{...otherProps}
12+
/>
13+
</figure>
14+
);
15+
}

components/CustomLink.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import Link from 'next/link';
22

33
export default function CustomLink({ as, href, ...otherProps }) {
4-
return <>
5-
<Link as={as} href={href} {...otherProps}>
6-
7-
</Link>
8-
</>;
4+
return <Link as={as} href={href} {...otherProps}></Link>;
95
}

pages/posts/[slug].js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { MDXRemote } from 'next-mdx-remote';
1010
import Head from 'next/head';
1111
import Link from 'next/link';
1212
import ArrowIcon from '../../components/ArrowIcon';
13+
import CustomImage from '../../components/CustomImage';
1314
import CustomLink from '../../components/CustomLink';
1415
import Footer from '../../components/Footer';
1516
import Header from '../../components/Header';
@@ -26,6 +27,7 @@ const components = {
2627
// useful for conditionally loading components for certain routes.
2728
// See the notes in README.md for more details.
2829
Head,
30+
img: CustomImage
2931
};
3032

3133
export default function PostPage({

posts/example-post-1.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ description: >-
77
across all pages and elements.
88
date: '2024-11-06'
99
---
10-
1110
A style guide for a website is a set of design standards that define the look, feel, and behavior of a digital product, ensuring consistency and cohesion across all pages and elements. It typically includes guidelines for colors, typography, spacing, buttons, icons, and imagery, as well as instructions on voice and tone for content.
1211

1312
# h1 Heading
@@ -101,3 +100,8 @@ Right aligned columns
101100
* [Next.js on Netlify](https://docs.netlify.com/frameworks/next-js/overview/)
102101
* [Use Visual Editor with Next.js](https://docs.netlify.com/visual-editor/frameworks/next/)
103102

103+
## Image
104+
105+
Recommended image orientation is horizontal. You can adjust the image component to your needs in `components/CustomImage.js`.
106+
107+
![Image alt text](/images/random-image.jpeg "Image Title")

public/images/random-image.jpeg

323 KB
Loading

0 commit comments

Comments
 (0)