@charlie posted a new topic, subject "Add rel='nofollow' to Markdown front matter". It read:

   Hi,
    
    How would I go about adding rel=‘nofollow' to the url in the front matter (YAML format) for just one specific post?
    [code] 
        ---
        title: "spf13-vim 3.0 release and new website"
        description: "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
        date: "2012-04-06"
        url: https://gohugo.io/content/front-matter/
        ---
        
        Content of the file goes Here
        
    [/code]
    
    Thanks.

@bep (Bjørn Erik Pedersen) replied

    rel=´nofollow´ is an attribute in a link (a href …) and has nothing to do with front matter.

So @charlie replied

    I understand. I was just wondering if there's a way to add it (somehow) to the markdown file instead of writing it out in html. Does that make sense?
    
    In the code below, I've written out the post just to give you a better idea. The whole `section class` is just duplicating the code, but allows me to use `rel='nofollow'`.
    [code] 
            <div class="content">
              <p class="content-subhead"></p>
        
              <section class="post">
                <header class="post-header">
                  <h2 class="post-title">
                    <a href="" rel='nofollow' target="_blank"></a>
                  </h2>
                  <p>
                  </p>
                </header>
        
                <div class="post-description">
                  <p>
                
                  </p>
                </div>
              </section>
              <div class="posts">
                {{ range .Data.Pages.ByTitle }}
                  {{ .Render "summary" }}
                {{ end }}
              </div>
            </div>
    [/code]

Then @bep (Bjørn Erik Pedersen) said

    OK, that makes more sense.
    
    I don't think it's possible with pure markdown. But you can mix markdown and html and put a <a href … in there.
    
    For markddown we could and should expose Blackfriday's HTML_NOFOLLOW_LINKS setting, but that would be per page or site.

So @charlie replied

    In this case, as I need it for just a post (not page or site) it seems as I've I'll have to write out the html. Thanks for helping out.

@bep (Bjørn Erik Pedersen) replied

    With “page” I ment “a post” – or the markdown in a post. But currently, as I said, you would have to spell out the HTML yourself.


{'source': 'discourse', 'url': 'https://discourse.gohugo.io/t/add-rel-nofollow-to-markdown-front-matter/1655', 'title': "Add rel='nofollow' to Markdown front matter", 'views': 3267, 'has_accepted_answer': False, 'word_count': 302, 'like_count': 0, 'reply_count': 3, 'participant_count': 2, 'posts': 6, 'tags': '', 'author': '@charlie', 'participants': '@charlie, @bep (Bjørn Erik Pedersen)', 'image_url': [None], 'created_at': '2015-09-03T10:45:50.640Z', 'last_posted_at': '2015-09-03T12:30:35.673Z'}