Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kflu committed Jan 9, 2017
1 parent 58243a2 commit f5e15e0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/plugins/helper/open_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ function openGraphHelper(options) {

images = images.map(function(path) {
if (!urlFn.parse(path).host) {
if (path[0] !== '/') {
// resolve `path`'s absolute path relative to current page's url
return urlFn.resolve(url, path);
}
// resolve `path`'s absolute path relative to current page's url
// `path` can be both absolute (starts with `/`) or relative.
return urlFn.resolve(url || config.url, path);
}

return path;
Expand Down

0 comments on commit f5e15e0

Please sign in to comment.