Skip to content

Commit

Permalink
Exclude static assets for Cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
noobnooc committed Jun 16, 2024
1 parent 1bd2491 commit b7e6296
Show file tree
Hide file tree
Showing 27 changed files with 47 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ next-env.d.ts

# Velite
.velite
public/static
public/static/posts
4 changes: 4 additions & 0 deletions _routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": 1,
"exclude": ["/static/*", "/favicon.ico", "/apple-icon.png", "/icon.png"]
}
6 changes: 3 additions & 3 deletions app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "../../styles/globals.css";

import { Metadata } from "next";
import Image from "next/image";
import avatar from "../../public/avatar.png";
import avatar from "../../public/static/avatar.png";
import Link from "next/link";
import { dictionaryKeys, getDictionary } from "../../dictionaries";

Expand Down Expand Up @@ -32,14 +32,14 @@ export async function generateMetadata({
title: dictionary.meta.websiteName,
description: dictionary.meta.motto,
siteName: dictionary.meta.websiteName,
images: "/banner.png",
images: "/static/banner.png",
},
twitter: {
title: dictionary.meta.websiteName,
description: dictionary.meta.motto,
site: "@noobnooc",
card: "summary_large_image",
images: "/banner.png",
images: "/static/banner.png",
},
alternates: {
languages: Object.fromEntries(langEntries),
Expand Down
4 changes: 2 additions & 2 deletions app/[lang]/posts/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export async function generateMetadata({
openGraph: {
title: post.title,
description: post.title,
images: "/banner.png",
images: "/static/banner.png",
},
twitter: {
title: post.title,
description: post.title,
site: "@noobnooc",
card: "summary_large_image",
images: "/banner.png",
images: "/static/banner.png",
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion components/profile-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Card from "./card";
import Image from "next/image";
import { ArrowPathRoundedSquareIcon } from "@heroicons/react/24/solid";
import avatar from "../public/avatar.png";
import avatar from "../public/static/avatar.png";
import FlippableCard from "./flippable-card";
import { useCallback, useState } from "react";
import classNames from "classnames";
Expand Down
34 changes: 17 additions & 17 deletions dictionaries/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ import {
SiX,
} from "@icons-pack/react-simple-icons";

import avatar from "../public/avatar.png";
import blankAvatar from "../public/avatars/blank.jpeg";
import jiaZombieAvatar from "../public/avatars/jiazombie.png";
import liunengAvatar from "../public/avatars/liuneng.jpg";
import pilotAvatar from "../public/avatars/pilot.jpg";
import gartnerAvatar from "../public/avatars/gartner.jpg";
import anonymousAvatar from "../public/avatars/anonymous.jpeg";
import xiaochengAvatar from "../public/avatars/xiaocheng.jpg";
import changefengAvatar from "../public/avatars/changfeng.jpg";
import yinAvatar from "../public/avatars/yin.jpg";
import kuiziAvatar from "../public/avatars/kuizi.jpeg";
import xiaoshuiAvatar from "../public/avatars/xiaoshui.jpg";
import avatar from "../public/static/avatar.png";
import blankAvatar from "../public/static/avatars/blank.jpeg";
import jiaZombieAvatar from "../public/static/avatars/jiazombie.png";
import liunengAvatar from "../public/static/avatars/liuneng.jpg";
import pilotAvatar from "../public/static/avatars/pilot.jpg";
import gartnerAvatar from "../public/static/avatars/gartner.jpg";
import anonymousAvatar from "../public/static/avatars/anonymous.jpeg";
import xiaochengAvatar from "../public/static/avatars/xiaocheng.jpg";
import changefengAvatar from "../public/static/avatars/changfeng.jpg";
import yinAvatar from "../public/static/avatars/yin.jpg";
import kuiziAvatar from "../public/static/avatars/kuizi.jpeg";
import xiaoshuiAvatar from "../public/static/avatars/xiaoshui.jpg";

import AssisChat from "../public/assischat.png";
import lofyee from "../public/lofyee.png";
import subnooc from "../public/subnooc.png";
import youminco from "../public/youminco.png";
import SparkMemosLogo from '../public/sparkmemos.webp';
import AssisChat from "../public/static/assischat.png";
import lofyee from "../public/static/lofyee.png";
import subnooc from "../public/static/subnooc.png";
import youminco from "../public/static/youminco.png";
import SparkMemosLogo from '../public/static/sparkmemos.webp';

const dictionary = {
meta: {
Expand Down
34 changes: 17 additions & 17 deletions dictionaries/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ import {
SiX,
} from "@icons-pack/react-simple-icons";

import avatar from "../public/avatar.png";
import blankAvatar from "../public/avatars/blank.jpeg";
import jiaZombieAvatar from "../public/avatars/jiazombie.png";
import liunengAvatar from "../public/avatars/liuneng.jpg";
import pilotAvatar from "../public/avatars/pilot.jpg";
import gartnerAvatar from "../public/avatars/gartner.jpg";
import anonymousAvatar from "../public/avatars/anonymous.jpeg";
import xiaochengAvatar from "../public/avatars/xiaocheng.jpg";
import changefengAvatar from "../public/avatars/changfeng.jpg";
import yinAvatar from "../public/avatars/yin.jpg";
import kuiziAvatar from "../public/avatars/kuizi.jpeg";
import xiaoshuiAvatar from "../public/avatars/xiaoshui.jpg";
import avatar from "../public/static/avatar.png";
import blankAvatar from "../public/static/avatars/blank.jpeg";
import jiaZombieAvatar from "../public/static/avatars/jiazombie.png";
import liunengAvatar from "../public/static/avatars/liuneng.jpg";
import pilotAvatar from "../public/static/avatars/pilot.jpg";
import gartnerAvatar from "../public/static/avatars/gartner.jpg";
import anonymousAvatar from "../public/static/avatars/anonymous.jpeg";
import xiaochengAvatar from "../public/static/avatars/xiaocheng.jpg";
import changefengAvatar from "../public/static/avatars/changfeng.jpg";
import yinAvatar from "../public/static/avatars/yin.jpg";
import kuiziAvatar from "../public/static/avatars/kuizi.jpeg";
import xiaoshuiAvatar from "../public/static/avatars/xiaoshui.jpg";

import AssisChat from "../public/assischat.png";
import lofyee from "../public/lofyee.png";
import subnooc from "../public/subnooc.png";
import youminco from "../public/youminco.png";
import SparkMemosLogo from '../public/sparkmemos.webp';
import AssisChat from "../public/static/assischat.png";
import lofyee from "../public/static/lofyee.png";
import subnooc from "../public/static/subnooc.png";
import youminco from "../public/static/youminco.png";
import SparkMemosLogo from '../public/static/sparkmemos.webp';

const dictionary = {
meta: {
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions velite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export default defineConfig({
root: "content",
output: {
data: ".velite",
assets: "public/static",
base: "/static/",
assets: "public/static/posts",
base: "/static/posts/",
name: "[name]-[hash:6].[ext]",
clean: true,
},
Expand Down

0 comments on commit b7e6296

Please sign in to comment.