Verse
对于将上一步的原料制成品进行再加工,或者说包装以及分销,要借助许多工具。这里的工具可能包括SSG以及版本控制系统git/jujutsu。
mdbook
cargo install mdbook
./book.toml
[book]
authors = ["ningxilai"]
language = "zh_CN"
multilingual = false
src = "src"
title = "Iris's Note Book"
[output.html]
mathjax-support = true
git-repository-url = "https://github.com/ningxilai/ningxilai.github.io"
git-repository-icon = "fa-github"
no-section-label = true
[output.html.playground]
editable = true
line-numbers = true
[output.html.search]
limit-results = 20
use-boolean-and = true
boost-title = 2
boost-hierarchy = 2
boost-paragraph = 1
expand = true
heading-split-level = 2
./theme/index.hbs
...
<head>
...
<!-- Addons -->
<link rel="stylesheet" type="text/css" href="https://www.cdnfonts.com/garamond.font" />
<style> body {
font-family: font-family: "Garamond","朱雀仿宋" ;
font-weight: normal;
font-variant-ligatures: historical-ligatures normal;
}
</style>
...
</head>
...
./theme/fonts/fonts.css
@font-face {
font-family: '朱雀仿宋';
font-style: "regular";
font-weight: normal;
src: url('{{ resource "fonts/ZhuqueFangsong-Regular.ttf" }}') format('truetype');
}
Font && CSS
Hakyll \deprecated\
hakyll-init -f ./
CSS
html,body {
background: white;
scroll-behavior: smooth;
color: black;
font-family: monospace;
font-size: 16px;
line-height: 1.4;
min-height: 100%;
overflow-wrap: break-word;
font-family: "Fira Code","LXGW WenKai",sans-serif
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 45%;
margin: 0;
padding: 0;
text-align: left
}
.post-meta {
text-align: right
}
h1,h2,h3,h4,h5,h6 {
font-weight: normal
}
h2,h3 {
margin-top: 3rem
}
h4,h5 {
margin-top: 1.8rem
}
h6 {
margin-top: 0.8rem
}
hr {
margin: 2rem 0
}
p {
margin: 1rem 0
}
li {
margin: 0.4rem 0
}
*:target {
background: yellow
}
.w {
max-width: 640px;
margin: 0 auto;
padding: 4rem 2rem
}
hr {
text-align: center;
border: 0
}
hr:before {
content: "/////"
}
hr:after {
content: attr(data-content) "/////"
}
table {
width: 40%;
border: 0px
}
table,th,td {
border-collapse: collapse;
padding: 0.4rem
}
code {
color: white;
background: black
}
div.highlighter-rouge code {
display: block;
overflow-x: auto;
white-space: pre-wrap;
padding: 1rem
}
blockquote {
font-style: italic;
border: thin solid black;
padding: 1rem
}
blockquote p {
margin: 0
}
img {
max-width: 100%;
display: block;
margin: 0 auto
}
…and HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Home</title>
<link rel="stylesheet" href="./css/default.css" />
<link href="https://cdn.bootcdn.net/ajax/libs/firacode/6.2.0/ttf/FiraCode-Bold.ttf" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/lxgw-wenkai-webfont/1.7.0/files/lxgwwenkai-bold-subset-100.woff2" rel="stylesheet">
</head>
<body>
<main role="main">
<h1>Home</h1>
<header>
<div class="logo">
<a href="./">Iris's Blog</a>
</div>
</header>
<body> body </body>
<footer>
Site proudly generated by
<a href="http://jaspervdj.be/hakyll">Hakyll</a>,
Site <code>.css</code> file generated from the <code>.sass</code> files of <a href="https://github.com/riggraz/no-style-please">riggraz/no-style-please</a>.
</footer>
</main>
</body>
</html>
SSG and git
SSL_ERROR_SYSCALL
在提交分支时报出了 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0 的错误。
根据 正宗咸豆花 at CSDN 的方案,可以使用SSH绕过HTTPS的OpenSSL延迟,在实际使用中,git remote set-url origin git@github.com:username/repo.git,就像这样。
另外的,附上当时的最小实例:
git clone --depth=1 git@github.com:username/repo.git
cd repo
// git remote add origin git@github.com:username/repo.git
// git push origin master
git add .
git commit -m "last commit"
git push origin master ## git push -u origin master(设置上游仓库)
remote
对于凭证登陆,选择 cache 则有 git config --global credential.credentialStore cache。(dotnet tool install -g git-credential-manager)
rsync
同步:cp -rp book/* repo or rsync -a ./book/* repo。
! [rejected] master -> master (non-fast-forward) 时,可用git push -f
在本地创建副本:git init && git remote add upstream [URL]。
CNAME file
gh-page需要一CNAME file以重定向,其内容为定向到的域名。
add submodule
like this
git submodule add "https://github.com/manateelazycat/lsp-bridge" site-lisp/lsp-bridge
patch
作为独立命令的patch,使用时可以这样:patch -p[0/1] < [patch file] ## 0/1代表当前目录的工作深度。