是否可以验证链接(或字符串)是否与任何有效的Jekyll permalink匹配?

是否可以验证链接(或字符串)是否与任何有效的Jekyll permalink匹配?,jekyll,liquid,permalinks,jekyll-extensions,Jekyll,Liquid,Permalinks,Jekyll Extensions,是否可以验证链接(或字符串)是否与任何有效的Jekyll permalink匹配 例如,我动态生成一个导航栏,如下所示: <li class="active"> <a href="{{ base }}/{{ site.locale }}/about/the-project/">About</a> </li> 现在,是否有可能知道“{{base}}/{{site.locale}}}/about/the project/”是否是有效的永久链

是否可以验证链接(或字符串)是否与任何有效的Jekyll permalink匹配

例如,我动态生成一个导航栏,如下所示:

<li class="active">
  <a href="{{ base }}/{{ site.locale }}/about/the-project/">About</a>
</li>
  • 现在,是否有可能知道“{{base}}/{{site.locale}}}/about/the project/”是否是有效的永久链接


    如果链接与任何有效的永久链接不匹配,则跳过“LI”标记。

    因此,我基本上是在使用我的站点地图

    {% assign tmp_posts = site.posts | where:'locale', site.locale %}
    {% assign tmp_buildlogs = site.buildlog | where:'locale', site.locale %}
    {% assign all_posts = tmp_posts | concat: tmp_buildlogs %}
    
    然后,我可以检查链接