Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachments URL wrong if site is deployed under subpath #550

Open
Nightshadelink opened this issue Jan 10, 2023 · 0 comments
Open

Attachments URL wrong if site is deployed under subpath #550

Nightshadelink opened this issue Jan 10, 2023 · 0 comments

Comments

@Nightshadelink
Copy link

Problem:

Whenever the web pages are not deployed in the root but under a subpath it shows that in the attachement.html a leading slash is used too much in the URL. So the full BasePath is not used relatively, but absolute "$fileDir", "$filesName" and ".Name".

Example:

Presumed cause:

In .../layouts/shortcodes/attachments.html

<a href="{{ (printf "%s%s/%s" $fileDir $filesName .Name) | relLangURL }}">{{.Name}}</a>

$fileDir probably (didn't test) carries a leading slash hence relLangURL does not utilize the BasePath fully.

Proposed modification:

Remove leading slash.
This works for now, but presumably you have a better solution for fixing.

<a href="{{ slicestr (printf "%s%s/%s" $fileDir $filesName .Name) 1 | relLangURL }}">{{.Name}}</a>

System-Info:

vanilla deployed on github-pages

maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
and make default style darkish grey similar to other shortcodes
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
maxatome pushed a commit to maxatome/hugo-theme-learn that referenced this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant