summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/generators.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/generators.c b/src/generators.c
index 3bd00a3..c1eaf5a 100644
--- a/src/generators.c
+++ b/src/generators.c
@@ -117,7 +117,8 @@ get_display_item_index (TAlbum *items, TIndexItem *item)
if (tmp_item->type == INDEX_ITEM_TYPE_PICTURE && (! tmp_item->hidden))
real_item_index++;
if (tmp_item == item)
- return real_item_index;
+ /* non-picture items shall be index-bound to the next picture item */
+ return real_item_index + ((tmp_item->type != INDEX_ITEM_TYPE_PICTURE) ? 1 : 0);
}
return 0;
}
@@ -1154,11 +1155,13 @@ write_html_page (TGallerySetup *setup,
case INDEX_ITEM_TYPE_SEPARATOR:
s1 = block_parser_get_data (block_parser, "LIST_SEPARATOR");
replace_table_add_key (local_replace_table, "LIST_SEPARATOR_TITLE", iter_item->title);
+ replace_table_add_key_int (local_replace_table, "ITEM_INDEX", get_display_item_index (items, iter_item));
break;
case INDEX_ITEM_TYPE_INTERSPACE:
s1 = block_parser_get_data (block_parser, "LIST_INTERSPACE");
replace_table_add_key (local_replace_table, "LIST_INTERSPACE_TITLE", iter_item->title);
+ replace_table_add_key_int (local_replace_table, "ITEM_INDEX", get_display_item_index (items, iter_item));
break;
}