mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Rename lib folder to utils
This commit is contained in:
+37
-40
@@ -1,18 +1,18 @@
|
||||
import { FC, useEffect } from "react";
|
||||
import { getBlogPostsSlugs, getBlogPostdata } from "../../lib/blog";
|
||||
import { useRouter } from "next/router";
|
||||
import { MdxRemote } from "next-mdx-remote/types";
|
||||
import { MDXProvider } from "@mdx-js/react";
|
||||
import { MDXEmbedProvider } from "mdx-embed";
|
||||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import renderToString from "next-mdx-remote/render-to-string";
|
||||
import hydrate from "next-mdx-remote/hydrate";
|
||||
import styled from "styled-components";
|
||||
import matter from "gray-matter";
|
||||
import AllComponents from "../../components/All";
|
||||
import Head from "next/head";
|
||||
import IconButton from "../../components/IconButton";
|
||||
import CodeBlock from "../../components/CodeBlock";
|
||||
import { FC, useEffect } from 'react';
|
||||
import { getBlogPostsSlugs, getBlogPostdata } from '../../utils/blog';
|
||||
import { useRouter } from 'next/router';
|
||||
import { MdxRemote } from 'next-mdx-remote/types';
|
||||
import { MDXProvider } from '@mdx-js/react';
|
||||
import { MDXEmbedProvider } from 'mdx-embed';
|
||||
import { GetStaticPaths, GetStaticProps } from 'next';
|
||||
import renderToString from 'next-mdx-remote/render-to-string';
|
||||
import hydrate from 'next-mdx-remote/hydrate';
|
||||
import styled from 'styled-components';
|
||||
import matter from 'gray-matter';
|
||||
import AllComponents from '../../components/All';
|
||||
import Head from 'next/head';
|
||||
import IconButton from '../../components/IconButton';
|
||||
import CodeBlock from '../../components/CodeBlock';
|
||||
|
||||
interface Props {
|
||||
source: MdxRemote.Source;
|
||||
@@ -119,45 +119,42 @@ const BlogPost: FC<Props> = ({ source, frontMatter }) => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="author" content="Hazem Krimi" />
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
|
||||
<meta name='author' content='Hazem Krimi' />
|
||||
<meta
|
||||
name="description"
|
||||
name='description'
|
||||
content={
|
||||
frontMatter.description
|
||||
? frontMatter.description
|
||||
: "Hazem Krimi is a Full Stack JavaScript Developer and a Software Engineering Enthusiast"
|
||||
: 'Hazem Krimi is a Full Stack JavaScript Developer and a Software Engineering Enthusiast'
|
||||
}
|
||||
/>
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
|
||||
<link rel="canonical" href="https://hazemkrimi.tech" />
|
||||
<meta property="og:image" content="/logo.jpg" />
|
||||
<link rel='shortcut icon' href='favicon.ico' type='image/x-icon' />
|
||||
<link rel='canonical' href='https://hazemkrimi.tech' />
|
||||
<meta property='og:image' content='/logo.jpg' />
|
||||
<meta
|
||||
property="og:description"
|
||||
property='og:description'
|
||||
content={
|
||||
frontMatter.description
|
||||
? frontMatter.description
|
||||
: "Hazem Krimi is a Full Stack JavaScript Developer and a Software Engineering Enthusiast"
|
||||
: 'Hazem Krimi is a Full Stack JavaScript Developer and a Software Engineering Enthusiast'
|
||||
}
|
||||
/>
|
||||
<meta property='og:title' content={`${frontMatter.title} | Hazem Krimi`} />
|
||||
<meta
|
||||
property="og:title"
|
||||
content={`${frontMatter.title} | Hazem Krimi`}
|
||||
/>
|
||||
<meta
|
||||
name="keywords"
|
||||
name='keywords'
|
||||
content={
|
||||
frontMatter.tags
|
||||
? frontMatter.tags.join(" ")
|
||||
: "Hazem, Krimi, Developer, Software, Engineer, Web, Mobile, Frontend, Backend, Fullstack, JavaScript, React.js, React Native, Node.js, Portfolio, Blog, Tutorials, Tech News"
|
||||
? frontMatter.tags.join(' ')
|
||||
: 'Hazem, Krimi, Developer, Software, Engineer, Web, Mobile, Frontend, Backend, Fullstack, JavaScript, React.js, React Native, Node.js, Portfolio, Blog, Tutorials, Tech News'
|
||||
}
|
||||
/>
|
||||
<title>{frontMatter.title} | Hazem Krimi</title>
|
||||
</Head>
|
||||
<Wrapper>
|
||||
<div className="meta">
|
||||
<div className="back" onClick={() => router.back()}>
|
||||
<IconButton icon="/icons/arrow-left.svg" />
|
||||
<div className='meta'>
|
||||
<div className='back' onClick={() => router.back()}>
|
||||
<IconButton icon='/icons/arrow-left.svg' />
|
||||
<span>Back</span>
|
||||
</div>
|
||||
<h1>{frontMatter.title}</h1>
|
||||
@@ -166,7 +163,7 @@ const BlogPost: FC<Props> = ({ source, frontMatter }) => {
|
||||
Written by <b>{frontMatter.author}</b> on <b>{frontMatter.date}</b>
|
||||
</p>
|
||||
{frontMatter.tags && (
|
||||
<div className="tags-wrapper">
|
||||
<div className='tags-wrapper'>
|
||||
{frontMatter.tags.map((tag: string, index: number) => (
|
||||
<span key={index}>#{tag} </span>
|
||||
))}
|
||||
@@ -176,7 +173,7 @@ const BlogPost: FC<Props> = ({ source, frontMatter }) => {
|
||||
</div>
|
||||
<MDXProvider components={{ code: CodeBlock }}>
|
||||
<MDXEmbedProvider>
|
||||
<div className="content">{content}</div>
|
||||
<div className='content'>{content}</div>
|
||||
</MDXEmbedProvider>
|
||||
</MDXProvider>
|
||||
</Wrapper>
|
||||
@@ -190,7 +187,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
const paths = getBlogPostsSlugs();
|
||||
return {
|
||||
paths,
|
||||
fallback: false,
|
||||
fallback: false
|
||||
};
|
||||
};
|
||||
export const getStaticProps: GetStaticProps = async ({ params }: any) => {
|
||||
@@ -198,13 +195,13 @@ export const getStaticProps: GetStaticProps = async ({ params }: any) => {
|
||||
const { data, content } = matter(blogPostContent);
|
||||
const mdxSource = await renderToString(content, {
|
||||
components,
|
||||
scope: data,
|
||||
scope: data
|
||||
});
|
||||
|
||||
return {
|
||||
props: {
|
||||
source: mdxSource,
|
||||
frontMatter: data,
|
||||
},
|
||||
frontMatter: data
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { FC } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { getBlogPosts } from '../../lib/blog';
|
||||
import { getBlogPosts } from '../../utils/blog';
|
||||
import styled from 'styled-components';
|
||||
import Card from '../../components/Card';
|
||||
import IconButton from '../../components/IconButton';
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { FC } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { getPortfolioProjects } from '../lib/portfolio';
|
||||
import { getBlogPosts } from '../lib/blog';
|
||||
import { getPortfolioProjects } from '../utils/portfolio';
|
||||
import { getBlogPosts } from '../utils/blog';
|
||||
import { GetStaticProps } from 'next';
|
||||
import styled from 'styled-components';
|
||||
import Hero from '../components/Hero';
|
||||
|
||||
+36
-42
@@ -1,21 +1,18 @@
|
||||
import { FC, useEffect } from "react";
|
||||
import {
|
||||
getPortfolioPorjectsSlugs,
|
||||
getPortfolioProjectdata,
|
||||
} from "../../lib/portfolio";
|
||||
import { useRouter } from "next/router";
|
||||
import { MdxRemote } from "next-mdx-remote/types";
|
||||
import { MDXProvider } from "@mdx-js/react";
|
||||
import { MDXEmbedProvider } from "mdx-embed";
|
||||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import renderToString from "next-mdx-remote/render-to-string";
|
||||
import hydrate from "next-mdx-remote/hydrate";
|
||||
import styled from "styled-components";
|
||||
import matter from "gray-matter";
|
||||
import AllComponents from "../../components/All";
|
||||
import Head from "next/head";
|
||||
import IconButton from "../../components/IconButton";
|
||||
import CodeBlock from "../../components/CodeBlock";
|
||||
import { FC, useEffect } from 'react';
|
||||
import { getPortfolioPorjectsSlugs, getPortfolioProjectdata } from '../../utils/portfolio';
|
||||
import { useRouter } from 'next/router';
|
||||
import { MdxRemote } from 'next-mdx-remote/types';
|
||||
import { MDXProvider } from '@mdx-js/react';
|
||||
import { MDXEmbedProvider } from 'mdx-embed';
|
||||
import { GetStaticPaths, GetStaticProps } from 'next';
|
||||
import renderToString from 'next-mdx-remote/render-to-string';
|
||||
import hydrate from 'next-mdx-remote/hydrate';
|
||||
import styled from 'styled-components';
|
||||
import matter from 'gray-matter';
|
||||
import AllComponents from '../../components/All';
|
||||
import Head from 'next/head';
|
||||
import IconButton from '../../components/IconButton';
|
||||
import CodeBlock from '../../components/CodeBlock';
|
||||
|
||||
interface Props {
|
||||
source: MdxRemote.Source;
|
||||
@@ -113,47 +110,44 @@ const PortfolioProject: FC<Props> = ({ source, frontMatter }) => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="author" content="Hazem Krimi" />
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
|
||||
<meta name='author' content='Hazem Krimi' />
|
||||
<meta
|
||||
name="description"
|
||||
name='description'
|
||||
content={
|
||||
frontMatter.description
|
||||
? frontMatter.description
|
||||
: "Hazem Krimi is a Full Stack JavaScript Developer and a Software Engineering Enthusiast"
|
||||
: 'Hazem Krimi is a Full Stack JavaScript Developer and a Software Engineering Enthusiast'
|
||||
}
|
||||
/>
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
|
||||
<link rel="canonical" href="https://hazemkrimi.tech" />
|
||||
<meta property="og:image" content="/logo.jpg" />
|
||||
<link rel='shortcut icon' href='favicon.ico' type='image/x-icon' />
|
||||
<link rel='canonical' href='https://hazemkrimi.tech' />
|
||||
<meta property='og:image' content='/logo.jpg' />
|
||||
<meta
|
||||
property="og:description"
|
||||
property='og:description'
|
||||
content={
|
||||
frontMatter.description
|
||||
? frontMatter.description
|
||||
: "Hazem Krimi is a Full Stack JavaScript Developer and a Software Engineering Enthusiast"
|
||||
: 'Hazem Krimi is a Full Stack JavaScript Developer and a Software Engineering Enthusiast'
|
||||
}
|
||||
/>
|
||||
<meta property='og:title' content={`${frontMatter.title} | Hazem Krimi`} />
|
||||
<meta
|
||||
property="og:title"
|
||||
content={`${frontMatter.title} | Hazem Krimi`}
|
||||
/>
|
||||
<meta
|
||||
name="keywords"
|
||||
content="Hazem, Krimi, Developer, Software, Engineer, Web, Mobile, Frontend, Backend, Fullstack, JavaScript, React.js, React Native, Node.js, Portfolio, Blog, Tutorials, Tech News"
|
||||
name='keywords'
|
||||
content='Hazem, Krimi, Developer, Software, Engineer, Web, Mobile, Frontend, Backend, Fullstack, JavaScript, React.js, React Native, Node.js, Portfolio, Blog, Tutorials, Tech News'
|
||||
/>
|
||||
<title>{frontMatter.title} | Hazem Krimi</title>
|
||||
</Head>
|
||||
<Wrapper>
|
||||
<div className="meta">
|
||||
<div className="back" onClick={() => router.back()}>
|
||||
<IconButton icon="/icons/arrow-left.svg" />
|
||||
<div className='meta'>
|
||||
<div className='back' onClick={() => router.back()}>
|
||||
<IconButton icon='/icons/arrow-left.svg' />
|
||||
<span>Back</span>
|
||||
</div>
|
||||
<h1>{frontMatter.title}</h1>
|
||||
<p>{frontMatter.description}</p>
|
||||
{frontMatter.tags && (
|
||||
<div className="tags-wrapper">
|
||||
<div className='tags-wrapper'>
|
||||
{frontMatter.tags.map((tag: string, index: number) => (
|
||||
<span key={index}>#{tag} </span>
|
||||
))}
|
||||
@@ -163,7 +157,7 @@ const PortfolioProject: FC<Props> = ({ source, frontMatter }) => {
|
||||
</div>
|
||||
<MDXProvider components={{ code: CodeBlock }}>
|
||||
<MDXEmbedProvider>
|
||||
<div className="content">{content}</div>
|
||||
<div className='content'>{content}</div>
|
||||
</MDXEmbedProvider>
|
||||
</MDXProvider>
|
||||
</Wrapper>
|
||||
@@ -177,7 +171,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
const paths = getPortfolioPorjectsSlugs();
|
||||
return {
|
||||
paths,
|
||||
fallback: false,
|
||||
fallback: false
|
||||
};
|
||||
};
|
||||
export const getStaticProps: GetStaticProps = async ({ params }: any) => {
|
||||
@@ -185,13 +179,13 @@ export const getStaticProps: GetStaticProps = async ({ params }: any) => {
|
||||
const { data, content } = matter(blogPostContent);
|
||||
const mdxSource = await renderToString(content, {
|
||||
components,
|
||||
scope: data,
|
||||
scope: data
|
||||
});
|
||||
|
||||
return {
|
||||
props: {
|
||||
source: mdxSource,
|
||||
frontMatter: data,
|
||||
},
|
||||
frontMatter: data
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { FC } from 'react';
|
||||
import { getPortfolioProjects } from '../../lib/portfolio';
|
||||
import { getPortfolioProjects } from '../../utils/portfolio';
|
||||
import { useRouter } from 'next/router';
|
||||
import styled from 'styled-components';
|
||||
import Card from '../../components/Card';
|
||||
|
||||
Reference in New Issue
Block a user