|
| 1 | +<head> |
| 2 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 3 | + <meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7"> |
| 4 | + <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#1b1b1e"> |
| 5 | + <meta name="mobile-web-app-capable" content="yes"> |
| 6 | + <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> |
| 7 | + <meta |
| 8 | + name="viewport" |
| 9 | + content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover" |
| 10 | + > |
| 11 | + |
| 12 | + {%- capture seo_tags -%} |
| 13 | + {% seo title=false %} |
| 14 | + {%- endcapture -%} |
| 15 | + |
| 16 | + <!-- Setup Open Graph image --> |
| 17 | + |
| 18 | + {% if page.image %} |
| 19 | + {% assign src = page.image.path | default: page.image %} |
| 20 | + |
| 21 | + {% unless src contains '://' %} |
| 22 | + {%- capture img_url -%} |
| 23 | + {% include media-url.html src=src subpath=page.media_subpath absolute=true %} |
| 24 | + {%- endcapture -%} |
| 25 | + |
| 26 | + {%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%} |
| 27 | + {%- capture new_url -%}{{ img_url }}{%- endcapture -%} |
| 28 | + |
| 29 | + {% assign seo_tags = seo_tags | replace: old_url, new_url %} |
| 30 | + {% endunless %} |
| 31 | + |
| 32 | + {% elsif site.social_preview_image %} |
| 33 | + {%- capture img_url -%} |
| 34 | + {% include media-url.html src=site.social_preview_image absolute=true %} |
| 35 | + {%- endcapture -%} |
| 36 | + |
| 37 | + {%- capture og_image -%} |
| 38 | + <meta property="og:image" content="{{ img_url }}" /> |
| 39 | + {%- endcapture -%} |
| 40 | + |
| 41 | + {%- capture twitter_image -%} |
| 42 | + <meta name="twitter:card" content="summary_large_image" /> |
| 43 | + <meta property="twitter:image" content="{{ img_url }}" /> |
| 44 | + {%- endcapture -%} |
| 45 | + |
| 46 | + {% assign old_meta_clip = '<meta name="twitter:card" content="summary" />' %} |
| 47 | + {% assign new_meta_clip = og_image | append: twitter_image %} |
| 48 | + {% assign seo_tags = seo_tags | replace: old_meta_clip, new_meta_clip %} |
| 49 | + {% endif %} |
| 50 | + |
| 51 | + {{ seo_tags }} |
| 52 | + |
| 53 | + <title> |
| 54 | + {%- unless page.layout == 'home' -%} |
| 55 | + {{ page.title | append: ' | ' }} |
| 56 | + {%- endunless -%} |
| 57 | + {{ site.title }} |
| 58 | + </title> |
| 59 | + |
| 60 | + {% include_cached favicons.html %} |
| 61 | + |
| 62 | + <!-- Resource Hints --> |
| 63 | + {% unless site.assets.self_host.enabled %} |
| 64 | + {% for hint in site.data.origin.cors.resource_hints %} |
| 65 | + {% for link in hint.links %} |
| 66 | + <link rel="{{ link.rel }}" href="{{ hint.url }}" {{ link.opts | join: ' ' }}> |
| 67 | + {% endfor %} |
| 68 | + {% endfor %} |
| 69 | + {% endunless %} |
| 70 | + |
| 71 | + <!-- Bootstrap --> |
| 72 | + {% unless jekyll.environment == 'production' %} |
| 73 | + <link rel=" stylesheet" href=" https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" > |
| 74 | + {% endunless %} |
| 75 | + |
| 76 | + <!-- Theme style --> |
| 77 | + <link rel="stylesheet" href="{{ '/assets/css/:THEME.css' | replace: ':THEME', site.theme | relative_url }}"> |
| 78 | + |
| 79 | + <!-- Web Font --> |
| 80 | + <link rel="stylesheet" href="{{ site.data.origin[type].webfonts | relative_url }}"> |
| 81 | + |
| 82 | + <!-- Font Awesome Icons --> |
| 83 | + <link rel="stylesheet" href="{{ site.data.origin[type].fontawesome.css | relative_url }}"> |
| 84 | + |
| 85 | + <!-- 3rd-party Dependencies --> |
| 86 | + |
| 87 | + {% if site.toc and page.toc %} |
| 88 | + <link rel="stylesheet" href="{{ site.data.origin[type].toc.css | relative_url }}"> |
| 89 | + {% endif %} |
| 90 | + |
| 91 | + {% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %} |
| 92 | + <link rel="stylesheet" href="{{ site.data.origin[type]['lazy-polyfill'].css | relative_url }}"> |
| 93 | + {% endif %} |
| 94 | + |
| 95 | + {% if page.layout == 'page' or page.layout == 'post' %} |
| 96 | + <!-- Image Popup --> |
| 97 | + <link rel="stylesheet" href="{{ site.data.origin[type].glightbox.css | relative_url }}"> |
| 98 | + {% endif %} |
| 99 | + |
| 100 | + <!-- Scripts --> |
| 101 | + |
| 102 | + {% unless site.theme_mode %} |
| 103 | + <script src="{{ '/assets/js/dist/theme.min.js' | relative_url }}"></script> |
| 104 | + {% endunless %} |
| 105 | + |
| 106 | + {% include js-selector.html lang=lang %} |
| 107 | + |
| 108 | + {% if jekyll.environment == 'production' %} |
| 109 | + <!-- PWA --> |
| 110 | + {% if site.pwa.enabled %} |
| 111 | + <script |
| 112 | + defer |
| 113 | + src="{{ '/app.min.js' | relative_url }}?baseurl={{ site.baseurl | default: '' }}®ister={{ site.pwa.cache.enabled }}" |
| 114 | + ></script> |
| 115 | + {% endif %} |
| 116 | + |
| 117 | + <!-- Web Analytics --> |
| 118 | + {% for analytics in site.analytics %} |
| 119 | + {% capture str %}{{ analytics }}{% endcapture %} |
| 120 | + {% assign platform = str | split: '{' | first %} |
| 121 | + {% if site.analytics[platform].id and site.analytics[platform].id != empty %} |
| 122 | + {% include analytics/{{ platform }}.html %} |
| 123 | + {% endif %} |
| 124 | + {% endfor %} |
| 125 | + {% endif %} |
| 126 | + |
| 127 | + {% include metadata-hook.html %} |
| 128 | + <link rel="stylesheet" href="{% link assets/main.css %}"> |
| 129 | +</head> |
0 commit comments