mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-29 11:12:39 +00:00
Added robots.txt, nofollow in metatags
Also noindex on /print/ pages
This commit is contained in:
@@ -203,7 +203,7 @@ const EditPage = createClass({
|
||||
|
||||
render : function(){
|
||||
return <div className='editPage page'>
|
||||
<Meta name="robots" content="noindex" />
|
||||
<Meta name='robots' content='noindex, nofollow' />
|
||||
{this.renderNavbar()}
|
||||
|
||||
<div className='content'>
|
||||
|
||||
@@ -73,7 +73,7 @@ const HomePage = createClass({
|
||||
|
||||
render : function(){
|
||||
return <div className='homePage page'>
|
||||
<Meta name="google-site-verification" content="NwnAQSSJZzAT7N-p5MY6ydQ7Njm67dtbu73ZSyE5Fy4" />
|
||||
<Meta name='google-site-verification' content='NwnAQSSJZzAT7N-p5MY6ydQ7Njm67dtbu73ZSyE5Fy4' />
|
||||
{this.renderNavbar()}
|
||||
|
||||
<div className='content'>
|
||||
|
||||
@@ -2,6 +2,7 @@ const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
const _ = require('lodash');
|
||||
const cx = require('classnames');
|
||||
const Meta = require('vitreum/meta');
|
||||
const Markdown = require('naturalcrit/markdown.js');
|
||||
|
||||
const PrintPage = createClass({
|
||||
@@ -42,6 +43,7 @@ const PrintPage = createClass({
|
||||
|
||||
render : function(){
|
||||
return <div>
|
||||
<Meta name='robots' content='noindex, nofollow' />
|
||||
{this.renderPages()}
|
||||
</div>;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ const SharePage = createClass({
|
||||
|
||||
render : function(){
|
||||
return <div className='sharePage page'>
|
||||
<Meta name="robots" content="noindex" />
|
||||
<Meta name='robots' content='noindex, nofollow' />
|
||||
<Navbar>
|
||||
<Nav.section>
|
||||
<Nav.item className='brewTitle'>{this.props.brew.title}</Nav.item>
|
||||
|
||||
5
robots.txt
Normal file
5
robots.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
# Disallow crawling brew edit and share pages
|
||||
User-agent: *
|
||||
Disallow: /edit/
|
||||
Disallow: /share/
|
||||
Disallow: /print/
|
||||
13
server.js
13
server.js
@@ -44,9 +44,14 @@ const HomebrewModel = require('./server/homebrew.model.js').model;
|
||||
const welcomeText = require('fs').readFileSync('./client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
|
||||
const changelogText = require('fs').readFileSync('./changelog.md', 'utf8');
|
||||
|
||||
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
|
||||
|
||||
//Robots.txt
|
||||
app.get('/robots.txt', (req, res)=>{
|
||||
return res.sendFile(`${__dirname}/robots.txt`);
|
||||
});
|
||||
|
||||
//Source page
|
||||
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
|
||||
app.get('/source/:id', (req, res)=>{
|
||||
HomebrewModel.get({ shareId: req.params.id })
|
||||
.then((brew)=>{
|
||||
@@ -59,7 +64,7 @@ app.get('/source/:id', (req, res)=>{
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//User Page
|
||||
app.get('/user/:username', (req, res, next)=>{
|
||||
const fullAccess = req.account && (req.account.username == req.params.username);
|
||||
HomebrewModel.getByUser(req.params.username, fullAccess)
|
||||
@@ -72,7 +77,7 @@ app.get('/user/:username', (req, res, next)=>{
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//Edit Page
|
||||
app.get('/edit/:id', (req, res, next)=>{
|
||||
HomebrewModel.get({ editId: req.params.id })
|
||||
.then((brew)=>{
|
||||
@@ -115,7 +120,7 @@ app.get('/print/:id', (req, res, next)=>{
|
||||
});
|
||||
|
||||
|
||||
//Render Page
|
||||
//Render the page
|
||||
const render = require('vitreum/steps/render');
|
||||
const templateFn = require('./client/template.js');
|
||||
app.use((req, res)=>{
|
||||
|
||||
Reference in New Issue
Block a user