about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-08-03 18:46:05 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-08-03 18:46:05 +0200
commit9e4af527b0e031be99a8b6726d2ee3ac074e9a61 (patch)
treea1760f40dd7bb0c48b58317d74f30a710728dad6
parentChange markdown generator to showdown (diff)
downloadbaitinq.ml-9e4af527b0e031be99a8b6726d2ee3ac074e9a61.tar.gz
baitinq.ml-9e4af527b0e031be99a8b6726d2ee3ac074e9a61.tar.bz2
baitinq.ml-9e4af527b0e031be99a8b6726d2ee3ac074e9a61.zip
Add projectFetch shortcode
-rw-r--r--content/projects/project/osxiv.md19
-rw-r--r--themes/researcher/layouts/partials/projectFetcher.html17
-rw-r--r--themes/researcher/layouts/shortcodes/projectFetch.html17
3 files changed, 35 insertions, 18 deletions
diff --git a/content/projects/project/osxiv.md b/content/projects/project/osxiv.md
index e6a74ec..ef948ae 100644
--- a/content/projects/project/osxiv.md
+++ b/content/projects/project/osxiv.md
@@ -5,21 +5,4 @@ notshowthedate: true
 draft: false
 ---
 
-
-<div id="fetched-markdown"></div>
-
-<script src="https://cdn.jsdelivr.net/npm/showdown@1.9.0/dist/showdown.min.js" type="text/javascript"></script>
-
-<script>
-
-fetch("https://raw.githubusercontent.com/Baitinq/OSXIV/master/README.md").then((response) => response.text()).then((data) => {
-	console.log(data);
-	const converter = new showdown.Converter();
-	const html      = converter.makeHtml(data);
-	document.getElementById('fetched-markdown').innerHTML = html;
-});
-</script>
-
------
-
-This information was fetched from [OSXIV's](https://github.com/Baitinq/OSXIV) [README]("https://raw.githubusercontent.com/Baitinq/OSXIV/master/README.md").
+{{% projectFetch projectName="OSXIV" projectURL="https://github.com/Baitinq/OSXIV" readmeURL="https://raw.githubusercontent.com/Baitinq/OSXIV/master/README.md" %}}
diff --git a/themes/researcher/layouts/partials/projectFetcher.html b/themes/researcher/layouts/partials/projectFetcher.html
new file mode 100644
index 0000000..40f2fea
--- /dev/null
+++ b/themes/researcher/layouts/partials/projectFetcher.html
@@ -0,0 +1,17 @@
+<div id="fetched-markdown"></div>
+
+<script src="https://cdn.jsdelivr.net/npm/showdown@1.9.0/dist/showdown.min.js" type="text/javascript"></script>
+
+<script>
+
+fetch("https://raw.githubusercontent.com/Baitinq/OSXIV/master/README.md").then((response) => response.text()).then((data) => {
+        console.log(data);
+        const converter = new showdown.Converter();
+        const html      = converter.makeHtml(data);
+        document.getElementById('fetched-markdown').innerHTML = html;
+});
+</script>
+
+-----
+
+This information was fetched from [OSXIV's](https://github.com/Baitinq/OSXIV) [README]("https://raw.githubusercontent.com/Baitinq/OSXIV/master/README.md").
diff --git a/themes/researcher/layouts/shortcodes/projectFetch.html b/themes/researcher/layouts/shortcodes/projectFetch.html
new file mode 100644
index 0000000..e943994
--- /dev/null
+++ b/themes/researcher/layouts/shortcodes/projectFetch.html
@@ -0,0 +1,17 @@
+<div id="fetched-markdown"></div>
+
+<script src="https://cdn.jsdelivr.net/npm/showdown@1.9.0/dist/showdown.min.js" type="text/javascript"></script>
+
+<script>
+
+fetch({{ .Get "readmeURL" }}).then((response) => response.text()).then((data) => {
+        console.log(data);
+        const converter = new showdown.Converter();
+        const html      = converter.makeHtml(data);
+        document.getElementById('fetched-markdown').innerHTML = html;
+});
+</script>
+
+-----
+
+This information was fetched from [{{ .Get "projectName" }}'s]({{ .Get "projectURL" }}) [README]({{ .Get "readmeURL" }}).