curtiscde / hugo-theme-massively

Massively theme for Hugo static site generator
https://hugo-theme-massively.netlify.app
Other
155 stars 138 forks source link

Change root url code #18

Closed stephlocke closed 6 years ago

stephlocke commented 6 years ago

Lines like this use / as the root directory, however, this doesn't support sites that are not the root.

Instead of <a href='{{ "/" | relURL }}'> these could go back to the baseURL methodology to correctly fix the location in these circumstances.

Files where this is an issue:

pmviva commented 6 years ago

@stephlocke, It seems that absURL and absLangURL doesn't take the the subpath into accout.

I made a few tests having baseURL="http://localhost:1313/blog/" in config.toml

Then I used {{ "/" | absURL }} and I got http://localhost:1313/ as a result.

Then I used {{ "/" | relURL }} and I got http://localhost:1313/blog/ as a result as expected

The same goes for Contact link, If you have {{ "#contact" | absURL }} you get http://localhost:1313/blog wich is not what you want

If you have {{ "#contact" | relURL }} you get the correct result http://localhost:1313/blog/#contact

We need to change the use of absURL (as we currently have) to relURL in the navigation links.

pmviva commented 6 years ago

@stephlocke I've submitted a pull request for multilingual support, using {{ .Site.BaseURL }} is not useful, so I changed that line to be {{ "/" | relLangURL }} which in the case of

baseURL=http://localhost:1313/blog/ and spanish language gives

http://localhost:1313/blog/es/ which is the expected result

stephlocke commented 6 years ago

Reverted in PR and closing then 👍