All Projects → kuflash → React Router Sitemap

kuflash / React Router Sitemap

Licence: mit
Generate sitemap.xml by React Router configuration

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Router Sitemap

React Firestore Authentication
🔥Boilerplate Project for Authentication with Firestore in React.
Stars: ✭ 165 (-12.7%)
Mutual labels:  react-router
React Router Native Stack
A stack navigation component for react-router-native
Stars: ✭ 171 (-9.52%)
Mutual labels:  react-router
React Pages
A complete solution for building a React/Redux application: routing, page preloading, (optional) server-side rendering, asynchronous HTTP requests, document metadata, etc.
Stars: ✭ 182 (-3.7%)
Mutual labels:  react-router
React Redux Universal Boilerplate
An Universal ReactJS/Redux Boilerplate
Stars: ✭ 165 (-12.7%)
Mutual labels:  react-router
Sitemap Generator Crawler
Script that generates a sitemap by crawling a given URL
Stars: ✭ 169 (-10.58%)
Mutual labels:  sitemap
Memos
React+React-router+redux+redux-thunk+less+es6实现的简易备忘录,在线demo地址:
Stars: ✭ 174 (-7.94%)
Mutual labels:  react-router
Redux First History
🎉 Redux First History - Redux history binding support react-router - @reach/router - wouter
Stars: ✭ 163 (-13.76%)
Mutual labels:  react-router
Redux Auth Wrapper
A React Higher Order Component (HOC) for handling Authentication and Authorization with Routing and Redux
Stars: ✭ 2,175 (+1050.79%)
Mutual labels:  react-router
Xpcms
基于node的cms系统, 后端采用node+koa+redis,并通过本人封装的redis库实现数据操作,前端采用vue+ts+vuex开发,后台管理系统采用react全家桶开发
Stars: ✭ 170 (-10.05%)
Mutual labels:  react-router
React Conf 17 Videos
Find that one presentation you missed!
Stars: ✭ 182 (-3.7%)
Mutual labels:  react-router
Full Stack Serverless Code
Code examples for my book Full Stack Serverless with O'Reilly Publications
Stars: ✭ 165 (-12.7%)
Mutual labels:  react-router
Online Shop
Online shop prototype implemented in React.
Stars: ✭ 168 (-11.11%)
Mutual labels:  react-router
React Auth App Example
An app example with authentication using Create React App, React, React Router, Apollo, GraphQL, Redux and Redux Form.
Stars: ✭ 179 (-5.29%)
Mutual labels:  react-router
Template Rwb
A full-featured Webpack setup with hot-reload
Stars: ✭ 165 (-12.7%)
Mutual labels:  react-router
Todo Redux Saga
Todo app with Create-React-App • React-Redux • Redux-Saga • Firebase • OAuth
Stars: ✭ 184 (-2.65%)
Mutual labels:  react-router
Ecommerce Reactjs
Full stack ecommerce online store application
Stars: ✭ 164 (-13.23%)
Mutual labels:  react-router
Devrantron
A cross platform desktop application for devRant
Stars: ✭ 173 (-8.47%)
Mutual labels:  react-router
Wanna
💡✔ Wanna is an implementation of a 21st-century to-do list app.
Stars: ✭ 189 (+0%)
Mutual labels:  react-router
React Admin
基于react的后台管理项目模板
Stars: ✭ 184 (-2.65%)
Mutual labels:  react-router
Express React Boilerplate
Express, MySQL, React/Redux, NodeJs Application Boilerplate
Stars: ✭ 179 (-5.29%)
Mutual labels:  react-router

React Router Sitemap

Build Status npm version

Module for generating sitemaps using React Router configuration. Also it can filter paths and replace params (like a :paramName) in dynamic paths.

Install

npm i --save react-router-sitemap

Usage

You need to have a module with the router configuration. For example:

router.jsx

import React from 'react';
import { Route } from 'react-router';

export default (
	<Route>
		<Route path='/' />
		<Route path='/about' />
		<Route path='/projects' />
		<Route path='/contacts' />
		<Route path='/auth' />
	</Route>
);

If you are using v4 react-router, your router.jsx might be:

import React from 'react';
import { Switch, Route } from 'react-router';

export default (
	// Switch is added in v4 react-router
	<Switch>
		<Route path='/' />
		<Route path='/about' />
		<Route path='/projects' />
		<Route path='/contacts' />
		<Route path='/auth' />
		<Route /> // No-match case
	</Switch>
);

And you need to create a script which will run from the command line or on the server.

Please note that in this case you need a module 'babel-register' to work with the ES2105 syntax and .jsx format.

sitemap-builder.js

require('babel-register');

const router = require('./router').default;
const Sitemap = require('../').default;

(
	new Sitemap(router)
		.build('http://my-site.ru')
		.save('./sitemap.xml')
);

It's a minimal example. After running the script, a sitemap.xml file will be created, which includes all paths, described in the configuration of react-router.

A more detailed example can be found in the example directory. You can also explore the details of the API.

API

Explore the public API for using the module.

License

React Router Sitemap is freely distributable under the terms of the MIT license.

MIT License

Copyright (c) 2016 kuflash

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].