aboutsummaryrefslogtreecommitdiff
path: root/docs/local_development.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/local_development.md')
-rw-r--r--docs/local_development.md29
1 files changed, 20 insertions, 9 deletions
diff --git a/docs/local_development.md b/docs/local_development.md
index ea5e4865..8e32eb6c 100644
--- a/docs/local_development.md
+++ b/docs/local_development.md
@@ -2,7 +2,7 @@
> This document is driven from https://docs.sourcegraph.com/dev/local_development.
-Gogs is developed in [Go](https://golang.org/), please take [A Tour of Go](https://tour.golang.org/) if you haven't done so!
+Gogs is written in [Go](https://golang.org/), please take [A Tour of Go](https://tour.golang.org/) if you haven't done so!
## Outline
@@ -47,6 +47,14 @@ Gogs has the following dependencies:
brew services start postgresql
```
+4. Ensure `psql`, the PostgreSQL command line client, is on your `$PATH`.
+ Homebrew does not put it there by default. Homebrew gives you the command to run to insert `psql` in your path in the "Caveats" section of `brew info postgresql`. Alternatively, you can use the command below. It might need to be adjusted depending on your Homebrew prefix (`/usr/local` below) and shell (bash below).
+
+ ```bash
+ hash psql || { echo 'export PATH="/usr/local/opt/postgresql/bin:$PATH"' >> ~/.bash_profile }
+ source ~/.bash_profile
+ ```
+
### Ubuntu
1. Update repositories:
@@ -68,14 +76,6 @@ Gogs has the following dependencies:
sudo systemctl enable postgresql
```
-4. Ensure `psql`, the PostgreSQL command line client, is on your `$PATH`.
- Homebrew does not put it there by default. Homebrew gives you the command to run to insert `psql` in your path in the "Caveats" section of `brew info postgresql`. Alternatively, you can use the command below. It might need to be adjusted depending on your Homebrew prefix (`/usr/local` below) and shell (bash below).
-
- ```bash
- hash psql || { echo 'export PATH="/usr/local/opt/postgresql/bin:$PATH"' >> ~/.bash_profile }
- source ~/.bash_profile
- ```
-
## Step 2: Initialize your database
You need a fresh Postgres database and a database user that has full ownership of that database.
@@ -132,8 +132,19 @@ SSL_MODE = disable
make web
```
+You would have to re-run this command after changing Go files, or any file under `conf/`, `template/` and `public/` directories.
+
## Other nice things
+### Load HTML templates and static files from disk
+
+When you are actively working on HTML templates and static files during development, you may want to enable the following configuration to avoid recompiling and restarting Gogs every time you make a change to files under `template/` and `public/` directories:
+
+```ini
+[server]
+LOAD_ASSETS_FROM_DISK = true
+```
+
### Offline development
Sometimes you will want to develop Gogs but it just so happens you will be on a plane or a train or perhaps a beach, and you will have no WiFi. And you may raise your fist toward heaven and say something like, "Why, we can put a man on the moon, so why can't we develop high-quality Git hosting without an Internet connection?" But lower your hand back to your keyboard and fret no further, for the year is 2020, and you *can* develop Gogs with no connectivity by setting the following configuration in your `custom/conf/app.ini`: