aboutsummaryrefslogtreecommitdiff
path: root/source/03_meta
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-08-26 23:56:10 +0200
committerAdrian Kummerlaender2014-08-26 23:56:10 +0200
commit7db86c66b4f187c4d10776428af1ce8817d3459c (patch)
tree1f72e7b3cdc660c6fecafed713a1a0b8ca9100d5 /source/03_meta
parent8aca155ea840cb3064d58b78508195be3bbcfdb3 (diff)
downloadblog.kummerlaender.eu-7db86c66b4f187c4d10776428af1ce8817d3459c.tar
blog.kummerlaender.eu-7db86c66b4f187c4d10776428af1ce8817d3459c.tar.gz
blog.kummerlaender.eu-7db86c66b4f187c4d10776428af1ce8817d3459c.tar.bz2
blog.kummerlaender.eu-7db86c66b4f187c4d10776428af1ce8817d3459c.tar.lz
blog.kummerlaender.eu-7db86c66b4f187c4d10776428af1ce8817d3459c.tar.xz
blog.kummerlaender.eu-7db86c66b4f187c4d10776428af1ce8817d3459c.tar.zst
blog.kummerlaender.eu-7db86c66b4f187c4d10776428af1ce8817d3459c.zip
Implemented a more balanced category sort logic
* random sort order of page-entries on category pages led to unsatisfing results * the entries are now sorted in an alternating fashion depending on their digest length * this produces a much more consistent and balanced output
Diffstat (limited to 'source/03_meta')
-rw-r--r--source/03_meta/categories.xsl22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/03_meta/categories.xsl b/source/03_meta/categories.xsl
index a0b1a41..a2945b3 100644
--- a/source/03_meta/categories.xsl
+++ b/source/03_meta/categories.xsl
@@ -20,12 +20,14 @@
<xsl:variable name="page" select="$root/pages/entry[@handle = $handle]"/>
- <title>
- <xsl:value-of select="$page/title"/>
- </title>
- <digest>
- <xsl:copy-of select="$page/content/p[1]/node()"/>
- </digest>
+ <page handle="{$handle}">
+ <title>
+ <xsl:value-of select="$page/title"/>
+ </title>
+ <digest size="{string-length($page/content/p[1])}">
+ <xsl:copy-of select="$page/content/p[1]/node()"/>
+ </digest>
+ </page>
</xsl:template>
<xsl:template match="files/pages/*[name() != 'file']">
@@ -35,11 +37,9 @@
</xsl:template>
<xsl:template match="files/pages/*/file[./extension = '.md']">
- <page handle="{./name}">
- <xsl:call-template name="get_page_data">
- <xsl:with-param name="handle" select="./name"/>
- </xsl:call-template>
- </page>
+ <xsl:call-template name="get_page_data">
+ <xsl:with-param name="handle" select="./name"/>
+ </xsl:call-template>
</xsl:template>
</xsl:stylesheet>