devlinjunker / template.webpack.fend

Example using Webpack to build a FEND Browser App (with HTML/CSS/JS and Image files)
http://devlinjunker.github.io/template.webpack.fend
MIT License
3 stars 2 forks source link

Relative-Href Helper method #14

Closed devlinjunker closed 4 years ago

devlinjunker commented 4 years ago

Description

Added relative-href helper to properly configure relative links, found issues with the links in the demo application and once we added a 'home' link with the icon library

The helper contains a small snippet of code that must be included in each javascript entry point. This code sets the <base> tag inside of the <head> element in the HTML page to tell relative links on the page the href that they should be relative to.

i.e. if <base href='http://test.com/'> exists at the top of the page, all relative links (e.g. <a href="example">...</a>) will direct to http://test.com/example (where example is any relative href value). This is compared to the regular relative link behavior where the link is relative to the current page (value in the browser url bar).

In the docs/demo example app, we set the base href to the current url location with docs/demo/, compared to the regular application where we set it to just the host of the url location.

Related

13

Visual

relative-href

relative2

TODO