🎨
booknote
  • Zpliu'Booknote
  • ggplot2
    • 不继承原有数据
    • Untitled Folder 1
      • 直方图绘制
    • 02基于Github笔记实现
    • 回归分析
    • 饼图
    • Theme函数
    • 直方图
    • 分面
    • pheatmap
    • 折线图
    • 桑基图
    • GO富集分析图
    • jupyter内使用R
    • 维恩图
    • 自定义图例
    • ggridges 山峦图
    • GO气泡图
    • 散点图
    • 从数据框中计算频率
    • 箱型图
  • 前端操作
    • 实例练习
      • 动态搜索网页
        • 后端
          • Node 服务框架
          • primer数据表的增删改查
          • 前端post请求
          • login 验证
          • Vue模板
            • Vue-router前端渲染
            • main.vue
          • 基于cookie登录验证
          • 使用mysql包进行数据库的交互
          • 数据库表
            • 学生信息表
            • 用户登录表
            • mysql 事务
            • 教师表
            • 引物表
          • mysql服务
          • html模板页面
            • 错误模板页
          • 08文件上传与下载
        • 解决webpack打包后文件过大问题
        • 前端
          • vue
            • 基于element-ui框架
            • 06 个人主页
            • 08上传组件el-upload
            • element-ui
            • Vue 构建前端框架
            • login登录界面
            • 07表格多选
            • show-data页面
          • vue-cookie
          • vue-router
            • 路由组件传参
        • Appach代理服务转发node
      • pie-progress
        • 01
      • 登录界面
      • Untitled
    • JavaScript
      • fasta文件校验
      • codewar中的练习题
      • 6kyu
      • chapter03
        • 数据类型
      • tweenjs
    • css
      • CSS布局
      • 02定位
    • 前端使用ajax进行异步请求
    • gitbook
    • html
      • 03表格
      • Vue星空
    • Log for study
  • 可变剪切
    • 第六次分析
      • 设计引物
      • 多倍化过程中的变化3
      • 不同棉种间AS的差异
      • At与Dt中不存在保守转录本的基因
      • AS调控基因表达
      • 多倍化过程中变化2
      • 可变剪切统计
      • 可变剪切的进化分析
      • 保守AS模式的鉴定
      • 提纲
      • 可变剪切的翻译分析
      • 多倍化过程中isoform的变化
      • 表观遗传在AS中的作用
      • 全长转录本数据的统计
      • 表观遗传在AS中的作用2
    • 03表观遗传与可变剪切
    • 数据处理流程
      • 计算同源基因间AS的保守程度
      • 重新开始鉴定AS.md
      • 统计IR保守性比例
      • 基因分类
      • 20200111可变剪切数目统计
      • 完全保守的基因对
      • 20200315
      • 20200214
      • 第三个结果
      • 20191230对AS类型进行定义
      • AS保守程度的统计
      • 20200219合并IR
      • 20200320
      • IR事件保守的长度
      • 分析同源基因中发生IR事件的频率
      • 保守的IR的长度统计
      • 筛选基因用于GO富集分析
      • 2020102把没有发生剪切事件的位置找出来
      • 对剪切事件进行分类
      • 06比较不同棉种中isform的差异
      • 甲基化数据处理
      • 寻找motif
      • 根据IR的保守程度对基因进行GO富集分析
      • 分析同源基因间可变剪切的差异
      • 基于前面已经分好的类进行统计
      • 寻找同源基因对应的位点
      • 对同源基因的剪切事件进行分类.md
      • 分析染色体上各种特征
      • HIN1下游调控基因的分析
      • intron 分布
      • 20200102GO富集分析
      • 01全长转录组数据处理
      • 甲基化重复间的处理
    • 文献理解
      • 10核小体定位决定外显子识别
      • 22
      • 09梨树中两个亚基因组经历unbiased 进化
      • 11RNA介导的局部染色质修饰对可变剪切的调控
      • 19讨论染色质开放程度与IR的关系
      • 03植物中的表观遗传
      • 06甲基化在拟南芥开花过程中的研究
      • 20可变剪切的进化
      • 14干旱积累对HIN1蛋白剪切效率的影响
      • 18内含子保留事件中不断变化的范式和调控方式
      • 04从RNA-seq研究可变剪切
      • 16多种RNA-seq策略揭示棉花中高精度的转录态势
      • 07ChIp-seq测序原理 chromatin immunoprecipitation
      • 05甲基化测序数据比对原理
      • 13使用iso-seq分析高粱转录本数据
      • 15POWERDRESS与HDA9相互作用促进去乙酰化
      • 12通过转录与染色质结构的耦合调控可变剪切
      • 英语句子
      • paper list
      • 01多组学数据揭示表观遗传
      • 02A global survey of alternative splicing in allopolyploid cotton: landscape, complexity and regulat
      • 17可变剪切与表观遗传导致白血病
      • 21smallRNA与DNA甲基化
    • 文章提纲
    • AS多倍化过程中的变化
    • 软件使用
      • 01三代测序Iso-seq
      • Bedtools
      • iso-seq测序2.0版本
      • 02Chip-seq操作流程
      • EMBOSS
      • 05鉴定duplicate gene
      • 07kobas本地进行注释
      • MEME本地化
      • DNA甲基化分析流程
      • stringtie
    • 第7个结果
    • 原始数据处理
      • 01三代测序数据原理
      • 02测序read数目统计
    • 第8个结果
    • 第五次分析
      • isoform水平分析
      • rmats2sashimiplot
      • 可变剪切的鉴定
      • 使用单个样本的数据进行AS分析
    • 表观遗传
    • 保守AS的鉴定
    • 第四次分析了
      • 甲基化计算
      • AS统计
      • 分析IR在各个基因组的保守性
    • 第三次对AS进行统计
      • 鉴定DRMs区域
      • 04
      • 重新下载原始数据进行比对
      • 02
      • 01
    • 第三个结果
    • 原始read的分类
    • 表观数据分析
    • 从RNA-seq研究可变剪切
  • 文献
    • 表观遗传
      • 植物中甲基化机制以及靶向操纵工具
    • 陈增建老师
      • 文章
    • 可变剪切
      • Post-transcriptional splicing of nascent RNA contributes to widespread intron retention in plants
      • Variant phasing and haplotypic expression from long-read sequencing in maize
      • 02
      • 01
      • 可变剪接的研究进展及展望
      • 06
      • Co-expression networks reveal the tissue-specific regulation of transcription and splicing
    • panGenome
      • 番茄中广泛的结构变异对基因表达和性状改良中的作用
    • TWAS
      • TWAS解读
    • 数量遗传older
      • Reinventing quantitative genetics for plant breeding: something old, something new, something borrow
    • Untitled 1
    • 多倍化
      • Measuring and interpreting transposable element expression
      • Homoeolog expression bias and expression level dominance (ELD) in four tissues of natural allotetrap
    • 转录调控
      • 指导植物RNA聚合酶II转录的‘GPS’
      • 02综述
    • 3D基因组
      • Methods for mapping 3D chromosome architecture
      • 由粘连蛋白介导的人类基因组中染色体loop图谱
      • 经典Hi-C文献
      • 小麦染色质被组装成基因组疆域和转录工厂
      • Lamina-associated domains: peripheral matters and internal affairs
      • Three-dimensional chromatin landscapes in T cell acute lymphoblastic leukemia
      • Disruption of chromatin folding domains by somatic genomic rearrangements in human cancer
      • Evolutionary dynamics of 3D genome architecture following polyploidization in cotton
      • On the existence and functionality of topologically associating domains
    • Untitled
    • GWAS
      • Population Genomic Analysis and De Novo Assembly Reveal the Origin of Weedy Rice as an Evolutionary
  • CRISP Case9
    • sgRNA设计
    • 01编辑效率检测
    • Hi-TOM
    • 02检查单株覆盖度
  • python
    • matplotlib
      • 图片的基本设置
      • 韦恩图
      • 折线图
      • 堆积直方图
      • 散点图
      • imshow绘制热图
    • 爬虫
      • 根据关键字获取对应的基因
      • TE
    • 多进程
    • 基于模块化编程
    • pybedtools
      • 01API
    • 高级特性
      • 列表操作
      • pickle
    • SOS
      • Script of scripts (SOS)
    • python 解析命令行参数
    • 简单实现python多进程
    • gffutils
      • gffutils
    • 多线程读取文件
    • rpy2
      • 在jupyter中调用R代码
    • pandas
      • 取数据
    • pysam
      • 01API接口
  • cottonWeb
    • 初始化项目
    • views
      • login
      • 404页面
      • register页面
    • 后端
      • Hi-C
      • 错误代码合集
      • SequenceServer搭建网页服务
      • 手把手教你搭建JBrowse-初始化应用
      • 优化JBrowse
    • Vue中使用Echarts
    • 2配置axios请求
    • 07搜索框实时推荐
    • 动画效果
    • layout布局
    • mysql
      • 基因操作
    • 路由配置
  • Vue
    • vue-route
      • 路由
    • Vue中发起ajax请求
    • 计算属性和侦听器
    • provide inject
    • 列表渲染
    • 自定义指令
    • 事件处理
    • Vue项目
      • 九宫格实现
      • 使用vue-resource进行ajax请求
      • 在项目中使用v-router
      • 新闻页面
      • 项目迁移
      • 使用Mint UI组件库
    • 案例操作
      • 02基于Github笔记实现
      • 实现购物车功能
      • Vue组建化
      • todomvc实现日程安排
    • 页面组件化
    • Vue 实例化操作
    • vue
    • 动画的渲染
    • 模板语法
    • class & style
    • 13 动画和过渡效果
    • 02guide
    • 深入了解组件化
    • 表单输入绑定
    • 条件渲染v-if
    • vue-chartjs
      • 起步
  • 并行计算
    • 实验室考试
    • 计算圆周率PI
    • 04.forthClass
    • 使用python3中的threading模块进行简单的并行计算
    • test
      • lastTest
      • 111
    • 第三节课作业
    • 05 test
    • 04test
    • 05homework
    • 04homework
    • OpenMP
    • 集群结构
    • CPU核、多线程、多进程
    • 05Class
    • 06class
    • 07class
    • 08class
  • WebPack
    • 打包css文件
    • 基于Webpack进行Vue开发
    • 处理url 图片
    • webpack 打包Vue
    • 基于webpack的路由操作
    • webpack
  • VueCLI
    • 03组件批量注册
    • 04拖拽插件
    • 05axios跨域问题
    • 07时间轴
    • Blast+ 网页实现
    • VueCLI 安装
    • axios请求
  • Script
    • 转录因子结合位点预测
    • BinomTest
  • mysql
    • 常见函数
      • 常见函数
      • 函数
    • 查询
      • 排序查询
      • 联合查询
      • 基本查询语句
    • 字段约束条件
    • SQLyog
    • 修改
      • 修改
    • powerdesigner数据库模型设计
    • 插入
      • 插入数据
    • 事务
      • 事务
    • 添加新用户
    • 视图
      • 视图
  • 文本编辑器
    • vscode 连接数据库
    • Vue模板补齐
    • visual Studio Code
  • source_code
    • Untitled
    • 并行计算
      • 04test
    • 公众号
      • RNA-seq
    • Untitled 1
  • GWAS
    • QQ-plot
  • RNA-seq
    • 01AnalysisFlow
    • 02脚本批量提交
    • 差异表达基因
    • 文献
      • 01SPL1赋予植物热忍受能力
    • 02 建库方式
  • Linux
    • LSF
    • 02诺和致源下载数据
    • 配置阿里yum源
    • linux三剑客
    • 云梯
    • 取文件相同列
    • root基本命令
    • 服务器网站数据搬迁
    • shell脚本激活Conda环境
    • 使用vscode与服务端R交互
    • 如何使用Conda
    • vim常见使用方法
    • oh-my-zsh
    • bash中的字典与数组
  • SNP分子标记
    • vcf文件处理
  • 生信软件
    • samtools
    • bedtools
    • annovar注释SNP
    • HiC-Pro安装
    • Untitled
    • bwa使用
  • Hi-C
    • 软件
      • HiCPlotter安装
      • pre程序
    • 20200102计算共线性区间保守的boundary
    • 20200108保守的TAD
    • PanGenome
      • PanGenome与各个元件进行注释
      • Pan-Genome数据比对
      • 鉴定两个基因组之间重排
  • node
    • mysql
      • 使用Promise封装
      • 基本的SQL语句
      • mysql的增删改查
      • 在node中使用mysql
    • session与cookie保留用户登录状态
    • MongoDB
      • MongoDB中的SQL语句
      • MongoDB 数据库
      • mongoose中一些常用的查询语句
      • :pig_nose: node中使用MongoDB的实例
      • MongoDB关联查询
      • 设计数据模型
    • 保持数据库处于连接状态
    • npm
    • node中路由设计
    • express中中间件的概念
    • art-template模块的用法
    • curd增删改查的使用
    • Promise 异步编程
    • 关于express框架的学习
    • express-session
    • 配置log4js
  • Cell-Ranger
    • count输出文件夹
      • ANALYSIS
      • feature_bc_matrix文件夹
      • Analysis 结果
      • BARcoded BAM
    • CellRanger aggr
    • 10X genomics测序中用到的术语
    • single sample Analysis
    • Cell Ranger count使用手册
  • HOX3
    • 03共表达分析
    • 01RNA-seq
    • 02基因差异表达分析
  • vue-admin
    • 项目目录结构
  • R
    • dplyr
      • dpylr
      • 过滤数据框
  • 系统遗传学
    • 翻译综述
    • 从脊椎动物的视角解析衰老的遗传机制
    • 01
  • eQTL
    • PEER
      • PEER方法
      • 软件使用
    • 群体结构
      • bcftools
  • sQTL
    • HISAT2比对
    • 02数据处理
  • 资源
    • hexo服务搭建
    • 转录因子数据库
    • 前端资源
    • 01 优雅的PPT设计
    • 文章书写规范
  • SVG
    • 01起步
  • 王悦瑾
    • Bash练习题
    • Bash脚本
    • 9_28起步
  • ES6
    • 模板字符串
    • promise源码解析
    • 01
  • scRNAseq
    • 干细胞不对称分裂
      • Root stem cell niche organizer specification by molecular convergence of PLETHORA and SCARECROW tran
    • 茉莉酸代谢
    • 老年痴呆
  • 多倍体进化
    • 棉花进化
    • 棉属A基因组的起源与进化
  • Vuex
    • 解构前端登录请求
    • VueX
  • ElementUI
    • 源码学习
      • 01drawer
    • Element UI:rocket:
  • reference周记
    • 第一期
    • test
  • 苏柃
    • Bash练习
