.Page.File.Dir : Problem with output
Helle everyone, I’m using {{ .Page.File.Dir }} in my template It renders as ./dirA%5dirB%5 instead of ./dirA/dirB/. How to change %5 to /? What am I doing wrong? Thank you very much and many greetings...
View Article.Page.File.Dir : Problem with output
I couldn’t reproduce it, if you’re using it as an element attribute value, safeHTMLAttr may help, for example. <p {{ printf `data-dir="%s"` .Page.File.Dir | safeHTMLAttr }}></p> Read full...
View Article.Page.File.Dir : Problem with output
Thank you @razon , it doesn’t help. Read full topic
View Article.Page.File.Dir : Problem with output
Cloud you please provide a reproducible code. Read full topic
View Article.Page.File.Dir : Problem with output
rufus42: It renders as ./dirA%5dirB%5 Really? Are you sure it’s not: It renders as ./dirA%5CdirB%5C Read full topic
View Article.Page.File.Dir : Problem with output
Hello @jmooring , thanks for your eye. You are right, it renders as ./dirA%5CdirB%5C. So the question is: How to change %5c to / ? What am I doing wrong? Read full topic
View Article.Page.File.Dir : Problem with output
You’re on a Windows system, so the OS path separators are backslashes (\). The hex representation is 5C. If you are trying to use .File.Dir to build a URL or something, pass it through path.Clean....
View Article.Page.File.Dir : Problem with output
Thank you @jmooring, it doesn’t help. Is there another way to get the URL? Read full topic
View Article.Page.File.Dir : Problem with output
Please post a link to the public repository for your project. See Requesting Help. Let us see your code Include a link to the source code repository of your project, because we really need the context...
View Article.Page.File.Dir : Problem with output
Thank you again for your good will @jmooring. I had a typo. Your answer solved my problem by using {{ path.Clean .Page.File.Dir }} Read full topic
View Article.Page.File.Dir : Problem with output
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed. Read full topic
View Article