无名轻博客修改笔记
加入dns预解析提升访问速度
网站的加载顺序都是从head开始 那么我们直接把dns预解析的代码放在头部即可,当然其他位置你也可以测试。
<!--dns预解析自动代码-->
<meta http-equiv="x-dns-prefetch-control" content="on">
<!--手动dns预解析-->
<link rel="dns-prefetch" href="//www.nmssb.cn/" />
<link rel="dns-prefetch" href="https://pan.nmssb.cn">
<link rel="dns-prefetch" href="//www.nmsbb.com/" />
手动设置需要dns预解析的网站域名,最好是你站点使用域名,如:图床域名,静态资源域名等。手动设置代码。
请把以上代码中的 https://pan.nmssb.cn
和 //www.nmssb.cn
//www.nmsbb.com
改为你站点用到的域名即可,有用到的域名你都可以加上,不限制代码为三个,如果你有10个域名,link标签你弄十个即可,但是rel=后面必须要dns-prefetch才有效,还是少用这个代码,原因百度吧。
限制摘要高度
<div style="height: 412px;overflow: hidden;"><center><img src="/assets/file/aa.webp" style="max-width:100%;"></center></div>
图集代码
<style type="text/css">
.layui-col-space15>* {
padding: 7.5px;
}
.layui-col-space15 {
margin: -7.5px;
}
.zhiche {
height: 205px;
}
@media screen and (min-width: 992px){
.layui-col-md6 {
width: 50%;
float: left;
position: relative;
display: block;
box-sizing: border-box;
}
}
@media screen and (max-width:650px){
.zhiche {
height: auto;
}
}
</style>
<div class="layui-bg-gray" style="padding: 10px 0px;">
<div class="layui-row layui-col-space15">
<div class="layui-col-md6">
<a href="/assets/file/2022/05/2022052102.webp" data-fancybox="gallery"><img src="/assets/file/2022/05/2022052102.webp" style="width: 100%;"></a>
</div>
<div class="layui-col-md6">
<a href="/assets/file/2022/05/2022052101.webp" data-fancybox="gallery"><img src="/assets/file/2022/05/2022052101.webp" class="zhiche"></a>
</div>
</div>
</div>
在线查看PDF文件
<a href="pdf/web/viewer.html?file=/assets/file/2022/01/创维光电一体常见问题及解决办法.pdf" target="_blank"><strong>创维光电一体常见问题及解决办法.pdf</strong></a>
在线查看Word、xlsx、PPT文件
<a href="/play.html?v=44.mp4" target="_blank">观看视频</a>
https://view.officeapps.live.com/op/embed.aspx?src=//linji.cn/123.doc&wdAccPdf=1
https://view.officeapps.live.com/op/embed.aspx?src=//linji.cn/123.doc&wdEmbedFS=1
https://view.officeapps.live.com/op/view.aspx?src=//linji.cn/123.doc
<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=//linji.org/assets/file/2020/02/1237469564_2386e534.doc&wdStartOn=1" width="100%" height="1030px" frameborder="0">这是嵌入 <a target="_blank" href="https://office.com" rel="noopener noreferrer">Microsoft Office</a> 文档,由 <a target="_blank" href="https://office.com/webapps" rel="noopener noreferrer">Office Online</a> 支持。</iframe>
段落缩进两格
<div style="font-family: 'Microsoft YaHei'; line-height:30px;">
<p>
</p>
<p style="text-indent:40px;">
内容
</p>
<br>
<p style="text-align: right;">
<br>
</p></div>
页首导航栏:设置----导航菜单
<li><a href="@index">首页</a></li>
一、下载模板样式
<div style="clear: both; border-left: 0pt solid rgb(214, 192, 148); width: 100%;"><div style="background-color: rgb(230, 238, 247); border-bottom: 1px dashed rgb(64, 138, 183) ! important; color: rgb(63, 103, 165); font-weight: bold; padding: 5px;"><i class="fas fa-download"></i> 下载文件 </div><div style="border-color: -moz-use-text-color rgb(230, 238, 247) rgb(230, 238, 247); border-style: none solid solid; border-width: 0pt 1px 1px; color: #E6EEF7; padding: 10px;"><a target="_blank" href="assets/file/2020/02/lin1.doc" style="">林继-自我总结.doc</a></div></div>
二、视频播放
直接播放
play.html?v=beijing/video/DSCF7489.mp4
调用ckplayer播放视频
<script type="text/javascript" src="assets/js/ckplayer/ckplayer.js"></script>
<div class="video" style="width: 100%;height: 529px;"></div>
<script type="text/javascript">
var videoObject = {
container: '.video',//“#”代表容器的ID,“.”或“”代表容器的class
variable: 'player',//该属性必需设置,值等于下面的new chplayer()的对象
poster:'',//封面图片
video:'//linji.cn/assets/file/2020/02/20130816_111444.flv'//视频地址
};
var player=new ckplayer(videoObject);
</script>
ckplayer去掉/修改右上角logo(位置)
在查阅该文之前需要了解的内容如下:
[配置文件]ckplayer.js文件功能说明
[配置文件]ckplayer.xml文件功能说明
配置功能介绍
ckplayer.js中搜索:logo(ckplayer.xml中搜索<logo>)
去掉的方法是修改成logo:'null'(ckplayer.xml中修改成<logo>null</logo>)
调用内置播放器
<iframe width="100%" height="529px" src="assets/file/2020/02/20130816_111444.mp4" frameborder="0" 'allowfullscreen'=""></iframe>
三、相册功能
<div id="gallery-1" class="gallery">
<dl class="gallery-item">
<dt class="gallery-icon landscape">
<a href="assets/file/2020/02/image_241.webp" data-fancybox="gallery"><img src="assets/file/2020/02/image_241.webp" style="max-width:100%;">
</a></dt></dl>
<br style="clear: both">
</div>
<style type="text/css">
#gallery-1 {
margin: auto;
}
#gallery-1 .gallery-item {
float: left;
margin-top: 10px;
text-align: center;
width: 20%;
}
#gallery-1 img {
border: 2px solid #cfcfcf;
}
#gallery-1 .gallery-caption {
margin-left: 0;
}
</style>
四、URLOS面板设置
无名轻博客伪静态
rewrite ^/post-([0-9]+).html /index.php?act=pl&id=$1 last;
rewrite ^/comment-([0-9]+).html /index.php?act=plist&p=$1 last;
rewrite ^/index-([0-9]+).html /index.php?p=$1 last;
rewrite ^/list-([0-9]+)\.html$ /index.php?tid=$1 last;
rewrite ^/list-([0-9]+)-([0-9]+)\.html$ /index.php?tid=$1&p=$2 last;
rewrite ^/index.html /index.php last;
rewrite ^/comment.html /index.php?act=plist last;
server块扩展内容
if (-d $request_filename){
rewrite ^/(.*)([^/])$ https://$host/$1$2/ permanent;
}
server_name www.linji.cn;
return 301 https://linji.cn$request_uri;
Wordpress设置
server块扩展内容
server_name www.wdlu.cn;
return 301 $scheme://wdlu.cn$request_uri;
if ($http_user_agent ~ "YandexBot|AhrefsBot|Dotbot|bingbot|qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot" ) {
return 403;
}
if (-d $request_filename){
rewrite ^/(.*)([^/])$ https://$host/$1$2/ permanent;
}
伪静态
try_files $uri $uri/ /index.php?$args;
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
五、wangEditor2:关闭过滤javascript
https://www.kancloud.cn/wangfupeng/wangeditor2/113983
默认情况下,用户编辑源码之后,编辑器会过滤掉源码中的<script>标签记起内容,防止用户输入一些攻击性的脚本。
你如果不想要这个过滤功能,可以通过 editor.config.jsFilter = false; 来关闭。该操作要在editor.create()之前进行。
<div id="div1">
<p>请输入内容...</p>
</div>
<!--这里引用jquery和wangEditor.js-->
<script type="text/javascript">
var editor = new wangEditor('div1');
// 关闭js过滤
editor.config.jsFilter = false;
editor.create();
</script>
六、以下代码放在 设置--微博座右铭
人生苦短,珍惜当下!
<!--倒功能代码-->
<script src="https://zz.bdstatic.com/linksubmit/push.js"></script><script language="javascript" type="text/javascript">/*<![CDATA[*/var interval = 1000;
function ShowCountDown(year,month,day,divname)
{
var now = new Date();
var endDate = new Date(year, month-1, day);
var leftTime=endDate.getTime()-now.getTime();
var leftsecond = parseInt(leftTime/1000);
//var day1=parseInt(leftsecond/(24*60*60*6));
var day1=Math.floor(leftsecond/(60*60*24));
var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
var cc = document.getElementById(divname);
cc.innerHTML = "暑假时间:"+year+"年"+month+"月"+day+"日<br>距今:"+day1+"天"+hour+"小时"+minute+"分"+second+"秒";
}
window.setInterval(function(){ShowCountDown(2020,7,5,'divdown2');}, interval);/*]]>*/
</script>
<!--倒功能代码-->
<!--计时功能代码-->
<script language="javascript">
function tick() {
var years,days,hours, minutes, seconds;
var openday = new Date('1977/10/26 00:00'); //这里填写建站时间 2005/01/03
var today = new Date(); //获取系统当前时间
var total = (today.getTime()-openday.getTime())/1000;
years=Math.floor(total/31536000);
total=total-years*31536000;
days=Math.floor(total/86400);
total=total-days*86400;
hours=Math.floor(total/3600);
total=total-hours*3600;
minutes=Math.floor(total/60);
total=total-minutes*60;
seconds=Math.floor(total);
timeString = ""+years+" 年 "+days+" 天 "+hours+" 时 "+minutes+" 分 "+seconds+" 秒";
document.getElementById("Clock").innerHTML = timeString;
window.setTimeout("tick();", 1000);
}
window.onload = tick;
</script>
<!--计时功能代码-->
<!-- 复制文字提示 -->
<link rel="stylesheet" type="text/css" target="_blank" href="assets/js/sweetalert/sweetalert.min.css">
<script src="assets/js/sweetalert/sweetalert.min.js"></script>
<script>document.body.oncopy = function() { swal("复制成功!", "转载请务必保留原文链接,申明来源,谢谢合作!!","success");};</script>
<!-- 复制文字提示 -->
<!-- 回顶部 -->
<style type="text/css">
.scroll-to-top {
display: none;
width: 30px;
height: 30px;
line-height: 0px;
color: #fff;
text-align: center;
background-color: #333;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
cursor: pointer;
bottom: 5%;
position: fixed;
right: 0px;
padding: 7px;
z-index: 999;
}
.scroll-to-top:hover {
opacity: .8;
}
</style>
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($){
if ($(window).scrollTop() != "0")
$(".scroll-to-top").fadeIn(1200) //如果距离顶部的距离不为20,显示.scroll-to-top
var scrollDiv = $(".scroll-to-top");
$(window).scroll(function()
{
if ($(window).scrollTop() == "0")
$(scrollDiv).fadeOut(350)//如果距离顶部的距离为20,隐藏scrollDiv
else
$(scrollDiv).fadeIn(1200)//其他情况下,显示scrollDiv
});
$(".scroll-to-top").click(function(){
$("html, body").animate({
scrollTop: 0 //点击按钮,滚动回到顶部
}, 600)
})
});
</script>
<div class="scroll-to-top" style="display: none;"><i class="fa fa-chevron-up"></i></div>
<!-- 返回顶部 -->
<!-- activity-power-mode 打字效果 -->
<script src='https://www.azimiao.com/wp-content/themes/purelove/js/activity-power-mode.min.js' ></script>
<script>
POWERMODE.colorful = true;
POWERMODE.shake = false;
document.body.addEventListener('input', POWERMODE);
</script>
<!-- 打字效果End -->
<!-- 标题变化 -->
<script>
eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('g(0).h(e(){e d(){0.9=0[b]?" :( 别走,嘛去?再待会儿~ ":a}f b,c,a=0.9;"2"!=4 0.8?(b="8",c="k"):"2"!=4 0.5?(b="5",c="j"):"2"!=4 0.6&&(b="6",c="l"),("2"!=4 0.7||"2"!=4 0[b])&&0.7(c,d,!1)});',22,22,'document||undefined||typeof|mozHidden|webkitHidden|addEventListener|hidden|title|||||function|var|jQuery|ready|Hi|mozvisibilitychange|visibilitychange|webkitvisibilitychange'.split('|'),0,{}))
</script>
<!-- 标题变化End -->
七、代码高亮自动换行
wangEditor.min.js
找到
<pre style="max-width:100%;overflow-x:auto;>
修改成
<pre style="max-width:100%;overflow-x:auto;white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;word-wrap: break-word;line-height: 1.8em;">
八、修改 404 not found 跳转页面 (index.php)
if(empty($v)){@header("http/1.1 404 not found");@header("status: 404 not found");exit('404 not found');}
if($v['hide']=="1" && $admin==0){@header("http/1.1 404 not found");@header("status: 404 not found");exit('404 not found');}
更换成以下代码
if(empty($v)){@header("http/1.1 404 not found");@header("status: 404 not found");exit('<meta http-equiv="refresh" content="0;url=/573.html"> ');}
if($v['hide']=="1" && $admin==0){@header("http/1.1 404 not found");@header("status: 404 not found");exit('<meta http-equiv="refresh" content="0;url=/573.html"> ');}
<!-- 统计代码 -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?a2918bbf217245e4804526a57c412e0e";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id: "1zD94Tfv4pSHRu8p",ck: "1zD94Tfv4pSHRu8p"})</script>
<script src="https://sdk.51.la/perf/js-sdk-perf.min.js" crossorigin="anonymous"></script>
<script>
new LingQue.Monitor().init({id:"1zD9HeO5MGUlWhyx"});
</script>
<script>(function(){var cltj=document.createElement("script");cltj.src="https://t.linji.cn/tongji/?v=1.2";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(cltj,s);})();</script>
<!-- 统计代码 -->
<script src="https://fastly.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js"></script>
<script>
// https://github.com/fghrsh/live2d_demo
window.onload=function(){
L2Dwidget.init({
"model": {
//jsonpath控制显示那个小萝莉模型,下面这个就是我觉得最可爱的小萝莉模型,替换时后面名字也要替换掉
jsonPath: "https://unpkg.com/live2d-widget-model-shizuku@1.0.5/assets/shizuku.model.json",
"scale": 1
},
"display": {
"position": "left", //看板娘的表现位置
"width": 60, //小萝莉的宽度
"height": 80, //小萝莉的高度
"hOffset": 5,
"vOffset": 0
},
"mobile": {
"show": false,
"scale": 0.5
},
"react": {
"opacityDefault": 1,
"opacityOnHover": 0.2
}
});
}
</script>
信息科技 2020-02-10 15:43:32 通过 网页 浏览(6609) 打印
共有0条评论!