Jekyll: خطأ نحوي سائل

تم إنشاؤها على ١٧ سبتمبر ٢٠١٦  ·  3تعليقات  ·  مصدر: jekyll/jekyll

  • [] أعتقد أن هذا خطأ ، وليس سؤالًا حول استخدام Jekyll.
  • [x] لقد قمت بالتحديث إلى أحدث إصدار من Jekyll (أو) إذا كنت على GitHub Pages إلى أحدث github-pages
  • [x] قرأت ملف المساهمة على https://jekyllrb.com/docs/contributing/
  • [] هذا طلب ميزة.

  • [] أنا على (أو قمت باختبار) _macOS _ 10+
  • [x] أنا على (أو قمت باختبار) _Debian / Ubuntu _ GNU / Linux
  • [] أنا (أو أجريت الاختبار على) _Fedora _ GNU / Linux
  • [] أنا (أو أجريت الاختبار على) _Arch _ GNU / Linux
  • [] أنا (أو قمت باختبار) _Other _ GNU / Linux
  • [] أنا على (أو أجريت الاختبار على) _Windows _ 10+

  • [] كنت أحاول التثبيت.
  • [] هناك واجهة برمجة تطبيقات البرنامج المساعد معطلة.
  • [] حدث خطأ في صفحات GitHub وقمت بإعادة إنتاجه محليًا.
  • [] كان لدي خطأ في صفحات GitHub ، وقال دعم GitHub أنه كان خطأ Jekyll.
  • [] حدث خطأ في صفحات GitHub ولم أختبره محليًا.
  • [] كنت أحاول البناء.
  • [x] كان خطأ آخر.

    خطواتي الإنجاب

أتلقى التحذير التالي أثناء التجميع ، كيف يمكنني إصلاح هذا

Liquid Warning: Liquid syntax error (line 5): Expected id but found open_square in "item in site.[item.label]" in feeds/feed.json
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html
    Liquid Warning: Liquid syntax error (line 19): Expected id but found open_square in "post in site.categories.[page.category]" in /_layouts/category.html

category.html

<h1 class="title">{{ page.title }}</h1>

{% unless page.content == '' %}
  <p>{{ page.content }}</p>
{% endunless %}
<ul id="blog-posts" class="posts">
{% for post in site.categories.[page.category] %}
  <li><span>{{ post.date | date: "%d/%m/%Y" }} &raquo;</span><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>

feed.json

{% assign first = true %}
[
{% for collection in site.collections %}
    {% for item in collection %}
        {% for item in site.[item.label] %}
            {% if item.title != null and item.title != empty %}
            {% unless first %},{% endunless %}{
                "title": {{item.title | jsonify}},
                "content": {{item.content | markdownify | strip_html | jsonify}},
                "link": "{{ site.baseurl }}{{ item.url }}",
                "date": "{{ item.date }}",
                "excerpt": "{{ item.snippet }}",
                "search_omit": "{{ item.search_omit }}"
            }
            {% assign first = false %}
            {% endif %}
        {% endfor %}
    {% endfor %}
{% endfor %}


{% for post in site.posts %}
    {% if post.title != null and post.title != empty %}
    {% unless first %},{% endunless %}{
        "title": {{post.title | jsonify}},
        "content": {{post.content | markdownify | strip_html | jsonify}},
        "link": "{{ site.baseurl }}{{ post.url }}",
        "date": "{{ post.date }}",
        "excerpt": "{{ post.snippet }}",
        "search_omit": "{{ post.search_omit }}"
    }
    {% assign first = false %}
    {% endif %}
{% endfor %}

{% for page in site.pages %}
    {% if page.title != null and page.title != empty %}
    {% unless first %},{% endunless %}{
        "title": {{page.title | jsonify}},
        "content": {{page.content | strip_html | jsonify}},
        "link": "{{ site.baseurl }}{{ page.url | replace: 'index.html', '' }}",
        "date": {{ page.date | jsonify }},
        "excerpt": {{ page.description | jsonify }},
        "search_omit": "{{ page.search_omit }}"
    }
    {% assign first = false %}
    {% endif %}
{% endfor %}
]
frozen-due-to-age

التعليق الأكثر فائدة

MertcanGokgoz الارتباط الخاص بك هو 404ing. هل يمكنك تقديم حل؟

تحرير: يبدو أنه يجب استبدال site.tags.[page.tag] بـ site.tags[page.tag] (إزالة النقطة)

ال 3 كومينتر

هذا ليس خطأ.

للحصول على مساعدة بشأن استخدام Jekyll ، يرجى نشر سؤالك على https://talk.jekyllrb.com

كما تنص رسالة الخطأ ، site.categories.[page.category] غير صالح.

MertcanGokgoz الارتباط الخاص بك هو 404ing. هل يمكنك تقديم حل؟

تحرير: يبدو أنه يجب استبدال site.tags.[page.tag] بـ site.tags[page.tag] (إزالة النقطة)

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات