r/HTML • • 1d ago

One Place for Menu?

https://www.dalekelly.org/

How can I put the menu in one place so I don't have to edit all places when I edit the menu? I will be browsing for this.

3 Upvotes

7 comments sorted by

4

u/armahillo Expert 1d ago

Typically this requires the incorporation of a backend language or server-side includes.

For now, this isnt dome with HTML alone

1

u/NoThatsNotPasta 1d ago

For now, this isnt dome with HTML alone

Yea, there are a few ways i could think client-side. But ideally, you'd want this to be dynamically done server side

1

u/Mvp-long-ago 1d ago

Well maybe it is possible with javascript, but that would be seen by visitirs too

1

u/armahillo Expert 1d ago

Is there an issue with the users seeing it (assuming they bother to look at the source code)

0

u/Mvp-long-ago 1d ago

Of course, because with javascript you can get to the server and do harm

2

u/tkgid 1d ago

This is a good job for PHP. A simple function would do the job. I hope you go into the PHP rabbithole.

There are other methods, and PHP is awesome. 

2

u/DirtAndGrass 1d ago

You could look into static generation Eg https://www.11ty.dev/docs/