11{{ define "main" }}
22< article class ="prose max-w-5xl ">
33< p >
4- go links provide short, memorable links for the websites you and your team use most.
4+ {{go}} links provide short, memorable links for the websites you and your team use most.
55
6- < h2 > Creating go links</ h2 >
6+ < h2 > Creating {{go}} links</ h2 >
77
88< p >
9- All go links have a < strong > short name</ strong > and a < strong > destination link</ strong > that the go link points to.
9+ All {{go}} links have a < strong > short name</ strong > and a < strong > destination link</ strong > that the {{go}} link points to.
1010Some notes on short names:
1111
1212< ul >
1313 < li > names must start with a letter or number
1414 < li > names may contain letters, numbers, hyphens, and periods
15- < li > names are < strong > not</ strong > case-sensitive (go /foo is the same as go /FOO)
16- < li > hyphens are ignored when resolving links (go /meetingnotes is the same as go /meeting-notes)
15+ < li > names are < strong > not</ strong > case-sensitive ({{go}} /foo is the same as {{go}} /FOO)
16+ < li > hyphens are ignored when resolving links ({{go}} /meetingnotes is the same as {{go}} /meeting-notes)
1717</ ul >
1818
1919< p >
@@ -25,26 +25,26 @@ <h2>Creating go links</h2>
2525< h2 > Resolving links</ h2 >
2626
2727< p >
28- When logged in to your Tailscale network, go links can be entered directly into any browser or command line utility such as curl.
28+ When logged in to your Tailscale network, {{go}} links can be entered directly into any browser or command line utility such as curl.
2929You do not need any additional browser extensions.
3030
3131< p >
3232Any additional path provided after the short name will be added to the end of the destination link.
33- For example, if < strong > go /who</ strong > goes to your company directory at < strong > http://directory/</ strong > ,
34- then < strong > go /who/amelie</ strong > will go to < strong > http://directory/amelie</ strong > .
33+ For example, if < strong > {{go}} /who</ strong > goes to your company directory at < strong > http://directory/</ strong > ,
34+ then < strong > {{go}} /who/amelie</ strong > will go to < strong > http://directory/amelie</ strong > .
3535
3636< p >
3737< a href ="#advanced "> Advanced destination links</ a > allow you to further customize this behavior.
3838
3939< h2 id ="advanced "> Advanced destination links</ h2 >
4040
4141< p >
42- To have more control over how go links are resolved, destination links can use < a href ="https://pkg.go.dev/text/template "> Go template syntax</ a > .
42+ To have more control over how {{go}} links are resolved, destination links can use < a href ="https://pkg.go.dev/text/template "> Go template syntax</ a > .
4343Templates are provided a data structure with the following fields:
4444
4545< ul >
4646 < li > < code > .Path</ code > is the remaining path value after the short name (without a leading slash).
47- For the link < strong > go /who/amelie</ strong > , the value of < code > .Path</ code > is < code > amelie</ code > .
47+ For the link < strong > {{go}} /who/amelie</ strong > , the value of < code > .Path</ code > is < code > amelie</ code > .
4848 < li > < code > .Now</ code > is a < a href ="https://pkg.go.dev/time#Time "> time.Time</ a > value representing the current date and time.
4949 < li > < code > .User</ code > is the current user resolving the link.
5050 This is the email address of the user or < code > {username}@github</ code > for tailnets that use GitHub authentication.
@@ -61,34 +61,34 @@ <h2 id="advanced">Advanced destination links</h2>
6161
6262< p >
6363The most common use of advanced destination links is to put the additional path in a custom location in the destination link.
64- For example, you might set the destination for < strong > go /search</ strong > to:
64+ For example, you might set the destination for < strong > {{go}} /search</ strong > to:
6565
6666< pre > {{`https://www.google.com/{{if .Path}}search?q={{QueryEscape .Path}}{{end}}`}}</ pre >
6767
68- When a user visits < strong > go /search</ strong > with no additional path, they will be directed to < a href ="https://www.google.com/ "> https://www.google.com/</ a > .
69- If they include an additional path like < strong > go /search/pangolins</ strong > , they will be directed to < a href ="https://www.google.com/search?q=pangolins "> https://www.google.com/search?q=pangolins</ a > .
68+ When a user visits < strong > {{go}} /search</ strong > with no additional path, they will be directed to < a href ="https://www.google.com/ "> https://www.google.com/</ a > .
69+ If they include an additional path like < strong > {{go}} /search/pangolins</ strong > , they will be directed to < a href ="https://www.google.com/search?q=pangolins "> https://www.google.com/search?q=pangolins</ a > .
7070
7171< h3 > Examples</ h3 >
7272
7373< table >
7474 < tr >
7575 < td > Include path in query</ td >
76- < td > go /search</ td >
76+ < td > {{go}} /search</ td >
7777 < td > {{`https://cloudsearch.google.com/{{if .Path}}cloudsearch/search?q={{QueryEscape .Path}}{{end}}`}}</ td >
7878 </ tr >
7979 < tr >
8080 < td > Include path in destination path</ td >
81- < td > go /slack</ td >
81+ < td > {{go}} /slack</ td >
8282 < td > {{`https://company.slack.com/{{if .Path}}channels/{{PathEscape .Path}}{{end}}`}}</ td >
8383 </ tr >
8484 < tr >
8585 < td > Include path in hostname</ td >
86- < td > go /varz</ td >
86+ < td > {{go}} /varz</ td >
8787 < td > {{`http://{{if .Path}}{{.Path}}{{else}}host{{end}}.example/debug/varz`}}</ td >
8888 </ tr >
8989 < tr >
9090 < td > Include today's date in wiki page</ td >
91- < td > go /today</ td >
91+ < td > {{go}} /today</ td >
9292 < td > {{`http://wiki/{{.Now.Format "01-02-2006"}}`}}</ td >
9393 </ tr >
9494</ table >
@@ -101,8 +101,8 @@ <h2 id="api">Application Programming Interface (API)</h2>
101101< p >
102102Include a "+" after a link to get information about a link without resolving it:
103103
104- < pre > {{` $ curl -L go /search+
105- {
104+ < pre > $ curl -L {{go}} /search+
105+ {{`{
106106"Short": "search",
107107"Long": "https://cloudsearch.google.com/{{if .Path}}cloudsearch/search?q={{QueryEscape .Path}}{{end}}",
108108"Created": "2022-06-08T04:27:32.829906577Z",
@@ -113,19 +113,19 @@ <h2 id="api">Application Programming Interface (API)</h2>
113113</ pre >
114114
115115< p >
116- Visit < a href ="/.export "> go /.export</ a > to export all saved links and their metadata in < a href ="https://jsonlines.org/ "> JSON Lines format</ a > .
116+ Visit < a href ="/.export "> {{go}} /.export</ a > to export all saved links and their metadata in < a href ="https://jsonlines.org/ "> JSON Lines format</ a > .
117117This is useful to create data snapshots that can be restored later.
118118
119- < pre > {{` $ curl -L go /.export
120- {"Short":"go","Long":"http://go","Created":"2022-05-31T13:04:44.741457796-07:00","LastEdit":"2022-05-31T13:04:44.741457796-07:00","Owner":"
[email protected] ","Clicks":1}
119+ < pre > $ curl -L {{go}} /.export
120+ {
{`{ "Short":"go","Long":"http://go","Created":"2022-05-31T13:04:44.741457796-07:00","LastEdit":"2022-05-31T13:04:44.741457796-07:00","Owner":"
[email protected] ","Clicks":1}
121121{"Short":"slack","Long":"https://company.slack.com/{{if .Path}}channels/{{PathEscape .Path}}{{end}}","Created":"2022-06-17T18:05:43.562948451Z","LastEdit":"2022-06-17T18:06:35.811398Z","Owner":"
[email protected] ","Clicks":4}`}}
122122</ pre >
123123
124124< p >
125125Create a new link by sending a POST request with a < code > short</ code > and < code > long</ code > value:
126126
127- < pre > {{` $ curl -L -H Sec-Golink:1 -d short=cs -d long=https://cs.github.com/ go
128- {"Short":"cs","Long":"https://cs.github.com/","Created":"2022-06-03T22:15:29.993978392Z","LastEdit":"2022-06-03T22:15:29.993978392Z","Owner":"
[email protected] "}`}}
127+ < pre > $ curl -L -H Sec-Golink:1 -d short=cs -d long=https://cs.github.com/ {{go}}
128+ {
{`{ "Short":"cs","Long":"https://cs.github.com/","Created":"2022-06-03T22:15:29.993978392Z","LastEdit":"2022-06-03T22:15:29.993978392Z","Owner":"
[email protected] "}`}}
129129</ pre >
130130
131131</ article >
0 commit comments