Powered by GitBook
On this page
  • 1.初始化hexo
  • 2.部署到云端
  • 2.1GithubPage进行部署
  • 2.2部署到腾讯云
  • 3.自定义主题
  • 3.1主题安装
  • 3.2主题优化
  • 4.第三方评论系统
  • 4.1Valine
  • 5.搜索
  • 6.自定义标签
  • 7.首页进行文章截取
  • 8.静态资源压缩
  • 9.保存原始post文件和主题配置文件
  • 9.1新建空分支
  • 9.2提交hexo源码
  • 9.3克隆远端源码
  • 10.参考

Was this helpful?

  1. 资源

hexo服务搭建

Previous资源Next转录因子数据库

Last updated 5 years ago

Was this helpful?

 {% label success@Hexo %} 一款简洁并且高效的博客框架,结合markdown语法,让你的想法展现的淋漓尽致。通过本地编译markdown文件生成html 静态文件,部署到云端;使得笔记得到永久保存。利用Github、腾讯云等免费代码仓库存储服务,让你能够随时随地编辑;不受设备影响。

1.初始化hexo

​ 在命令行中运行一下命令

#初始化hexo
hexo init <folder_name>
cd <folder_name>
#下载相关依赖
npm i

​ hexo 初始化完成之后,在folder_name目录下将会产生一下文件和文件夹

