@@ -190,13 +190,11 @@ our conventions::
190
190
$ mkdir -p themes/lanyon/assets/css
191
191
$ cp ../lanyon/public/css/lanyon.css themes/lanyon/assets/css/
192
192
$ cp ../lanyon/public/css/poole.css themes/lanyon/assets/css/
193
- $ cp ../lanyon/public/css/syntax.css themes/lanyon/assets/css/code.css
194
193
195
- Notice we renamed ``syntax.css`` as ``code.css``? That's because Nikola handles that specific stylesheet
196
- in a particular way, because we have a setting called ``CODE_COLOR_SCHEME`` where you can configure
197
- what color scheme the syntax highlighter uses. Having your own ``assets/css/code.css`` just makes it work.
198
-
199
- **FIXME:** The syntax highlighting is broken, needs fixing.
194
+ Notice I am *not* copying ``syntax.css``? That's because Nikola handles that styles for syntax highlighting
195
+ in a particular way, using a setting called ``CODE_COLOR_SCHEME`` where you can configure
196
+ what color scheme the syntax highlighter uses. You can use your own ``assets/css/code.css`` if you
197
+ don't like the provided ones.
200
198
201
199
But how do I tell **our** lanyon theme to use those CSS files instead of whatever it's using now?
202
200
By giving our theme its own base_helper.tmpl
@@ -233,21 +231,17 @@ And we will change it so it uses the lanyon styles instead of theme.css (again,
233
231
234
232
<%def name="html_stylesheets()">
235
233
%if use_bundles:
236
- %if use_cdn:
237
- <link href="/assets/css/all.css" rel="stylesheet" type="text/css">
238
- %else:
239
- <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
240
- %endif
234
+ <link href="/assets/css/all.css" rel="stylesheet" type="text/css">
241
235
%else:
242
236
<link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
243
237
<link href="/assets/css/lanyon.css" rel="stylesheet" type="text/css">
244
238
<link href="/assets/css/poole.css" rel="stylesheet" type="text/css">
245
239
<link href="/assets/css/code.css" rel="stylesheet" type="text/css">
246
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700|PT+Sans:400">
247
240
%if has_custom_css:
248
241
<link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
249
242
%endif
250
243
%endif
244
+ <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700|PT+Sans:400">
251
245
</%def>
252
246
253
247
.. figure:: /images/lanyon-1.thumbnail.png
@@ -752,7 +746,18 @@ Doing the same for layout-reverse, sidebar-overlay and the rest is left as an ex
752
746
Bundles
753
747
-------
754
748
755
- I promised to get to bundles. Sadly I ran out of steam. To be done soon.
749
+ If you have ``WebAssets`` installed and the ``USE_BUNDLES`` option set to True, Nikola can put several CSS or JS files together in a larger file,
750
+ which makes sites load faster. To do that, your theme needs a ``bundles`` file where the syntax is::
751
+
752
+ outputfile1.js: thing1.js, thing2.js, ...
753
+ outputfile2.css: thing1.css, thing2.css, ...
754
+
755
+ For this theme, it should be like this::
756
+
757
+ assets/css/all.css=rst.css,code.css,lanyon.css,poole.css
758
+
759
+ **Note:** Some themes also support the ``USE_CDN`` option meaning that in some cases it will load one bundle with all CSS and in other will load some CSS files
760
+ from a CDN and others from a bundle. This is complicated and probably not worth the effort.
756
761
757
762
The End
758
763
-------
0 commit comments