summaryrefslogtreecommitdiff
path: root/themes/theme/layout/partials/head.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'themes/theme/layout/partials/head.ejs')
-rw-r--r--themes/theme/layout/partials/head.ejs73
1 files changed, 73 insertions, 0 deletions
diff --git a/themes/theme/layout/partials/head.ejs b/themes/theme/layout/partials/head.ejs
new file mode 100644
index 00000000..23265719
--- /dev/null
+++ b/themes/theme/layout/partials/head.ejs
@@ -0,0 +1,73 @@
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+<meta http-equiv="X-UA-Compatible" content="ie=edge">
+<% if(config.author){ %>
+ <meta name="author" content="<%- config.author %>">
+ <% } %>
+ <% if(config.subtitle){ %>
+ <meta name="subtitle" content="<%- config.subtitle %>">
+ <% } %>
+ <% if(config.description){ %>
+ <meta name="description" content="<%- config.description %>">
+ <% } %>
+ <% if(config.keywords){ %>
+ <meta name="keywords" content="<%- config.keywords %>">
+ <% } %>
+
+ <% var title=page.title; if (is_archive()){ title=__('Archive'); if (is_month()){ title
+ +=': ' + page.year + '/' + page.month; } else if (is_year()){ title +=': ' +
+ page.year; } } else if (is_category()){ title=__('Category') + ': ' + page.category;
+ } else if (is_tag()){ title=__('Tag') + ': ' + page.tag; } %>
+
+ <title>
+ <% if (title){ %>
+ <%= title %> | <% } %>
+ <%= config.title %>
+ </title>
+
+ <%# favicon %>
+ <% if (theme.favicon){ %>
+ <link rel="icon" href="<%- url_for(theme.favicon) %>">
+ <% } %>
+
+ <%# css list %>
+ <% if (theme.stylesheets !==undefined && theme.stylesheets.length>
+ 0) { %>
+ <!-- stylesheets list from _config.yml -->
+ <% theme.stylesheets.forEach(url=> { %>
+ <link rel="stylesheet" href="<%- url_for(url) %>">
+ <% }); %>
+ <% } %>
+
+ <%# font preload - critical slices %>
+ <link rel="preload" href="<%- url_for('/fonts/latin-base.woff2') %>" as="font" type="font/woff2" crossorigin>
+ <link rel="preload" href="<%- url_for('/fonts/cjk-common.woff2') %>" as="font" type="font/woff2" crossorigin>
+
+ <%# javascript list %>
+ <% if (theme.scripts !==undefined &&
+ theme.scripts.length> 0) { %>
+ <!-- scripts list from _config.yml -->
+ <% theme.scripts.forEach(url=> { %>
+ <script
+ src="<%- url_for(url) %>"></script>
+ <% }); %>
+ <% } %>
+
+ <%# mathjax support %>
+ <% if(theme.mathjax_enable){
+ %>
+ <script
+ src="https://polyfill.alicdn.com/polyfill.js?features=es6"></script>
+ <script
+ id="MathJax-script"
+ async
+ src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/mathjax/3.2.0/es5/tex-mml-chtml.js"></script>
+ <% } %>
+
+ <%# valine comment
+ support %>
+ <% if(theme.valine.enable){
+ %>
+ <script
+ src='https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/valine/1.4.16/Valine.min.js'></script>
+ <% } %> \ No newline at end of file