-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
111 lines (107 loc) · 3.63 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Git上的免费的编程书籍</title>
<link id="bts-style-link" rel="stylesheet" href="assets/lib/bootswatch/paper/bootstrap.min.css">
<link id="code-style-link" rel="stylesheet" href="assets/lib/highlight/styles/github.css">
<style>
#book-list .book:hover {
box-shadow: 0 0 10px #999;
}
#book-list .book-title {
font-size: 18px;
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
#book-list p.book-description {
height: 6rem;
line-height: 2em;
overflow: hidden;
/*white-space: nowrap; -o-text-overflow: ellipsis; text-overflow: ellipsis;*/
}
</style>
<script src="/books.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-4" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">GIT Books</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-4">
<p class="navbar-text">Some books from any git repo</p>
</div>
</div>
</nav>
<div class="container">
<div class="jumbotron">
<h1>Hello, Books!</h1>
<p>free programming books ...</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
<!-- <div class="page-header">
<h1>Books<small>free programming books</small></h1>
</div> -->
<div id="book-list" class="row">
</div>
</div>
<div class="page-footer" style="margin: 25px 0;">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="info-box">
<div class="info-item">
Project <a href="https://github.com/git-books/git-books.github.io" target="_blank"><i class="fa fa-github" aria-hidden="true"></i> Git-books</a>
</div>
<div class="info-item">
Document site powered by <a href="https://github.com/inhere/md-site-reader" target="_blank"><i class="fa fa-github" aria-hidden="true"></i> inhere/md-site-reader</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end.page-footer -->
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<script src="/assets/lib/jquery-2.2.4.min.js"></script>
<script type="text/javascript">
$(function () {
let booksHtml = ''
$.each(books, function (index, book) {
// console.log(index, book)
booksHtml += `
<div class="book panel panel-default col-xs-6 col-sm-4 col-md-3">
<div class="panel-body">
<h4 class="book-title">
<a href="${book.url}" title="${book.name}">${book.name}</a>
</h4>
<p class="book-description">${book.description} ...</p>
<div class="clearfix">
<a href="${book.url}" class="btn btn-primary btn-sm pull-right">
Read <i class="glyphicon glyphicon-book" aria-hidden="true"></i>
</a>
</div>
</div>
</div>`
})
if (booksHtml) {
$('#book-list').html(booksHtml)
}
})
</script>
</body>
</html>