Bitcoin Forum

Other => Off-topic => Topic started by: seoincorporation on February 11, 2020, 05:16:26 AM



Title: One menu for all pages (HTML discussion)
Post by: seoincorporation on February 11, 2020, 05:16:26 AM
When we code an HTML site is really frustrating when we have to make a small modification to the menu because we have to edit each file and if the site is big then it's a problem.

I was reading a way to make the menu in another file and call it with JS, and this looks like a really nice solution, but the problem is the SEO. I'm not sure how much this affects for the browsers at the moment to index our site.

So, this is the way to do it and my question... How bad is this for SEO?

http://fab.cba.mit.edu/classes/863.15/section.CBA/people/Shtarbanov/OneMenuForAllPages.html
http://www.menucool.com/ddmenu/one-menu-for-all-pages


Title: Re: One menu for all pages (HTML discussion)
Post by: Artemis3 on February 12, 2020, 06:56:47 PM
I think something like this can easily be done using PHP or similar server side code. If you do it running the code in the client browser instead, like it would if you use that .js, you risk lowering functionality in browsers that refuse or cant execute client code.

It also happens to be worse for the user, making their computer / device slower or consume more power. Of course that does offload your server computing resources...


Title: Re: One menu for all pages (HTML discussion)
Post by: Initscri on February 13, 2020, 01:47:08 AM
There's honestly been a debate about how much javascript-generated sites affects SEO. A few years ago, I would have said it impacts it quite a bit, but with the popularity of frameworks such as Angular & Ember gaining steam, not so much anymore.

https://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157

Now Google may handle OK w/ javascript, but other search engines MAY NOT react in the same way.

As mentioned above, if it's just loading templates, I would more likely recommend server generated code for this. Such as PHP. It's really not that difficult, and can be embedded right into your HTML code. Probably even more easily than Javascript (and less client-side work to be done)

Code:
<html>
<head></head>
<body>
<div id="header">
// Replace / with question mark because Cloudflare doesn't like it.
</php include('header-links.php'); />
</div>
<div id="content"></div>
<div id="footer"></div>
</body>
</html>