iconDirEasy

SEO优化

目录网站是SEO的绝佳选择,千万不要错过!

元数据

我们已经使用Metadata为所有页面进行了配置。您所需的一切都已从lib/config/seo.ts文件中预填充

  • 标题
  • 描述
  • 类型
  • URL
  • OpenGraph
  • Twitter卡片

等等...

您可以为每个页面自定义这些SEO元数据。

站点地图

DirEasy使用Next.js内置的生成多个站点地图功能(sitemap.ts)自动生成网站的站点地图。生成过程会扫描项目中的不同目录,并为各种类型的内容创建站点地图条目:

1. 页面集合

如果您添加新页面或更改页面的路由,需要确保站点地图反映这些变化。

您可以在lib/config/seo.ts中找到站点地图的配置:

lib/config/seo.ts
  sitemapConfig: {
    staticPages: [
      {
        url: "/page1",
        changeFrequency: "weekly",
        priority: 0.8,
      },
    ],
  },

2. 内容集合

博客文章

  • 读取content/blog目录中的所有文件

文档文章

  • 读取content/docs目录中的所有文件

3. 项目

  • 用户提交的每个项目都会添加到站点地图中

4. 集合

  • 管理员创建的每个集合都会添加到站点地图中
站点地图在每次构建时都会自动重新生成,确保与您的内容保持同步。
  • Google Search Console每个sitemap.xml文件不能超过5000个项目。如果您的目录网站项目提交不超过5000个,则生成的sitemap.xml的URL将是:https://your-domain.com/sitemap/0.xmlhttps://your-domain.com/sitemap/1.xml
  • 页面集合内容集合集合列在0.xml文件中
  • 项目列在1.xml文件中,接下来的5000个项目列在2.xml中,依此类推

Robots文件

robots.txt文件将帮助爬虫(Google、Bing等)了解您希望索引哪些页面。

DirEasy使用Next.js内置的robots生成功能(robots.ts)自动生成网站的robots.txt

robots.txt在每次构建时都会自动重新生成。

交换反向链接

如果您想为交换反向链接添加链接列表,我们为此提供了一个特殊页面 https://yourdomain.com/friends。 您可以在“lib/config/seo.ts”中找到该页面的配置:

lib/config/seo.ts
  friendsConfig: {
    title: "Discover | Weekly selection of innovative products",
    description:
      "Discover the best innovative products and tools of the week, voted by the community to help you improve your productivity and quality of life.",
    items: [
      {
        title: "Bento - Explore the most creative Bentos",
        url: "https://bento.me/allentown",
        nofollow: true,
      },
      {
        title: "Linktree - One link to share everything you create",
        url: "https://linktr.ee/allentown521",
        nofollow: true,
      },
      {
        title:
          "Evernote - Remember everything and tackle any project with your notes, tasks, and schedule all in one place",
        url: "https://share.evernote.com/note/cf938b8b-a2db-4c43-6e37-ba750fa05905",
        nofollow: true,
      },
      {
        title: "Cal - Calendar and scheduling app",
        url: "https://cal.com/@allentown521",
        nofollow: true,
      },
      {
        title: "Creem - financial OS for Global Teams",
        url: "https://www.creem.io/bip/saashunt",
        nofollow: true,
      },
      {
        title: "Substack - Discover and follow the best newsletters",
        url: "https://substack.com/@allentown521",
        nofollow: true,
      },
    ],
  },
  • 我们已经默认将该页面添加到了sitemap中
  • 你应该始终控制该页面的链接数量,通常不超过10个,否则Google可能会认为是链接农场

目录