​ hexo相关的命令均需要在bash中进入folder_name目录后运行

#启动本地预览
hexo s
#将md文件编译为html
hexo g

​ 启动本地预览后,访问网址可以查看到静态网页

2.部署到云端

2.1GithubPage进行部署

  1. 在github中创建一个仓库

  2. 将hexo push到github仓库中

下载对应的插件

--save参数会将插件信息保存在package.json文件中

npm install hexo-deployer-git --save

配置站点目录下_config.yml文件

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:zpliu1126/codeHub.git
  branch: gh-pages

部署实际上就是在将hexo编译生成的public目录下的所有文件推送到云端

部署完成后通过访问网址即可访问到hexo静态博客

https://.github.io /仓库名

2.2部署到腾讯云

当有多个云端时,配置文件如下进行配置

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
 -  type: git
    repo: git@github.com:zpliu1126/codeHub.git
    branch: gh-pages
 -  type: git
    repo: git@e.coding.net:biocodehub/codeHub.git
    branch: master

3.自定义主题

​ hexo中默认的主题是landscape,可以在github中搜索对应的主题选择下载

3.1主题安装

我这里使用到的是next主题

  1. 下载对应的主题文件

  2. 将主题整个文件夹粘贴到themes目录下

  3. 更改站点文件夹配置文件中theme字段为对应的主题名

