Commit b9cbb5f3 authored by Arnaud Legrand's avatar Arnaud Legrand

Fix relative url images so that they point to gitlab origin.

parent cd1c724d
...@@ -20,6 +20,12 @@ $input =~ s/.md/.html/; ...@@ -20,6 +20,12 @@ $input =~ s/.md/.html/;
open INPUT, $input or die; open INPUT, $input or die;
my($input_path)=$input;
$input_path =~ s|/[^/]*$||g;
# print $input."\n\n";
my($url_path) = "https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/blob/master/".$input_path;
while(defined($line=<INPUT>)) { while(defined($line=<INPUT>)) {
$line =~ s|https://gitlab.inria.fr/learninglab/|https://learninglab.gitlabpages.inria.fr/|g; ## Not such a good idea! $line =~ s|https://gitlab.inria.fr/learninglab/|https://learninglab.gitlabpages.inria.fr/|g; ## Not such a good idea!
if($input=~ /_fr.html/) { if($input=~ /_fr.html/) {
...@@ -32,6 +38,13 @@ while(defined($line=<INPUT>)) { ...@@ -32,6 +38,13 @@ while(defined($line=<INPUT>)) {
$line =~ s|<p>TITLE:\(.*\)<br|<b>TITLE:$1</b><br|g; $line =~ s|<p>TITLE:\(.*\)<br|<b>TITLE:$1</b><br|g;
$line =~ s|href=" ---</p>|<hr/>|g; $line =~ s|href=" ---</p>|<hr/>|g;
$line =~ s|img src="http|img src="%|g;
$line =~ s|img src="([^%][^"]*)"|img src="$url_path/$1"|g;
$line =~ s|img src="%|img src="http|g;
# if($line =~ /img src="([^%][^"]*)"/) {
# $line = "\t".$line;
# }
if($line =~ /<p>AUTHOR:/) { next; } if($line =~ /<p>AUTHOR:/) { next; }
print $line; print $line;
} }
......
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