diff options
-rw-r--r-- | strus/document.ana | 14 | ||||
-rw-r--r-- | themes/new_theme/layouts/partials/ranklist.html | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/strus/document.ana b/strus/document.ana index a296775..3ffefa8 100644 --- a/strus/document.ana +++ b/strus/document.ana @@ -1,11 +1,14 @@ -[Attribute] - docid = orig content /posts/post/slug(); - filename = orig content /posts/post/filename(); -# title = orig content /posts/post/meta()/title(); +[Document] + post = /posts/post; [Content] "encoding=UTF-8; content=JSON;" /posts/post/meta(); +[Attribute] + docid = orig content /posts/post/slug(); + filename = orig content /posts/post/filename(); + title = orig content /posts/post/meta()/title(); + [SearchIndex] # word = lc:convdia(en):stem(en):lc word /posts/post/body/para(); # word = orig split /posts/post/body/para(); @@ -13,9 +16,6 @@ [ForwardIndex] word = orig split /posts/post/body/para(); - -[Document] - post = /posts/post; #[MetaData] # release_date = date2int("d 1877-01-01", "%Y-%m-%d %H:%M:%s *") content /posts/post/meta()/date; diff --git a/themes/new_theme/layouts/partials/ranklist.html b/themes/new_theme/layouts/partials/ranklist.html index 65607c7..9c91422 100644 --- a/themes/new_theme/layouts/partials/ranklist.html +++ b/themes/new_theme/layouts/partials/ranklist.html @@ -70,13 +70,13 @@ for( var i = 0; i < data.ranklist.ranks.length; i++ ) { var rank = data.ranklist.ranks[i]; var abstract = ''; - var slug = ''; + var title = 'No Title'; var docid = ''; html += "<li>"; for( var j = 0; j < rank.attributes.length; j++ ) { var attribute = rank.attributes[j]; - if( attribute.key == 'filename' ) { - slug = attribute.value; + if( attribute.key == 'title' ) { + title = attribute.value; } else if( attribute.key == 'docid' ) { docid = attribute.value; } else { @@ -84,7 +84,7 @@ } } html += "<div class='title'>" - html += "<a href=\"" + docid + "\">" + slug + "</a></div>"; + html += "<a href=\"" + docid + "\">" + title + "</a></div>"; if( abstract != '' ) { html += "<div class='abstract'>" + abstract + "</div>"; } @@ -131,12 +131,12 @@ ] }, { - attribute: "slug", + attribute: "title", name: "attribute", params: [ { key : "name", - value : "filename" + value : "title" } ] }, |