mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-02 02:10:27 +00:00
Update text alignment to the left
This commit is contained in:
+49
-39
@@ -1,18 +1,21 @@
|
||||
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 "../../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";
|
||||
|
||||
interface Props {
|
||||
source: MdxRemote.Source;
|
||||
@@ -31,8 +34,6 @@ const Wrapper = styled.div`
|
||||
}
|
||||
|
||||
.meta {
|
||||
text-align: center;
|
||||
|
||||
.back {
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
@@ -41,9 +42,15 @@ const Wrapper = styled.div`
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
h1,
|
||||
p {
|
||||
text-align: left;
|
||||
width: 85%;
|
||||
margin: 0.5rem auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
margin: 0.5rem 0rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@@ -106,44 +113,47 @@ 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
|
||||
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'
|
||||
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"
|
||||
/>
|
||||
<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>
|
||||
))}
|
||||
@@ -153,7 +163,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>
|
||||
@@ -167,7 +177,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
const paths = getPortfolioPorjectsSlugs();
|
||||
return {
|
||||
paths,
|
||||
fallback: false
|
||||
fallback: false,
|
||||
};
|
||||
};
|
||||
export const getStaticProps: GetStaticProps = async ({ params }: any) => {
|
||||
@@ -175,13 +185,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,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user