Skip to content

Commit

Permalink
adds a new listing for relevant research, fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoamaral committed Aug 14, 2021
1 parent 3fbc1d9 commit c01f0e8
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 98 deletions.
21 changes: 21 additions & 0 deletions content/observatorio/Bexarotene/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Bexarotene"
date: 2021-08-14T21:31:49+01:00
lastmod:
author: Bruno Amaral

description:
categories: []
tags: []

draft: false
enableDisqus : true
enableMathJax: false
disableToC: false
disableAutoCollapse: true
---

<h3 id="Bexarotene">Bexarotene</h3>
<ol class="articles Bexarotene"></ol>
<h4>Ensaios Clínicos</h4>
<ol class="trials Bexarotene"></ol>
21 changes: 21 additions & 0 deletions content/observatorio/Metformin/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Metformin"
date: 2021-08-14T21:32:04+01:00
lastmod:
author: Bruno Amaral

description:
categories: []
tags: []

draft: false
enableDisqus : true
enableMathJax: false
disableToC: false
disableAutoCollapse: true
---

<h3 id="Metformin">Metformin</h3>
<ol class="articles Metformin"></ol>
<h4>Ensaios Clínicos</h4>
<ol class="trials Metformin"></ol>
21 changes: 21 additions & 0 deletions content/observatorio/Simvastatin/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Simvastatin"
date: 2021-08-14T21:32:16+01:00
lastmod:
author: Bruno Amaral

description:
categories: []
tags: []

draft: false
enableDisqus : true
enableMathJax: false
disableToC: false
disableAutoCollapse: true
---

<h3 id="Simvastatin">Simvastatin</h3>
<ol class="articles Simvastatin"></ol>
<h4>Ensaios Clínicos</h4>
<ol class="trials Simvastatin"></ol>
21 changes: 21 additions & 0 deletions content/observatorio/Tcelna/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Tcelna"
date: 2021-08-14T21:32:11+01:00
lastmod:
author: Bruno Amaral

description:
categories: []
tags: []

draft: false
enableDisqus : true
enableMathJax: false
disableToC: false
disableAutoCollapse: true
---

<h3 id="Tcelna">Tcelna</h3>
<ol class="articles Tcelna"></ol>
<h4>Ensaios Clínicos</h4>
<ol class="trials Tcelna"></ol>
21 changes: 21 additions & 0 deletions content/observatorio/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Observatorio"
date: 2021-08-12T15:33:35+01:00
lastmod:
author: Bruno Amaral

description:
categories: []
tags: []

draft: false
enableDisqus : true
enableMathJax: false
disableToC: false
disableAutoCollapse: true
---

Esta página tem uma secção para cada uma das terapias listadas como relevantes pela [MS Society](https://www.mssociety.org.uk/research/explore-our-research/emerging-research-and-treatments/explore-treatments-in-trials).

Em cada secção, são listados os ensaios clínicos e artigos publicados em que o fármaco consta do título.

93 changes: 0 additions & 93 deletions content/observatorio/index.md

This file was deleted.

21 changes: 21 additions & 0 deletions content/observatorio/ocrelizumab/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Ocrelizumab"
date: 2021-08-14T20:47:32+01:00
lastmod:
author: Bruno Amaral

description:
categories: []
tags: []

draft: false
enableDisqus : true
enableMathJax: false
disableToC: false
disableAutoCollapse: true
---

<h3 id="Ocrelizumab">Ocrelizumab</h3>
<ol class="articles Ocrelizumab"></ol>
<h4>Ensaios Clínicos</h4>
<ol class="trials Ocrelizumab"></ol>
60 changes: 60 additions & 0 deletions themes/gregory/assets/js/gregory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
document.addEventListener('DOMContentLoaded', (event) => {
const queries = document.querySelectorAll('h3')

function searchArticles(term) {
// let list = document.querySelector('ol.articles.'+ term );
let articleRequest = new Request('https://api.brunoamaral.net/articles/keyword/' + term);

fetch(articleRequest).then(response => response.json()).then(data => { console.log(data) })

fetch(articleRequest)
.then(response => response.json())
.then(data => {
let list = document.querySelector('ol.articles.' + term);
for (const item of data) {
let listItem = document.createElement('li');
listItem.appendChild(
document.createElement('strong')
).textContent = item.title;

let a = listItem.appendChild(document.createElement('a'));
a.textContent = `${item.source}`;
a.href = `${item.link}`;
list.appendChild(listItem);
}
})
.catch(console.error);
}

function searchTrials(term) {
// let list = document.querySelector('ol.trials.'+ term );
let trialsRequest = new Request('https://api.brunoamaral.net/trials/keyword/' + term);
fetch(trialsRequest).then(response => response.json()).then(data => { console.log(data) })

fetch(trialsRequest)
.then(response => response.json())
.then(data => {
let list = document.querySelector('ol.trials.' + term);
for (const item of data) {
let listItem = document.createElement('li');
listItem.appendChild(
document.createElement('strong')
).textContent = item.title;

let a = listItem.appendChild(document.createElement('a'));
a.textContent = `${item.source}`;
a.href = `${item.link}`;
list.appendChild(listItem);
}
})
.catch(console.error);
}



for (let i = 0; i < queries.length; i++) {
// console.log(queries[i].id)
searchArticles(queries[i].id)
searchTrials(queries[i].id)
}
});
29 changes: 29 additions & 0 deletions themes/gregory/layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ define "main" }} {{ $Pages := .Pages }} {{ $home := .IsHome }} {{ if .IsHome }} {{ $Pages = where site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ end }}

<article class="archive">
{{ if not .IsHome }}
<header style="text-align: center;">
<h1>
{{ .Title }}
</h1>
</header>
{{ end }}
<div class="archive-list">

{{.Content}} {{ range $Pages.GroupByDate "2006" }}
<h2 class="archive-year">{{ .Key }}</h2>
<ul>
{{ range .Pages.GroupByDate "January"}}
<!-- .Pages in $Pages -->
{{ range .Pages }}
<li class="archive-item">
{{ if .Date }}
<time datetime="{{ .Date.Format " 2006-01-02T15:04:05Z07:00 " }}">{{ .Date.Format "2006-01-02" }}</time>
<a href="{{ .Permalink }}">{{ .Title }}</a> {{ end }}
</li>
{{ end }} {{ end }}
</ul>
{{ end }}
</div>
</article>
{{ end }}
11 changes: 6 additions & 5 deletions themes/gregory/layouts/partials/scripts.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{ if and .Site.Params.lazyImage (not .IsHome) -}}
<script src="{{ .Site.Params.staticPrefix }}{{ "js/lazyload.min.js" | relURL }}"></script>
<script src="{{ .Site.Params.staticPrefix }}{{ " js/lazyload.min.js " | relURL }}"></script>
<script>
var lazyImage = new LazyLoad({
container: document.getElementById('article')
});
var lazyImage = new LazyLoad({
container: document.getElementById('article')
});
</script>
{{ end }}
<script src="https://code.iconify.design/1/1.0.7/iconify.min.js"></script>
Expand All @@ -15,4 +15,5 @@
};
</script>
{{ $custom := resources.Get "css/custom.css" }}
<link rel="stylesheet" href="{{$custom.Permalink}}">
<link rel="stylesheet" href="{{$custom.Permalink}}"> {{ $gregory := resources.Get "js/gregory.js" }}
<script type="text/javascript" src="{{$gregory.Permalink}}"></script>

0 comments on commit c01f0e8

Please sign in to comment.