Skip to content

Conversation

@d3vzer0
Copy link

@d3vzer0 d3vzer0 commented May 28, 2025

Hi team,

I'm using the latest version of Hugo (v0.147.6) and running the server will issue a warning + error when trying to render the map-embedding.html partial. Initially the server shows the following warning:

WARN  Doubtful use of partial function in {{ partial "partials/map-embedding.html"}}), this is most likely not what you want. Consider removing superfluous prefix "partials/" from template name given as first function argument.

Followed by an error, stopping the server:

Error: error building site: render: failed to render pages: render of "/my_path/conference-site/themes/event/content/_content.gotmpl:/location" failed: "/my_path/themes/event/layouts/_default/baseof.html:32:8": execute of template failed: template: miscellaneous/location.html:32:8: executing "main" at <partial "partials/map-embedding.html" (dict "embeddableMapUrl" $event.map.embeddableMapUrl "viewLargerMapUrl" $event.map.viewLargerMapUrl)>: error calling partial: partial "partials/map-embedding.html" not found

This can be fixed by removing the "partials/" prefix".

Also spotted another small issue, where the URL for partners is not referenced correctly. The sponsor-card.html template uses the "companyUrl" variable to fill in the URL for the sponsor and partners cards, however, sponsors.html attempts to use "profileUrl" when rendering the template for the validPartners section. Renaming this to companyUrl fixes the issue and now the cards for partners contain the valid URL as defined in the hugo config :)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings
  • My changes take different screen sizes into account
  • My changes are backward compatible
    • I have not changed any parameter names
    • I have not changed any translation keys
  • My changes conform to the contributing guidelines (CONTRIBUTING.md)

@d3vzer0 d3vzer0 changed the title Fixed loading of map-embedding.html (warning-partial-superfluous-prefix) Fixed loading of map-embedding.html (warning-partial-superfluous-prefix) + fixed URL reference in partner URL May 29, 2025
@d3vzer0 d3vzer0 changed the title Fixed loading of map-embedding.html (warning-partial-superfluous-prefix) + fixed URL reference in partner URL Fixed loading of map-embedding.html (warning-partial-superfluous-prefix) + fixed URL in cards for partners May 29, 2025
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

Successfully merging this pull request may close these issues.

1 participant