#下载对应的主题 
git clone https://github.com/theme-next/hexo-theme-next themes/next
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

3.2主题优化

Next主题优化官方文档

  • 自定义样式文件

    Next最新版主题支持将样式文件放置在主题文件夹之外,只需要在主题文件夹中进行配置

custom_file_path:
  #head: source/_data/head.swig
  #header: source/_data/header.swig
  #sidebar: source/_data/sidebar.swig
  #postMeta: source/_data/post-meta.swig
  #postBodyEnd: source/_data/post-body-end.swig
  #footer: source/_data/footer.swig
   style: source/_data/styles.styl
  • 添加背景图片

    添加主题自定义样式

    修改样式时,最后将public文件夹全部删除,然后hexo g重新编译生成css文件

body{
    background:url(/images/themeImg/splash.png);
    background-size:cover;
    background-repeat:no-repeat;
    background-attachment:fixed;
    background-position:center;
}
  • 转载协议

creative_commons:
  license: by-nc-sa
  sidebar: true
  post: true
  language:
  • 自定义logo

# Custom Logo (Do not support scheme Mist)
custom_logo: /images/themeImg/logo.png
  • 代码高亮显示和复制按钮

codeblock:
  # Code Highlight theme
  # Available values: normal | night | night eighties | night blue | night bright | solarized | solarized dark | galactic
  # See: https://github.com/chriskempson/tomorrow-theme
  highlight_theme: night
  # Add copy button on codeblock
  copy_button:
    enable: true
    # Show text copy result.
    show_result: true
    # Available values: default | flat | mac
    style:
  • 阅读进度条

