Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dulapahv committed Apr 11, 2024
2 parents 971d246 + 76f64d7 commit 9c6ecbe
Show file tree
Hide file tree
Showing 14 changed files with 379 additions and 293 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
Binary file added bun.lockb
Binary file not shown.
23 changes: 23 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const siteURL = 'https://dulapahv.dev';

module.exports = {
siteUrl: siteURL,
generateRobotsTxt: true,
exclude: ['/server-sitemap.xml'],
robotsTxtOptions: {
policies: [
{
userAgent: '*',
allow: '/',
disallow: [
'/_next',
'/server-sitemap.xml',
'/404',
'/500',
'/_offline',
],
},
],
additionalSitemaps: [`${siteURL}/server-sitemap.xml`],
},
};
15 changes: 15 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ const nextConfig = withPWA({
destination: 'https://dulapahv.notion.site/:slug*',
permanent: true,
},
{
source: '/404',
destination: '/',
permanent: true,
},
{
source: '/500',
destination: '/',
permanent: true,
},
{
source: '/_offline',
destination: '/',
permanent: true,
},
];
},
images: {
Expand Down
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,27 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"postbuild": "next-sitemap"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@marsidev/react-turnstile": "^0.5.3",
"@emotion/styled": "^11.11.5",
"@marsidev/react-turnstile": "^0.5.4",
"@nextui-org/react": "^2.2.10",
"@sentry/nextjs": "^7.108.0",
"@types/node": "^20.11.30",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"@sentry/nextjs": "^7.109.0",
"@types/node": "^20.12.7",
"@types/react": "^18.2.75",
"@types/react-dom": "^18.2.24",
"@vercel/speed-insights": "^1.0.10",
"autoprefixer": "^10.4.19",
"daisyui": "^4.9.0",
"eslint": "^8.57.0",
"daisyui": "^4.10.1",
"eslint": "^9.0.0",
"eslint-config-next": "^14.1.4",
"framer-motion": "^11.0.23",
"framer-motion": "^11.0.27",
"next": "^14.1.4",
"next-pwa": "^5.6.0",
"next-sitemap": "^4.2.3",
"next-themes": "^0.3.0",
"no-darkreader": "^1.0.3",
"postcss": "^8.4.38",
Expand All @@ -36,7 +38,7 @@
"react-icons": "^5.0.1",
"tailwindcss": "^3.4.3",
"tailwindcss-animation-delay": "^1.2.0",
"typescript": "^5.4.3"
"typescript": "^5.4.5"
},
"packageManager": "yarn@4.1.1"
}
15 changes: 14 additions & 1 deletion public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# *
User-agent: *
Disallow:
Allow: /
Disallow: /_next
Disallow: /server-sitemap.xml
Disallow: /404
Disallow: /500
Disallow: /_offline

# Host
Host: https://dulapahv.dev

# Sitemaps
Sitemap: https://dulapahv.dev/sitemap.xml
Sitemap: https://dulapahv.dev/server-sitemap.xml
4 changes: 4 additions & 0 deletions public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://dulapahv.dev</loc><lastmod>2024-04-11T00:23:26.208Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
5 changes: 5 additions & 0 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://dulapahv.dev/sitemap-0.xml</loc></sitemap>
<sitemap><loc>https://dulapahv.dev/server-sitemap.xml</loc></sitemap>
</sitemapindex>
2 changes: 1 addition & 1 deletion src/components/aboutme/AboutMe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const AboutMe = forwardRef((props, ref) => {
<section
className="flex flex-col overflow-hidden"
ref={aboutmeRef}
id="aboutme"
id="about"
>
<Floaties />
<div className="relative">
Expand Down
11 changes: 0 additions & 11 deletions src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
import { useEffect } from 'react';

import { Button, Link } from '@nextui-org/react';
import { useRouter } from 'next/router';
import { LuUnlink } from 'react-icons/lu';
import { TiHome } from 'react-icons/ti';

const Error404 = () => {
const router = useRouter();

useEffect(() => {
if (typeof window !== 'undefined' && window.location.pathname === '/404') {
router.replace('/');
}
}, [router]);

return (
<div className="flex h-screen flex-col items-center justify-center gap-y-8 p-4 sm:p-12">
<LuUnlink className="size-24 sm:size-32" />
Expand Down
8 changes: 0 additions & 8 deletions src/pages/500.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useEffect } from 'react';

import { Button } from '@nextui-org/react';
import { useRouter } from 'next/router';
import { LuServerOff } from 'react-icons/lu';
Expand All @@ -8,12 +6,6 @@ import { TbReload } from 'react-icons/tb';
const Error500 = () => {
const router = useRouter();

useEffect(() => {
if (typeof window !== 'undefined' && window.location.pathname === '/500') {
router.replace('/');
}
}, [router]);

return (
<div className="flex h-screen flex-col items-center justify-center gap-y-8 p-4 sm:p-12">
<LuServerOff className="size-24 sm:size-32" />
Expand Down
11 changes: 0 additions & 11 deletions src/pages/_offline.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useEffect } from 'react';

import { Button } from '@nextui-org/react';
import { useRouter } from 'next/router';
import { IoCloudOfflineOutline } from 'react-icons/io5';
Expand All @@ -8,15 +6,6 @@ import { TbReload } from 'react-icons/tb';
const ErrorOffline = () => {
const router = useRouter();

useEffect(() => {
if (
typeof window !== 'undefined' &&
window.location.pathname === '/_offline'
) {
router.replace('/');
}
}, [router]);

return (
<div className="flex h-screen flex-col items-center justify-center gap-y-8 p-4 sm:p-12">
<IoCloudOfflineOutline className="size-24 sm:size-32" />
Expand Down
43 changes: 43 additions & 0 deletions src/pages/server-sitemap.xml/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { GetServerSideProps } from 'next';
import { getServerSideSitemapLegacy, ISitemapField } from 'next-sitemap';

export const getServerSideProps: GetServerSideProps = async (ctx) => {
const fields: ISitemapField[] = [
{
loc: 'https://dulapahv.dev',
lastmod: new Date().toISOString(),
},
{
loc: 'https://dulapahv.dev/gistda',
lastmod: new Date().toISOString(),
},
{
loc: 'https://dulapahv.dev/notion',
lastmod: new Date().toISOString(),
},
{
loc: 'https://dulapahv.dev/#about',
lastmod: new Date().toISOString(),
},
{
loc: 'https://dulapahv.dev/#education',
lastmod: new Date().toISOString(),
},
{
loc: 'https://dulapahv.dev/#experience',
lastmod: new Date().toISOString(),
},
{
loc: 'https://dulapahv.dev/#skill',
lastmod: new Date().toISOString(),
},
{
loc: 'https://dulapahv.dev/#project',
lastmod: new Date().toISOString(),
},
];

return getServerSideSitemapLegacy(ctx, fields);
};

export default function ServerSitemap() {}
Loading

0 comments on commit 9c6ecbe

Please sign in to comment.