summaryrefslogtreecommitdiff
path: root/_layouts/page.html
blob: de6b7b2ecd8f132d5530e0a793f0461ecd32eb09 (plain)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
---
layout: base
---
{%- assign _page_mode = page.mode | default: layout.mode | default: site.data.variables.default.page.mode -%}
{%- assign _page_type = page.type | default: layout.type | default: site.data.variables.default.page.type -%}
{%- assign _article_header_type = page.article_header.type | default: layout.article_header.type -%}

{%- include snippets/assign.html
  target=layout.header source0=page.header -%}
{%- assign _header = __return -%}

{%- include snippets/assign.html
  target=layout.footer source0=page.footer -%}
{%- assign _footer = __return -%}

{%- include snippets/assign.html
  target=layout.lightbox source0=page.lightbox -%}
{%- assign _lightbox = __return -%}

{%- include snippets/assign.html
  target = site.data.variables.default.page.full_width
  source0=layout.full_width source1=page.full_width -%}
{%- assign _full_width = __return -%}

{%- include snippets/assign.html
  target = site.data.variables.default.page.comment
  source0=layout.comment source1=page.comment -%}
{%- assign _comment = __return -%}


{%- assign _article_header_excerpt_truncate = include.excerpt_truncate | default: 200 -%}

{%- if page.sidebar -%}
<div class="layout--page layout--page--sidebar clearfix js-page-root">
  <div class="page__mask d-print-none js-page-mask js-sidebar-hide"></div>
  <div class="page__viewport">
    <div class="page__actions d-print-none">
      <div class="button button--circle button--lg box-shadow-2 sidebar-button js-sidebar-show">
        <i class="fas fa-bars icon--show"></i>
      </div>
    </div>

    <div class="grid page__grid">

      <div class="page__sidebar d-print-none">
        {%- include sidebar/toc.html -%}
      </div>

