mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-11-19 12:53:47 +00:00
Update check.py
入口页中指向目录地址(/notes/)的链接按其中的 index.html 检查。
This commit is contained in:
@@ -37,7 +37,9 @@ def check(source, output):
|
||||
if name not in files and name + '.md' not in files and name.rstrip('/') + '/index.html' not in files:
|
||||
errors.append('缺失引用:' + name)
|
||||
for name in re.findall(r'(?:src|href)="(/[^"#]+)"', (output / 'index.html').read_text()):
|
||||
if name.split('?')[0].lstrip('/') not in files:
|
||||
path = name.split('?')[0].lstrip('/')
|
||||
# 目录地址(/notes/)由其中的 index.html 提供
|
||||
if path not in files and not (path.endswith('/') and path + 'index.html' in files):
|
||||
errors.append('缺失页面资源:' + name)
|
||||
forbidden = [name for name in files if set(Path(name).parts) & {
|
||||
'.git', '.cache', 'node_modules', 'builder', 'templates', 'upstream', 'remote',
|
||||
|
||||
Reference in New Issue
Block a user