Skip to content

Conversation

@TheSpeedyFrog
Copy link

Set IsExternalRefsAllowed to true and provide a ReadFromURIFunc.

Fixes #8067

@CLAassistant
Copy link

CLAassistant commented Jun 8, 2023

CLA assistant check
All committers have signed the CLA.

@TheSpeedyFrog TheSpeedyFrog force-pushed the iss8067_support_external_openai_ref branch from 645aa72 to c3c773c Compare June 9, 2023 08:43
return nil, err
}

return ioutil.ReadAll(file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return ioutil.ReadAll(file)
return io.ReadAll(file)

ioutil is deprecated. See #10732

Comment on lines 99 to 102
var relativePath string

if strings.HasPrefix(url.Path, "./") {
relativePath = strings.TrimRightFunc(key, func(r rune) bool { return r != '/' }) + strings.TrimPrefix(url.Path, "./")
} else {
relativePath = url.Path
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var relativePath string
if strings.HasPrefix(url.Path, "./") {
relativePath = strings.TrimRightFunc(key, func(r rune) bool { return r != '/' }) + strings.TrimPrefix(url.Path, "./")
} else {
relativePath = url.Path
}
relativePath := url.Path
if strings.HasPrefix(url.Path, "./") {
relativePath = strings.TrimRightFunc(key, func(r rune) bool { return r != '/' }) + strings.TrimPrefix(url.Path, "./")
}
if err != nil {
return nil, err
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing defer file.Close()

Copy link

@andrew-werdna andrew-werdna Sep 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just throwing this out there, but it looks like the contributor added the defer file.Close() on line 108

Set IsExternalRefsAllowed to true and provide a ReadFromURIFunc.

Fixes gohugoio#8067
@TheSpeedyFrog TheSpeedyFrog force-pushed the iss8067_support_external_openai_ref branch from c3c773c to 8ee09a6 Compare June 9, 2023 12:16
@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
Please check https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md#code-contribution and verify that this code contribution fits with the description. If yes, tell is in a comment.
This PR will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Jan 28, 2025
@github-actions github-actions bot closed this Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 participants