reading_progress:
  enable: true
  color: "#37c6c0"
  height: 2px
  • 书签

    当下次访问时自动滚动到对应位置

bookmark:
  enable: false
  # Customize the color of the bookmark.
  color: "#222"
  # If auto, save the reading progress when closing the page or clicking the bookmark-icon.
  # If manual, only save it by clicking the bookmark-icon.
  save: auto
  • Follow me 标签

# Follow me on GitHub banner in right-top corner.
github_banner:
  enable: true
  permalink: https://github.com/yourname
  title: Follow me on GitHub
  • 字体设置

    Next为5中类型提供字体设置

    • 全局字体设置

    • title字体设置

    • 标题字体设置 h1 、h2

    • 文章字体设置

    • 代码字体设置

font:
  # Use custom fonts families or not.
  # Depended options: `external` and `family`.
  enable: true

  # Uri of fonts host, e.g. //fonts.googleapis.com (Default).
  host:

  # Font options:
  # `external: true` will load this font family from `host` above.
  # `family: Times New Roman`. Without any quotes.
  # `size: x.x`. Use `em` as unit. Default: 1 (16px)

  # Global font settings used for all elements inside <body>.
  global:
    external: true
    family: Monda
    size: 1.125

  # Font settings for site title (.site-title).
  title:
    external: true
    family: Lobster Two
    size:

  # Font settings for headlines (<h1> to <h6>).
  headings:
    external: true
    family: Amita
    size:

  # Font settings for posts (.post-body).
  posts:
    external: true
    family: Roboto Slab

  # Font settings for <code> and code blocks.
  codes:
    external: true
    family: PT Mono
  • 安装插件

    支持两种安装方法

    1. 本地安装

    2. 使用CDN links

    如果你的站点是部署在一些免费的云端,推荐使用CDN links,因为它加载起来更快

    本地安装

