Commit bec22381 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Merge branch '3-try-to-use-external-frozen-components' into 'master'

Resolve "Try to use external frozen components"

Closes #3

See merge request core-services/r3-pages!1
parents e022712c 9cd53e92
Pipeline #44038 failed with stage
in 19 seconds
......@@ -6,15 +6,15 @@ variables:
before_script:
- bundle install && bundle update
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
except:
- master
#test:
# stage: test
# script:
# - bundle exec jekyll build -d test
# artifacts:
# paths:
# - test
# except:
# - master
pages:
stage: deploy
......@@ -23,5 +23,5 @@ pages:
artifacts:
paths:
- public
only:
- master
# only:
# - master
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.5"
gem "bundler", "> 1.16.1"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
gem 'jekyll-theme-primer', '~> 0.5.2'
gem 'jekyll-theme-lcsb-default', '~> 0.2.21', :git => "https://git-r3lab.uni.lu/core-services/jekyll-theme-lcsb-default.git", :branch => "develop"
#gem 'jekyll-theme-lcsb-default', :path => '~/djangoeli/dev/myenv/Gitlab_work/jekyll-theme-lcsb-default'
gem "minima",
"~> 2.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
gem 'jekyll-theme-primer',
'~> 0.5.2'
gem 'jekyll-theme-lcsb-default',
'~> 0.2.21',
:git => "https://git-r3lab.uni.lu/core-services/jekyll-theme-lcsb-default.git",
:branch => "master"
gem 'jekyll-theme-lcsb-frozen-components',
'~> 0.0.1',
:git => "https://git-r3lab.uni.lu/core-services/jekyll-theme-lcsb-frozen-components.git",
:branch => "fix-gem"
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-paginate-v2", "~> 1.7"
gem "jekyll-feed", "~> 0.6"
gem "jekyll-paginate-v2",
"~> 1.7"
gem "jekyll-feed",
"~> 0.6"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
......
......@@ -38,6 +38,7 @@ theme: jekyll-theme-lcsb-default
plugins:
- jekyll-feed
- jekyll-paginate-v2
- jekyll-theme-lcsb-frozen-components
......
module Jekyll
module Tags
class RblockTag < Liquid::Block
def split_params(params)
params.split("|").map(&:strip)
end
def initialize(tag_name, block_options, liquid_options)
super
args = split_params(block_options)
@title = args[0]
if args.length >1
@icon = args[1]
else
#default icon
@icon = "fas fa-code"
end
end
def render(context)
rgridblockID = context["rgridblockID"]
#content = super
site = context.registers[:site]
converter = site.find_converter_instance(::Jekyll::Converters::Markdown)
content = converter.convert(super)
#Because we’re not changing the context, there’s no need to push the context stack as with the rgridblock.
# generate collapsible card HTML
output = <<~EOS
<div class="rblock">
<h3>
<i class="#{@icon}"></i>
#{@title}
</h3>
<hr>
<p>
#{content}
</p>
</div>
EOS
output
end
end
end
end
Liquid::Template.register_tag('rblock', Jekyll::Tags::RblockTag)
\ No newline at end of file
module Jekyll
module Tags
class RgridblockTag < Liquid::Block
def initialize(tag_name, block_options, liquid_options)
super
@rgridblockID = "rgridblock-#{block_options.strip}"
end
def render(context)
#Pushes a new local scope on the stack, pops it at the end of the block
#Each new rgridblock creates a new scope, and contexts have a custom implementation of [] to search up the stack for a matching value.
context.stack do
context["rgridblockID"] = @rgridblockID
@content = super
end
# The last bit we add is saving the resulting output of our block contents to an instance variable so we can access it outside of the stack scope.
output= %(<div class="rgridblock" id="#{@rgridblockID}">#{@content}</div>)
output
end
end
end
end
Liquid::Template.register_tag('rgridblock', Jekyll::Tags::RgridblockTag)
\ No newline at end of file
module Jekyll
module Tags
class RtitleTag < Liquid::Block
def initialize(tag_name, block_options, liquid_options)
super
@title = block_options.strip
end
def render(context)
site = context.registers[:site]
converter = site.find_converter_instance(::Jekyll::Converters::Markdown)
content = converter.convert(super)
output = <<~EOS
<div class="rtitle">
<h2>#{@title}</h2>
<hr>
#{content}
</div>
EOS
output
end
end
end
end
Liquid::Template.register_tag('rtitle', Jekyll::Tags::RtitleTag)
\ No newline at end of file
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