Commit 5e6ed7d9 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

#23 Alert tag

parent 61bf4eb1
module Jekyll
module Tags
class AlertTag < Liquid::Block
def initialize(tag_name, block_options, liquid_options)
super
@class = block_options.strip
end
def render(context)
context.stack do
context["class"] = @class
@content = super
end
output = <<~EOS
<div class="alert #{@class}">
#{@content}
</div>
EOS
end
end
end
end
Liquid::Template.register_tag('alert', Jekyll::Tags::AlertTag)
\ No newline at end of file
module Jekyll
module Tags
class AlertHeaderTag < Liquid::Block
def initialize(tag_name, block_options, liquid_options)
super
end
def render(context)
context.stack do
@content = super
end
output = "<h3>#{@content}</h3>"
end
end
end
end
Liquid::Template.register_tag('alert_header', Jekyll::Tags::AlertHeaderTag)
\ No newline at end of file
......@@ -10,6 +10,31 @@
height: 50px;
}
div.alert {
padding: .75rem 1.25rem;
border: 1px solid transparent;
border-radius: 3px;
margin: 10px;
font-weight: 300;
}
div.alert > h3 {
font-weight: 600;
margin-bottom: 3px
}
div.alert.warning {
border-color: #feedbb;
background-color: #fef5cf;
color: #846102;
}
div.alert.info {
border-color: #baeeff;
background-color: #c3e5ff;
color: #045689;
}
// Normal (desktop) ========================================================
.img-uni-lu {
bottom: -2px;
......
......@@ -14,4 +14,14 @@ The theme is displayed via Gitlab [pages](https://core-services.pages.uni.lu/jek
Read the [README](https://git-r3lab.uni.lu/core-services/jekyll-theme-lcsb-default/blob/master/README.md) file to know how to use in your project.
To start a new page for your repository, you can fork [this project](https://git-r3lab.uni.lu/core-services/pages-jekyll-lcsb-template) and start to modify it directly.
\ No newline at end of file
To start a new page for your repository, you can fork [this project](https://git-r3lab.uni.lu/core-services/pages-jekyll-lcsb-template) and start to modify it directly.
{% alert info %}
{% alert_header %}Header{% endalert_header %}
This is a test info alert
{% endalert %}
{% alert warning %}
{% alert_header %}Header{% endalert_header %}
This is a test warning alert
{% endalert %}
\ No newline at end of file
......@@ -2,7 +2,7 @@
Gem::Specification.new do |spec|
spec.name = "jekyll-theme-lcsb-default"
spec.version = "0.2.18"
spec.version = "0.2.19"
spec.authors = ["Trefex", "jaceklebioda_lux"]
spec.email = ["lcsb-sysadmins@uni.lu"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment