antwarjs / antwar

A static site generator built with React and Webpack.
https://antwar.js.org/
MIT License
460 stars 35 forks source link

Figure out safer ways to link inside the site #80

Closed bebraw closed 7 years ago

bebraw commented 9 years ago

Just doing hrefs is a bit dangerous if the target changes. We might want to figure out something safer (or go through current link components).

iamstarkov commented 9 years ago

sorry, I don’t follow, can you describe in a bit more details?

bebraw commented 9 years ago

Let's say you are linking from a blog post to another. If you do this the good old way (ie. just href) and the target changes somehow, it will get broken. Within the site itself we can provide safer links since we have all the routing information. In this case links would have to go through our logic (ie. some React component).

Alternatively or in addition we could implement some form of 404 checker that operates against the whole site. The advantage of this is that it would catch outbound links that are broken. I expect there are solutions for this already as it's a common problem. We could for instance provide some hook (pre-deployment?) that would perform the check.

iamstarkov commented 9 years ago

okie, I get it

bebraw commented 7 years ago

I think the right way to solve this is to use an external tool like hyperlink. No need to solve here.