按要求删除导航栏「教程」及整个教程模块。
删除内容
- 导航项「教程」(/guide/videos) 及其 activeMatch
- 侧边栏「教程中心」条目
- pages/guide/videos.md(教程中心页,76 行)
- pages/projects/{iotlcm,xiu-dtu,xiu-admin}/guide/tutorial.md(三份教程视频页,共 251 行)
- data/projects.ts 里三个项目的「教程视频」子页面登记
同步清理的引用(避免 404)
- pages/projects/iotlcm/index.md:“下一步”表格里的教程视频行
- pages/projects/iotlcm/guide/quickstart.md:“下一步”里的教程链接
- 4 个审计脚本里的教程路径:
audit-band-offset.mjs / audit-layout.mjs / audit-sidebar-footer.mjs / render-check.mjs
- 注释里「教程等」的措辞
保留的内容(与本次无关,未动)
- DemoVideo.vue 及其 data/demo.ts 里的 demoVideos:
那是「系统演示」页里的 BV 号外链卡片,不是教程栏目
- compare.md 里「录屏教程」对比维度:属于竞品对比表的正常描述
验证
- 导航实测 8 项:首页/系统演示/产品功能/核心能力/界面预览/项目/官方文档/联系我们,无「教程」
- 侧边栏实测仅「门户部署」
- 干净副本构建成功,产物中无 tutorial/videos 文件
- 断链检查:失效项里无一条与教程相关
- check-registry 与 check-nav-brand 通过
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
import { chromium } from 'playwright'
|
||||
|
||||
/**
|
||||
* 「整宽色块 + 内容被挤到右边」全站扫描
|
||||
* 症状:某条通栏 band(背景铺满视口)内,首个内容块的左边界离视口左边 > 20% 视口宽。
|
||||
* 这正是用户截图里页脚那条「左边一大片空白、内容挤在右边」的形态。
|
||||
*/
|
||||
const BASE = 'http://127.0.0.1:18075'
|
||||
const PAGES = [
|
||||
'/', '/demo/', '/about/', '/projects/', '/projects/iotlcm/',
|
||||
'/projects/iotlcm/compare/', '/projects/iotlcm/guide/quickstart/',
|
||||
'/projects/iotlcm/guide/deploy/',
|
||||
'/projects/xiu-dtu/', '/projects/xiu-admin/', '/guide/portal-deploy/',
|
||||
]
|
||||
|
||||
const browser = await chromium.launch({
|
||||
executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
|
||||
})
|
||||
|
||||
for (const w of [1920, 1440, 1280]) {
|
||||
const page = await browser.newPage({ viewport: { width: w, height: 950 } })
|
||||
for (const path of PAGES) {
|
||||
await page.goto(BASE + path, { waitUntil: 'domcontentloaded' })
|
||||
await page.waitForFunction(() => !!document.querySelector('footer.pf-foot'), null, { timeout: 60000 })
|
||||
await page.waitForTimeout(900)
|
||||
const bad = await page.evaluate(() => {
|
||||
const vp = document.documentElement.clientWidth
|
||||
const out = []
|
||||
const bands = document.querySelectorAll('section, footer, header, div.p-hero, div.p-section')
|
||||
bands.forEach((el) => {
|
||||
const cs = getComputedStyle(el)
|
||||
const r = el.getBoundingClientRect()
|
||||
const hasBg = cs.backgroundImage !== 'none' || (cs.backgroundColor && cs.backgroundColor !== 'rgba(0, 0, 0, 0)')
|
||||
if (!hasBg) return
|
||||
if (r.width < vp * 0.9) return
|
||||
// 找该 band 内第一个「有内容的块」
|
||||
const probe = el.querySelector('.p-wrap, .pf-foot-main, .container')
|
||||
if (!probe) return
|
||||
const pr = probe.getBoundingClientRect()
|
||||
const offset = pr.left - r.left
|
||||
if (offset > vp * 0.2) {
|
||||
out.push({
|
||||
tag: el.tagName.toLowerCase(),
|
||||
cls: (el.className || '').toString().slice(0, 50),
|
||||
offset: Math.round(offset),
|
||||
pct: Math.round((offset / vp) * 100),
|
||||
})
|
||||
}
|
||||
})
|
||||
return out
|
||||
})
|
||||
if (bad.length) console.log(`${w}\t${path}\t${JSON.stringify(bad)}`)
|
||||
}
|
||||
await page.close()
|
||||
}
|
||||
await browser.close()
|
||||
console.log('scan done')
|
||||
Reference in New Issue
Block a user