Commit 6f2d1669 authored by Karol Herbst's avatar Karol Herbst 🐧

add auto deployment via CI and ikiwiki

parent 165e56e5
Pipeline #205887 passed with stage
in 43 seconds
*.mdwn gitlab-language=markdown
sources/.ikiwiki/
public/
image: elecnix/ikiwiki
before_script:
- apt-get -qq update
- apt-get -qq install
libtext-multimarkdown-perl
libtext-csv-perl
test:
stage: test
script:
- ikiwiki --setup nouveau.yml
artifacts:
paths:
- public
only:
- merge_requests
pages:
stage: deploy
script:
- ikiwiki --setup nouveau.yml
artifacts:
paths:
- public
only:
- master
#!/usr/bin/perl
package IkiWiki::Plugin::fdo;
use warnings;
use strict;
use IkiWiki 3.00;
use HTML::Entities;
use URI::Escape;
sub import {
hook(type => "getsetup", id => "fdo", call => \&getsetup);
hook(type => "pagetemplate", id => "fdo", call => \&pagetemplate);
}
sub getsetup () {
return
plugin => {
safe => 0,
rebuild => undef,
section => "rcs",
},
gitlab_edit_url => {
type => "string",
example => "https://gitlab.example.org/example/wiki/-/edit/master/[[file]]",
description => "gitweb url to edit the file ([[file]] substituted)",
safe => 1,
rebuild => 1,
},
gitlab_src_url => {
type => "string",
example => "https://gitlab.example.org/example/wiki/-/blob/master/[[file]]",
description => "gitweb url to view the file ([[file]] substituted)",
safe => 1,
rebuild => 1,
},
}
sub pagetemplate (@) {
my %params=@_;
my $actions=$params{actions};
my $page=$params{page};
my $template=$params{template};
if (defined $config{gitlab_edit_url} && length $config{gitlab_edit_url}) {
my $u=$config{gitlab_edit_url};
my $p=uri_escape_utf8($pagesources{$page}, '^A-Za-z0-9\-\._~/');
$u=~s/\[\[file\]\]/$p/g;
$template->param(editurl => $u);
$actions++;
}
if (defined $config{gitlab_src_url} && length $config{gitlab_src_url}) {
my $u=$config{gitlab_src_url};
my $p=uri_escape_utf8($pagesources{$page}, '^A-Za-z0-9\-\._~/');
$u=~s/\[\[file\]\]/$p/g;
$template->param(getsourceurl => $u);
$actions++;
}
}
1
This diff is collapsed.
body {
background: #dedede;
}
div#content, div#footer {
margin: 0;
padding: 1em 2em;
background: #dedede;
}
.box {
border: 1px solid #aaa;
background: white;
padding: 5px;
height: 100%;
}
.boxes {
width: 100%;
max-width: 800px;
margin: 0 auto;
}
.boxes > tbody > tr {
background-color: inherit;
}
.boxes > tbody > tr > td {
padding: 2px;
}
.boxes > tbody > tr > td:not(.wide) {
width: 50%;
height: 180px;
}
.boxes h2, .boxes h1 {
margin-top: 0;
}
.versions tr:nth-child(even) {
background: #eee;
}
.versions tr:nth-child(odd) {
background: white;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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