Jekyll and custom css

Is there any way to enable custom css tags on jekyll website when using markdowns for input files; For example, when do I want to highlight a specific paragraph?

+5
source share
3 answers

Markdown and YAML FrontMatter have a built-in embedded system. But you can do it yourself.

Say you have foo.css that you want to include in certain posts.

In _posts/2013-02-03-higligting-foo.markdown:

---
css: foo
title: "Drupal Imagecache security vulnarability with DDOS attack explained"
tags: [drupal, imagecache, security, ddos]
---

Then in _layouts/default.html:

{% if post && post.css %}
  <link rel='stylesheet' type='text/css' href='public/assets/{{ post.css }}.css' />
{% endif %}

If the message is displayed and the post has a variable defined, css, then use this to include the css file with the name. Please note that this does not validate the file name, whether the css file exists, etc.

+14
source

, Markdown , , , :

My **first** paragraph

<p class="mySpecialClass">My **second** paragraph</p>

My **third** paragraph

Markdown p HTML.

Markdown , , Markdown — **second** .

Textile Jekyll - .

!

+4

you must be able to place html tags in your markdown document, and it should not parse them without problems. eg:

#This

is a paragraph <span style="background-color:yellow">with highlighting</span>
0
source

All Articles