hugo博客静态网站搜索方案原创

2020-12-20  本文已影响0人  大地缸

去看看原创(http://www.real007.cn/post/hugo%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99%E6%90%9C%E7%B4%A2%E6%96%B9%E6%A1%88/)

去看看

hugo简介

    一个静态博客网站生成工具,基于golang开发,可以跨平台运行与windows,linux,mac等主流操作系统

去官网看看

hugo new site
hugo new xxxx.md

下载stork.js

/root/web/static/
./stork --build adv.toml

索引文件的样子大概是这样adv.toml

命令执行后会在当前目录下生成federalist.st,将此文件拷贝纸/root/web/static即可


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>Federalist Search</title>
    <link rel="stylesheet" href="/basic.css" />
  </head>
  <body>
    <div class="stork-wrapper">
      <input data-stork="federalist" class="stork-input" />
      <div data-stork="federalist-output" class="stork-output"></div>
    </div>
    <script src="/stork.js"></script>
    <script>
      stork.register(
        'federalist',
        '/federalist.st'
      )
    </script>
  </body>
</html>

上一篇下一篇

猜你喜欢

热点阅读