我正在尝试按字母顺序而不是按日期对我的“类别”页面中的帖子进行排序。有了这个,我正在尝试分配一个新的变量sorted_posts
,但我在endfor
---
layout: page
---
{% unless page.content == '' %}
{{ content }}
{% endunless %}
<ul class="posts-list">
{% assign category = page.category | default: page.title %}
{% assign sorted_posts = site.categories[category] | sort: post.title}
{% for post in site.categories[category] %}
<li>
<h3>
<a href="{{ site.baseurl }}{{ post.url }}">
{{ post.title }}
<!-- <small>{{ post.date | date_to_string }}</small> -->
</a>
</h3>
</li> {% endfor %} </ul>
错误在哪里
Error: Liquid syntax error (line 16): Unknown tag 'endfor'
Error: Run jekyll build --trace for more information.
非常感谢! =]
答案 0 :(得分:-1)
也许这是因为您在第6行错过了# simulate some data
country <- data.frame(year = 2000:2017,
GDP = rep(100, 18),
Population = rep(1000, 18))
country[19:23,1] <- seq(2018, by=1, length.out = 5)
# define gdp and pop parameters
hypo_gdp = 5
hypo_pop = 2
# define common ratios
b1 <- (1 + hypo_gdp/100)
b2 <- (1 + hypo_pop/100)
# calculate values for years 2018-2022
country[19:23,2] = country$GDP[18]* b1 ^ (1:5)
country[19:23,3] = country$Population[18]* b2 ^ (1:5)
tail(country)
# year GDP Population
# 18 2017 100.0000 1000.000
# 19 2018 105.0000 1020.000
# 20 2019 110.2500 1040.400
# 21 2020 115.7625 1061.208
# 22 2021 121.5506 1082.432
# 23 2022 127.6282 1104.081
。请尝试将其更改为:
%
你的语法似乎是正确的。