reorganize file structure for firebase

This commit is contained in:
Raymond Wang 2022-10-25 11:54:07 -07:00
parent 972064a710
commit 0e48bf7c31
70 changed files with 527 additions and 523 deletions

View file

Before

Width:  |  Height:  |  Size: 492 B

After

Width:  |  Height:  |  Size: 492 B

View file

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View file

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View file

Before

Width:  |  Height:  |  Size: 275 KiB

After

Width:  |  Height:  |  Size: 275 KiB

View file

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View file

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View file

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View file

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View file

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

View file

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View file

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View file

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 115 KiB

View file

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 899 B

After

Width:  |  Height:  |  Size: 899 B

View file

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 897 B

View file

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 511 B

View file

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 509 B

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View file

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View file

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View file

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View file

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View file

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View file

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 361 KiB

View file

@ -11,6 +11,7 @@ interface Website {
jsfile: string; jsfile: string;
cssfile: string; cssfile: string;
themecolor: string; themecolor: string;
path?: string;
} }
const APP = express(); const APP = express();
@ -23,32 +24,33 @@ const WEBSITES = [
sitename: "index", sitename: "index",
title: "IEEE at UCSD", title: "IEEE at UCSD",
description: "", description: "",
jsfile: "js/index.js", jsfile: "assets/js/index.js",
cssfile: "css/styles.css", cssfile: "assets/css/styles.css",
themecolor: "", themecolor: "",
path: "/",
}, },
{ {
sitename: "events", sitename: "events",
title: "IEEE at UCSD", title: "IEEE at UCSD",
description: "", description: "",
jsfile: "js/events.js", jsfile: "assets/js/events.js",
cssfile: "css/styles.css", cssfile: "assets/css/styles.css",
themecolor: "", themecolor: "",
}, },
{ {
sitename: "projects", sitename: "projects",
title: "IEEE at UCSD", title: "IEEE at UCSD",
description: "", description: "",
jsfile: "js/projects.js", jsfile: "assets/js/projects.js",
cssfile: "css/styles.css", cssfile: "assets/css/styles.css",
themecolor: "", themecolor: "",
}, },
{ {
sitename: "committees", sitename: "committees",
title: "IEEE at UCSD", title: "IEEE at UCSD",
description: "", description: "",
jsfile: "js/committees.js", jsfile: "assets/js/committees.js",
cssfile: "css/styles.css", cssfile: "assets/css/styles.css",
themecolor: "", themecolor: "",
}, },
] as Website[]; ] as Website[];
@ -106,8 +108,19 @@ function generateFilePages() {
let site: Website; let site: Website;
for (site of WEBSITES) { for (site of WEBSITES) {
const html = generatePage(site.sitename); const html = generatePage(site.sitename);
fs.mkdirSync(
path.join(__dirname, "../public/", site.path ?? site.sitename),
{
recursive: true,
}
);
fs.writeFileSync( fs.writeFileSync(
path.join(__dirname, "../public/", `${site.sitename}.html`), path.join(
__dirname,
"../public/",
site.path ?? site.sitename,
"/index.html"
),
html html
); );
} }

View file

@ -2,10 +2,9 @@
<html lang="en"> <html lang="en">
<head> <head>
<link rel="stylesheet" type="text/css" href="assets/css/fonts.css" media="screen">
<link rel="stylesheet" type="text/css" href="css/fonts.css" media="screen">
<link rel="stylesheet" type="text/css" href="$CSSFILE" media="screen"> <link rel="stylesheet" type="text/css" href="$CSSFILE" media="screen">
<link rel="icon" href="img/favicon.ico" type="image/x-icon"> <link rel="icon" href="favicon.ico" type="image/x-icon">
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1"> <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1">
<meta name="description" content="$DESCRIPTION"> <meta name="description" content="$DESCRIPTION">
<meta name="theme-color" content="$THEMECOLOR"> <meta name="theme-color" content="$THEMECOLOR">

View file

@ -6,7 +6,7 @@ module.exports = {
entry: loadEntries("./src/public"), entry: loadEntries("./src/public"),
output: { output: {
path: path.resolve(__dirname, "build/public"), path: path.resolve(__dirname, "build/public"),
filename: "./js/[name].js", filename: "./assets/js/[name].js",
}, },
mode: "production", mode: "production",
module: { module: {
@ -32,19 +32,11 @@ module.exports = {
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
{ {
// Copy utility files // Copy non-ts, non-tsx files
from: "./src/util", from: "./src",
to: "../util", to: "../",
globOptions: { filter: (resourcePath) => {
ignore: ["**/*.ts", "**/*.tsx"], return !resourcePath.match(/\.(tsx|ts)?$/);
},
},
{
// Copy public files
from: "./src/public",
to: "./",
globOptions: {
ignore: ["**/*.ts", "**/*.tsx"],
}, },
}, },
], ],