Refactor al nuovo nome del repo anche qua
This commit is contained in:
@@ -3,8 +3,8 @@ MODE=development
|
|||||||
HOST=localhost:8000
|
HOST=localhost:8000
|
||||||
|
|
||||||
# Separate services
|
# Separate services
|
||||||
GIT_URL=https://git.example.org
|
GIT_URL=https://git.phc.dm.unipi.it
|
||||||
FORUM_URL=https://forum.example.org
|
CHAT_URL=https://chat.phc.dm.unipi.it
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
EMAIL=mail@example.org
|
EMAIL=mail@example.org
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Repo del server del nuovo sito per il PHC.
|
|||||||
Per clonare il progetto usare
|
Per clonare il progetto usare
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/phc-dm/phc-server
|
$ git clone https://git.phc.dm.unipi.it/phc/website
|
||||||
```
|
```
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
@@ -39,4 +39,4 @@ $ find . -type f -name '*.go' | entr -r go run .
|
|||||||
|
|
||||||
Rappresentano link ad altri servizi forniti, è comodo impostarli così in modo da poter anche provare tutto insieme in locale su varie porte (e poi in produzione i vari url diventano link a sotto-domini del sito principale).
|
Rappresentano link ad altri servizi forniti, è comodo impostarli così in modo da poter anche provare tutto insieme in locale su varie porte (e poi in produzione i vari url diventano link a sotto-domini del sito principale).
|
||||||
|
|
||||||
Per ora ci sono solo `GIT_URL` e `FORUM_URL`.
|
Per ora ci sono solo `GIT_URL` e `CHAT_URL`.
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/phc-dm/phc-server/config"
|
"git.phc.dm.unipi.it/phc/website/config"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -5,15 +5,15 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"git.phc.dm.unipi.it/phc/website/util"
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
"github.com/phc-dm/phc-server/util"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var Mode string
|
var Mode string
|
||||||
var Host string
|
var Host string
|
||||||
|
|
||||||
var GitUrl string
|
var GitUrl string
|
||||||
var ForumUrl string
|
var ChatUrl string
|
||||||
var Email string
|
var Email string
|
||||||
|
|
||||||
func loadEnv(target *string, name, defaultValue string) {
|
func loadEnv(target *string, name, defaultValue string) {
|
||||||
@@ -34,16 +34,16 @@ func Load() {
|
|||||||
loadEnv(&Mode, "MODE", "production")
|
loadEnv(&Mode, "MODE", "production")
|
||||||
loadEnv(&Host, "HOST", "localhost:8080")
|
loadEnv(&Host, "HOST", "localhost:8080")
|
||||||
loadEnv(&GitUrl, "GIT_URL", "https://git.example.org")
|
loadEnv(&GitUrl, "GIT_URL", "https://git.example.org")
|
||||||
loadEnv(&ForumUrl, "FORUM_URL", "https://forum.example.org")
|
loadEnv(&ChatUrl, "CHAT_URL", "https://chat.example.org")
|
||||||
loadEnv(&Email, "EMAIL", "mail@example.org")
|
loadEnv(&Email, "EMAIL", "mail@example.org")
|
||||||
}
|
}
|
||||||
|
|
||||||
func Object() util.H {
|
func Object() util.H {
|
||||||
return util.H{
|
return util.H{
|
||||||
"Mode": Mode,
|
"Mode": Mode,
|
||||||
"Host": Host,
|
"Host": Host,
|
||||||
"GitUrl": GitUrl,
|
"GitUrl": GitUrl,
|
||||||
"ForumUrl": ForumUrl,
|
"ChatUrl": ChatUrl,
|
||||||
"Email": Email,
|
"Email": Email,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module github.com/phc-dm/phc-server
|
module git.phc.dm.unipi.it/phc/website
|
||||||
|
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"git.phc.dm.unipi.it/phc/website/articles"
|
||||||
|
"git.phc.dm.unipi.it/phc/website/config"
|
||||||
|
"git.phc.dm.unipi.it/phc/website/templates"
|
||||||
|
"git.phc.dm.unipi.it/phc/website/util"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"github.com/go-chi/chi/v5/middleware"
|
||||||
"github.com/phc-dm/phc-server/articles"
|
|
||||||
"github.com/phc-dm/phc-server/config"
|
|
||||||
"github.com/phc-dm/phc-server/templates"
|
|
||||||
"github.com/phc-dm/phc-server/util"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/phc-dm/phc-server/config"
|
"git.phc.dm.unipi.it/phc/website/config"
|
||||||
"github.com/phc-dm/phc-server/util"
|
"git.phc.dm.unipi.it/phc/website/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LoadTemplate interface {
|
type LoadTemplate interface {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<a class="nav-element" href="{{ .Config.GitUrl }}">Gitea</a>
|
<a class="nav-element" href="{{ .Config.GitUrl }}">Gitea</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-item">
|
<div class="nav-item">
|
||||||
<a class="nav-element" href="{{ .Config.ForumUrl }}">Zulip</a>
|
<a class="nav-element" href="{{ .Config.ChatUrl }}">Zulip</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-item">
|
<div class="nav-item">
|
||||||
<a class="nav-element" href="/seminari">Seminari</a>
|
<a class="nav-element" href="/seminari">Seminari</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user