Skip to content

Commit

Permalink
removed all the references to the old page, just a simple redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
davidquintr committed Apr 29, 2024
1 parent d32385f commit f2b5d18
Show file tree
Hide file tree
Showing 31 changed files with 14 additions and 1,163 deletions.
5 changes: 1 addition & 4 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ import "./scss/panel.scss";
import './css/prism-theme.css'
import './scss/darkmode.scss'

import ConfigProvider from './components/config_provider'

import type { AppProps } from 'next/app'


export default function App({ Component, pageProps }: AppProps) {
return (
<ConfigProvider>
<Component {...pageProps} />
</ConfigProvider>
<Component {...pageProps} />
)
}
6 changes: 0 additions & 6 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Html, Head, Main, NextScript } from 'next/document'
import Footer from './components/footer'
import PersonInit from './components/person_init'

export default function Document() {

Expand All @@ -15,11 +13,7 @@ export default function Document() {
<meta property="twitter:title" content="Portfolio - David Quintanilla"></meta>
</Head>
<body>
<div className='person-init'>
<PersonInit></PersonInit>
</div>
<Main />
<Footer></Footer>
<NextScript />
</body>
</Html>
Expand Down
47 changes: 1 addition & 46 deletions pages/blog.tsx
Original file line number Diff line number Diff line change
@@ -1,50 +1,8 @@
import NavBar from "./nav_bar";
import Head from "next/head";
import BlogItem from "./components/blog_item";
import { GetStaticProps } from "next";
import { useEffect, useState } from "react";
import Panel from "./components/panel";
import dynamic from "next/dynamic";
import { useConfigContext } from "./components/config_provider";
import Redirect from "./components/redirect";

const blog = require("./assets/json/blog_published.json");
const PageWrapper = dynamic(() => import("./components/page_wrapper"));

export const getStaticProps: GetStaticProps = async () => {
return {
props: {
blog,
},
};
};

export default function Blog() {
const [articlesBlog, setArticlesBlog] = useState([]);
const [filters, setFilters] = useState([])
// @ts-ignore
const { language, setLanguage, darkMode, setDarkMode } = useConfigContext();
let lightModeActive = darkMode ? "lightMode" : ""

const collectFilters = () =>{
let collectedTags = []

blog.forEach((element, index)=>{
collectedTags.push(...element.tags)
})

setFilters(collectedTags.filter((element, index)=> collectedTags.indexOf(element) === index))
}

useEffect(() => {

let orderBlog = blog.sort((a, b) =>
a.date.localeCompare(b.date, undefined, { sensitivity: "base" })
);
setArticlesBlog(orderBlog.reverse());
collectFilters();
}, []);


return (
<>
Expand All @@ -62,12 +20,9 @@ export default function Blog() {
<meta name="twitter:title" content="Portfolio | Blog"></meta>
<meta name="twitter:description" content="A blog with explainment, details and code of my projects."></meta>
<meta name="twitter:image" content="https://davidquintr.github.io/portfolio/thumbnail.png"></meta>

</Head>
<article className="article article-base extended">
<PageWrapper>
<Redirect href="blog" />
</PageWrapper>
<Redirect href="blog" />
</article>
</>
);
Expand Down
18 changes: 3 additions & 15 deletions pages/blog/[blog].tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import { useRouter } from "next/router";
import PageWrapper from "../components/page_wrapper";
import NavBar from "../nav_bar";
import Head from "next/head";
import Image from "next/image";
import DateParsed from "../components/date";
import personal from "../assets/json/personal.json";
import Tags from "../components/tags";
import SocialShare from "../components/social_share";
import { GetStaticProps, GetStaticPaths } from "next";
import Prism from 'prismjs';
import fs from 'fs';
import path from 'path';
import { useEffect, useState } from "react";
import { useConfigContext } from "../components/config_provider";
import Redirect from "../components/redirect";

const BlogPublished = require("../assets/json/blog_published.json");
Expand Down Expand Up @@ -63,9 +55,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
};

const BlogArticle = ({ blogElement }) => {
// @ts-ignore
const { language, setLanguage, darkMode, setDarkMode } = useConfigContext();
let lightModeActive = darkMode ? "lightMode" : ""
let lightModeActive = ""

const router = useRouter();
const { asPath } = useRouter();
Expand All @@ -91,8 +81,8 @@ const BlogArticle = ({ blogElement }) => {
const deployUrl = "https://davidquintr.github.io";
const pathProj = "/portfolio/";
const URL = `${deployUrl}${pathProj}${asPath}`;
const title = language == "es" ? blogElement?.title.es : blogElement?.title.eng
const description = language == "es" ? blogElement?.description.es : blogElement?.description.eng
const title = blogElement?.title.eng
const description = blogElement?.description.eng

return (
<>
Expand Down Expand Up @@ -136,9 +126,7 @@ const BlogArticle = ({ blogElement }) => {
></meta>
</Head>
<article className="article article-base extended">
<PageWrapper>
<Redirect href={`post/${blogElement?.url.eng}`} />
</PageWrapper>
</article>
</>
);
Expand Down
26 changes: 0 additions & 26 deletions pages/components/about_me.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions pages/components/alert_element.tsx

This file was deleted.

75 changes: 0 additions & 75 deletions pages/components/blog_item.tsx

This file was deleted.

98 changes: 0 additions & 98 deletions pages/components/config_provider.tsx

This file was deleted.

Loading

0 comments on commit f2b5d18

Please sign in to comment.