Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevekrouse/unbreakable-links
all github pages links can be permalinks
https://github.com/stevekrouse/unbreakable-links
Last synced: 16 days ago
JSON representation
all github pages links can be permalinks
- Host: GitHub
- URL: https://github.com/stevekrouse/unbreakable-links
- Owner: stevekrouse
- License: mit
- Created: 2017-10-08T22:25:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-09T01:45:12.000Z (about 7 years ago)
- Last Synced: 2024-12-16T13:43:21.810Z (17 days ago)
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unbreakable-links: rm without anxiety
You want to delete a page from your Github Pages site, but are worried about all of the countless links around the web this will break.
Unbreakable-links to the rescue.
By associating your content with its git commit hash, it ensures your links never break.
## How to install
Add the following script tag to every page in your website:
```html
```
**NOTE: don't forget to customize the `repoPath` attribute to what it is for you.**
Also, don't forget to add it to your `404.html` page if you want it to work for deleted pages!
## We handle all the cases
| File | Commit Hash | Output |
| ------------- | ------------- |---------------------------------------------------------------------------------------------------|
| currently exits | none in URL | "You are viewing the most recent version of this file." We also add the commit hash to the URL. |
| currently exits | current hash | "You are viewing the most recent version of this file." |
| currently exits | old hash | "There is a more recent version of this file." |
| deleted | none in URL | "This file was deleted. Here is the most recent version." We also add the commit hash to the URL. |
| deleted | current hash | "This file was deleted, but this is the most recent version that existed." |
| deleted | old hash | "This file was deleted, but there is a more recent version than this one." |
| never existed | N/A | "This file never existed" |
| moved | N/A | not yet handled |## FAQ
### Isn't this basically a server on the frontend?
Yes, yes it is. Someone probably should [turn this into a backend service at some point](https://github.com/stevekrouse/unbreakable-links/issues/11).
### Why did you make this?
I was tired of mapping out migration plans and wanted to be able to move around my content with ease.
You can [read my full thought proccess here](https://github.com/stevekrouse/futureofcoding.org/issues/51).