+
\ No newline at end of file
diff --git a/content/observatorio/Metformin/index.md b/content/observatorio/Metformin/index.md
new file mode 100644
index 00000000..5742bf3e
--- /dev/null
+++ b/content/observatorio/Metformin/index.md
@@ -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
+---
+
+
Metformin
+
+
Ensaios Clínicos
+
\ No newline at end of file
diff --git a/content/observatorio/Simvastatin/index.md b/content/observatorio/Simvastatin/index.md
new file mode 100644
index 00000000..4bed05c6
--- /dev/null
+++ b/content/observatorio/Simvastatin/index.md
@@ -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
+---
+
+
Simvastatin
+
+
Ensaios Clínicos
+
\ No newline at end of file
diff --git a/content/observatorio/Tcelna/index.md b/content/observatorio/Tcelna/index.md
new file mode 100644
index 00000000..91dd36e0
--- /dev/null
+++ b/content/observatorio/Tcelna/index.md
@@ -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
+---
+
+
Tcelna
+
+
Ensaios Clínicos
+
\ No newline at end of file
diff --git a/content/observatorio/_index.md b/content/observatorio/_index.md
new file mode 100644
index 00000000..1b5805ff
--- /dev/null
+++ b/content/observatorio/_index.md
@@ -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.
+
diff --git a/content/observatorio/index.md b/content/observatorio/index.md
deleted file mode 100644
index c0fbb269..00000000
--- a/content/observatorio/index.md
+++ /dev/null
@@ -1,93 +0,0 @@
----
-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.
-
-
-
Ocrelizumab
-
-
Ensaios Clínicos
-
-
-
-
Metformin
-
-
Ensaios Clínicos
-
-
-
\ No newline at end of file
diff --git a/content/observatorio/ocrelizumab/index.md b/content/observatorio/ocrelizumab/index.md
new file mode 100644
index 00000000..bafac4ca
--- /dev/null
+++ b/content/observatorio/ocrelizumab/index.md
@@ -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
+---
+
+
Ocrelizumab
+
+
Ensaios Clínicos
+
\ No newline at end of file
diff --git a/themes/gregory/assets/js/gregory.js b/themes/gregory/assets/js/gregory.js
new file mode 100644
index 00000000..5d5620e3
--- /dev/null
+++ b/themes/gregory/assets/js/gregory.js
@@ -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)
+ }
+});
\ No newline at end of file
diff --git a/themes/gregory/layouts/_default/list.html b/themes/gregory/layouts/_default/list.html
new file mode 100644
index 00000000..5cab936c
--- /dev/null
+++ b/themes/gregory/layouts/_default/list.html
@@ -0,0 +1,29 @@
+{{ define "main" }} {{ $Pages := .Pages }} {{ $home := .IsHome }} {{ if .IsHome }} {{ $Pages = where site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ end }}
+
+
+ {{ if not .IsHome }}
+
+
+ {{ .Title }}
+
+
+ {{ end }}
+
+
+ {{.Content}} {{ range $Pages.GroupByDate "2006" }}
+
{{ .Key }}
+
+ {{ range .Pages.GroupByDate "January"}}
+
+ {{ range .Pages }}
+
+
+{{ end }}
\ No newline at end of file
diff --git a/themes/gregory/layouts/partials/scripts.html b/themes/gregory/layouts/partials/scripts.html
index 7da63d50..54261cf1 100644
--- a/themes/gregory/layouts/partials/scripts.html
+++ b/themes/gregory/layouts/partials/scripts.html
@@ -1,9 +1,9 @@
{{ if and .Site.Params.lazyImage (not .IsHome) -}}
-
+
{{ end }}
@@ -15,4 +15,5 @@
};
{{ $custom := resources.Get "css/custom.css" }}
-
\ No newline at end of file
+ {{ $gregory := resources.Get "js/gregory.js" }}
+
\ No newline at end of file