Styling the Front Page
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
<!--views/home.tpl-->
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>{{data['blogTitle']}}</title>
    <script src="/static/scripts/jQuery.js"></script>
    <script src="/static/scripts/main.js"></script>
    <link href="/static/styles/main.css" rel="stylesheet"></link>
    <link href="/static/images/site_logo.png" rel="icon" ></link>
    <link href="/static/fonts/setup.css" rel="stylesheet"></link>
  </head>
  <body>
    <div id="site">
      <header id="blog-header">
        <div class="region">
          <a href="/"><img src="/static/images/site_logo.png"/></a>
          <a id="blog-title" href="/">{{data['blogTitle']}}</a>
          <a>
            <form class="search" action="/search" method="post">
              <input type="text"  placeholder="Search.." name="query" required>
              <button type="submit">ស្វែង​រក</button>
            </form>
          </a>
          <a id="log-in" href="#">ចូលក្នុងប្រព័ន្ធ</a>
        </div><!--region-->
      </header>
      <div id="header-border"></div>
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
/*static/css/main.css*/
a{
  text-decoration: none;
}
 
a:hover{
  color: rgb(35, 118, 226);
}
 
.region{
  max-width: 1100px;
  margin: 0 auto;
}
 
body{
  margin: 0;
  padding: 0;
  font: 14px/1.5 OdorMeanChey;
  background: lightgrey;
}
 
#blog-header{
  background: lavender;
  margin: 0;
  padding: 0;
}
 
#blog-header div{
  padding: 7px;
  display: grid;
  grid-template-columns: 40px auto auto auto;
  align-items: center;
}
 
#blog-header #blog-title{
  font: 30px/1.5 Moul;
}
 
#blog-header img{
  max-height: 40px;
}
 
#blog-header #log-in{
  text-align: right;
}
 
#blog-header form.search{
  display:grid;
  grid-template-columns: 75% 25%;
}
#blog-header form.search input[type=text] {
  padding: 7px 10px;
  box-sizing: border-box;
}
#blog-header form.search button {
  cursor: pointer;
  width:100%;
  font: 14px/1.5 OdorMeanChey;
}
#blog-header form.search button:hover {
  opacity:.6;
}
 
#header-border{
  background: rgb(190, 189, 189);
  height: 20px;
}
 
#main{
  display: grid;
  grid-template-columns: 20% calc(80% - 15px);
  grid-gap: 15px;
  margin-top: 15px;
}
 
@media only screen and (max-width: 600px){
  #blog-header div{
     
    grid-template-columns: 100%;
    text-align: center;
  }
 
  #blog-header form.search{
    padding: 10px;
  }
 
  #blog-header #log-in{
    text-align: center;
  }
 
  #main{
    grid-template-columns: 100%;
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
%include('./partials/header.tpl')
 
<style>
  #content{
    min-height: 350px;
    background: lavender;
    padding: 10px;
    box-sizing: border-box;
  }
</style>
 
<div id="main" class="main region">
 
  %include('./partials/sidebar.tpl')
 
  <section id="content" class="content">
    content
  </section><!--content-->
</div><!--main-->
 
%include('./partials/footer.tpl')
1
2
3
4
5
6
7
8
9
10
11
12
<style>
  #sidebar{
    min-height: 350px;
    background: lavender;
    padding: 10px;
    box-sizing: border-box;
  }
</style>
 
<section id="sidebar" class="sidebar">
  sidebar
</section><!--sidebar-->
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<style>
  .footer{
    min-height: 150px;
    background: lavender;
    padding: 10px;
    box-sizing: border-box;
    margin: 15px auto;
  }
</style>
 
      <footer class="footer region">
        footer
      </footer>
    </div><!--site-->
  </body>
</html>

GitHub: https://github.com/Sokhavuth/kwblog
Heroku: https://khmerweb-kwblog.herokuapp.com/