Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
CptCompiler authored Nov 11, 2021
1 parent 59644b6 commit 001254f
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# Redirects
# Location

> Redirects is a Statamic addon that allows to easily setup simple redirect rules in the control panel.
> Location is a Statamic addon that adds a location field using the google places api.
## Features

This addon allows you to:

- redirect source URLs to custom URLs or entries
- define the redirect status code
- save notes for each redirect to remember later what it was created for

## How to Install

Expand All @@ -20,28 +14,10 @@ composer require tfd/statamic-redirects

## How to Use

To create a redirect rule go to the new control panel section `Tools > Redirects`.
You have to provide a source and target URL. To enable the redirect rule you have to activate the `Active` toggle.
You also can provide notes for your future self or others, e. g. to explain what the redirect rule was made for.

A typical redirect could look like this:

![image](https://user-images.githubusercontent.com/2184676/138484789-f36a2ee9-fffc-4f3d-a1bd-dc3f370f71ac.png)

This configuration will redirect
- from https://my-domain.com/halloween
- to https://my-domain.com/calender/events-of-the-year/halloween

You can also provide absolute URLs to redirect to external sites.
Additionally you can select an entry instead of entering a URL and the redirect addon will automatically get redirect to the URL of the entry.

**Tip:** Do not forget to `activate` the rule via the toggle switch.
Set the google API key via .env `GOOGLE_MAPS_API_KEY`

## Development Notes
- Run `npm install` from the packages root directory
- Run `npm run watch` during development
- After changing js files you have to either
- manually publish the cp.js file (https://statamic.dev/extending/addons#publishing-assets) or
- create a symlink: `ln -s /path/to/tfd/statamic-redirects/public public/vendor/statamic-redirects`
- Run `npm run production` at the end to create the distribution files
`

0 comments on commit 001254f

Please sign in to comment.