(Question) Where are the `base` theme files (for creating new child theme)?

38 views
Skip to first unread message

Ankush Thakur

unread,
Sep 8, 2021, 6:13:25 AM9/8/21
to nikola-discuss
Hello, so, I was following the tutorial for creating a new theme: https://getnikola.com/creating-a-theme.html. Thing is, I don't want to get into Jekyll theme, and would instead very much prefer to modify the templates of the existing base theme. But I'm confused about where the base theme lives and what to do (I'm guessing it's somewhere in my virtualenv?).

So far, I created a blank site and ran the following:
1. `nikola theme -n river --parent base --engine mako`
2. (edited `conf.py` to change theme to `river`)
3. `nikola build`
4. `nikola auto --browser --port=8001`

I get a much-nicer looking "empty" layout now: 

2021-09-08_15-36-42.png

But let's say I want to change the way the page is structured (take away the "Archive", "Tag", etc., links, for starters). Now I have no idea where to start. It looks like the folder `themes/river` got created automatically, but all it has is a `river.theme` file. Where are the template files? Where's the CSS? I'd really prefer to have them in the project directory for source control.

So, yeah, some noob-friendly instructions are needed! 😄 

Roberto Alsina

unread,
Sep 8, 2021, 7:27:40 AM9/8/21
to Nikola—Discuss
Because themes will only contain the templates they change (and for the rest will use their parent's ... which will use their parent's and so on) that's a bit complicated and confusing.

As a start you can take a look here: these are all the templates used by our base theme:


Usually themes don't add new templates, so that should be about all of them.

Now: DON'T JUST DOWNLOAD THOSE. They may be very different from what you want. Just use that as a list of names :-)

To get a copy of a template in your theme that you can modify, use

nikola theme -c templatename.tmpl

That will give you a fresh copy that you can change all you want.

Also, maybe read this, it's a guide showing how you can create a theme


--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/b9d1833d-1055-4230-bd90-c66fd8fd27d4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages