diff options
| author | Nicolas Paul <n@nc0.fr> | 2023-10-04 09:18:14 +0200 |
|---|---|---|
| committer | Nicolas Paul <n@nc0.fr> | 2023-10-04 09:27:14 +0200 |
| commit | 85a90f56fbe098e8e8e83127809ed15e20017b7c (patch) | |
| tree | cd1fb88c277b074b5a518a7c0a9c4ad415ddfb1c | |
| parent | 98ed75b1be4d50547d065659e201618d950f3db2 (diff) | |
Fix typos in the Guide
| -rw-r--r-- | doc/pages/guide.md | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/doc/pages/guide.md b/doc/pages/guide.md index ed098e4..edf0c3a 100644 --- a/doc/pages/guide.md +++ b/doc/pages/guide.md @@ -44,22 +44,21 @@ This document is a guide to setting up SVGU, configuring an index and hosting it on a Web server. A production-ready example can be found for [go.nc0.fr](https://go.nc0.fr) -which works thanks to SVGU. The source repository is available on -[GitHub](https://github.com/nc0fr/gomods). +on [GitHub](https://github.com/nc0fr/gomods). ## Getting Started -To get started, you need to make sure you have [installed SVGU](./install.mdx). +To get started, you to have [installed SVGU](./install.mdx). Also, you will need a [text editing software](https://vim.org), -a web server (you can either host one yourself or use a service like -[Vercel](https://vercel.com) or -[Cloudflare Pages](https://pages.cloudflare.com), and a domain name with access -to your DNS. +a Web server (either host one yourself or use a service like +[Vercel](https://vercel.com) and +[Cloudflare Pages](https://pages.cloudflare.com)), and a domain name with +access to your DNS. ## Overview In this guide, we will use the `example.com` domain as our target. -We will assume the existence of three Go modules, `example.com/a` hosted on +We assume the existence of three Go modules, `example.com/a` hosted on GitHub (Git), `example.com/b` hosted on SourceHut (Mercurial), and `example.com/c` hosted on a private server with Bazaar. @@ -74,12 +73,12 @@ Remember that Go supports [Bazaar][bzr], [Subversion][svn], [Git][git], ## Writing the Configuration -Let's create a file named `svgu.star` in a directory of your choice. -This file will serve as our index configuration. +Let's create a file named `svgu.star` in the directory of your choice. +This file serves as our index configuration. ### Initialization -Inside this file, we will initialize the index and register our three modules. +Inside this file, we next initialize the index and register our three modules. Let's start with the index: ```python @@ -88,17 +87,16 @@ Let's start with the index: index(domain="example.com") ``` -The [`index()`](./references.mdx#index) is responsible for the initialization -of the index. It takes one argument (named `domain`) which corresponds to the -domain name the registry will be published at. -Since we have decided to use `example.com` in this guide, we set `domain` to -`example.com`. +The [`index()`](./references.mdx#index) function is responsible for +initializing our index: it takes one argument (named `domain`) which +corresponds to the domain name the registry will be published at. +Since it is `example.com` in this guide, we set `domain` to `example.com`. ### Modules Next, we need to declare our three modules, `example.com/{a,b,c}`. This can be achieved with the help of the -[`module()`](./references.mdx#module). +[`module()`](./references.mdx#module) function. ```python # svgu.star @@ -139,13 +137,13 @@ module( ) ``` -Here we can see our three Go modules declared successfully. +Here we can see our three modules declared correctly. ### Helpers -While you can write as many `module()` as required, there is a lot boilerplate -involved in declaring a module. Luckily, SVGU use the -[Starlark configuration language](./starlark.mdx) which helps with that. +However, while you can write as many `module()` as required, there is a +lot boilerplate involved. Luckily, thanks to the +[Starlark configuration language](./starlark.mdx), we can solve this issue. Indeed, imagine you need to declare multiple repositories, all hosted on your public GitHub profile `example`. They all publish their `main` branch. @@ -191,23 +189,23 @@ in your tasks, so make sure to use it. ### Linting -You can format and lint your configuration using the -[Buildifier](https://github.com/bazelbuild/buildtools). +Additionally, it is possible to format and lint your configuration using the +[Buildifier](https://github.com/bazelbuild/buildtools) tool. ## Going to Production ### Compiling -Now that your configuration is ready, you may generate your index as a set -of HTML document. +Now that your configuration is ready, you can generate your index as a set +of HTML documents. The `svgu` command-line tool accepts two parameters: - `-c=file` the configuration file to use, here it will be `svgu.star`; - `-o=directory` the output directory. -We want to generate our registry inside a directory called `out`. -Therefore, we can run: +We want to generate our registry inside a directory called `out`, therefore, +we can run: ```bash $ svgu -c=svgu.star -o=out @@ -223,25 +221,25 @@ a.html b.html c.html index.html ### Deploying -Now that you have everything ready inside your `out` directory, the last step +Now that you have everything ready inside the `out` directory, the last step is to deploy the directory's content on the Web server of your choice. Make sure your Web server has URL rewriting enabled, such that the `.html` extension is not required in the request URL (some services, including [GitHub Pages](https://pages.github.io) and -[Cloudflare Pages](https://pages.cloudflare.com) have this enabled by default, +[Cloudflare Pages](https://pages.cloudflare.com) do it enabled by default, traditional servers may require configuration: [Caddy](https://caddyserver.com/docs/caddyfile/directives/rewrite), [NGINX](https://www.nginx.com/blog/creating-nginx-rewrite-rules)...). -Finally, make sure you have correctly configured your DNS entries, and you +Finally, make sure to have correctly configured your DNS entries, and you should quickly be able to import your Go modules using your domain name! ## Additional Notes By default, the standard Go toolchain uses Google's Go module proxy to retrieve -modules. The proxy ensures the availablity of modules for all users by caching -Go modules. +modules. The proxy ensures the availablity of modules for all users by +aggresively caching existing Go modules. However, due to the cache, you may experience delays and differences between the latest pushed version and the imported one. These issues are related to Google's proxy and are usually not an issue as the cache is often |
