0

Hello I have inserted html elements into my yml file

  content : |
    Hello! I am a <span>Graphic Designer</span> & <span>Web Developer</span>.

This is how I added this content to my html <div class="content">{{ .content | markdownify }}</div> But once I tried to style it that way, it does not work, I wonder why!

.content{
    span{  
        color: $primary; 
    }
}
DINA TAKLIT
  • 7,074
  • 10
  • 69
  • 74

2 Answers2

2

Enable unsafe markup in yaml from the hugo config file.

Hugo shortcode ignored saying "raw HTML omitted"

markup:
  goldmark:
    renderer:
      unsafe: true
Jkarttunen
  • 6,764
  • 4
  • 27
  • 29
1

Thank you for your answer Jkarttunen, based on the link you shared: I was getting the same thing once I verified my generated website

Hugo shortcode ignored saying “raw HTML omitted”

So to fix it In the Hugo config file, you need to tell the default Markdown renderer, to render raw HTML.

  • For config.yml, you should add
markup:
  goldmark:
    renderer:
      unsafe: true
  • In my cas since I am using config.toml, I should add:
[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

Check the link shared in the previous response for more details.

DINA TAKLIT
  • 7,074
  • 10
  • 69
  • 74