index.html.tmpl 5.0 KB
Newer Older
Y
Yu Yang 已提交
1
<!DOCTYPE html>
Y
Yu Yang 已提交
2
<html lang="{% if is_en %}en{%else%}zh-Hans{% endif %}">
Y
Yu Yang 已提交
3 4
<head>
    <meta charset="UTF-8">
Y
Yu Yang 已提交
5
    <title>{% if not is_en %}深度学习入门{%else%}Deep Learning 101{% endif %}</title>
Y
Yu Yang 已提交
6 7 8 9 10
    <link href="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://cdn.bootcss.com/tether/1.4.0/js/tether.js"></script>
    <script src="http://cdn.bootcss.com/jquery/3.1.0/jquery.slim.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
    <style>
Y
Yu Yang 已提交
11 12 13
* {
    font-family:"Roboto","Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
}
Y
Yu Yang 已提交
14
.left-panel {
Y
Yu Yang 已提交
15
    background: #E5E6EA;
Y
Yu Yang 已提交
16 17
}

Y
Yu Yang 已提交
18 19 20 21 22
.left-panel .card-block a.click_active {
    background-color: #597cf1;
    color: #fff;
}
 
Y
Yu Yang 已提交
23 24 25 26
.left-panel .card-header {
    background: #ecedee;
}

Y
Yu Yang 已提交
27
{% if not is_en %}
Y
Yu Yang 已提交
28
.left-panel .card-header a {
Y
Yu Yang 已提交
29 30 31 32 33 34
    font-size: 14px;
}
{% endif %}

.left-panel .card-block a:not(.click_active) {
    background: #e4e6e9;
Y
Yu Yang 已提交
35 36 37 38 39
}

.left-panel .card-block a {
    border-radius: 0px;
    font-size: 13px;
Y
Yu Yang 已提交
40
    color: #2F323A;
Y
Yu Yang 已提交
41 42 43 44 45
    padding-left: 40px;
    border: 1px solid rgba(0,0,0,.125);
}

.left-panel .card-block a.active_color {
Y
Yu Yang 已提交
46
    color:  rgb(70, 74, 76);
Y
Yu Yang 已提交
47 48 49
    font-weight: bolder;
}

Y
Yu Yang 已提交
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
.left-panel .list-group-item {
    -moz-box-align: center;
    align-items: center;
    display: flex;
    flex-flow: row wrap;
    margin-bottom: -1px;
    padding: 0.75rem 1.25rem;
    position: relative;
    color: #2f323a;
}

.navbar img {
    height: 90%;
    width: 90%;
}

   </style>
Y
Yu Yang 已提交
67 68 69 70 71 72 73 74
</head>
<body>
    <nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse">
        <a class="navbar-brand mr-auto" href="#">
            <img alt="PaddlePaddle" src="./.theme/PP_w.png">
        </a>
        <ul class="nav navbar-nav">
          <li class="nav-item">
Y
Yu Yang 已提交
75 76 77
            <a class="nav-link" href="http://paddlepaddle.org">
                {% if is_en %}Home{% else %}首页{% endif %}
            </a>
Y
Yu Yang 已提交
78
          </li>
Y
Yu Yang 已提交
79 80 81 82
          <li class="nav-item {% if not is_en %}active{% endif %}">
            <a class="nav-link" href="{% if is_en %}./index.html{% else %}#{%endif%}">
                {% if is_en %}中文{% else %}深度学习入门{% endif %}
            </a>
Y
Yu Yang 已提交
83
          </li>
Y
Yu Yang 已提交
84 85 86 87
          <li class="nav-item {% if is_en %}active{% endif %}">
            <a class="nav-link" href="{% if is_en %}#{% else %}./index.en.html{% endif %}">
                {% if is_en %}Deep Learning 101{% else %}English{% endif %}
            </a>
Y
Yu Yang 已提交
88 89 90 91 92 93 94 95 96 97 98 99 100 101
          </li>
          <li class="nav-item">
            <a class="nav-link" href="https://github.com/PaddlePaddle/book/">Fork on Github</a>
          </li>
        </ul>
    </nav>
    <div class="container-fluid">
        <div class="row">
            <div class="col-3 pl-1 pr-1 left-panel">
                <div id="accordion" role="tablist" aria-multiselectable="true">
                  <div class="card">
                    <div class="card-header" role="tab" id="headingOne">
                      <h5 class="mb-0">
                        <a aria-expanded="true" aria-controls="collapseOne">
Y
Yu Yang 已提交
102
                            {% if is_en %}Deep Learning 101<span class="sr-only">(current)</span>{% else %}深度学习入门{% endif %}
Y
Yu Yang 已提交
103 104 105 106 107 108 109
                        </a>
                      </h5>
                    </div>
                    <div id="collapseOne" class="rounded-0 collapse show" role="tabpanel" aria-labelledby="headingOne">
                      <div class="card-block pl-0 pr-0 pt-0 pb-0">
                        <div class="list-group ">
                          {% for chapter in chapters %}
Y
Yu Yang 已提交
110
                            <a href="{{ chapter.link }}" target="content_iframe" class="list-group-item list-group-item-action" style="border: 0px; border-bottom: 2px solid #dddfe3;">
Y
Yu Yang 已提交
111 112 113 114 115 116 117 118 119 120
                                {{ chapter.name }}
                            </a>
                          {% endfor %}
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
            </div>
            <div class="col">
121
                <iframe src="./01.fit_a_line/index{% if is_en %}.en{% endif %}.html" style="border: none; overflow-y : hidden" width="100%" height="100%" name="content_iframe" id="content_iframe">
Y
Yu Yang 已提交
122 123 124 125 126 127 128
                </iframe>
            </div>
        </div>
    </div>
    <script>
    $('#content_iframe').on('load', function(){
        $("#content_iframe").height(200)  // trick code to shrink iframe size
Y
Yu Yang 已提交
129 130 131
        var body = $('#content_iframe').contents().find("body")
        body.css("overflow-y", "hidden")
        $("#content_iframe").height(body.height()+20)
Y
Yu Yang 已提交
132 133 134 135
        var alllinks = $('#content_iframe').contents().find("a")
        for (var i =0; i<alllinks.length; ++i) {
            alllinks[i].setAttribute("target", "_blank")
        }
Y
Yu Yang 已提交
136
    });
Y
Yu Yang 已提交
137 138 139 140 141
    $(".list-group a").click(function(){ 
       $(".list-group a.click_active").removeClass("click_active"); 
       $(this).addClass("click_active"); 
    })
    $($(".list-group a")[0]).addClass("click_active") 
Y
Yu Yang 已提交
142 143 144
    </script>
</body>
</html>