[blogger template customize]Elegant navigation for the archive page

You can test elegant archive navigation. /2016_08_28_archive.html

  1. JS free!
  2. Use a BlogArchive widget for navigation.(BlogArchive widget limite is just 2.)
  3. Use lambda expression to get last index of loop.
    <b:with var='ylast' value='data:data.data count ( y => y.name != &quot;&quot; )'/>
  4. Only <b:eval> and <b:with> can touch list item directly.
  5. Need a space around the operator.
    <b:with var='_m' value='data:y.data[data:mi + 1]'/>

Elegant Archive Pager

<b:widget id='BlogArchive1' locked='true' type='BlogArchive' mobile='yes'>
    <b:includable id='main'>
        <b:if cond='data:blog.pageType == "archive"'>
            <b:loop values='data:data' var='y' index='yi'>
                <b:loop values='data:y.data' var='m' index='mi'>
                    <b:if cond='data:m.url == data:blog.url'>
                        <b:with var='mlast' value='data:y.data count ( _m => _m.url != &quot;&quot; )'>
                            <b:if cond='data:mlast - 1 != data:mi'>
                                <b:with var='_m' value='data:y.data[data:mi + 1]'>
                                    <a expr:href='data:_m.url' hidefocus="true"><data:y.name/>-<data:_m.name/>(<data:_m.post-count/>)</a>
                                </b:with>
                            <b:else/>
                                <b:with var='ylast' value='data:data count ( _y => _y.name != &quot;&quot; )'>
                                    <b:if cond='data:ylast - 1 != data:yi'>
                                        <b:loop values='data:data' var='_y' index='_yi'>
                                            <b:if cond='data:yi + 1 == data:_yi'>
                                                <b:with var='_m' value='data:_y.data[0]'>
                                                    <a expr:href='data:_m.url' hidefocus="true"><data:_y.name/>-<data:_m.name/>(<data:_m.post-count/>)</a>
                                                </b:with>
                                            </b:if>
                                        </b:loop>
                                    </b:if>
                                </b:with>
                            </b:if>
                        </b:with>

                        <b:if cond='data:mi == 0'>
                            <b:if cond='data:yi != 0'>
                                <b:loop values='data:data' var='_y' index='_yi'>
                                    <b:if cond='(data:yi - 1) == data:_yi'>
                                        <b:with var='mlast' value='data:_y.data count ( _m => _m.url != &quot;&quot; )'>
                                            <b:with var='_m' value='data:_y.data[data:mlast - 1]'>
                                                <a expr:href='data:_m.url' hidefocus="true"><data:_y.name/>-<data:_m.name/>(<data:_m.post-count/>)</a>
                                            </b:with>
                                        </b:with>
                                    </b:if>
                                </b:loop>
                            </b:if>
                        <b:else/>
                            <b:with var='_m' value='data:y.data[data:mi - 1]'>
                                <a expr:href='data:_m.url' hidefocus="true"><data:y.name/>-<data:_m.name/>(<data:_m.post-count/>)</a>
                            </b:with>
                        </b:if>
                    </b:if>
                </b:loop>
            </b:loop>
        </b:if>
    </b:includable>
</b:widget>

Loop monster (T-T)...