Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Fix img path for baseurl with subdirectory #33

Merged
merged 1 commit into from
Jul 5, 2019

Conversation

pacollins
Copy link
Owner

Description

Previously, site where baseurl contained a subdirectory (e.g. site.com/main/) would place images at site.com/img instead of site.com/main/img.

New Code:
<img src="{{ (path.Join "img" (cond (eq .Params.featuredpath "date") (.Page.Date.Format "2006/01") (.Params.featuredpath)) .Params.featured) | relURL }}" alt="{{ .Params.featuredalt }}">

Motivation and Context

Closes #32

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

@pacollins pacollins merged commit 8099910 into master Jul 5, 2019
@pacollins pacollins deleted the bug-fix-img-path-generic branch July 5, 2019 15:44
@pacollins pacollins mentioned this pull request Jul 5, 2019
@VincentTam
Copy link
Collaborator

Thanks for the fix! This works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Incorrect image paths
2 participants