Skip to content

Commit

Permalink
meta, robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalnjs committed Oct 17, 2023
1 parent a14dbbc commit b74662e
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frontend/pages/article.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/articles.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/artwork.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/artworks.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/index.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/newspaper.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/newspapers.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/poll.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/polls.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/search.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/tag.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/tags.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html>
<html lang="en">

<head>
<%- include('../partials/head.ejs'); %>
Expand Down
16 changes: 14 additions & 2 deletions frontend/partials/head.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
<link rel="icon" href="<%- vars.asset_prefix %><%= cms.siteDetails[0].favicon.path %>">
<title><% if (title != '') { %><%- title %> | <% } %><%= cms.siteDetails[0].title %></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="<%- vars.asset_prefix %><%= cms.siteDetails[0].favicon.path %>">
<title><% if (title != '') { %><%- title %> | <% } %><%= cms.siteDetails[0].title %></title>
<meta name="title" content="<% if (title != '') { %><%- title %> | <% } %><%= cms.siteDetails[0].title %>" />
<meta name="description" content="<%= cms.siteDetails[0].description %>" />
<meta property="og:type" content="website" />
<meta property="og:url" content="<%- vars.domain %>" />
<meta property="og:title" content="<% if (title != '') { %><%- title %> | <% } %><%= cms.siteDetails[0].title %>" />
<meta property="og:description" content="<%= cms.siteDetails[0].description %>" />
<meta property="og:image" content="<%- vars.asset_prefix %><%= cms.siteDetails[0].background.path %>" />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="<%- vars.domain %>" />
<meta property="twitter:title" content="<% if (title != '') { %><%- title %> | <% } %><%= cms.siteDetails[0].title %>" />
<meta property="twitter:description" content="<%= cms.siteDetails[0].description %>" />
<meta property="twitter:image" content="<%- vars.asset_prefix %><%= cms.siteDetails[0].background.path %>" />
<style>
:root {
--theme: <%=cms.siteDetails[0].color %>;
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ async function startApp() {
res.redirect('/');
});

app.get('/robots.txt', function (req, res) {
res.type('text/plain');
res.send((defaults.environment === 'production') ? "User-agent: *\nAllow: /" : "User-agent: *\nDisallow: /");
});

app.use(async (req, res, next) => {
await allRoutes(req, res);
return res.render('404', { vars: defaults, title: '404', cms, pageviews: req.pageViews });
Expand Down

0 comments on commit b74662e

Please sign in to comment.