-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Open
Milestone
Description
What version of Hugo are you using (hugo version)?
$ hugo version hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended linux/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=snap:0.119.0
Does this issue reproduce with the latest release?
yes
Steps to reproduce
- Create a new repo
- Add
config.yamlwith the following contents
# config.yaml
disableKinds:
- sitemap
- taxonomy
- term
outputs:
home:
- html
- Add
layouts\index.htmlwith the following contents
{{/* prebuild/layouts/index.html */}}
<ul>
{{ with resources.GetRemote "https://blog.arb.dev/feed/?t=1698195621" | transform.Unmarshal }}
{{ range .channel.item }}
{{ $timestamp := time .pubDate }}
{{ $link := .link | plainify | htmlUnescape }}
{{ $postID := replace $link "https://blog.arb.dev/" "" }}
{{ $postID := replace $postID "/" "-" }}
{{/* 1. */}} {{ $string := printf "<h1>%s</h1>%s" .title .description }}
{{/* 2. */}} {{ $filename := printf "post/%s/%s.md" (urlize $timestamp.Year) (urlize $postID) }}
{{/* 3. */}} {{ $resource := resources.FromString $filename $string }}
{{/* 4. */}} {{ $file := $resource.RelPermalink }}
<li><a href="{{$filename}}">{{$filename}}</a></li>
{{ end }}
{{ end }}
</ul>
-
Run
hugo serverand you will see a successfully generated page with links to all of files that have been generated

-
Run
hugoand no child files will be generated and the resultingindex.htmlpage will be blank
Additional info:
If you print the output of resources.GetRemote "https://proton.me/blog/feed" | transform.Unmarshal on build it generates the following error.
map[error calling resources.GetRemote:failed to resolve media type for remote resource "https://blog.arb.dev/feed/?t=1698195621"]
Please note, I'm using https://blog.arb.dev/feed/?t=1698195621 as a stand in for the this example.