{%- else -%}
<div class="layout--page js-page-root">
{%- endif -%}

    {%- assign _page_main_class = 'page__main js-page-main' -%}
    {%- if _page_mode == 'immersive' -%}
      {%- assign _page_main_class = _page_main_class | append: ' page__main--immersive' -%}
    {%- endif -%}
    {%- unless page.sidebar -%}
      {%- assign _page_main_class = _page_main_class | append: ' page__viewport' -%}
    {%- endunless -%}
    {%- if _footer == false -%}
      {%- assign _page_main_class = _page_main_class | append: ' hide-footer' -%}
    {%- endif -%}
    {%- if page.aside -%}
      {%- assign _page_main_class = _page_main_class | append: ' has-aside' -%}
    {%- elsif _full_width -%}
      {%- assign _page_main_class = _page_main_class | append: ' full-width' -%}
    {%- endif -%}
    <div class="{{ _page_main_class }} cell cell--auto">

      <div class="page__main-inner">
      {%- if _header != false -%}
        <div class="page__header d-print-none">
        {%- assign _header_theme = page.header.theme | default: layout.header.theme -%}
        {%- if _header_theme == 'dark'-%}
          {%- include header.html theme='dark' background=page.header.background -%}
        {%- elsif _header_theme == 'light' -%}
          {%- include header.html theme='light' background=page.header.background -%}
        {%- else -%}
          {%- include header.html -%}
        {%- endif -%}
        </div>
      {%- endif -%}


        <div class="page__content">
        {%- if _article_header_type == 'overlay' or _article_header_type == 'cover' -%}

          {%- if _article_header_type == 'overlay' -%}

            {%- assign _article_header_height = page.article_header.height | default: layout.article_header.height -%}
            {%- assign _article_header_align = page.article_header.align | default: layout.article_header.align | default: site.data.variables.default.page.article_header.align -%}
            {%- assign _article_header_theme = page.article_header.theme | default: layout.article_header.theme | default: site.data.variables.default.page.article_header.theme -%}

            {%- if page.article_header.background_image.src -%}
              {%- assign _header_background_image_src = page.article_header.background_image.src -%}
            {%- elsif page.article_header.background_image != false and page.cover -%}
              {%- assign _header_background_image_src = page.cover -%}
            {%- endif -%}

            {%- if page.article_header.background_image.gradient -%}
              {%- assign _header_background_image = page.article_header.background_image.gradient -%}
              {%- if _header_background_image_src -%}
                {%- assign _header_background_image = _header_background_image | append: ',' -%}
              {%- endif -%}
            {%- endif -%}

            {%- if _header_background_image_src -%}
              {%- include snippets/get-nav-url.html path=_header_background_image_src -%}
              {%- assign _header_background_image_src = __return -%}
              {%- assign _header_background_image = _header_background_image
                | append: 'url(' | append: _header_background_image_src  | append: ')'-%}
            {%- endif -%}

            {%- assign _header_style = 'background-image:' | append: _header_background_image | append: ';' -%}

            {%- if page.article_header.background_color -%}
              {%- assign _header_style = _header_style | append: 'background-color:' | append: page.article_header.background_color | append: ';' -%}
            {%- endif -%}

            {%- if _article_header_height -%}
              {%- assign _header_style = _header_style | append: 'min-height:' | append: _article_header_height | append: ';' -%}
            {%- endif -%}

            <div class="article__header--overlay">

            {%- if _article_header_theme == 'light' -%}
              {%- if _article_header_align == 'center' -%}
                <div class="hero hero--center hero--light overlay" style="{{ _header_style }}">
              {%- else -%}
                <div class="hero hero--light overlay" style="{{ _header_style }}">
              {%- endif -%}
            {%- elsif _article_header_theme == 'dark' -%}
              {%- if _article_header_align == 'center' -%}
                <div class="hero hero--center hero--dark overlay" style="{{ _header_style }}">
              {%- else -%}
                <div class="hero hero--dark overlay" style="{{ _header_style }}">
              {%- endif -%}
            {%- else -%}
              {%- if _article_header_align == 'center' -%}
                <div class="hero hero--center overlay" style="{{ _header_style }}">
              {%- else -%}
                <div class="hero overlay" style="{{ _header_style }}">
              {%- endif -%}
            {%- endif -%}
                <div class="hero__content">
                  {%- if _full_width == false -%}
                    <div class ="main">
                  {%- endif -%}
                    {%- include article-info.html article=page semantic=false -%}
                    {%- include article-header.html article=page semantic=false -%}
                    {%- if page.excerpt -%}
                      <p class="overlay__excerpt">{{ page.excerpt | strip_html | strip_newlines | strip | truncate: _article_header_excerpt_truncate }}</p>
                    {%- endif -%}
                    {%- if page.article_header.actions -%}
                      <ul class="menu">
                        {%- for _action in page.article_header.actions -%}
                          {%- include snippets/get-nav-url.html path=_action.url -%}
                          {%- assign _url = __return -%}
                          {%- assign _type = _action.type | default: 'info' -%}
                          <li><a class="button button--{{ _type }} button--rounded button--xl" href="{{ _url }}">{{ _action.text }}</a></li>
                        {%- endfor -%}
                      </ul>
                    {%- endif -%}
                  {%- if _full_width == false -%}
                    </div>
                  {%- endif -%}
                </div>
              </div>
            </div>
          {%- elsif _article_header_type == 'cover' -%}
            {%- if page.article_header.image.src -%}
              {%- include snippets/get-nav-url.html path=page.article_header.image.src -%}
              {%- assign _header_image_src = __return -%}
              <img class="article__header--cover" src="{{ _header_image_src }}"></img>
            {%- endif -%}
          {%- endif -%}

        {%- endif -%}


        {%- if _full_width == false -%}
          <div class ="main">
        {%- endif -%}
            <div class="grid grid--reverse">

              <div class="col-aside d-print-none js-col-aside">
                {%- if page.aside -%}
                  <aside class="page__aside js-page-aside">
                    {%- include aside/toc.html -%}
                  </aside>
                {%- endif -%}
              </div>

              <div class="col-main cell cell--auto">
                {%- include main/top/custom.html -%}
                {%- if _page_type == 'article' -%}
                  <article itemscope itemtype="http://schema.org/Article">
                {%- elsif _page_type == 'webpage' -%}
                  <article itemscope itemtype="http://schema.org/WebPage">
                {%- else -%}
                  <article>
                {%- endif -%}

                {%- if _article_header_type == 'overlay' or page.article_header == false -%}
                  {%- include article-header.html article=page html=false -%}
                  {%- include article-info.html article=page html=false -%}
                {%- else -%}
                  {%- include article-header.html article=page -%}
                  {%- include article-info.html article=page -%}
                {%- endif -%}

                    <div class="js-article-content">{{ content }}</div>
                    {%- if _comment != false -%}
                      <section class="page__comments d-print-none">{%- include comments.html -%}</section>
                    {%- endif -%}
                </article>
                {%- include main/bottom/custom.html -%}
              </div>
            </div>

        {%- if _full_width == false -%}
          </div>
        {%- endif -%}
        </div>

        {%- if _footer != false -%}
          <div class="page__footer d-print-none">{%- include footer.html -%}</div>
        {%- endif -%}
      </div>
    </div> {%- comment -%} end page__main {%- endcomment -%}
{%- if page.sidebar -%}
    </div> {%- comment -%} end grid {%- endcomment -%}
  </div> {%- comment -%} end page__viewport {%- endcomment -%}
{%- endif -%}

<script>{%- include scripts/lib/modal.js -%}</script>
{%- if _lightbox == true -%}
  <div class="modal d-print-none js-page-gallery-modal"><div class="gallery"></div></div>
{%- endif -%}
{%- if _header != false -%}
  <div class="modal modal--overflow page__search-modal d-print-none js-page-search-modal">{%- include search.html -%}</div>
{%- endif -%}
</div>


<script>
  {%- include scripts/lib/scroll-to.js -%}
  {%- include scripts/lib/affix.js -%}
  {%- include scripts/lib/toc.js -%}
  {%- if _lightbox == true -%}
    {%- include scripts/lib/gallery.js -%}
    {%- include scripts/components/lightbox.js -%}
  {%- endif -%}
  {%- include scripts/page.js -%}
</script>

{%- if page.sidebar -%}
<script>{%- include scripts/components/sidebar.js -%}</script>
{%- endif -%}

{%- if page.aside -%}
<script>
  /* toc must before affix, since affix need to konw toc' height. */
  {%- if page.aside.toc -%}{%- include scripts/aside/toc.js -%}{%- endif -%}
  {%- include scripts/aside/affix.js -%}
</script>
{%- endif -%}

{%- include markdown-enhancements.html -%}
{%- include pageview.html -%}