#在bash中安装下载对应插件
$ cd themes/next
$ git clone https://github.com/theme-next/theme-next-pjax source/lib/pjax
# 启用pjax插件
# Easily enable fast Ajax navigation on your website.
# Dependencies: https://github.com/theme-next/theme-next-pjax
pjax: true

CDN links 安装

jsDelivr CDN is recommended to deliver our third-party plugins

# Script Vendors. Set a CDN address for the vendor you want to customize.
# Be aware that you would better use the same version as internal ones to avoid potential problems.
# Remember to use the https protocol of CDN files when you enable https on your site.
vendors:
  # Internal path prefix.
  _internal: lib
  pjax: https://cdn.jsdelivr.net/npm/pjax@0.2.8/pjax.min.js
  • 设置整体布局

# Schemes
# scheme: Muse
#scheme: Mist
#scheme: Pisces
scheme: Gemini
  • 配置菜单栏

    1. 第一栏表示菜单名

    2. 第二栏表示相对url

    3. ||后表示icon

menu:
  home: / || home
  #about: /about/ || user
  #tags: /tags/ || tags
  #categories: /categories/ || th
  archives: /archives/ || archiveasad
  • 菜单栏的一些修饰

    • 显示icon

    • 显示条目数

# Enable / Disable menu icons / item badges.
menu_settings:
  icons: true
  badges: true

条目数支持中文

修改next\layout\_partials\header\menu-item.swig文件

    {%- if theme.menu_settings.badges %}
      {%- set badges = {
        '文章'  : site.posts.length,
        '分类': site.categories.length,
        '标签'      : site.tags.length
        }
      %}
  • 侧边栏显示头像

    支持将图片放在theme文件夹之外,例如在 site directory source/uploads/ 下

# Sidebar Avatar
avatar:
  # Replace the default image and set the url here.
  url: /images/avatar.gif
  • 编辑站点信息

    • author

    • description

    配置hexo/_config.yml文件

# Site
author:
description:

4.第三方评论系统

推荐指数

优点

缺点

4

每天30000条评论,10GB的储存

作者评论无标识

4

多种账号登录

评论无法导出

3

美观

必须备案域名

3

简洁

只能登陆github评论

Disqus

1

需要翻*墙

4.1Valine

注册Valine账户

文章中添加字段

comments: true

主题文件中进行设置

valine:
  enable: true
  appid:  # Your leancloud application appid
  appkey:  # Your leancloud application appkey
  notify: false # Mail notifier
  verify: false # Verification code
  placeholder: Just go go # Comment box placeholder
  avatar: mm # Gravatar style
  guest_info: nick,mail,link # Custom comment header
  pageSize: 10 # Pagination size
  language: zh-cn # Language, available values: en, zh-cn
  visitor: false # Article reading statistic
  comment_count: true # If false, comment count will only be displayed in post page, not in home page
  recordIP: false # Whether to record the commenter IP
  serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in)
  #post_meta_order: 0

5.搜索

使用本地插件配置搜索数据库

npm install hexo-generator-searchdb

hexo/_config.yml文件配置

`search:  path: search.xml  field: post  format: html  limit: 10000`

next/_config.yml文件中配置

# Local search
# Dependencies: https://github.com/theme-next/hexo-generator-searchdb
local_search:
  enable: true
  # If auto, trigger search by changing input.
  # If manual, trigger search by pressing enter key or search button.
  trigger: auto
  # Show top n results per article, show all results by setting to -1
  top_n_per_article: 1
  # Unescape html strings to the readable one.
  unescape: false
  # Preload the search data when the page loads.
  preload: false

6.自定义标签

hexo生成标签页面

hexo new "新的标签"

在标签页面md文件中指定类型为标签

title: 新的标签
date: 2020-03-22 08:39:29
type: tags

在post文章中使用标签

  • 多个标签使用-进行区分

title: hexo服务搭建
comments: true
author: zzz
date: {date}
categories: 
    - test
tags:
    - hexo

7.首页进行文章截取

编辑theme/_config.yml文件

excerpt_description: true

