Skip to content

Commit

Permalink
update code structure
Browse files Browse the repository at this point in the history
  • Loading branch information
EryouHao committed Dec 24, 2019
1 parent 690316f commit a703aff
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 9 deletions.
14 changes: 14 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@
"card": "color",
"note": "颜色字符串:(如:#EEEEEE、rgba(255, 255, 255, 0.9))"
},
{
"name": "renderKaTeX",
"label": "是否渲染 KaTeX 公式",
"group": "渲染",
"value": false,
"type": "switch"
},
{
"name": "renderCode",
"label": "是否渲染代码高亮",
"group": "渲染",
"value": false,
"type": "switch"
},
{
"name": "github",
"label": "Github",
Expand Down
6 changes: 1 addition & 5 deletions templates/_blocks/head.ejs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<meta charset="utf-8" >

<title><%= siteTitle %></title>
<meta name="description" content="<%= themeConfig.siteDescription %>">

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<link rel="shortcut icon" href="<%= themeConfig.domain %>/favicon.ico?v=<%= site.utils.now %>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css">
<link rel="stylesheet" href="<%= themeConfig.domain %>/styles/main.css">

<% if (typeof commentSetting !== 'undefined' && commentSetting.showComment) { %>
Expand All @@ -20,10 +18,8 @@
<% } %>
<% } %>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>

<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<% if (site.customConfig.ga) { %>
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= site.customConfig.ga %>"></script>
Expand Down
10 changes: 7 additions & 3 deletions templates/_blocks/scripts.ejs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>

<script type="application/javascript">
AOS.init();
hljs.initHighlightingOnLoad()
var app = new Vue({
el: '#app',
data: {
Expand All @@ -15,6 +12,13 @@ var app = new Vue({
</script>

<% if (site.customConfig.renderCode) { %>
<script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
<script>
hljs.initHighlightingOnLoad()
</script>
<% } %>

<% if (typeof commentSetting !== 'undefined' && commentSetting.showComment) { %>
<% if (commentSetting.commentPlatform === 'gitalk') { %>
Expand Down
1 change: 1 addition & 0 deletions templates/archives.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<%- include('./_blocks/head', { siteTitle: `文章归档 | ${themeConfig.siteName}` }) %>
<meta name="description" content="<%= themeConfig.siteDescription %>">
</head>
<body>
<div id="app" class="main">
Expand Down
4 changes: 4 additions & 0 deletions templates/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<html>
<head>
<%- include('./_blocks/head', { siteTitle: themeConfig.siteName }) %>
<meta name="description" content="<%= themeConfig.siteDescription %>">
<% if (site.customConfig.renderKaTeX) { %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css">
<% } %>
</head>
<body>
<div id="app" class="main">
Expand Down
4 changes: 3 additions & 1 deletion templates/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<html>
<head>
<%- include('./_blocks/head', { siteTitle: `${post.title} | ${themeConfig.siteName}` }) %>
<meta name="description" content="<%- post.description %>" />
<meta name="keywords" content="<%- post.tags.map(tag => tag.name).join(',') %>" />
</head>
<body>
<div id="app" class="main">
Expand All @@ -17,7 +19,7 @@
<div class="feature-container" style="background-image: url('<%= post.feature %>')">
</div>
<% } %>
<div class="post-content">
<div class="post-content" v-pre>
<%- post.content %>
</div>
<% if (post.tags.length > 0) { %>
Expand Down
1 change: 1 addition & 0 deletions templates/tag.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<%- include('./_blocks/head', { siteTitle: `${tag.name} | ${themeConfig.siteName}` }) %>
<meta name="description" content="<%= themeConfig.siteDescription %>">
</head>
<body>
<div id="app" class="main">
Expand Down
1 change: 1 addition & 0 deletions templates/tags.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<%- include('./_blocks/head', { siteTitle: `标签列表 | ${themeConfig.siteName}` }) %>
<meta name="description" content="<%= themeConfig.siteDescription %>">
</head>
<body>
<div id="app" class="main">
Expand Down

0 comments on commit a703aff

Please sign in to comment.