Skip to content

Commit 158df5e

Browse files
authored
Merge pull request #82 from chrisweb/preview
small fixes and social icons
2 parents ec0ca0c + b5b7aa7 commit 158df5e

File tree

7 files changed

+81
-35
lines changed

7 files changed

+81
-35
lines changed

app/global.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,19 @@ make the text color a bit darker */
926926
margin-right: calc(var(--main-spacing) / 2);
927927
}
928928

929+
.socialIcon {
930+
margin-right: calc(var(--main-spacing) / 2);
931+
color: var(--primary-light-color);
932+
}
933+
934+
/* not on mobile */
935+
@media (hover: hover) {
936+
937+
.socialIcon:hover {
938+
color: var(--secondary-light-color);
939+
}
940+
}
941+
929942
@keyframes rippleAnimation {
930943
0% {
931944
box-shadow: 0 0 0 0 rgba(255, 255, 255, 1);

app/web_development/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const metadata = {
2424
<div className="asideCore">
2525
<ul className="linksList">
2626
<li>
27-
<FontAwesomeIcon icon={faGithub} color='white' size="2x" className="social" /> <BaseLink href="https://github.com/chrisweb">My GitHub Projects</BaseLink>
27+
<FontAwesomeIcon icon={faGithub} color="white" size="2x" className="social" /> <BaseLink href="https://github.com/chrisweb">My GitHub Projects</BaseLink>
2828
</li>
2929
</ul>
3030
<AsideContent />

app/web_development/posts/mdx/page.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: MDX
3-
keywords: ['MDX', 'markdown', 'remark', 'rehype', 'MDAST', 'HAST']
3+
keywords: ['MDX', 'markdown', 'md', 'micromark', 'unifiedjs', 'commonmark', 'remark', 'rehype', 'MDAST', 'HAST']
44
published: 2024-08-10T11:22:33.444Z
5-
modified: 2024-10-25T10:10:10.444Z
5+
modified: 2025-01-01T10:10:10.444Z
66
permalink: https://chris.lu/web_development/posts/mdx
77
section: Web development
88
---
@@ -146,9 +146,13 @@ All major frameworks support MDX either out of the box or via packages that you
146146

147147
[markdoc](https://markdoc.dev/docs/nextjs) is a markdown only package (so no MDX), but they now have a Next.js plugin, which makes it easy to use markdoc with Next.js
148148

149-
[contentlayer](https://github.com/contentlayerdev/contentlayer) is an MDX package that was popular in the past (having earned >3k stars) but does not seem to get any updates anymore
149+
~~[contentlayer](https://github.com/contentlayerdev/contentlayer)~~ is an MDX package that was popular in the past (having earned >3k stars) but does not seem to get any updates anymore
150150

151151
> [!WARN]
152-
> This is the post suggests that its [development is currently halted](https://github.com/contentlayerdev/contentlayer/issues/429). Also, as of now, the last update was almost a year ago, so be careful when considering that package
152+
> contentlayer update: as this post suggests: [development is currently halted](https://github.com/contentlayerdev/contentlayer/issues/429)
153+
>
154+
> they now also added this warning in their readme:
155+
>
156+
> > Unfortunately Contentlayer is no longer maintained due to lack of funding. [You can find a fork of the project here.](https://github.com/timlrx/contentlayer2)
153157
154158
</article>

app/web_development/tutorials/next-js-static-first-mdx-starterkit/mdx-plugins/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ I digged in the code of the [@next/mdx/mdx-js-loader.js](https://github.com/verc
177177

178178
meaning that the following example will lead to the TypeError above:
179179

180-
```shell
180+
```js
181181
const withMDX = createMDX({
182182
options: {
183183
remarkPlugins: [],
@@ -188,7 +188,7 @@ const withMDX = createMDX({
188188

189189
To fix the configuration you need to use:
190190

191-
```shell
191+
```js
192192
const withMDX = createMDX({
193193
options: {
194194
remarkPlugins: [],

components/aside/Content.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import BaseLink from '@/components/base/Link'
33
import ShareButton from '@/components/base/button/Share'
44
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
55
import { faHeart, faBug, faComments } from '@fortawesome/free-solid-svg-icons'
6+
import { faGithub, faMastodon, faDiscord } from '@fortawesome/free-brands-svg-icons'
67
import Image from 'next/image'
78
import buyMeACoffeeImport from '@/public/assets/images/buy_me_a_coffee_button.png'
89

@@ -14,7 +15,6 @@ const AsideContent: React.FC = () => {
1415
<a href="https://www.buymeacoffee.com/chriswwweb" className={`${styles.coffeeButton} shake`} rel="noopener noreferrer" target="_blank">
1516
<Image src={buyMeACoffeeImport} priority fill alt="buy me a coffee, please" />
1617
</a>
17-
<br />
1818
<span className="fontDarker">* Please 😉</span>
1919
<p className="fontSmall fontDarker alignLeft">
2020
<FontAwesomeIcon icon={faHeart} size="1x" className="startInlineIcon" />
@@ -32,9 +32,22 @@ const AsideContent: React.FC = () => {
3232
<p className="fontSmall fontDarker alignLeft">
3333
<FontAwesomeIcon icon={faComments} className="startInlineIcon" />
3434
Suggestions and Ideas are appreciated, please use the&nbsp;
35+
<BaseLink href="https://discord.gg/4p59CCTUAJ">chris.lu Discord server</BaseLink>
36+
or the&nbsp;
3537
<BaseLink href="https://github.com/chrisweb/chris.lu/discussions">discussion board</BaseLink>
3638
to leave feedback or ask a question.
3739
</p>
40+
<p>
41+
<BaseLink href="https://discord.gg/4p59CCTUAJ" noExternalIcon={true}>
42+
<FontAwesomeIcon icon={faDiscord} color="white" size="2x" className="socialIcon" />
43+
</BaseLink>
44+
<BaseLink href="https://mastodon.social/@chriswwweb" noExternalIcon={true}>
45+
<FontAwesomeIcon icon={faMastodon} color="white" size="2x" className="socialIcon" />
46+
</BaseLink>
47+
<BaseLink href="https://github.com/chrisweb" noExternalIcon={true}>
48+
<FontAwesomeIcon icon={faGithub} color="white" size="2x" className="socialIcon" />
49+
</BaseLink>
50+
</p>
3851
</div>
3952
)
4053
}

components/base/Link.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface IBaseLinkProps extends PropsWithChildren {
99
target?: string
1010
rel?: string
1111
className?: string
12+
noExternalIcon?: boolean
1213
}
1314

1415
const isExternalUrl = (url: string, domain: string): boolean => {
@@ -53,12 +54,12 @@ const isUrlMe = (url: string): boolean => {
5354

5455
const BaseLink: React.FC<IBaseLinkProps> = (props) => {
5556

56-
const { href, children, ...linkProps } = props
57+
const { href, children, noExternalIcon, ...linkProps } = props
58+
const newLinkProps = { ...linkProps }
5759

5860
const isExternal = isExternalUrl(href.toString(), 'chris.lu')
5961
const isMe = isUrlMe(href.toString())
60-
61-
const newLinkProps = { ...linkProps }
62+
const withExternalIcon = isExternal && !noExternalIcon
6263

6364
if (isExternal) {
6465
newLinkProps.rel = 'noopener noreferrer'
@@ -71,7 +72,7 @@ const BaseLink: React.FC<IBaseLinkProps> = (props) => {
7172

7273
return (
7374
<>
74-
{isExternal ?
75+
{(withExternalIcon) ?
7576
(
7677
<>
7778
<a href={href.toString()} {...newLinkProps}>

package-lock.json

Lines changed: 38 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)