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

Optimize performance and SEO #8

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
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
50 changes: 50 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 @@ -20,6 +20,7 @@
},
"dependencies": {
"express": "^4.18.2",
"compression": "^1.7.4",
"sirv-cli": "^2.0.0",
"svelte-routing": "^1.11.0"
}
Expand Down
4 changes: 2 additions & 2 deletions public/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ h1.sparkle-heading {
}
}

h3 {
h2 {
color: var(--text);
font-family: 'Ubuntu', sans-serif;
font-weight: 500;
Expand All @@ -103,7 +103,7 @@ h3 {
cursor: pointer;
}

h3:hover {
h2:hover {
color: var(--primary);
}

Expand Down
13 changes: 9 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -19,9 +20,12 @@
<meta property="og:image:height" content="420">
<meta name="twitter:card" content="summary_large_image">

<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
<link rel='stylesheet' href='/build/bundle.css'>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />

<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
<link rel='stylesheet' href='/build/bundle.css'>

<script defer src='/build/bundle.js'></script>

Expand All @@ -38,4 +42,5 @@

<body>
</body>
</html>

</html>
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Allow: /
2 changes: 2 additions & 0 deletions server.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const express = require('express');
const compression = require('compression')
const path = require('path');
const app = express();

const PORT = process.env.PORT || 50985;

app.use(compression())
app.use(express.static(path.join(__dirname, 'public')));

app.get('*', (req, res) => {
Expand Down
10 changes: 5 additions & 5 deletions src/Category.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@

<main>
<div class="main-grid">
{#each websites as website}
{#each websites as website, website_index}
<button class="website-card" on:click={() => showOverlay(website)}>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<img src={website.image} alt={website.name} class="website-image"/>
<img src={website.image} alt={website.name} class="website-image" loading={website_index < 2 ? "eager" : "lazy"}/>
<div class="card-info">
<!-- svelte-ignore a11y-click-events-have-key-events -->
<h3>{website.name}</h3>
<h2>{website.name}</h2>
<div class="outbound-cont">
{#if website.code && website.code !== null}
<a href="{website.code}" target="_blank" class="outbound code-link" on:click|stopPropagation>
<a href="{website.code}" aria-label="{website.name} code" rel="ugc" target="_blank" class="outbound code-link" on:click|stopPropagation>
<svg width="30" height="29" viewBox="0 0 30 29" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="30" height="29" rx="3" fill="transparent"/>
<path d="M19 7L26 14L19 21" stroke="white"/>
Expand All @@ -80,7 +80,7 @@
{/if}


<a href="{website.url}" target="_blank" class="outbound" on:click|stopPropagation>
<a href="{website.url}" aria-label="{website.name} site" rel="ugc" target="_blank" class="outbound" on:click|stopPropagation>
<svg width="30" height="29" viewBox="0 0 30 29" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="30" height="29" rx="3" fill="transparent"/>
<path d="M10.454 7.36396H23.182V20.0919" stroke="white"/>
Expand Down
6 changes: 3 additions & 3 deletions src/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<div class="modal-overlay" on:click|stopPropagation={handleOverlayClick}>
<div class="modal">
<div class="card-info">
<h3><a href="{websiteUrl}" target="_blank">{websiteName}</a></h3>
<h2><a href="{websiteUrl}" rel="ugc" target="_blank">{websiteName}</a></h2>
<div class="modal-nav">

<svg on:click={prevModal} class="modal-nav-button" width="30" height="29" viewBox="0 0 30 29" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down Expand Up @@ -89,7 +89,7 @@

<!-- svelte-ignore missing-declaration -->
{#if websiteCode && websiteCode !== null}
<a href="{websiteCode}" target="_blank" class="outbound code-link">
<a href="{websiteCode}" rel="ugc" target="_blank" class="outbound code-link">
<span>Check Code</span>
<svg width="30" height="29" viewBox="0 0 30 29" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="30" height="29" rx="3" fill="transparent"/>
Expand All @@ -108,7 +108,7 @@
</a>
{/if}

<a href="{websiteUrl}" target="_blank" class="outbound">
<a href="{websiteUrl}" rel="ugc" target="_blank" class="outbound">
<span>Visit Site</span>
<svg width="30" height="29" viewBox="0 0 30 29" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="30" height="29" rx="3" fill="transparent"/>
Expand Down