Skip to content

Commit 1d48e4a

Browse files
committed
Adjust promobar shortcode
1 parent fed5255 commit 1d48e4a

File tree

9 files changed

+255
-206
lines changed

9 files changed

+255
-206
lines changed

assets/scss/_common.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ a:hover {
7070
text-decoration: underline;
7171
}
7272

73+
.link__force-underline a {
74+
text-decoration: underline !important;
75+
}
7376
h1, .h1 {
7477
font-size:36px;
7578
}

content/english/technical-tools/BDT.md

Lines changed: 31 additions & 39 deletions
Large diffs are not rendered by default.

content/english/technical-tools/SDG.md

Lines changed: 59 additions & 45 deletions
Large diffs are not rendered by default.

content/nederlands/technical-tools/BDT.md

Lines changed: 46 additions & 50 deletions
Large diffs are not rendered by default.

content/nederlands/technical-tools/SDG.md

Lines changed: 56 additions & 42 deletions
Large diffs are not rendered by default.

layouts/shortcodes/promo_bar.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
{{ $_hugo_config := `{ "version": 1 }` }}
2-
<div id={{.Get "id" }} class="container-fluid mt-0 p-0">
2+
{{$param := int (.Get "index")}}
3+
{{ with index .Page.Params.promo_bar $param }}
4+
<div id={{.id}} class="container-fluid mt-0 p-0">
35
<div class="shadow bg-lightblue">
46
<div class="row promobar-mobile-desktop-layout">
5-
<div class="col-12 flex justify-center items-center px-5">
6-
<!-- Content -->
7+
<div class=" d-flex justify-center items-center px-5 link__force-underline">
78
<span class="mr-3" style="font-size:16px; color:#005aa7;">
8-
<b>{{ .Get "content" }} <a href="https://github.com/NGO-Algorithm-Audit/unsupervised-bias-detection" style="text-decoration: underline;" target="_blank">GitHub</a></b>
9+
{{ .content | markdownify }}
910
</span>
11+
{{if .iframe }}
1012
<span>
11-
<iframe src="https://ghbtns.com/github-btn.html?user=NGO-Algorithm-Audit&repo=unsupervised-bias-detection&type=star&count=true" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>
13+
<iframe src={{.iframe}} frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>
1214
</span>
15+
{{ end }}
1316
</div>
1417
</div>
1518
</div>
16-
</div>
19+
</div>
20+
{{ end }}

tina/collections/shared/page/building_blocks.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,37 @@ const building_blocks: TinaField[] = [
738738
},
739739
],
740740
},
741+
{
742+
type: "object",
743+
name: "promo_bar",
744+
label: "Promo bar",
745+
list: true,
746+
ui: {
747+
itemProps: (item) => {
748+
return { label: item?.id };
749+
},
750+
},
751+
fields: [
752+
{
753+
type: "rich-text",
754+
name: "content",
755+
label: "content",
756+
required: true,
757+
},
758+
{
759+
type: "string",
760+
name: "id",
761+
label: "ID",
762+
description: "ID to refer to this block as algorithmaudit.eu/.../#ID",
763+
required: false,
764+
},
765+
{
766+
type: "string",
767+
name: "iframe",
768+
label: "iFrame",
769+
},
770+
],
771+
},
741772
{
742773
type: "object",
743774
name: "reports_preview",
Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
1-
import { RichTextTemplate } from "@tinacms/schema-tools/dist/types/index"
2-
let pdf_frame : RichTextTemplate = {
3-
name: 'promo_bar',
4-
label: 'Promo bar',
5-
match: {
6-
start: '{{<',
7-
end: '>}}'
1+
import { RichTextTemplate } from "@tinacms/schema-tools/dist/types/index";
2+
let pdf_frame: RichTextTemplate = {
3+
name: "promo_bar",
4+
label: "Promo bar",
5+
match: {
6+
start: "{{<",
7+
end: ">}}",
8+
},
9+
fields: [
10+
{
11+
name: "index",
12+
label: "Index of the promobar entry",
13+
type: "string",
14+
description:
15+
"0-based index of the promobar entry of the fields on the page (Promo bar)",
16+
required: true,
817
},
9-
fields: [
10-
{
11-
type: "string",
12-
name: "content",
13-
label: "content",
14-
required: true,
15-
},
16-
{
17-
type: "string",
18-
name: "id",
19-
label: "ID",
20-
description: "ID to refer to this block as algorithmaudit.eu/.../#ID",
21-
required: false,
22-
}
23-
]
18+
],
2419
};
25-
export default pdf_frame;
20+
export default pdf_frame;

tina/tina-lock.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)