update documentation for GET /b
This commit is contained in:
parent
c1cf9e0812
commit
aea43361f7
1 changed files with 42 additions and 8 deletions
|
@ -1,21 +1,55 @@
|
|||
%% title = "GET /b"
|
||||
|
||||
% id = "b"
|
||||
- # GET /b?<span class="http-request-parameter">branch</span>
|
||||
- ### SYNOPSIS
|
||||
|
||||
<style>
|
||||
.http-request-parameter { opacity: 80%; --recursive-wght: 700; }
|
||||
</style>
|
||||
```
|
||||
GET /b?branch
|
||||
```
|
||||
|
||||
% id = "01JHDWDWC7C27NTPTQC2035DK7"
|
||||
- ### DESCRIPTION
|
||||
|
||||
% id = "01HMF8KQ990KC8Q08XYSKTV4TQ"
|
||||
- this endpoint takes you to the <span class="http-request-parameter">branch</span> with the given ID
|
||||
- this endpoint redirects you to the page containing the [branch]{.http-request-parameter} with the given ID, with an anchor on the selected branch.
|
||||
|
||||
% id = "01HMF8KQ99VBWQSG1Y8NDTM8QA"
|
||||
- it also includes proper OpenGraph metadata for the page, unlike the raw .html files.
|
||||
therefore it's used for permalinks (those on the far right side of the branch →)
|
||||
% id = "01JHDWDWC78GKP1881KHAHN66C"
|
||||
- since the lookup is dynamic, *this provides a method of permalinking to branches even if they are moved across pages.*
|
||||
|
||||
% id = "01JHDWDWC78ERY5CHEYG4EAS3N"
|
||||
- the destination URL of the redirect should not be considered permanent!
|
||||
|
||||
% id = "01JHDWDWC7K0R3DZ5KJV1HW0NJ"
|
||||
- ### RETURN VALUE
|
||||
|
||||
% id = "01JHDWDWC7QP7V4470NB1JKZ0D"
|
||||
- if the lookup is successful, `302 Found` is returned with the `Location` header set to the destination URL as described above.
|
||||
|
||||
% id = "01JHDWDWC7VNC6EWJQV39SE641"
|
||||
- if the branch with the given ID cannot be found, HTTP `404 Not Found` is returned.
|
||||
|
||||
% id = "01JHDWDWC7VRKAD82V9YKR9T9C"
|
||||
- if no parameters are provided, this page is returned.
|
||||
|
||||
% id = "01JHDWDWC7EPDC6HECHVG2VA57"
|
||||
- ### EXAMPLES
|
||||
|
||||
% id = "01JHDWDWC7DQ5D4F1X5FYX3MF6"
|
||||
- ```
|
||||
/b?hello
|
||||
```
|
||||
|
||||
(currently) redirects to
|
||||
|
||||
```
|
||||
/about#b-hello
|
||||
```
|
||||
|
||||
causing the browser to scroll and highlight the branch with ID `hello`.
|
||||
|
||||
% id = "01HMF8KQ99KWR1K9QHKPYY2K15"
|
||||
+ c'mon, [give it a whirl](/b?the-end-is-never)
|
||||
|
||||
% id = "01HMF8KQ99WX9P6D05T5VYBSKK"
|
||||
- <https://www.youtube.com/watch?v=8Kban1IOQ4M>
|
||||
|
||||
|
|
Loading…
Reference in a new issue