简体   繁体   English

如何创建包含导航菜单链接的站点地图?

[英]How to create a sitemap that includes links of the navigation menu?

I have a website in which there is a navigation menu in each HTML page.我有一个网站,其中每个 HTML 页面都有一个导航菜单。 In order to implement this, there is a JavaScript function that is called and writes the navigation panel with all the links为了实现这一点,有一个 JavaScript 函数被调用并编写包含所有链接的导航面板

<!------------------------------------------------------------------------
                      HEADER Navigation bar  
------------------------------------------------------------------------>
<script>
   insertHeader();
</script>

Thus, if there is a change, it is done only in the JavaScript file and is automatically applied to dozens of pages across the website.因此,如果有更改,它只会在 JavaScript 文件中完成,并会自动应用于整个网站的数十个页面。

Problem : I am trying to generate a sitemap with this tool .问题:我正在尝试使用此工具生成站点地图。 However, since my navigation panel is not written in the HTML (but inserted by JS), this tool does not recognize the navigation.但是,由于我的导航面板不是用 HTML 编写的(而是由 JS 插入的),因此该工具无法识别导航。 As a result 99.9% of my website is not recognized.结果,我网站的 99.9% 都无法识别。 Other tools I saw also behave similar behavior.我看到的其他工具也有类似的行为。

1) How can I overcome this problem? 1)我怎样才能克服这个问题?

2) Will google crawlers see the other links I have in navigation panel? 2) 谷歌爬虫会看到我在导航面板中的其他链接吗?

This question is very old, but I ran into the same problem as you.这个问题很老了,但我遇到了和你一样的问题。 I also create my nav using JavaScript.我还使用 JavaScript 创建了我的导航。 To be able to generate my sitemap, what I did was copy the JavaScript generated nav into my index.html temporarily.为了能够生成我的站点地图,我所做的是将 JavaScript 生成的导航临时复制到我的 index.html 中。 Then after successfully running the sitemap generator, the copied nav can be removed from index.html.然后在成功运行站点地图生成器后,可以从 index.html 中删除复制的导航。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM