hugo-theme-bleak icon indicating copy to clipboard operation
hugo-theme-bleak copied to clipboard

hugo-theme-bleak wont work on a subdirectory in webserver

Open aravindhsampath opened this issue 7 years ago • 7 comments

First of all, thanks for building this theme. I absolutely love it.

I tried to setup a personal blog with hugo and theme it with huge-theme-bleak, and landed into this problem. The issue is reproducible here. Blog link: https://aravindh.net/blog/ ^ leads to a page that shows cards of my two trial posts.

However, when I click on either of the posts it wouldnt load. Browser console doesnt report any errors either.

Weirdly, if I try the urls for the posts directly manually, it seems to work as perfectly. Something is broken with establishing that link from posts page to the actual post.

direct link to post: https://aravindh.net/blog/post/great-post.html

I posted the entire hugo directory into a git repo here: https://github.com/aravindhsampath/hugo_blog PS: I was trying all sorts of paramm fields in config.toml (UglyURLs, CanonifyURLS, relativeURLs) in hope that they would fix the problem, but they made no difference. Any help figuring this is greatly appreciated. Thanks in advance.

aravindhsampath avatar Apr 04 '17 23:04 aravindhsampath

Hi @aravindhsampath, I've tried 3 browsers here and everything seems to work fine.

Lusitaniae avatar Apr 05 '17 07:04 Lusitaniae

Hi @Lusitaniae , between my post and now, I tried to add tags to every post I made, and it seems to magically making them work as intended. If I create a new post and not have tags = ["tag1"] in its header, it doesn't work... I dont remember reading anywhere in the repo README about tags.

Thanks for the response.

aravindhsampath avatar Apr 05 '17 20:04 aravindhsampath

I'm currently working on a fix for issues with the static files loading under a sub-directory:

https://github.com/CurtTimson/hugo-theme-bleak

This is caused by the static files having references such as /js/main.js.

There's an example of the version I've created in use here:

https://curttimson.github.io/curtis-timson/

curtiscde avatar Apr 06 '17 08:04 curtiscde

I've opened a new issue, #23, as the fix I've worked on is only for loading static files, and not general issues with loading the application in a sub-directory.

curtiscde avatar Apr 06 '17 20:04 curtiscde

Ok PR merged, check and close this issue. Thanks for contribution.

Zenithar avatar Apr 07 '17 07:04 Zenithar

@CurtTimson Thanks for the fix. I pulled your changes in. It does work within the sub directory now. However, I'm still seeing a weird situation where links(only those with my domain name in it) are tagged with specific classes, while other links on the same post works just fine... <a href="https://aravindh.net" class="js-ajax-link js-show-index">my website - aravindh.net</a> You can see the issue in my post here : https://aravindh.net/blog/post/first-post/ The same happens with the logo image I added. Asking here because it leads to an empty very similar to the original issue..

Any suggestions how I can make that class="js-ajax-link js-show-index" go away?

aravindhsampath avatar Apr 09 '17 03:04 aravindhsampath

For me my page is only loading forever and no blog posts are shown. Locally everything works fine. Any ideas how to solve this?

Edit: It seems there are still some references missing in index.html:

    <link rel="preload" href="/js/main.js" as="script" />
    <link rel="preload" href="/css/main.css" as="style" />

Edit2: I found the reason: https://github.com/Zenithar/hugo-theme-bleak/commit/a55a4df4f6eea479c5215b2f5430cd8704794a3d#r29052515

Edit3: Tried to fix it partial: https://github.com/Zenithar/hugo-theme-bleak/pull/47

NicoHood avatar May 20 '18 12:05 NicoHood