Skip to content

Commit 82a45f4

Browse files
8enSmithBen Smith
and
Ben Smith
authored
feat: add favicons (#9)
* feat: add favicons * fix: update robots.txt so site can be crawled * fix: remove redundant prop * refactor: change favicon code * fix: remove redundant code --------- Co-authored-by: Ben Smith <[email protected]>
1 parent 4a9a20e commit 82a45f4

24 files changed

+28
-12
lines changed

frontend/index.html

+20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4+
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="favicons/apple-touch-icon-57x57.png" />
5+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="favicons/apple-touch-icon-114x114.png" />
6+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="favicons/apple-touch-icon-72x72.png" />
7+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="favicons/apple-touch-icon-144x144.png" />
8+
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="favicons/apple-touch-icon-60x60.png" />
9+
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="favicons/apple-touch-icon-120x120.png" />
10+
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="favicons/apple-touch-icon-76x76.png" />
11+
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="favicons/apple-touch-icon-152x152.png" />
12+
<link rel="icon" type="image/png" href="favicons/favicon-196x196.png" sizes="196x196" />
13+
<link rel="icon" type="image/png" href="favicons/favicon-96x96.png" sizes="96x96" />
14+
<link rel="icon" type="image/png" href="favicons/favicon-32x32.png" sizes="32x32" />
15+
<link rel="icon" type="image/png" href="favicons/favicon-16x16.png" sizes="16x16" />
16+
<link rel="icon" type="image/png" href="favicons/favicon-128.png" sizes="128x128" />
17+
<meta name="application-name" content="&nbsp;"/>
18+
<meta name="msapplication-TileColor" content="#FFFFFF" />
19+
<meta name="msapplication-TileImage" content="favicons/mstile-144x144.png" />
20+
<meta name="msapplication-square70x70logo" content="favicons/mstile-70x70.png" />
21+
<meta name="msapplication-square150x150logo" content="favicons/mstile-150x150.png" />
22+
<meta name="msapplication-wide310x150logo" content="favicons/mstile-310x150.png" />
23+
<meta name="msapplication-square310x310logo" content="favicons/mstile-310x310.png" />
424
<meta name="description" content="Book-Tok is a TikTok style interface for exploring random Open Library books. It displays a books cover, title and author. It also allows you to find out more about the book." />
525
<meta charset="UTF-8" />
626
<meta name="apple-mobile-web-app-title" content="Book-Tok" />
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
25.8 KB
Loading
699 Bytes
Loading
51.5 KB
Loading
2.26 KB
Loading
16.1 KB
Loading

frontend/public/favicons/favicon.ico

33.7 KB
Binary file not shown.
31.6 KB
Loading
83.4 KB
Loading
199 KB
Loading
259 KB
Loading
25.8 KB
Loading

frontend/public/manifest.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
2-
"short_name": "Book-Tok",
3-
"name": "Book-Tok",
4-
"icons": [],
5-
"start_url": ".",
6-
"display": "standalone",
7-
"theme_color": "#000000",
8-
"background_color": "#ffffff"
2+
"short_name": "Book-Tok",
3+
"name": "Book-Tok",
4+
"start_url": ".",
5+
"display": "standalone",
6+
"theme_color": "#000000",
7+
"background_color": "#ffffff"
98
}

frontend/public/robots.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
User-Agent: *
2-
Allow: /index.html
3-
Disallow: /
2+
Allow: /index.html

frontend/src/hooks/useBookCovers.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export interface Book {
99
coverId: number
1010
coverUrl: string
1111
description?: string
12-
olid?: string
1312
covers: string[] // Array of all edition IDs for the book
1413
}
1514

@@ -121,7 +120,6 @@ export function useBookCovers() {
121120
coverId,
122121
coverUrl,
123122
description: undefined, // Will be populated later
124-
olid: book.edition_key ? book.edition_key[0] : undefined,
125123
covers: [], // Will be populated later with edition IDs
126124
}
127125
})
@@ -161,7 +159,7 @@ export function useBookCovers() {
161159
const enhancedBooks = booksWithoutDescriptions.map((book, index) => ({
162160
...book,
163161
description: descriptions[index],
164-
covers: allCoverIds[index].map(id => id.toString()),
162+
covers: allCoverIds[index].filter(id => id > 0).map(id => id.toString()),
165163
}))
166164

167165
console.log('Enhanced books:', enhancedBooks)

image.png

-736 Bytes
Loading

0 commit comments

Comments
 (0)