Skip to content
0

去掉footer底部小破站运行时间

去掉footer底部小破站运行时间

环境

Teek@1.5.0-2025.9.23 版本上测试

自己的开源库《vitepress-theme-teek-one》 --(克隆自 作者Teeker的文档风开源库《vitepress-theme-teek-docs-template》)

2025年9月26日测试

需求

这里需要去掉footer底部小破站运行时间,因为首页侧边栏已经有写运行时间了。

image-20250926062041921

配置

编辑docs\.vitepress\theme\components\TeekLayoutProvider.vue文件:

修改前:

vue
const watchRuntimeAndRibbon = async (layout: string, style: string) => {
  const isHome = layout === "home";
  const isDoc = [undefined, "doc"].includes(layout);
  const isBlog = style.startsWith("blog");

  // 博客类风格的首页显示运行时间
  await nextTick();
  if (isHome && isBlog) startRuntime();
  else stopRuntime();

  // 关闭彩带背景,直接停止彩带
  stopRibbon();

  // 如果需要恢复彩带功能,可以注释上面一行,取消下面注释
  // if ((isHome && isBlog && style !== "blog-body") || (isDoc && teekConfig.value.pageStyle)) startRibbon();
  // else stopRibbon();

image-20250926203607361

修改后:

vue
  // 博客类风格的首页显示运行时间
  await nextTick();
  // if (isHome && isBlog) startRuntime();
  // else stopRuntime();
  stopRuntime(); // 始终停止运行时间显示

  // 关闭彩带背景,直接停止彩带
  stopRibbon();

image-20250926203700374

验证:

可以看到,footer底部小破站运行时间 消失了。😉

image-20250926203743939

结束。

最近更新