补齐浏览器回归和发布指纹,更新应用访问说明

This commit is contained in:
fam
2026-09-21 12:12:25 +01:00
parent a0fefc5041
commit acfa02f96d
11 changed files with 118 additions and 8 deletions
+6 -1
View File
@@ -128,7 +128,12 @@ def build():
write('sitemap.xml', ET.tostring(site,encoding='unicode'))
write('robots.txt', f'User-agent: *\nAllow: /\nSitemap: {BASE}/sitemap.xml\n')
write('index.json', json.dumps([{'title':p['title'],'permalink':BASE+p['url'],'summary':p.get('summary',''),'content':p['raw']} for p in posts],ensure_ascii=False))
write('release.json', json.dumps({'site':'famzheng.me','posts':len(posts),'apps':len(apps),'content_sha256':hashlib.sha256(''.join(p['raw'] for p in posts).encode()).hexdigest()}))
inputs = [ROOT/'build.py', ROOT/'apps.json', ROOT/'requirements.txt'] + sorted((ROOT/'assets').rglob('*')) + sorted((ROOT/'content').rglob('*')) + sorted((ROOT/'static').rglob('*'))
digest = hashlib.sha256()
for path in inputs:
if path.is_file():
digest.update(str(path.relative_to(ROOT)).encode()); digest.update(path.read_bytes())
write('release.json', json.dumps({'site':'famzheng.me','posts':len(posts),'apps':len(apps),'build_sha256':digest.hexdigest()}))
print(f'Built {len(posts)} posts and {len(apps)} applications → {OUT}')
if __name__ == '__main__': build()