hexo theme ocean 优化 の 实记

本文档详细介绍了如何优化Hexo Ocean主题,包括调整主页视频蒙版透明度、实现侧边栏自动隐藏、设置相册功能、定制鼠标样式以及使用免费CDN。此外,还提供了部署自定义静态HTML的方法和B站外链的插入方式,帮助提升博客的视觉效果和用户体验。
摘要由CSDN通过智能技术生成

传送门:
Github hexo-theme-ocean
Ocean 中文文档
关于 Ocean 使用中的问题

页面优化

主页视频前置蒙版不透明度

themes/ocean/source/css/_partial/ocean.styl
.video-overlay background-color rgba(178, 191, 204, .6) background-color rgba(178, 191, 204, .3)

侧边栏自动隐藏

themes\ocean\source\css_partial\layou.styl

// Media Query
@media (min-width: 768px)
  .jumbotron
    margin-bottom 6rem

  .content
    margin-right aside-width

  .sidebar
    right 0
    background-color white

  .navbar-toggle
    display none

删除相关控制样式的css, 最终修改为:

// Media Query
@media (min-width: 768px)
  // .jumbotron
  //   margin-bottom 6rem

  // .content
  //   margin-right aside-width

  .sidebar
    // right 0
    background-color white

  // .navbar-toggle
  //   display none

PS:可于themes/ocean/source/css/_variables.styl 调整侧边栏宽度 aside-width

功能优化

相册功能
albums: [
        ["1", "https://cdn.jsdelivr.net/gh/honjun/cdn@1.4/img/banner/about.jpg"],	# 线上链接
        ["2", "gallery/00.jpg"],		# 本地路径
        ["3", "gallery/01.jpg"],
        ["4", "gallery/02.jpg"],
        ]
鼠标样式

themes/ocean/source/css/style.styl 开头 添加

//  普通指针样式  // 可于`https://zhutix.com/tag/cursors/`挑选样式
body
  cursor url(https://cdn.jsdelivr.net/gh/snorlaxse/jsDeliver/theme/cursor/ComixCursors-White/Comix_White_Pointer.cur),default

// 链接指针样式
a
  &:hover
    cursor url(https://cdn.jsdelivr.net/gh/snorlaxse/jsDeliver/theme/cursor/ComixCursors-White/Comix_White_Link.cur),pointer
cdn

使用jsDeliver+github搭建免费的cdn
免费CDN:jsDeliver+Github 使用方法

![](https://cdn.jsdelivr.net/gh/snorlaxse/jsDeliver/cover/gundam00.jpg)
部署自定义静态HTML

将相应项目文件夹 放置于 source
_config.yml中修改:

# 跳过文件夹下所有子文件夹和文件
skip_render: 
  - "文件夹名/**    # ex. "- demo/**/*"
b站外链

安装插件

npm install hexo-tag-bili --save

在md文件中编辑:

<div 
     style="position: relative; width: 100%; height: 0; padding-bottom: 75%;">
    <iframe 
            src="//player.bilibili.com/player.html?aid=43224979&bvid=BV1ob411S7gM&cid=75780544&page=1"
            scrolling="no" 
            border="0" 
            frameborder="no" 
            framespacing="0" 
            allowfullscreen="true" 
            style="position: absolute; width: 100%;height: 100%; left: 0; top: 0;"> 
    </iframe>
</div>


写在最后:若本文章对您有帮助,请点个赞啦 ٩(๑•̀ω•́๑)۶

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱学习的卡比兽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值