其实很简单, 从post的header里面进行参数设置

layout: post
title: Jekyll x Liquid: 文章置顶功能的实现
category: 个人博客
tags: [个人博客,Jekyll,文章置顶,gorpeln]
description: 
stickie: true

然后liquid进行判断(*号换成%)

{* for post in site.posts *}
    {* if post.stickie != true *}
        {* continue *}
    {* endif *}
    <div>置顶文章细节</div>
{* endfor *}
{* for post in site.posts *}
    {* if post.stickie == true *}
        {* continue *}
    {* endif *}
    <div>普通文章细节</div>
{* endfor *}

当然这个可以进行多种扩展, 比如只输出特定类别的文章等等,这里就是个只输出带有gorpeln这个tag的post

{* for post in site.posts *}

    {* assign isGorpeln = 0 *}

    {* for tag in post.tags *}
        {* if tag == gorpeln *}
           {* assign isGorpeln = 1 *}
        {* endif *}
    {* endfor *}

    {* if isGorpeln == 0 *}
      {* continue *}
    {* endif *}

{* endfor *}