Skip to content

Commit

Permalink
fix(pages): update/merge default views
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 28, 2024
2 parents 889f12e + b4b284e commit ce68658
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 2 deletions.
34 changes: 33 additions & 1 deletion template/pages/#cms/pages.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<%
const { slug, content } = await _.resolveRoute()
const isNotFound = !Object.keys(content).length
_.breadcrumbs = [{
name: content.title,
link: `/pages/${slug}`
Expand All @@ -15,4 +16,35 @@ if (!content.sections || !content.sections.length) {
}
%>

<%- await include('@/view') %>
<% if (!isNotFound) { %>
<%- await include('@/view') %>
<% } else { %>
<!doctype html>
<html lang="<%= _.lang.replace('_', '-') %>" dir="ltr">
<head>
<%- await include('@/head') %>
</head>
<body id="page-404">
<%- await include('@/layout/menu') %>
<main role="main" id="main">
<%- await include('@/layout/header') %>
<div class="container py-5">
<article id="fallback-404">
<p class="display-1">
<b>404</b>
</p>
<p class="display-4 text-muted">
Página não encontrada.
</p>
<p class="display-4">
<a href="/">Ir para a home</a>
</p>
</article>
</div>
<%- await include('@/layout/footer') %>
</main>
<%- await include('@/json') %>
<%- await include('@/scripts') %>
</body>
</html>
<% } %>
34 changes: 33 additions & 1 deletion template/pages/#cms/posts.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<%
const blogPage = _.cms('blog')
const { slug, content } = await _.resolveRoute()
const isNotFound = !Object.keys(content).length
_.breadcrumbs = [{
name: blogPage.title,
link: `/blog`
Expand All @@ -19,4 +20,35 @@ if (!content.sections || !content.sections.length) {
}
%>

<%- await include('@/view') %>
<% if (!isNotFound) { %>
<%- await include('@/view') %>
<% } else { %>
<!doctype html>
<html lang="<%= _.lang.replace('_', '-') %>" dir="ltr">
<head>
<%- await include('@/head') %>
</head>
<body id="page-404">
<%- await include('@/layout/menu') %>
<main role="main" id="main">
<%- await include('@/layout/header') %>
<div class="container py-5">
<article id="fallback-404">
<p class="display-1">
<b>404</b>
</p>
<p class="display-4 text-muted">
Post não encontrado.
</p>
<p class="display-4">
<a href="/blog">Ir para o blog</a>
</p>
</article>
</div>
<%- await include('@/layout/footer') %>
</main>
<%- await include('@/json') %>
<%- await include('@/scripts') %>
</body>
</html>
<% } %>

0 comments on commit ce68658

Please sign in to comment.