{% load static %}
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
      <style>
          .post { margin-bottom: 5px; }
      </style>
    <title>{% block title %}{% endblock %}--博客系统</title>
    {% block extra_head %}
    {% endblock %}
</head>
<body>
    <div class="container head">
      <!-- Content here -->
         <nav class="navbar navbar-expand-lg navbar-light bg-light">
          <a class="navbar-brand" href="/">首页</a>
          <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
                {% for cate in navs %}
                  <li class="nav-item">
                    <a class="nav-link" href="{% url 'category-list' cate.id %}">{{ cate.name }}</a>
                  </li>
                {% endfor %}

            </ul>
                <form class="form-inline" action='/search/' method='GET'>
                    <input class="form-control" type="search" name="keyword" placeholder="Search" aria-label="Search" value="{{ keyword }}">
                    <button class="btn btn-outline-success" type="submit">搜索</button>
                </form>
          </div>
        </nav>

        <div class="jumbotron">
          <h1 class="display-4">ZSK2000.net</h1>
          <p class="lead">基于Django的工程安全监测云平台</p>
        </div>
      </div>
    <div class="container main">
      <div class="row">
        <div class="col-9 post-list">
        {% block main %}
        {% endblock %}
        </div>
        <div class="col-3">
            {% block sidebar %}
                {% for sidebar in sidebars %}
                <div class="card sidebar">
                  <div class="card-body">
                    <h4 class="card-title">{{ sidebar.title }}</h4>
                    <p class="card-text">{{ sidebar.content_html }}</p>
                  </div>
                </div>
                {% endfor %}
            {% endblock %}

        </div>
      </div>
    </div>
    <footer class="footer">
        {% block footer %}
        <div class="container">
            <hr/>
            <nav class="nav category">
            {% for cate in categories %}
            <a href="{% url 'category-list' cate.id %}" class="nav-link">{{ cate.name }}</a>
            {% endfor %}
            </nav>
        </div>
        <div class="container power">
            <span class="text-muted">Power by Aiheehoo</span>
        </div>
        {% endblock %}
    </footer>


</body>
</html>