From 116bd7230c91e76e1d94e8878bef6487cbcc00ea Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Fri, 4 Oct 2019 11:04:58 +0200 Subject: Added og-metadata to index page - image and URL properties are only included if the server url is set, because opengraph protocol does not support relative links Signed-off-by: Erik Michelson --- public/views/index/head.ejs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'public/views') diff --git a/public/views/index/head.ejs b/public/views/index/head.ejs index d790d917..400e2e59 100644 --- a/public/views/index/head.ejs +++ b/public/views/index/head.ejs @@ -6,6 +6,15 @@ + + + +<% if (serverURL !== "") { %> + + + + +<% } %> CodiMD - <%= __('Collaborative markdown notes') %> -- cgit v1.2.3 From 2881f8211aaaa2def3f3cedabf635f03733ac82e Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Fri, 4 Oct 2019 19:49:45 +0200 Subject: Added customizable og-metadata to notes Signed-off-by: Erik Michelson --- public/views/codimd/head.ejs | 4 ++++ public/views/pretty.ejs | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'public/views') diff --git a/public/views/codimd/head.ejs b/public/views/codimd/head.ejs index e3edde66..e2f0375c 100644 --- a/public/views/codimd/head.ejs +++ b/public/views/codimd/head.ejs @@ -4,6 +4,10 @@ +<% for (var og in opengraph) { %> +<% if (opengraph.hasOwnProperty(og) && opengraph[og].trim() !== '') { %> + +<% }} %> <%= title %> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 1970ab2f..5f18ea8b 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -14,6 +14,10 @@ <% if(typeof description !== 'undefined' && description) { %> <% } %> + <% for (var og in opengraph) { %> + <% if (opengraph.hasOwnProperty(og) && opengraph[og].trim() !== '') { %> + + <% }} %> <%= title %> -- cgit v1.2.3 From f26f48793fdf5bb81f4bec5d7c50e5fe1ba978d6 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Tue, 8 Oct 2019 21:11:01 +0200 Subject: Fixed bugs, added default image Signed-off-by: Erik Michelson --- public/views/codimd/head.ejs | 8 ++++++-- public/views/index/head.ejs | 4 +--- public/views/pretty.ejs | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'public/views') diff --git a/public/views/codimd/head.ejs b/public/views/codimd/head.ejs index e2f0375c..934767f6 100644 --- a/public/views/codimd/head.ejs +++ b/public/views/codimd/head.ejs @@ -6,8 +6,12 @@ <% for (var og in opengraph) { %> <% if (opengraph.hasOwnProperty(og) && opengraph[og].trim() !== '') { %> - -<% }} %> + +<% }} if (!opengraph.hasOwnProperty('image')) { %> + + + +<% } %> <%= title %> diff --git a/public/views/index/head.ejs b/public/views/index/head.ejs index 400e2e59..0f1e584e 100644 --- a/public/views/index/head.ejs +++ b/public/views/index/head.ejs @@ -9,12 +9,10 @@ -<% if (serverURL !== "") { %> - + -<% } %> CodiMD - <%= __('Collaborative markdown notes') %> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 5f18ea8b..20bb44e3 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -17,7 +17,11 @@ <% for (var og in opengraph) { %> <% if (opengraph.hasOwnProperty(og) && opengraph[og].trim() !== '') { %> - <% }} %> + <% }} if (!opengraph.hasOwnProperty('image')) { %> + + + + <% } %> <%= title %> -- cgit v1.2.3