Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf3161c

Browse filesBrowse files
committed
1 parent 8c8c081 commit cf3161c
Copy full SHA for cf3161c

File tree

Expand file treeCollapse file tree

6 files changed

+4
-1280
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+4
-1280
lines changed

‎links/README.md

Copy file name to clipboard
+4-50Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,6 @@
1-
# Short links for URLs in the book
1+
This file is deployed as `.htaccess` to the FPY.LI domain
2+
to map short URLs in Fluent Python to the original URLs.
23

3-
## Problem: link rot
4+
To update it, I use tools in this other repo:
45

5-
_Fluent Python, Second Edition_ has more than 1000 links to external resources.
6-
Inevitably, some of those links will rot as time passes.
7-
But I can't change the URLs in the print book...
8-
9-
## Solution: indirection
10-
11-
I replaced almost all URLs in the book with shortened versions that go through the `fpy.li` site which I control.
12-
The site has an `.htaccess` file with *temporary* redirects.
13-
14-
When I find out a link is stale, I can thange the redirect in `.htaccess` to a new target,
15-
which may be a link to copy in the Internet Archive's
16-
[Wayback Machine](https://archive.org/web/)
17-
o the link in the book is back in service through the updated redirect.
18-
19-
20-
## Help wanted
21-
22-
Please report broken links as bugs in the [`FPY.LI.htaccess`](FPY.LI.htaccess) file.
23-
Also, feel free to send pull requests with fixes to that file.
24-
When I accept a PR, I will redeploy it to `fpy.li/.htaccess`.
25-
26-
27-
## Details
28-
29-
Almost all URLs in the book are replaced with shortened versions like
30-
[`http://fpy.li/1-3`](http://fpy.li/1-3)—for chapter 1, link #3.
31-
32-
There are also custom short URLs like
33-
[`https://fpy.li/code`](https://fpy.li/code) which redirects to the example code repository.
34-
I used custom short URLs for URLs with 3 or more mentions, or links to PEPs.
35-
36-
Exceptions:
37-
38-
- URLs with `oreilly` in them are unchanged;
39-
- `fluentpython.com` URL (with no path) is unchanged;
40-
41-
The `custom.htaccess` file contains redirects with custom names
42-
plus numbered URLs generated from the links in each chapter in
43-
the Second Edition in English.
44-
45-
`short.htaccess` has redirects made by `short.py`, starting
46-
with the Second Edition in Brazilian Portuguese.
47-
48-
```shell
49-
cat custom.htaccess short.htaccess > FPY.LI.htaccess
50-
```
51-
52-
`FPY.LI.htaccess` is deployed at the root folder in `http://fpy.li`.
6+
https://github.com/pythonfluente/pythonfluente2e

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.