- Blog/
 
Udeluk bestemte indholdstyper fra søgeindeks i Hugo
    
    
      ·109 ord·1 minut
    
    
    
  
  
  
    
  
      Jeg ønskede ikke mine micro-blogging “snippets” som jeg vil bruge på LinkedIn, skulle “forurene” søgeindekset her på Kiils.
Derfor skiftede jeg
[                                                                          
    {{ range $index, $value := where .Site.Pages ".Draft" false }}         
    {{ if $index }}, {{ end }}                                             
    {                                                                      
        "url": "{{ .RelPermalink }}",                                      
        "title": "{{ .Title }}",                                           
        "content": {{ .Content | plainify | jsonify }}                     
    }                                                                      
    {{ end }}                                                              
]      
ud med
[                                                                          
    {{ range $index, $value := where ( where .Site.Pages "Section" "!=" "short" ) ".Draft" false }}                                                   
    {{ if $index }}, {{ end }}                                             
    {                                                                      
        "url": "{{ .RelPermalink }}",                                      
        "title": "{{ .Title }}",                                           
        "content": {{ .Content | plainify | jsonify }}                     
    }                                                                      
    {{ end }}                                                              
]