diff --git a/_plugins/alert.rb b/_plugins/alert.rb new file mode 100644 index 0000000000000000000000000000000000000000..72a968ae29bb114d02165604127dc51762f0a23a --- /dev/null +++ b/_plugins/alert.rb @@ -0,0 +1,24 @@ +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 diff --git a/_plugins/alert_header.rb b/_plugins/alert_header.rb new file mode 100644 index 0000000000000000000000000000000000000000..2f1617d975e1a9d082aa8d176ff189de8f11784f --- /dev/null +++ b/_plugins/alert_header.rb @@ -0,0 +1,18 @@ +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 diff --git a/_sass/minima/_lcsb.scss b/_sass/minima/_lcsb.scss index 7ec1390aa196e41b5420fad0b2270b8ba0f4d8c6..f88e74025e9a241b35ae7a418fcb8c347400eb3a 100644 --- a/_sass/minima/_lcsb.scss +++ b/_sass/minima/_lcsb.scss @@ -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; diff --git a/index.md b/index.md index 880ce3bfd9b1b101b72fcb53c925504134d3b5d9..d621f6bcf6aa7f713822d2d5380a267848fece0f 100644 --- a/index.md +++ b/index.md @@ -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 diff --git a/jekyll-theme-lcsb-default.gemspec b/jekyll-theme-lcsb-default.gemspec index 65eef0367a5162e8dde431e3d5b6b154ae50547b..dd127efebdcbb69e8e4a9fec9624faed52a53e03 100644 --- a/jekyll-theme-lcsb-default.gemspec +++ b/jekyll-theme-lcsb-default.gemspec @@ -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"]