Skip to content
Snippets Groups Projects
Commit 6f0321e6 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Merge branch '23-implement-alert-tag' into 'master'

Resolve "Implement alert tag"

Closes #23

See merge request core-services/jekyll-theme-lcsb-default!1
parents 61bf4eb1 fac8c7ed
No related branches found
No related tags found
No related merge requests found
......@@ -132,6 +132,10 @@ For details refer to [the documentation of ruby gems](https://guides.rubygems.or
## Changelog
### 0.2.19
Added `alert` and `alert_header` blocks.
To use: `{% alert info %}{% alert_header %}Header{% endalert_header %}Content{% endalert %}` or `{% alert warning %}{% alert_header %}Header{% endalert_header %}Content{% endalert %}`
### 0.2.18
* Corrected placement of R3 logo in the footer on mobile
......
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;
......
......@@ -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"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment