cd ~/eipi10/xuxiangwen.github.io
_bin/publish.sh _notes/00-env/centos_cuda_cudnn.mdpublish.sh 可以指定两个参数。
- 发布的文件或目录:一般指定具体文件。
- 发布的消息:如果为空,默认是publish blogs
cd ~/eipi10/xuxiangwen.github.io
git pull
_bin/generate.sh _notes/00-env/centos_cuda_cudnn.md
_bin/start.sh_bin/move.sh _notes/05-ai/05-math/entropy.md _temp
move.sh有两个参数
- 要移动的文件
- 目标目录
move.sh会首先copy文件中所引用的图片(原地址图片不会删除),然后再移动文件到新的目录。
可以查询获取网站的访问历史。
cat << EOF > _config.yml
title: Weclome to eipi10
description: stay hungry, stay foolish
theme: jekyll-theme-architect
permalink: pretty
show_downloads: false
markdown: kramdown
highlighter: rouge
google_analytics: UA-154374268-1
defaults:
- scope:
path: ""
type: "posts"
values:
layout: "post"
- scope:
path: ""
values:
layout: "default"
# Gitalk settings
gitalk_clientID: 8278f492ce9a6b43f85d
gitalk_clientSecret: 68a96d3c76e8ac218d9afa4e93add583ce3535c4
gitalk_repo: xuxiangwen.github.io
gitalk_owner: xuxiangwen
EOF
- Google Analysis的配置,参见Jekyll 网站添加访问量统计分析
- gitalk的配置,参见Add Gitalk to Your Jekyll Blog
cat << EOF >> Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# gem "rails"
gem "jekyll"
gem "jekyll-theme-architect"
gem "github-pages", group: :jekyll_plugins
EOF
cat Gemfile在 @import 后面添加自定义的 CSS (or Sass, including imports)
mkdir -p assets/css
cat << EOF > assets/css/style.scss
---
---
@import "{{ site.theme }}";
body {
font-size: 14px;
}
header {
padding-top: 20px;
padding-bottom: 20px;
}
header h1 {
font-size: 36px;
}
header h2 {
font-size: 18px;
}
#main-content h1 {
font-size: 32px;
}
#main-content h2 {
font-size: 28px;
}
#main-content h3 {
font-size: 24px;
}
#main-content h4 {
font-size: 18px;
}
aside#sidebar h2 {
margin-top: 0;
margin-bottom: 0;
font-size: 24px;
font-weight: normal;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
line-height: 1.3;
letter-spacing: 0; }
aside#sidebar h3 {
margin-top: 0;
margin-bottom: 0;
font-size: 15px;
font-weight: normal;
line-height: 1.5;
color: #9ddcff;
letter-spacing: 0; }
EOFNote: If you'd like to change the theme's Sass variables, you must set new values before the
@importline in your stylesheet.
body {
background: white; }
aside#sidebar {
min-height: 100%;
background: #fafafa; }为了更好的展现效果,需要自定义layout,下面代码从原来的theme中下载layout。
mkdir -p _layouts
wget https://raw.githubusercontent.com/pages-themes/architect/master/_layouts/default.html -P _layouts默认情况下,不支持Latex(也就是解释$$或$)。
mkdir -p _includes
cat << EOF >> _includes/head.html
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
inlineMath: [['$','$']]
}
});
</script>
<script src="proxy.php?url=https%3A%2F%2Fcdn.mathjax.org%2Fmathjax%2Flatest%2FMathJax.js%3Fconfig%3DTeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
EOF如果在一个新环境,需要先部署Jekyll。参考https://www.jekyll.com.cn/docs/
第一次
bundle install更新
bundle update每一篇markdown文件,然后通过下面命令进行生成。
# 指定目录生成所有发布文件
_bin/generate.sh _posts
# 指定文件生成发布文件
_bin/generate.sh _posts/vector-and-matrix.md上面命令主要做了:
-
从要发布的markdown文件的front matter中获取日期,然后复制文件,新的文件名是
<日期>-<原文件名> -
删除之前发布的文件
-
把文件中图片的相对路径由
images改成/assets/images -
把
$$前后各添加一个换行符。在typora中,如果$$是一行的开始,是默认居中,而在github pages中默认显示的是和文本混合在一起(inline mode),在前后添加换行符后,解决这个问题。 -
把单个
$换成$$。一个$在github pages中,对于其中换行符号\\会变成\,$$可以正常显示。 -
在
{{中间插入一个换行符,避免被Jekyll识别为Liquid。 -
把图片从markdown文件所在目录的
images中拷贝到/assets/images目录中去。 -
把原始文件路径添加到生成中的blog中,便于查找其来源。
