设为首页 加入收藏

TOP

Typecho搭建和美化(四)
2023-07-23 13:31:35 】 浏览:68
Tags:Typecho
); $cookie = implode(',', $cookie); Typecho_Cookie::set('contents_views', $cookie); } } echo $exist == 0 ? ' 暂无阅读' :$exist.' 人浏览'; } # 调用方式。我是用的 Jasmine 主题,所以文章浏览页面是 middle-single.php,添加代码(大约在35行左右) # 这个页面是必加的,否则不能实现计数功能。其他页面还需调用则添加同样代码 # 查看所有文章概况时,也可添加上 (default-item.php) <!-- 添加页面浏览次数统计 --> <span class="middotDivider"></span> <span><?php Postviews($this); ?></span>

添加友链功能

# 添加友链独立页面 link.html,粘贴如下代码

<table>
<div class="post-body">
   <div id="links">
      <div class="links-content">
         <div class="link-navigation">
            <div class="card">
               <img class="ava" src="https://cdn.jsdelivr.net/gh/hvnobug/assets/common/avatar.png" />
               <div class="card-header">
                  <div>
                     <a href="https://blog.hvnobug.com/">Emil’s blog</a>
                  </div>
                  <div class="info">这是一个分享IT技术的小站。</div>
               </div>
            </div>
            <div class="card">
               <img class="ava" src="https://blog-images-1301001018.cos.ap-beijing.myqcloud.com/favicon.png" />
               <div class="card-header">
                  <div>
                     <a href="https://yingwiki.top">越行勤's Blog</a>
                  </div>
                  <div class="info">努力学习的小菜鸟</div>
               </div>
            </div>
         </div>
      </div>
   </div>
</div>
</table>


# 主图外观中,左边菜单栏添加如下代码

{
    "name": "友链",
    "icon": "bi bi-people-fill",
    "url": "/link.html",
    "newTab": false
  }


# 主图外观中,自定义样式添加如下代码

.links-content {
    margin-top: 1rem
}

.link-navigation::after {
    content: " ";
    display: block;
    clear: both
}

.card {
    width: 45%;
    font-size: 1rem;
    padding: 10px 30px;
    border-radius: 4px;
    transition-duration: 0.15s;
    margin-bottom: 1rem;
    display: flex;
    border-style:none;
}

.card:nth-child(odd) {
    float: left
}

.card:nth-child(even) {
    /* float: right */
}

.card:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04)
}

.card a {
    border: none
}

.card .ava {
    width: 3rem !important;
    height: 3rem !important;
    margin: 0 !important;
    margin-right: 1em !important;
    border-radius: 4px
}

.card .card-header {
    font-style: italic;
    overflow: hidden;
    width: 100%
}

.card .card-header a {
    font-style: normal;
    color: #2bbc8a;
    font-weight: bold;
    text-decoration: none
}

.card .card-header a:hover {
    color: #d480aa;
    text-decoration: none
}

.card .card-header .info {
    font-style: normal;
    color: #a3a3a3;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap
}
# 以后每次添加友链复制一份,手动修改内容

# 名称 {name}
# 链接 {link}
# 头像 {avatarurl}
# 简介 {description}

<div class="card">
   <img class="ava" src="{avatarurl}" />
   <div class="card-header">
      <div>
         <a href="{link}">{name}</a>
      </div>
      <div class="info">{description}</div>
   </div>
</div>

手动配置SSL,并使用域名访问

如果在安装Typecho应用模版前,没有购买域名、备案、申请SSL,通过以下内容,手动配置。

  • 添加域名(hupifeng.cn),申请对应域名
首页 上一页 1 2 3 4 下一页 尾页 4/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇关于ArchLinux 在 Wayland 环境下.. 下一篇【Linux】(小白向)详解VirtualBox..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目