Little fixes

This commit is contained in:
Antonio de la Rosa 2021-12-24 16:38:40 +01:00
parent 5f815907e1
commit 2011e9f892
4 changed files with 56 additions and 17 deletions

View file

@ -10,7 +10,7 @@
<div class="content_post">
</div>
<footer>
<p><a href="#" class="url_post">${lang('cuchulublog', 'permanent_link', 'Permanent link')}</a></p>
<p><a href="#" class="url_post" id="url_post">${lang('cuchulublog', 'permanent_link', 'Permanent link')}</a></p>
</footer>
</article>
</div>
@ -26,6 +26,8 @@
%>
//http://localhost:5000/blog/2021/12/07/first-post/1#
var lang_default="${lang_default}";
$.ajax({
@ -33,7 +35,9 @@
data: {},
success: function (data) {
$('.blog_post_name').html(JSON.parse(data.title)[lang_default]);
post_name=JSON.parse(data.title)[lang_default];
$('.blog_post_name').html(post_name);
var date_post=data.date.replace(' 00:00:00', '').replace(/-/g, '/');
@ -41,6 +45,12 @@
$('.content_post').html(JSON.parse(data.text)[lang_default]);
var url_post='/blog/'+date_post+'/'+data.slugify+'/'+${post_id};
$('#url_post').attr('href', url_post);
$('title').html(post_name);
},
dataType: 'json'
});