Closed ComplicatedPhenomenon closed 5 years ago
It looks like jQuery
link is invalid when online.
Can you change the jquery link to https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js
, you can find this link in your template file or your settings.
You can refer to this: https://github.com/MikeCoder/hexo-blog-encrypt/pull/73
Thanks for your response, I use the theme next and I've looked up its source directory tree, I have no idea of where this template file is.
Can you give me a link to your page?
Also I mean template file is /node_modules/hexo-blog-encrypt/template.html
, sorry for the misleading.
My original /node_modules/hexo-blog-encrypt/template.html
is as below
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</script>
</script> type="text/javascript">
</script>
<div id="hbe-security">
<div class="hbe-input-container">
<input type="password" class="hbe-form-control" id="pass" placeholder="{{message}}" />
<label for="pass">{{message}}</label>
<div class="bottom-line"></div>
</div>
</div>
<div id="decryptionError" style="display: none;">{{decryptionError}}</div>
<div id="noContentError" style="display: none;">{{noContentError}}</div>
<div id="encrypt-blog" style="display:none">
{{content}}
</div>
The link is already the latest one, seems no need to modify
I get you problem. In your post, the JQuery link is at the last, but the plugin call jQuery in the middle.
I don't know whether you customized template in your post, like https://github.com/MikeCoder/hexo-blog-encrypt#change-template. I don't find
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
in your post.
I recommend you to add a jquery link before blog-encrypt.js
.
The default one is:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="hbe-security">
<div class="hbe-input-container">
<input type="password" class="hbe-form-control" id="pass" placeholder="{{message}}" />
<label for="pass">{{message}}</label>
<div class="bottom-line"></div>
</div>
</div>
<div id="decryptionError" style="display: none;">{{decryptionError}}</div>
<div id="noContentError" style="display: none;">{{noContentError}}</div>
<div id="encrypt-blog" style="display:none">
{{content}}
</div>
It's wired, what I provide is indeed different from yours. But I didn't modify a thing of this plugin. Moreover, I also host this website on Gitlab, this problem appears too. on Gitlab, CI & CD is done automatically with .gitlab-ci.yml
.
image: node:11.5.0
cache:
paths:
- node_modules/
before_script:
- npm install hexo-cli -g
- test -e package.json && npm install
- hexo generate
pages:
script:
- hexo generate
artifacts:
paths:
- public
only:
- master
Sorry, I was supposed to give you https://complicatedphenomenon.github.io/2018/01/27/life at first.
Try adding <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
in https://github.com/theme-next/hexo-theme-next/blob/master/layout/_partials/head/head.swig. As
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
<meta name="theme-color" content="{{ theme.android_chrome_color }}"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
...
It may help.
The solution works, although I didn't make myself clear, you find the problem finally. Thanks 🍻
Actually, no... I don't know why your blog remove the jquery link generated by hexo-blog-encrypt
. But accroding to you, it works fine offline. So it's possible caused by CI or something between you and the website.
文章封面总是多出来一串字符
Expected Behavior
When I tested the site locally, it seems fine, the post shows up after I type in the password, yet there is no response when doing online test.
Actual Behavior
Steps to Reproduce the Problem
hexo clean && hexo g && hexo d
, didn't workhexo-blog-encrypt
and resinstall, didn't workSpecifications
(The version of the project, operating system, hardware etc.)