Twitter cards not working as path are rewritten to relative


My problem is the following: twitter cards are not working, image is not showing (og works fine). I’ve gone through Card error, unable to render, or no image: READ THIS FIRST - Cards - Twitter Developers , and the only issue I find is “Are you using an absolute and full URL (including the http protocol piece), not a relative one?

And indeed,URL in meta tags are relative, which facebook recognizes but twitter does not, for example in index.html:

<meta name=twitter:card content="summary_large_image">
<meta name=twitter:image content="/images/banner-osc.png">
<meta name=twitter:title content="Open Source Church">

But when I run hugo --minify --gc --buildFuture locally, here is the output of index.html:

<meta name=twitter:card content="summary_large_image">
<meta name=twitter:image content="">
<meta name=twitter:title content="Open Source Church">

So it seems to me that somewhere, netlify is changing the URL from absolute to relative, and I can find where, why or how to deactivate. This happens on as well as custom domain (

Here is a link to the deploy log: Netlify App. I’ve searched the doc to understand what exactly is behind those lines, but without succes:

10:03:31 AM: Starting post processing
10:03:31 AM: Post processing - HTML
10:03:35 AM: Post processing - header rules
10:03:35 AM: Post processing - redirect rules
10:03:35 AM: Post processing done

By the way, asset optimization is disabled in settings, and here is my netlify.toml (to be honnest I’ve copied from somewhere, and I don’t understand what the headers.values means…)

  publish = "public"
  command = "hugo --minify --gc --buildFuture"
  HUGO_VERSION = "0.92.0"

  for = "/*" # This defines which paths this specific [[headers]] block will cover.

  X-Frame-Options = "DENY"
  X-XSS-Protection = "1; mode=block"
  Referrer-Policy = "same-origin"
  Strict-Transport-Security = "max-age=31536000; includeSubDomains; preload"

Thanks !

Hi @olivierk

In the config.toml is the line

baseURL = ""

However, in the netlify.toml you are setting

This overrides the baseURL in the config.toml.