I added the file inside js folder which is by default located under static folder. I am trying to use this feature which is mentioned by the author that it works with Hugo
So, you are telling me that I cannot use js files locally with Hugo? My question is that why the Hugo cannot load the js file inside Hugo file structure. I can solve the rest myself hopefully.
Of course you can. Create a folder static/JS from the root of your project and put your JS files in there. Otherwise, please share source code and be sure to check your JS console/dev tools to make sure your paths are correct.
Is it me mis-reading it, or did you say you added “this info” into your pages markdown file where you want the back-to-top button to be seen… except that where you’ve put it looks like front matter… which is not a “place” on your page, just metadata that can be used.
I have managed to locate the correct path to use the *js file locally. Thanks
Hovewer, when i click the arrow, it sends me to the main page instead of sending me to the very top of the page i am on. I know it is something to do with Hugo for sure. I am not a web developer and I am sorry if I am posting something out of topic here. My site is here if anyone wants to give a hand on this script issue, thanks ozanweb.github.io
From what I see the script you use changes the URL location hash when the back to top button is clicked. It does not redirect the user to the home page because the user is already on the home page.
For example when scrolling down at the location hash https://ozanweb.github.io/#solutions once I click the button the content fades out and the location hash is changed to https://ozanweb.github.io/#
Your issue has nothing to do with Hugo.
You may try another script but from what I gather your theme already uses some other JS function or CSS to fade in content once a menu option is clicked.
I doubt that you will get what you want with this theme.
Also your menu disappears when the content is loaded. What is the point of scrolling to the top of the content if the menu is not visible?
Your page is functional as is. If this not what you want try a different theme.
I’m not closing this thread (like I did your other one) but this is also OT.
(If another moderator feels that this should be closed he/she may do it).
Thanks for not locking it, I really appreciate your time. If you notice, I always share the solution I find at the end of each thread created by me. So I do not want to be seen like a spammer here since my only aim is to develop my Hugo/html skill. The page located at https://ozanweb.github.io/#solutions has links at the top. I want the reader not to get lost on this “long” page where many items are listed. This is my second theme and I am too lazy to change it third time.
In that case you need to find or write a script that does not change the URL location hash and when called scrolls the page to the top of the viewport.
P.S. I hardly speak any Turkish but anyway, iyi geceler.