You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stories/creating-a-theme.txt
+13-13
Original file line number
Diff line number
Diff line change
@@ -205,7 +205,7 @@ That file is a **template** used to generate parts of the pages. It's large and
205
205
206
206
The part we want to change is this:
207
207
208
-
.. code:: mako
208
+
.. code:: html+mako
209
209
210
210
<%def name="html_stylesheets()">
211
211
%if use_bundles:
@@ -226,7 +226,7 @@ The part we want to change is this:
226
226
227
227
And we will change it so it uses the lanyon styles instead of theme.css (again, ignore the bundles for now!):
228
228
229
-
.. code:: mako
229
+
.. code:: html+mako
230
230
231
231
<%def name="html_stylesheets()">
232
232
%if use_bundles:
@@ -299,12 +299,12 @@ If we look for the equivalent code in Nikola's side, we see this:
299
299
So Nikola has the "masthead" above the nav element, and uses list elements in nav instead of bare links.
300
300
Not all that different is it?
301
301
302
-
Let's make it lanyon-like! We will need 2 more templates: `base.tmpl <https://github.com/getnikola/nikola/blob/master/nikola/data/themes/base/templates/base.tmpl>`__ and `base_header.tmpl`<https://github.com/getnikola/nikola/blob/master/nikola/data/themes/base/templates/base_header.tmpl>`__. Get them and put them in your ``themes/lanyon/templates`` folder.
302
+
Let's make it lanyon-like! We will need 2 more templates: `base.tmpl <https://github.com/getnikola/nikola/blob/master/nikola/data/themes/base/templates/base.tmpl>`__ and `base_header.tmpl<https://github.com/getnikola/nikola/blob/master/nikola/data/themes/base/templates/base_header.tmpl>`__. Get them and put them in your ``themes/lanyon/templates`` folder.
303
303
304
304
Let's look at ``base.tmpl`` first. It's short and nice, it looks like a webpage without
@@ -453,7 +453,7 @@ Now let's look at the content. In Lanyon, this is how the "main" content looks:
453
453
Everything inside the "container content" div is ... the content. The rest is a masthead with the site title
454
454
and at the bottom a label for the sidebar's toggle. Easy to do in ``base.tmpl`` (only showing relevant part):
455
455
456
-
.. code:: mako
456
+
.. code:: html+mako
457
457
458
458
<!-- Wrap is the content to shift when toggling the sidebar. We wrap the
459
459
content to avoid any CSS collisions with our real content. -->
@@ -539,7 +539,7 @@ Also, the accessibility link on top is visible when it should not. That's becaus
539
539
One clear problem is that the title "Lanyon A Jekyll theme" is set in the theme itself. We don't do that sort of things
540
540
in Nikola, we have settings for that. So, let's use it. There is a ``html_site_title`` function in ``base_helper.tmpl`` which is just the thing. So we change base.tmpl to use it:
541
541
542
-
.. code:: mako
542
+
.. code:: html+mako
543
543
544
544
<div class="wrap">
545
545
<div class="masthead">
@@ -576,7 +576,7 @@ Versus our port:
576
576
577
577
So, it looks like we will have to fix ``html_site_title`` after all:
578
578
579
-
.. code:: mako
579
+
.. code:: html+mako
580
580
581
581
<%def name="html_site_title()">
582
582
<h3 id="brand" class="masthead-title">
@@ -589,7 +589,7 @@ As for the actual content, that's not in any of the templates we have seen so fa
589
589
things in the way the Lanyon CSS expects it to. Here's the original, which you can find in Nikola's source
0 commit comments