100
templates/index.html
Normal file
100
templates/index.html
Normal file
@@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Next Book</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta property="og:title" content="Next Book" />
|
||||
<meta property="og:description" content="Suggestions for the next book to read from your Storygraph to-read pile" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="assets/css/normalize.css">
|
||||
<link rel="stylesheet" href="assets/css/skeleton.css">
|
||||
<style>
|
||||
header {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
main {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
}
|
||||
|
||||
.category {
|
||||
padding: 1rem;
|
||||
margin: 1rem;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
background-color: #f9f9f9;
|
||||
|
||||
display: grid;
|
||||
text-align: center;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: 47px 250px auto 40px;
|
||||
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.rating {
|
||||
font-weight: bold;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
main {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Next Book</h1>
|
||||
<p>Suggestions for the next book to read from your Storygraph to-read pile</p>
|
||||
</header>
|
||||
<div class="container">
|
||||
|
||||
<main>
|
||||
{{ $cat := "Fiction" }}
|
||||
{{ $book := index . $cat }}
|
||||
<div class="category" style="grid-column: span 3;">
|
||||
<h3>{{ $cat }}</h3>
|
||||
<a href="{{ $book.Link }}" target="_blank">
|
||||
<img src="{{ $book.Image }}" alt="{{ $book.Name }} cover" style="height: 250px;" />
|
||||
</a>
|
||||
<a href="{{ $book.Link }}" target="_blank">{{ $book.Name }}</a>
|
||||
<div class="rating">⭐ {{ $book.Rating }}</div>
|
||||
</div>
|
||||
{{ $cat := "Non-Fiction" }}
|
||||
{{ $book := index . $cat }}
|
||||
<div class="category" style="grid-column: span 3;">
|
||||
<h3>{{ $cat }}</h3>
|
||||
<a href="{{ $book.Link }}" target="_blank">
|
||||
<img src="{{ $book.Image }}" alt="{{ $book.Name }} cover" style="height: 250px;" />
|
||||
</a>
|
||||
<a href="{{ $book.Link }}" target="_blank">{{ $book.Name }}</a>
|
||||
<div class="rating">⭐ {{ $book.Rating }}</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{ range $cat, $book := .}}
|
||||
{{ if or (eq $cat "Fiction") (eq $cat "Non-Fiction") }}
|
||||
{{ continue }}
|
||||
{{ end }}
|
||||
<div class="category">
|
||||
<h3>{{ $cat }}</h3>
|
||||
<a href="{{ $book.Link }}" target="_blank">
|
||||
<img src="{{ $book.Image }}" alt="{{ $book.Name }} cover" style="height: 250px;" />
|
||||
</a>
|
||||
<a href="{{ $book.Link }}" target="_blank">{{ $book.Name }}</a>
|
||||
<div class="rating">⭐ {{ $book.Rating }}</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</main>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user