Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEO Optimize #187

Merged
merged 5 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const passport = require('passport')
const auth = require('./auth/auth')
const session = require('express-session')
const cookieParser = require('cookie-parser')
const compression = require('compression')

const { UserModel } = require('./model/users')
const { BlogModel } = require('./model/blog')
Expand All @@ -33,6 +34,7 @@ app.use(express.json())
app.use(session({ secret: config.secret }))
app.use(passport.initialize())
app.use(passport.session())
app.use(compression())

app.use('/api', apiRoute)

Expand Down
102 changes: 102 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"dependencies": {
"body-passer": "^1.0.0",
"chai-http": "^4.3.0",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
"dotenv": "^16.0.2",
"ejs": "^3.1.8",
Expand Down
144 changes: 72 additions & 72 deletions views/admin.ejs
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin</title>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="/assets/favicon.png" />
<link rel="stylesheet" href="css/common.css" />
<link rel="stylesheet" href="css/navbar.css" />
<link rel="stylesheet" href="css/table.css" />
<link rel="stylesheet" href="css/data-row.css" />
<link rel="stylesheet" href="css/admin.css" />
<style>
#temp-container {
display: flex;
flex-direction: column;
justify-content: center;
}
</style>
<script>
var blogTableSelections = []
var usersTableSelections = []
var imagesTableSelections = []
</script>
<script defer src="js/dashboard.js"></script>
<script src="./js/navbar.js" defer async></script>
</head>
<body>
<%- include('./components/alert.ejs') %>
<%- include('./components/navbar.ejs') %>
<section id="dashboard-section">
<section class="dashboard-subsection">
<button
class="new-button"
type="button"
onclick="window.open('/api/edit/blog')"
>NEW</button>
<button id="delete-button-blog" type="button" onclick="deleteHandler('blog');">DELETE</button>
<h1>Blog</h1>
<hr/>
<%- include('./components/blog-table.ejs', { data: blog}) %>
</section>
<section class="dashboard-subsection">
<button
class="new-button"
type="button"
onclick="window.open('/api/edit/user')"
>NEW</button>
<button id="delete-button-users" type="button" onclick="deleteHandler('users');">DELETE</button>
<h1>Users</h1>
<hr/>
<div class="table-wrapper">
<%- include('./components/users-table.ejs', { data: users }) %>
</div>
</section>
<section class="dashboard-subsection">
<button
id="new-button-images"
class="new-button"
type="button"
onclick="window.open('/api/edit/image')"
> NEW
</button>
<button id="delete-button-images" type="button" onclick="deleteHandler('image');">DELETE</button>
<h1>Images</h1>
<hr/>
<div class="table-wrapper">
<%- include('./components/images-table.ejs', { data: images }) %>
</div>
</section>
</section>
<%- include('./components/footer.ejs') %>
</body>
<head>
<title>Admin</title>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="/assets/favicon.png" />
<link rel="stylesheet" href="css/common.css" />
<link rel="stylesheet" href="css/navbar.css" />
<link rel="stylesheet" href="css/table.css" />
<link rel="stylesheet" href="css/data-row.css" />
<link rel="stylesheet" href="css/admin.css" />
<style>
#temp-container {
display: flex;
flex-direction: column;
justify-content: center;
}
</style>
<script>
var blogTableSelections = []
var usersTableSelections = []
var imagesTableSelections = []
</script>
<script defer src="js/dashboard.js"></script>
<script src="./js/navbar.js" defer async></script>
</head>
<body>
<%- include('./components/alert.ejs') %>
<%- include('./components/navbar.ejs') %>
<section id="dashboard-section">
<section class="dashboard-subsection">
<button
class="new-button"
type="button"
onclick="window.open('/api/edit/blog')"
>NEW</button>
<button id="delete-button-blog" type="button" onclick="deleteHandler('blog');">DELETE</button>
<h1>Blog</h1>
<hr/>
<%- include('./components/blog-table.ejs', { data: blog}) %>
</section>
<section class="dashboard-subsection">
<button
class="new-button"
type="button"
onclick="window.open('/api/edit/user')"
>NEW</button>
<button id="delete-button-users" type="button" onclick="deleteHandler('users');">DELETE</button>
<h1>Users</h1>
<hr/>
<div class="table-wrapper">
<%- include('./components/users-table.ejs', { data: users }) %>
</div>
</section>
<section class="dashboard-subsection">
<button
id="new-button-images"
class="new-button"
type="button"
onclick="window.open('/api/edit/image')"
> NEW
</button>
<button id="delete-button-images" type="button" onclick="deleteHandler('image');">DELETE</button>
<h1>Images</h1>
<hr/>
<div class="table-wrapper">
<%- include('./components/images-table.ejs', { data: images }) %>
</div>
</section>
</section>
<%- include('./components/footer.ejs') %>
</body>
</html>
86 changes: 45 additions & 41 deletions views/article.ejs
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UF Open Source Club | <%= locals.title %></title>
<link rel="icon" type="image/x-icon" href="/assets/favicon.png" />
<link rel="stylesheet" href="/css/common.css" />
<link rel="stylesheet" href="/css/article.css" />
<script src="/js/navbar.js" defer async></script>
</head>
<body>
<%- include('./components/navbar.ejs') %>
<section id="article-section">
<% if (locals.previewImg) { %>
<div id="banner"><img src="<%= previewImg %>" alt="<%= title %>"></div>
<% } %>
<div id="article-content">
<h1 id="article-title"><%= title %></h1>
<div id="date-author">
<h3>Date: <%= date.toLocaleDateString('en-us', { month: "long", day: "numeric", year: "numeric" }) %></h3>
<% if (locals.author) { %>
<h3>Author: <% for(var i=0; i < author.length; i++) { %>
<%= author[i] %>
<% } %>
</h3>
<% } %>
</div>
<% if (locals.subtitle) { %>
<h2 id="article-subheading">
<%- subtitle %>
</h2>
<% } %>
<% if (locals.content) { %>
<p id="article-body">
<%- content %>
</p>
<% } %>
</div>
</section>
<%- include('./components/footer.ejs') %>
</body>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="keywords"
content="University of Florida, UF, OSC, Open Source,
Computer Science, Data Science, Programming"
>
<title>UF Open Source Club | <%= locals.title %></title>
<link rel="icon" type="image/x-icon" href="/assets/favicon.png" />
<link rel="stylesheet" href="/css/common.css" />
<link rel="stylesheet" href="/css/article.css" />
<script src="/js/navbar.js" defer async></script>
</head>
<body>
<%- include('./components/navbar.ejs') %>
<section id="article-section">
<% if (locals.previewImg) { %>
<div id="banner"><img src="<%= previewImg %>" alt="<%= title %>"></div>
<% } %>
<div id="article-content">
<h1 id="article-title"><%= title %></h1>
<div id="date-author">
<h3>Date: <%= date.toLocaleDateString('en-us', { month: "long", day: "numeric", year: "numeric" }) %></h3>
<% if (locals.author) { %>
<h3>Author: <% for(var i=0; i < author.length; i++) { %>
<%= author[i] %>
<% } %>
</h3>
<% } %>
</div>
<% if (locals.subtitle) { %>
<h2 id="article-subheading">
<%- subtitle %>
</h2>
<% } %>
<% if (locals.content) { %>
<p id="article-body">
<%- content %>
</p>
<% } %>
</div>
</section>
<%- include('./components/footer.ejs') %>
</body>
</html>
Loading