summaryrefslogtreecommitdiff
path: root/layouts/_default/baseof.html
blob: 2711fee7e62d4159731cca1cc485f27259d3040a (plain) (blame)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">

<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  {{ $title := .Title }}
  {{ if gt (len $title) 0 }}
  {{ $title = print $title " | " .Site.Title }}
  {{ else }}
  {{ $title = .Site.Title }}
  {{ end }}

  <title>{{ $title }}</title>

  {{ with .Site.Params.author }}
  <meta name="author" content="{{ . }}">{{ end }}
  <meta name="description" content="{{ .Description | default (.Summary | default .Site.Params.description ) }}">
  <meta name="keywords" content="{{ (delimit .Keywords " ,") | default .Site.Params.keywords }}">

  {{ template "_internal/twitter_cards.html" . }}
  {{ template "_internal/opengraph.html" . }}

  <link rel="stylesheet" href="/css/bootstrap.min.css" crossorigin="anonymous">
  <!-- Hux change font-awesome CDN to qiniu -->
  <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"
    type="text/css">

  {{ $options := (dict "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction) "includePaths" (slice
  "sass")) }}
  {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }}
  <link rel="stylesheet" href="{{ $style.Permalink }}">

  {{ range .Site.Params.custom_css -}}
  {{ $custom_template := resources.Get . }}
  {{ if $custom_template }}
  {{ $custom_style := $custom_template | resources.ToCSS | resources.Minify }}
  <link rel="stylesheet" href="{{ $custom_style.RelPermalink }}">
  {{ end }}
  {{ end }}
  <!-- custom js -->
  {{ range .Site.Params.custom_js -}}
  {{ $custom_template := resources.Get . }}
  {{ if $custom_template }}
  {{ $custom_js := $custom_template | resources.Minify | resources.Fingerprint }}
  <script defer src="{{ $custom_js.RelPermalink }}"></script>
  {{ end }}
  {{ end }}

</head>

<!-- hack iOS CSS :active style -->

<body ontouchstart="">

  {{ $header_img := .Param "header_img" }}
  {{ if .IsHome }}
  {{ $header_img = .Site.Params.img_home }}
  {{ else if eq .Kind "404" }}
  {{ $header_img = .Site.Params.img_404 }}
  {{ end }}
  {{ if $header_img }}
  {{ .Scratch.Set "header_img" $header_img }}
  {{ end }}

  {{ if and .IsPage (gt .WordCount 400 ) (.Params.toc) }}
  {{ .Scratch.Set "toc" true }}
  {{ end }}

  <!-- Nav -->
  {{ partial "nav.html" . }}
  {{ partial "search.html" . }}

  <!-- Page Header -->
  {{ partial "intro-header.html" . }}

  {{ block "main" . }}

  <!-- Main Content -->
  <div class="container">
    <div class="row">
      {{ if eq .Site.Params.sidebar.enable false }}

      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1
      postlist-container">
        {{ block "container" . }}{{ end }}
      </div>
      <!-- Sidebar Container -->
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1
      sidebar-container">
        <!-- Featured Tags -->
        {{ partial "featured-tags.html" }}
        <!-- Friends Blog -->
        {{ partial "friends.html" . }}
      </div>

      {{ else }}
      <!-- USE SIDEBAR -->
      <!-- PostList Container -->
      <div class="col-lg-8 col-lg-offset-1 col-md-8 col-md-offset-1 col-sm-12
      col-xs-12 postlist-container">
        {{ block "container" . }}{{ end }}
      </div>
      <!-- Sidebar Container -->
      <div class="col-lg-3 col-lg-offset-0 col-md-3 col-md-offset-0 col-sm-12
      col-xs-12 sidebar-container">

        <!-- Featured Tags -->
        {{ partial "featured-tags.html" . }}
        {{ partial "short-about.html" . }}
        <!-- Friends Blog -->
        {{ partial "friends.html" . }}

      </div>
      {{ end }}

    </div>
  </div>

  {{ end }}

  {{ partial "footer.html" . }}
</body>

</html>