Skip to content

Commit

Permalink
Merge pull request #51 from CodeandoMexico/feat/authors
Browse files Browse the repository at this point in the history
removed console.log and account for not authors
  • Loading branch information
basicavisual authored Aug 20, 2024
2 parents 636fbe1 + 45a0eaf commit e443051
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/routes/aviso-de-privacidad/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
const date_updated = processDate(aviso.date_updated)
function processDate(dateObject, locale) {
locale ??= 'es-mx'
console.log(locale)
let formattedDate = new Date(dateObject)
let finalDate = formattedDate.toLocaleString(locale, { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' })
return finalDate
Expand Down
12 changes: 7 additions & 5 deletions src/routes/blog/[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@

<div class="container m-auto p-3 prose">
<h1 class="text-center font-bold">{post.title}</h1>
<p class="text-center">Por
{#each post.authors as author, i }
<span>{author.authors_id.name || ''}{#if i < (post.authors.length-1)}, {/if}</span>
{/each}
</p>
{#if post.authors}
<p class="text-center">Por
{#each post.authors as author, i }
<span>{author.authors_id.name || ''}{#if i < (post.authors.length-1)}, {/if}</span>
{/each}
</p>
{/if}
<p class="text-center text-sm text-gray-400">{new Date(post.date_created).toLocaleString('es-MX')}</p>
</div>
<img src={`https://content.codeandomexico.org/assets/${post.post_image}`} alt="Imagen de blog" class="w-full max-h-[450px] object-cover" />
Expand Down

0 comments on commit e443051

Please sign in to comment.