# frozen_string_literal: true12module Jekyll3module Tags45# Replaces the built in link tag temporarily6class CustomLinkTag < Liquid::Tag7def initialize(tag_name, text, tokens)8super9@text = text.strip10end1112def render(_context)13# This is a workaround for https://github.com/jekyll/jekyll/issues/917914# We should remove it when 9179 is solved.15#16# Note that this does NOT support news posts with a date in the URL.17"/training-material/#{@text.gsub(/\.md/, '.html')}"18end19end20end21end2223Liquid::Template.register_tag('link', Jekyll::Tags::CustomLinkTag)242526