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

New page come out in basic format, never adhering to templates or tpl files #77

Closed vsitante closed 4 months ago

vsitante commented 5 months ago

Back again with yet another issue that I feel must only be happening to me because the Universe has always hated me xD

FYI: I have read the wiki over and over, before posting the issue ^_^; I saw no such resolution to my problem, despite what Adding New Pages and Editing Existing Pages say--I've also tried to deal with Jinja2 templates from scratch like you recommend and honestly, all it did was confuse me x_x;; Especially when they didn't work anyway, as I'll explain below.

Since the last time I wrote here, I've been trying to add a gallery and about page to the site. I've given up on the gallery section because nothing works, and it's the same reason as for why the about page isn't working, per se. (I'll only be concentrating on the about page for this issue.)

Here is my about page--I checked on Firefox and Vivaldi, and yes, the page is only present as basic formatted site. It does not match the rest of the site: image

My understanding of the Add New Pages part is that you can simply create a HTML file and the rest should take care of itself in terms of colors, paragraphs, fonts, etc. However, this has not been the case for me. I initially did it as so, just write and save the HTML, put it in templates of the default theme and upload it. That didn't work.

So I thought, maybe creating a tpl file will work better to make the about.html acquire the look of the rest of the website. I used base.tpl as the basis to see if that would work. It, uh, didn't.

Then I saw this part from the base.tpl:
{# This is the start of the `content` block. Nothing is here now because other templates are expected to fill it in on their own. It will contain everything on a webpage after the links bar and before the "Powered by comic_git" footer. #} {% block content %}{% endblock %}

and thought, maybe if I put that in the html file, the % code and the text in between, that would work. It didn't, yet again. Reading the Jinja2 page on it didn't help.

Then lastly, I thought of trying to use comic_minimal.tpl, since then I'd just take out anything comic relevant instead. See here for the code. Once more, with feeling, it didn't work!

Then I wondered if simply making the about page its own folder, with its own comic_info.ini and home page.txt, would work. It did!...At least, the entire thing was formatted correctly, but the links in the links bar were smushed instead (basically no space between the links) and the home page txt added a line from one of the comics in the archives for reasons unknown to me. So, technically it worked but in trying to fix all the other problems that popped up, I simply just lost my patience.

(I tried making the gallery its own folder as well, and that worked somewhat but the images never popped up in their own archives, and the frustration from the about page shenanigans made me have less patience xD The separate html option also never worked.)

I am at an absolute loss as to why nothing is working. The Add New Pages and Editing Existing Pages sections makes all of this seem very easy to simply add new pages, but it hasn't been that easy for me Dx

Any help is appreciated, thank you--and thank you for your time in helping!

ryanvilbrandt commented 4 months ago

comic_git will look in two places for files to build your web pages: The templates folder for the theme you have chosen (for your site, it's set to the default of your_content/themes/default/templates) and the src/templates folder as a last resort.

Your about.html file in your_content/themes/default/templates is taking precedence over the about.tpl file in src/templates, so your changes to about.tpl are being ignored. If you delete the about.html file, comic_git will start using your about.tpl file instead, which is likely what you want.

Your about.tpl file might work as is. If you have trouble with it, try recreating it using the 404.tpl file as a reference. Make sure to only update content between {% block content %} and {% endblock %}.

vsitante commented 4 months ago

Sorry for the very late reply! Time got away from me. I decided to opt for the about.tpl, so I deleted the about.html and based the .tpl file on the 4040.tpl--and it worked! I'm so happy, the about page finally looks the way I want XD

Thank you again, and sorry for taking so long to answer what turned out to have an easy solution!