diff --git a/static/js/custom.js b/static/js/custom.js
index 4b1064d48..e7fc72867 100644
--- a/static/js/custom.js
+++ b/static/js/custom.js
@@ -4,6 +4,19 @@ var hamburgerShown = false;
let width = screen.width;
var isMobile = width < 1024;
+function readingTime() {
+ let articles = document.querySelectorAll(".article");
+ let times = document.querySelectorAll(".time");
+ const wpm = 225;
+ let words;
+ for (var i = 0; i < articles.length; i++) {
+ words = articles[i].innerText.trim().split(/\s+/).length;
+ let time = Math.ceil(words / wpm);
+ times[i].innerText = `${time} minute read`
+ }
+}
+readingTime()
+
function toggleMenu(button) {
if (displayedMenu === button.id.split("-")[0]) {
button.className = button.className.replace(" text-gray-800 bg-stone-200 sm:bg-transparent", " text-gray-900");
diff --git a/templates/_default/base.html b/templates/_default/base.html
index 6d789147e..ac65b6023 100644
--- a/templates/_default/base.html
+++ b/templates/_default/base.html
@@ -36,7 +36,6 @@
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
if (!internal_hosts.includes(links[i].hostname)) {
links[i].target = '_blank';
- console.log(links[i])
}
}
diff --git a/templates/blogPage.html b/templates/blogPage.html
index f7ce34890..a3bab94cb 100644
--- a/templates/blogPage.html
+++ b/templates/blogPage.html
@@ -2,48 +2,32 @@
{% block content %}
{% if page.taxonomies.people %}
- {% set people = get_section(path="people/_index.md") %}
- {% set pages_str = people.pages | json_encode() | as_str %}
- {% if pages_str is containing(page.taxonomies.people[0]) %}
- {% set author_path = 'people/' ~ page.taxonomies.people[0] ~ '/index.md' %}
- {% set author = get_page(path=author_path) %}
- {% endif %}
+{% set people = get_section(path="people/_index.md") %}
+{% set pages_str = people.pages | json_encode() | as_str %}
+{% if pages_str is containing(page.taxonomies.people[0]) %}
+{% set author_path = 'people/' ~ page.taxonomies.people[0] ~ '/index.md' %}
+{% set author = get_page(path=author_path) %}
+{% endif %}
{% endif %}
{% set split = page.content | split(pat="threefold.io") %}
-{% if split | length < 2 %}
- {% set content = page.content %}
-{% else %}
- {% set content = "" %}
- {% for part in split %}
- {% if part is starting_with("/blog") %}
- {% set split_part = part | split(pat='/">') %}
- {% set link = split_part[0] %}
- {% set link = link | replace(from="/blog/post", to="/blog") %}
- {% set link = link | replace(from="_", to="-") %}
- {% set rest_part = split_part | slice(start=1) | join(sep='/">') %}
- {% set part = link ~ '/">' ~ rest_part %}
- {% endif %}
- {% if loop.first %}
- {% set_global content = part%}
- {% else %}
- {% set_global content = content ~ "threefold.io" ~ part%}
- {% endif %}
- {% endfor %}
-{% endif %}
-
-
-
{{ page.title }}
+
{{ page.description }}
@@ -52,9 +36,10 @@
-