mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-11-02 20:33:42 +00:00
Update build.py
构建时在根目录写入 robots.txt,指向学习站的站点地图。
This commit is contained in:
@@ -230,6 +230,8 @@ def build(optimize=True):
|
||||
(dist / '_sidebar.md').write_text('\n'.join(sidebar) + '\n')
|
||||
(dist / '_404.md').write_text('# 页面暂未找到\n\n请从目录或搜索查找笔记。\n\n[返回首页](/)\n')
|
||||
(dist / '.nojekyll').touch()
|
||||
# 允许收录;学习站每道题的页面列在它的站点地图中(笔记页面在 # 之后,没有单独的地址)
|
||||
(dist / 'robots.txt').write_text('User-agent: *\nAllow: /\n' + (f'Sitemap: {SITE_URL}learn/sitemap.xml\n' if LEARN_BUILD.is_file() else ''))
|
||||
shutil.copyfile(ROOT / 'docs/_media/LogoMakr_1J56bI.png', dist / 'favicon.png')
|
||||
learn_report = None
|
||||
if LEARN_BUILD.is_file():
|
||||
|
||||
Reference in New Issue
Block a user