Skip to content

Commit 0be7b07

Browse files
authored
Merge pull request #15 from dannycolin/fix-caching
Explicitly pass page variable to the include_cached file
2 parents 2243db4 + 11fd396 commit 0be7b07

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

_includes/head.html

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
11
<head>
22
{%- assign title = site.title -%}
3-
{% if page.title %}
4-
{%- assign title = page.title -%}
3+
{% if include.page.title %}
4+
{%- assign title = include.page.title -%}
55
{%- endif -%}
66
{%- capture image %}{{ site.url }}/assets/img/banner.png{% endcapture -%}
7-
{% if page.image %}
8-
{% if page.ogtype == "profile" %}
9-
{%- capture image %}{{ site.url }}/assets/img/developers/{{ page.image }}{% endcapture -%}
7+
{% if include.page.image %}
8+
{% if include.page.ogtype == "profile" %}
9+
{%- capture image %}{{ site.url }}/assets/img/developers/{{ include.page.image }}{% endcapture -%}
1010
{% else %}
11-
{%- capture image %}{{ site.url }}{{ page.image }}{% endcapture %}
11+
{%- capture image %}{{ site.url }}{{ include.page.image }}{% endcapture %}
1212
{% endif %}
1313
{%- endif -%}
1414
{% assign description = site.description %}
15-
{% if page.content != "" %}
16-
{% assign description = page.content | markdownify | strip_html | normalize_whitespace | truncate: 145 %}
15+
{% if include.page.content != "" %}
16+
{% assign description = include.page.content | markdownify | strip_html | normalize_whitespace | truncate: 145 %}
1717
{% endif %}
18-
{% if page.intro %}
19-
{% assign description = page.intro %}
18+
{% if include.page.intro %}
19+
{% assign description = include.page.intro %}
2020
{% endif %}
21-
{% if page.ogtype == "profile" %}
22-
{% capture description %}{% if page.former %}Former {% endif %}{{ page.role }}{% endcapture %}
21+
{% if include.page.ogtype == "profile" %}
22+
{% capture description %}{% if include.page.former %}Former {% endif %}{{ include.page.role }}{% endcapture %}
2323
{% endif %}
24-
{%- capture canonical %}{{ site.url }}{{ page.url | replace:'index.html',''}}{% endcapture %}
25-
<title>{% if page.title != True %}{{ page.title }} - {% endif %}{{ site.title }}</title>
24+
{%- capture canonical %}{{ site.url }}{{ include.page.url | replace:'index.html',''}}{% endcapture %}
25+
<title>{% if include.page.title != True %}{{ include.page.title }} - {% endif %}{{ site.title }}</title>
2626
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
2727
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
2828
<meta name="keywords" content="bugzilla bug track tracking enterprise solution">
2929
<link rel="icon" href="/assets/favicon/favicon.ico" type="image/ico">
3030
<link rel="stylesheet" type="text/css" href="/assets/css/global.css">
3131
<link rel="stylesheet" type="text/css" href="/assets/css/addon.css">
3232
<script defer src="/assets/js/global.js"></script>
33-
{% for addon in page.addons %}
33+
{% for addon in include.page.addons %}
3434
{% case addon.type %}
3535
{% when 'js' %}
3636
<script defer src="{{ addon.link }}"></script>
3737
{% when 'css' %}
3838
<link defer rel="stylesheet" type="text/css" href="{{ addon.link }}" {% if addon.media %}media="{{ addon.media }}"{% endif %}>
3939
{% endcase %}
4040
{% endfor %}
41-
{% for meta in page.meta %}
41+
{% for meta in include.page.meta %}
4242
<{{ meta.type }} {{ meta.tags }}>
4343
{% endfor %}
4444
<link color="#9248c8" href="/assets/favicon/mask-icon.svg" rel="mask-icon">
4545
<meta property="og:site_name" content="{{ site.title }}">
4646
<meta property="og:title" content="{{ title }}">
4747
<meta property="og:description" content="{{ description }}" />
48-
<meta property="og:type" content="{% if page.ogtype %}{{ page.ogtype }}{% else %}website{% endif %}">
49-
{%- case page.ogtype -%}
48+
<meta property="og:type" content="{% if include.page.ogtype %}{{ include.page.ogtype }}{% else %}website{% endif %}">
49+
{%- case include.page.ogtype -%}
5050
{%- when "article" %}
51-
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
52-
{% for author in page.author -%}
51+
<meta property="article:published_time" content="{{ include.page.date | date_to_xmlschema }}">
52+
{% for author in include.page.author -%}
5353
<meta property="article:author" content="{{ site.url }}/developers/{{ author }}">
5454
{%- endfor %}
55-
{% for tag in page.tags -%}
55+
{% for tag in include.page.tags -%}
5656
<meta property="article:tag" content="{{ tag }}">
5757
{%- endfor %}
58-
<meta property="article:section" content="{{ page.categories | first }}">
58+
<meta property="article:section" content="{{ include.page.categories | first }}">
5959
{%- when "profile" %}
60-
<meta property="profile:first_name" content="{{ page.firstname }}">
61-
<meta property="profile:last_name" content="{{ page.lastname }}">
62-
<meta property="profile:username" content="{{ page.nickname }}">
60+
<meta property="profile:first_name" content="{{ include.page.firstname }}">
61+
<meta property="profile:last_name" content="{{ include.page.lastname }}">
62+
<meta property="profile:username" content="{{ include.page.nickname }}">
6363
{%- endcase %}
6464
<meta property="og:image" content="{{ image }}">
6565
<meta property="og:url" content="{{ canonical }}">
@@ -69,7 +69,7 @@
6969
<meta name="twitter:url" content="{{ canonical }}">
7070
<meta name="twitter:image" content="{{ image }}">
7171
<meta name="twitter:site" content="@bugzilla"/>
72-
<meta name="twitter:creator" content="{% if page.twitter %}{{ page.twitter }}{% else %}@bugzilla{% endif %}"/>
72+
<meta name="twitter:creator" content="{% if include.page.twitter %}{{ include.page.twitter }}{% else %}@bugzilla{% endif %}"/>
7373
<meta name="theme-color" content="#9248c8">
7474

7575
<link rel="canonical" href="{{ canonical }}">

_layouts/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
{% include_cached head.html %}
3+
{% include_cached head.html page=page %}
44
<body id="www-bugzilla-org" class="homepage">
55
{% include header.html %}
66
{% include socials.html %}

0 commit comments

Comments
 (0)