这个网站是怎么做成的?

VPS和域名跳过。 自然请允许窝推荐Vultr,自由换ip.

生成网页时vimwiki的模板要在 nviminit.vim 中更改,例如:

let g:vimwiki_list=[{'path': '~/Documents/vimwiki/geistlib.wiki', 'template_path': '~/Documents/vimwiki/templates/','template_default': 'default2','template_ext': '.html'}]

对于 ~/Documents/vimwiki/templates/default2.html, 如果要使用cdn,在</body>前加入

<link rel="stylesheet"
      href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.6.0/build/styles/default.min.css">
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.6.0/build/highlight.min.js"></script>

以及

<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

亲测 highlightjs 不可以用 async.

自己的完整文件下(没使用cdn,mathjax略过对mml的支持):

<html>
<head>
    <link rel="Stylesheet" type="text/css" href="%root_path%style.css" />
    <title>%title%</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="content">
    %content%
    </div>

    <script src="%root_path%highlight.pack.js"></script>
    <script type="text/javascript">
    document.querySelectorAll('pre').forEach(block => hljs.highlightBlock(block));
    </script>
    <script id="MathJax-script" async src="%root_path%mathjax/tex-chtml.js"></script>
    <br>
<footer class="main-footer">
        <center>
        <a href="%root_path%index.html" style="font-size:14px">Home</a>&nbsp
        <a href="https://creativecommons.org/licenses/by-sa/2.0/" style="font-size:14px">CC-BY-SA</a>
        </center>
</footer>
</body>
</html>

不过实际上,由于在不需要代码高亮和 mathjax 的地方也加载这些脚本太浪费了,我做了四个模板 code.html

<html>
<head>
    <link rel="Stylesheet" type="text/css" href="%root_path%style.css" />
    <title>%title%</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="content">
    %content%
    </div>

    <script src="%root_path%highlight.pack.js"></script>
    <script type="text/javascript">
    document.querySelectorAll('pre').forEach(block => hljs.highlightBlock(block));
    </script>
    <br>
<footer class="main-footer">
        <center>
        <a href="%root_path%index.html" style="font-size:14px">Home</a>&nbsp
        <a href="https://creativecommons.org/licenses/by-sa/2.0/" style="font-size:14px">CC-BY-SA</a>
        </center>
</footer>
</body>
</html>


math.html

<html>
<head>
    <link rel="Stylesheet" type="text/css" href="%root_path%style.css" />
    <title>%title%</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="content">
    %content%
    </div>

    <script id="MathJax-script" async src="%root_path%mathjax/tex-chtml.js"></script>
    <br>
<footer class="main-footer">
        <center>
        <a href="%root_path%index.html" style="font-size:14px">Home</a>&nbsp
        <a href="https://creativecommons.org/licenses/by-sa/2.0/" style="font-size:14px">CC-BY-SA</a>
        </center>
</footer>
</body>
</html>


default.html

<html>
<head>
    <link rel="Stylesheet" type="text/css" href="%root_path%style.css" />
    <title>%title%</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="content">
    %content%
    </div>

    <br>
<footer class="main-footer">
        <center>
        <a href="%root_path%index.html" style="font-size:14px">Home</a>&nbsp
        <a href="https://creativecommons.org/licenses/by-sa/2.0/" style="font-size:14px">CC-BY-SA</a>
        </center>
</footer>
</body>
</html>


full.html

<html>
<head>
    <link rel="Stylesheet" type="text/css" href="%root_path%style.css" />
    <title>%title%</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="content">
    %content%
    </div>

    <script src="%root_path%highlight.pack.js"></script>
    <script type="text/javascript">
    document.querySelectorAll('pre').forEach(block => hljs.highlightBlock(block));
    </script>
    <script id="MathJax-script" async src="%root_path%mathjax/tex-chtml.js"></script>
    <br>
<footer class="main-footer">
        <center>
        <a href="%root_path%index.html" style="font-size:14px">Home</a>&nbsp
        <a href="https://creativecommons.org/licenses/by-sa/2.0/" style="font-size:14px">CC-BY-SA</a>
        </center>
</footer>
</body>
</html>

本地的 hljs 需要另外设置好 hljs 的 css,挺麻烦的。