Procházet zdrojové kódy

docs: improve set up guide

[CI SKIP]
ᴜɴᴋɴᴡᴏɴ před 4 roky
rodič
revize
8d73608672
4 změnil soubory, kde provedl 27 přidání a 24 odebrání
  1. 2 3
      README.md
  2. 0 7
      conf/README.md
  3. 20 9
      docs/local_development.md
  4. 5 5
      internal/assets/conf/conf_gen.go

+ 2 - 3
README.md

@@ -12,9 +12,8 @@
 
 ### ⚠️ Important notes ⚠️
 
-1. Due to testing purpose, data of [try.gogs.io](https://try.gogs.io) was reset in **Jan 28, 2015** and will reset multiple times after. Please do **NOT** put your important data on the site.
-2. The demo site [try.gogs.io](https://try.gogs.io) is running `master` branch.
-3. If you're interested in using APIs, we have experimental support with [documentation](https://github.com/gogs/go-gogs-client/wiki).
+- The demo site [try.gogs.io](https://try.gogs.io) is running `master` branch. Please do **NOT** put your important data on the site.
+- If you're interested in using APIs, we have experimental support with [documentation](https://github.com/gogs/go-gogs-client/wiki).
 
 [简体中文](README_ZH.md)
 

+ 0 - 7
conf/README.md

@@ -1,7 +0,0 @@
-After change anything (other than this file) in this directory, a re-run of the following command in the root directory of this repository is required:
-
-```
-$ make generate
-```
-
-To install the `go-bindata`, please see https://github.com/kevinburke/go-bindata#installation.

+ 20 - 9
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`:

+ 5 - 5
internal/assets/conf/conf_gen.go

@@ -324,7 +324,7 @@ func confAppIni() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "conf/app.ini", size: 17055, mode: os.FileMode(0644), modTime: time.Unix(1581943454, 0)}
+	info := bindataFileInfo{name: "conf/app.ini", size: 17055, mode: os.FileMode(0644), modTime: time.Unix(1581999833, 0)}
 	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x48, 0x41, 0xfd, 0x4b, 0x83, 0x24, 0x4e, 0x64, 0x13, 0xf6, 0x71, 0x97, 0x21, 0x99, 0x78, 0x18, 0x3c, 0x8e, 0xee, 0xea, 0xef, 0x7c, 0xcd, 0x6b, 0x8d, 0xfe, 0xcd, 0x9e, 0x16, 0x95, 0x29, 0x5a}}
 	return a, nil
 }
@@ -4524,7 +4524,7 @@ func confLocaleLocale_csCzIni() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "conf/locale/locale_cs-CZ.ini", size: 70566, mode: os.FileMode(0644), modTime: time.Unix(1581935537, 0)}
+	info := bindataFileInfo{name: "conf/locale/locale_cs-CZ.ini", size: 70566, mode: os.FileMode(0644), modTime: time.Unix(1581999833, 0)}
 	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0xe7, 0xff, 0x80, 0x58, 0x55, 0xea, 0x74, 0xbb, 0xe8, 0xc0, 0xb6, 0xbb, 0xc7, 0x80, 0xfc, 0x59, 0x5, 0x7b, 0x18, 0xab, 0x15, 0x62, 0xf9, 0x10, 0xb8, 0x7c, 0xe0, 0x2c, 0xbf, 0xbe, 0x7}}
 	return a, nil
 }
@@ -4764,7 +4764,7 @@ func confLocaleLocale_jaJpIni() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "conf/locale/locale_ja-JP.ini", size: 81129, mode: os.FileMode(0644), modTime: time.Unix(1581935537, 0)}
+	info := bindataFileInfo{name: "conf/locale/locale_ja-JP.ini", size: 81129, mode: os.FileMode(0644), modTime: time.Unix(1581999833, 0)}
 	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x86, 0x11, 0xc3, 0xb5, 0xa, 0xe0, 0x77, 0xe, 0xaa, 0x50, 0x55, 0xbf, 0x2, 0xea, 0xe7, 0x8b, 0xc4, 0x93, 0xd5, 0xa8, 0x11, 0xba, 0xe4, 0x3e, 0xe, 0xc1, 0xa0, 0x6a, 0x49, 0x87, 0xff, 0x2d}}
 	return a, nil
 }
@@ -4844,7 +4844,7 @@ func confLocaleLocale_plPlIni() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "conf/locale/locale_pl-PL.ini", size: 69393, mode: os.FileMode(0644), modTime: time.Unix(1581935537, 0)}
+	info := bindataFileInfo{name: "conf/locale/locale_pl-PL.ini", size: 69393, mode: os.FileMode(0644), modTime: time.Unix(1581999833, 0)}
 	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x65, 0x6a, 0xfb, 0x4b, 0xe5, 0xf4, 0xa3, 0x3f, 0x6e, 0xa8, 0x94, 0xea, 0x8, 0x25, 0x66, 0xc4, 0x6e, 0x2a, 0x18, 0x71, 0x78, 0xa1, 0x11, 0x9c, 0x96, 0x7f, 0xfc, 0x20, 0xc7, 0x16, 0xe0, 0xe7}}
 	return a, nil
 }
@@ -5004,7 +5004,7 @@ func confLocaleLocale_ukUaIni() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "conf/locale/locale_uk-UA.ini", size: 98819, mode: os.FileMode(0644), modTime: time.Unix(1581935537, 0)}
+	info := bindataFileInfo{name: "conf/locale/locale_uk-UA.ini", size: 98819, mode: os.FileMode(0644), modTime: time.Unix(1581999833, 0)}
 	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x12, 0xb6, 0x98, 0xbb, 0x55, 0x7, 0xe0, 0xd2, 0x82, 0x46, 0x4f, 0xee, 0x68, 0x7d, 0xc5, 0x2c, 0x66, 0xb9, 0x39, 0xe7, 0x6d, 0x76, 0xc6, 0xa, 0x65, 0x11, 0xc6, 0xc9, 0xf, 0x74, 0x88, 0x17}}
 	return a, nil
 }