#!/usr/bin/env python3
"""批量更新 vendor_stockout 系列頁面的導航列"""
import re
from pathlib import Path
NEW_NAVBAR = '''
'''
TIME_SCRIPT = ''' // 更新導航列時鐘
function updateNavTime() {
const now = new Date();
const elem = document.getElementById('nav-time');
if (elem) {
elem.textContent = now.toLocaleString('zh-TW', {
year: 'numeric', month: '2-digit', day: '2-digit',
hour: '2-digit', minute: '2-digit', second: '2-digit'
});
}
}
updateNavTime();
setInterval(updateNavTime, 1000);'''
def update_file(filepath):
"""更新單個文件"""
with open(filepath, 'r', encoding='utf-8') as f:
content = f.read()
# 替換導航列(從 或