Skip to content
Snippets Groups Projects
search.json 1.02 KiB
Newer Older
  • Learn to ignore specific revisions
  • {% if site.baseurl != '/' %}
    {% assign base_url = site.baseurl %}
    
    Uwe Jandt (DESY, HIFIS)'s avatar
    Uwe Jandt (DESY, HIFIS) committed
    {% else %}
    {% assign base_url = '' %}
    
    [
      {% for post in site.posts %}
        {
    
          "title"    : "{{ post.title | escape }}",
    
    Uwe Jandt (DESY, HIFIS)'s avatar
    Uwe Jandt (DESY, HIFIS) committed
          "url"      : "{{ base_url }}{{ post.url }}",
    
          "category" : "{{ post.category }}",
          "tags"     : "{{ post.tags | join: ', ' }}",
          "date"     : "{{ post.date }}",
          "content"  : "{{ post.content | strip_html | strip_newlines | remove_chars | escape }}"
    
        } {% unless forloop.last %},{% endunless %}
      {% endfor %}
      ,
      {% for page in site.pages %}
       {
         {% if page.title != nil %}
            "title"    : "{{ page.title | escape }}",
            "category" : "{{ page.category }}",
            "tags"     : "{{ page.tags | join: ', ' }}",
    
    Uwe Jandt (DESY, HIFIS)'s avatar
    Uwe Jandt (DESY, HIFIS) committed
            "url"      : "{{ base_url }}{{ page.url }}",
    
            "date"     : "{{ page.date }}",
            "content"  : "{{ page.content | strip_html | strip_newlines | remove_chars | escape }}"
         {% endif %}
       } {% unless forloop.last %},{% endunless %}
      {% endfor %}
    ]