Switch to Kramdown, write a blog post
All checks were successful
/ deploy (push) Successful in 4m7s

This commit is contained in:
Aleks Rutins 2025-06-10 22:27:08 -04:00
parent 4b73564dac
commit a4f9dadd8b
Signed by: asr
SSH key fingerprint: SHA256:DBype7RrB3qCdOLdkvecD2Y3THOYgYOVw6jAHVgsGRQ
10 changed files with 58 additions and 17 deletions

View file

@ -5,23 +5,23 @@ published_on: '2025-02-13'
*Updated 6/4/2025: Replaced the demo page.*
Go modules are great. URL-based imports, generally, are great. One of the things that makes them so great is that putting them on your own domain provides a good way of verifying ownership without going through a third party or a complicated review process. Plus, it looks cool.
Go modules are great. URL-based imports, generally, are great. One of the things that makes them so great is that putting them on your own domain provides a good way of verifying ownership without going through a third party or a complicated review process. Plus, it looks cool.
So, how exactly does one accomplish such a thing? Well, it's [buried in the documentation](https://pkg.go.dev/cmd/go#hdr-Remote_import_paths), but it's really pretty simple. For each import path (e.g. `mysite.com/mypackage`), just put a page on your website with a `go-import` meta tag:
```html
~~~ html
<meta name="go-import" content="mysite.com/mypackage git https://ultragreatgithost.com/me/mypackage">
```
~~~
_(`git` can be replaced with `bzr`, `fossil`, `hg`, or `svn` for different VCSs &mdash; see the docs page linked above.)_
This website, for instance, builds these pages from a hash in [`build.rb`](https://git.sr.ht/~aleksrutins/farthergate.com/tree/main/item/build.rb#L14):
```ruby
~~~ ruby
def go_modules = {
"farthergate.com/stack" => "https://git.farthergate.com/aleks/stack",
# ...
}
```
~~~
See [farthergate.com/terminated](/terminated) for an example of a generated page. Look in the web inspector for the `meta` tag!
See [farthergate.com/terminated](/terminated) for an example of a generated page. Look in the web inspector for the `meta` tag!