# Read more button
# If true, the read more button will be displayed in excerpt section.
read_more_btn: true

下载对应插件

npm i hexo-excerpt

另外一种可以使用<!-- more -->在md文件中实现更加精准的控制

8.静态资源压缩

一般将css和js文件中的空格和换行符进行压缩,一定程度上能减少网络延迟

  • 安装gulp 命令

    站点根目录下运行

$ npm install gulp
  • 安装gulp插件

npm install gulp-minify-css --save
npm install gulp-uglify --save
npm install gulp-htmlmin --save
npm install gulp-htmlclean --save
npm install gulp-imagemin --save
  • 压缩规则文件

var gulp = require('gulp');
var minifycss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var htmlmin = require('gulp-htmlmin');
var htmlclean = require('gulp-htmlclean');
var imagemin = require('gulp-imagemin');
// 压缩css文件
gulp.task('minify-css', function() {
  return gulp.src('./public/**/*.css')
  .pipe(minifycss())
  .pipe(gulp.dest('./public'));
});
// 压缩html文件
gulp.task('minify-html',  gulp.series('minify-css',function() {
  return gulp.src('./public/**/*.html')
  .pipe(htmlclean())
  .pipe(htmlmin({
    removeComments: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,
  }))
  .pipe(gulp.dest('./public'))
}));
// 压缩js文件
gulp.task('minify-js', gulp.series('minify-html',function() {
    return gulp.src(['./public/**/.js','!./public/js/**/*min.js'])
        .pipe(uglify())
        .pipe(gulp.dest('./public'));
}));
// 压缩 public/demo 目录内图片
gulp.task('minify-images', gulp.series('minify-js',function() {
    gulp.src('./public/demo/**/*.*')
        .pipe(imagemin({
           optimizationLevel: 5, //类型:Number  默认:3  取值范围:0-7(优化等级)
           progressive: true, //类型:Boolean 默认:false 无损压缩jpg图片
           interlaced: false, //类型:Boolean 默认:false 隔行扫描gif进行渲染
           multipass: false, //类型:Boolean 默认:false 多次优化svg直到完全优化
        }))
        .pipe(gulp.dest('./public/uploads'));
}));
// 默认任务
gulp.task('default', gulp.series('minify-css',function() {
  return gulp.src('./public/**/*.css')
  .pipe(minifycss())
  .pipe(gulp.dest('./public'));
}));
  • 在hexo 编译生成html文件后执行压缩即可

hexo g && gulp && hexo d

​

9.保存原始post文件和主题配置文件

9.1新建空分支

#先克隆仓库
 git clone git@e.coding.net:biocodehub/codeHub.git
# 进入仓库
cd codeHub
# 创建新的分支
git checkout --orphan source
# 删除当前分支所有文件
git rm -rf .
# 创建一个文件并提交到当前分支
$ echo \"My GitHub Page\" > index.html
$ git add .
$ git commit -a -m \"new branch source\"
$ git push origin source

登录远程仓库,手动删除index.html就变成空的分支了

9.2提交hexo源码

# 站点初始化仓库
cd codeHub
git init
# 添加远程地址
git remote add origin “仓库地址"
# 编辑

gitignore文件 ,选择推送的文件

在添加要推送的文件之间,先将主题下的\themes\next\.git文件夹删除,git不允许一个仓库包含另外一个仓库。

#获取远端分析
git fetch
#切换到origin source分支
git checkout origin/source
#新建本地分支
git checkout -b source
#将本地分支与远端分支关联
git branch -u origin/source source
#开始上传文件
git add .
git commit -m "code Hub source code"
git push origin source

9.3克隆远端源码

$ git clone -b source git@e.coding.net:biocodehub/codeHub.git
$ hexo s
$ npm install hexo-deployer-git -save
# 推送到远端
$ hexo g && gulp hexo d

10.参考

遇见西门

Next

git仓库推送

http://localhost:4000/
https://theme-next.org/docs/theme-settings/
https://leancloud.cn/dashboard/applist.html
https://www.simon96.online/2018/10/12/hexo-tutorial/
https://theme-next.org/docs/
https://blog.csdn.net/wankui/article/details/53328369
Valine
来必力/livere
畅言
gitment