Skip to content

Commit

Permalink
fixup! fixup! fixup! Change feed to load in webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
sangamcse committed Mar 6, 2023
1 parent b10aef1 commit f33bba9
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NEXT_PUBLIC_ROOT_URL="localhost:3500"
NEXT_PUBLIC_ROOT_URL="localhost:3535"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"dependencies": {
"@mapbox/rehype-prism": "0.8.0",
"@pondorasti/remark-img-links": "1.0.8",
"@tailwindcss/typography": "0.5.4",
"@vercel/node": "2.5.8",
"autoprefixer": "10.4.8",
Expand Down
6 changes: 5 additions & 1 deletion src/utils/generate_rss_feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Feed } from 'feed';
import { MDXRemote } from 'next-mdx-remote';
import { serialize } from 'next-mdx-remote/serialize';

import { getImageSrc } from 'components/blog/get_image_src';

import { getFrontMatters } from 'utils/get_front_matters';
import { BLOG_PATH_PREFIX, blogComponents, mdxOptions } from 'utils/mdx';
import { rootUrl } from 'utils/constants';
Expand Down Expand Up @@ -53,13 +55,15 @@ export async function generateRssFeed() {

entries.forEach(
({ title, slug, img, publishedAt, tags, snippet, content }) => {
const imageSrc = getImageSrc(img);

feed.addItem({
title,
id: `${rootUrl}/${slug}`,
link: `${rootUrl}/${slug}`,
date: new Date(publishedAt),
published: new Date(publishedAt),
image: `${rootUrl}/${img}`,
image: `${rootUrl}${imageSrc}`,
description: snippet,
category: tags.map((tag) => ({ name: tag })),
content: ReactDOMServer.renderToStaticMarkup(
Expand Down
8 changes: 7 additions & 1 deletion src/utils/mdx.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import rehypePrism from '@mapbox/rehype-prism';
import imgLinks from '@pondorasti/remark-img-links';

import { rootUrl } from 'utils/constants';

// import { RelativeTimeDemo } from 'components/blog/RelativeTimeDemo/RelativeTimeDemo';
// import { FeaturedPreview } from 'components/CodingChallenges/2020/CyclingElement/FeaturedPreview';
Expand All @@ -7,7 +10,10 @@ import rehypePrism from '@mapbox/rehype-prism';
export const BLOG_PATH_PREFIX = 'src/pages/blog/';
export const CODING_CHALLENGES_PATH_PREFIX = 'src/pages/coding-challenges/';

export const mdxOptions = { rehypePlugins: [rehypePrism] };
export const mdxOptions = {
rehypePlugins: [rehypePrism],
remarkPlugins: [[imgLinks, { absolutePath: rootUrl }]],
};

export const blogComponents = {
// RelativeTimeDemo,
Expand Down
26 changes: 26 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@
"@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0"

"@pondorasti/[email protected]":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@pondorasti/remark-img-links/-/remark-img-links-1.0.8.tgz#1ba8246834c0a5b6b13a9b25a77827d49f6bea25"
integrity sha512-UpW5AfimYi7EdkL9qvQ4trzIzgi5KERdd4KHN8fkVWrh2BqCzKuheJbAzSgIxJr0opQ7NvaIwf+JRjV/fBRdrA==
dependencies:
unist-util-visit "1.4.0"

"@rushstack/eslint-patch@^1.1.3":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27"
Expand Down Expand Up @@ -6696,6 +6703,11 @@ unist-util-generated@^2.0.0:
resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-2.0.0.tgz#86fafb77eb6ce9bfa6b663c3f5ad4f8e56a60113"
integrity sha512-TiWE6DVtVe7Ye2QxOVW9kqybs6cZexNwTwSMVgkfjEReqy/xwGpAXb99OxktoWwmL+Z+Epb0Dn8/GNDYP1wnUw==

unist-util-is@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd"
integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==

unist-util-is@^4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.0.3.tgz#e8b44db55fc20c43752b3346c116344d45d7c91d"
Expand Down Expand Up @@ -6735,6 +6747,13 @@ unist-util-stringify-position@^3.0.0:
dependencies:
"@types/unist" "^2.0.0"

unist-util-visit-parents@^2.0.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz#25e43e55312166f3348cae6743588781d112c1e9"
integrity sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==
dependencies:
unist-util-is "^3.0.0"

unist-util-visit-parents@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6"
Expand All @@ -6751,6 +6770,13 @@ unist-util-visit-parents@^5.0.0:
"@types/unist" "^2.0.0"
unist-util-is "^5.0.0"

[email protected]:
version "1.4.0"
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.0.tgz#1cb763647186dc26f5e1df5db6bd1e48b3cc2fb1"
integrity sha512-FiGu34ziNsZA3ZUteZxSFaczIjGmksfSgdKqBfOejrrfzyUy5b7YrlzT1Bcvi+djkYDituJDy2XB7tGTeBieKw==
dependencies:
unist-util-visit-parents "^2.0.0"

unist-util-visit@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c"
Expand Down

1 comment on commit f33bba9

@vercel
Copy link

@vercel vercel bot commented on f33bba9 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

portfolio – ./

portfolio-sangamcse.vercel.app
www.sangam.dev
portfolio-git-master-sangamcse.vercel.app
sangam.dev

Please sign in to comment.