Fork me on GitHub

只在移动端网页内显示”Fork me on Github”

1.修改文件hexo博客根目录\themes\next\layout_layout.swig 找到如下代码块
1
2
3
4
<html class="{{ html_class | lower }}" lang="{{ config.language }}">
<head>
{% include '_partials/head.swig' %}
<title>{% block title %}{% endblock %}</title>
2.添加代码,结果如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<html class="{{ html_class | lower }}" lang="{{ config.language }}">
<head>
{% include '_partials/head.swig' %}
<title>{% block title %}{% endblock %}</title>
{% include '_third-party/analytics/index.swig' %}

<style>
.forkMeOnGithub{
display: none;
}
@media (min-width: 768px) {
.forkMeOnGithub{
display: inline;
}
}
</style>
</head>
3.最后在之前引用代码块上套上div加上class就行了,代码如下
1
2
3
<div class="forkMeOnGithub">
<a href="https://github.com/hannius"><img style="position........</a>
</div>
如果文章对您有用请随意打赏,谢谢支持!