ryanvilbrandt / comic_git

A statically-hosted web comic server core intended to be hosted on github.io. For help getting started, click the Wiki link above!
23 stars 7 forks source link

Add a separate field in .ini for page number #18

Closed cvilbrandt closed 4 years ago

cvilbrandt commented 4 years ago

I would like to display a custom page number separately and would like to be able to set it as a field in the .ini file.

It can't be computed programatically because undoubtedly I'll have non-comic pages in the archive at times and I don't want it to break.

I also can't use just page_title for that same reason.

Because I anticipate non-comic posts to have some sort of standard entry here (idk. "Interlude"?), the page number should not be repeat-sensitive.

ALTERNATIVELY, help me write a thing for my comic site and mine alone so that if the page title isn't explicitly "Page ###" it will fill in "interlude" and if it IS "Page ###" it will clip out the ### and use it.

cvilbrandt commented 4 years ago

For the record, here's the text in the comic.tpl that supported this solution.

Going off the titles of the folders, where non-comic pages will have Names and comic pages have digits (e.g. Fanart-Ashley-Nichols vs 202)...

{% if page_name|int %}
      <div id="page-number"><span>{{ page_name }}</span></div>
{% else %}
      <div id="page-number"><span>Interlude</span></div>
{% endif %}