How to edit CSS for a single page?

18 views
Skip to first unread message

Warut Phothiphan

unread,
Jul 5, 2017, 1:25:54 AM7/5/17
to nikola-discuss

Hello again


Could you guide me how to edit the CSS, if I put raw html inside the page?


Thank you




Chris Warrick

unread,
Jul 5, 2017, 3:08:15 AM7/5/17
to Nikola—Discuss
You can add a <style> block in content. You could also create a
custom.css file, but this will affect all pages.

Also, two technical remarks: (1) you should use a .html file here, not
.rst, and (2) you have two metadata blocks, but only the first one is
read.

To convert to .html, rename your file accordingly, put metadata in a
comment like this:

<!--
.. title: Welcome
.. slug: index
-->

and use regular HTML syntax in your post (with a <div> instead of .. class::).

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Warut Phothiphan

unread,
Jul 5, 2017, 8:52:22 AM7/5/17
to nikola-discuss
One more question. 


As you can see in my new code, I commented out the title name. Why does the title "Welcome" still show up?

Thank you very much for your guide.

Chris Warrick

unread,
Jul 5, 2017, 9:00:54 AM7/5/17
to Nikola—Discuss
On 5 July 2017 at 14:52, Warut Phothiphan <gto...@gmail.com> wrote:
> One more question.
>
>
> As you can see in my new code, I commented out the title name. Why does the
> title "Welcome" still show up?

It’s not commented out. Our metadata format is put in comments in
formats other than reST.
To hide the title, you can use this meta tag:

.. hidetitle: True
Reply all
Reply to author
Forward
0 new messages