Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robsonkades/fusion-plugin-robots
🎈 Handles creating and returning a Robots(robots.txt) file for your Fusion app.
https://github.com/robsonkades/fusion-plugin-robots
fusionjs javascript nodejs reactjs web
Last synced: 3 days ago
JSON representation
🎈 Handles creating and returning a Robots(robots.txt) file for your Fusion app.
- Host: GitHub
- URL: https://github.com/robsonkades/fusion-plugin-robots
- Owner: robsonkades
- License: mit
- Created: 2020-02-20T19:33:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-02-21T00:23:55.000Z (over 4 years ago)
- Last Synced: 2024-10-11T17:43:29.224Z (about 1 month ago)
- Topics: fusionjs, javascript, nodejs, reactjs, web
- Language: JavaScript
- Homepage: https://fusionjs.com/
- Size: 104 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fusion-plugin-robots
[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)
Handles creating and returning a Robots(_robots.txt_) file for your Fusion app.
---
### Table of contents
* [Installation](#installation)
* [Setup](#setup)---
### Installation
```sh
yarn add fusion-plugin-robots
```---
### Setup
Create an `Const` to use for your `robots.js` content.
```js
// src/robots.js
export const Robots = `User-agent: googlebot
Disallow: /directory1/
Disallow: /directory2/
Allow: /directory2/subdirectory1/# Block the entire site from anothercrawler.
User-agent: anothercrawler
Disallow: /`
`
```
Register `RobotsToken` with your robots `File` and register `RobotsPlugin` for the `__NODE__` env.
```js
// src/main.js
import App from 'fusion-react'
import RobotsPlugin, {
RobotsToken
} from 'fusion-plugin-robots'
import { Robots } from './robots'
export default () => {
const app = new App(root)
if (__NODE__) {
app.register(RobotsToken, Robots)
app.register(RobotsPlugin)
}
return app
}
```