feeds: fix articles Link(s)

This commit is contained in:
2022-08-27 22:05:01 +02:00
parent 684859c197
commit 1ddc71f64b
3 changed files with 13 additions and 2 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
# Server config
MODE=development
HOST=:8000
HOST=:8080
# Separate services
GIT_URL=https://git.phc.dm.unipi.it
@@ -9,6 +9,9 @@ CHAT_URL=https://chat.phc.dm.unipi.it
# Other
EMAIL=macchinisti@lists.dm.unipi.it
# Base URL
BASE_URL=https://phc.dm.unipi.it
# Lista Utenti
USER_PAGES_BASE_URL=https://poisson.phc.dm.unipi.it/~
+7
View File
@@ -16,6 +16,8 @@ var GitUrl string
var ChatUrl string
var Email string
var BaseUrl string
var UserPagesBaseUrl string
var AuthServiceHost string
@@ -47,6 +49,9 @@ func Load() {
loadEnv(&ChatUrl, "CHAT_URL", "https://chat.example.org")
loadEnv(&Email, "EMAIL", "mail@example.org")
// Base URL
loadEnv(&BaseUrl, "BASE_URL", "localhost:8080")
// Poisson
loadEnv(&UserPagesBaseUrl, "USER_PAGES_BASE_URL", "https://poisson.phc.dm.unipi.it/~")
@@ -63,6 +68,8 @@ func Object() util.Map {
"ChatUrl": ChatUrl,
"Email": Email,
"BaseUrl": BaseUrl,
"UserPagesBaseUrl": UserPagesBaseUrl,
"AuthServiceHost": AuthServiceHost,
+2 -1
View File
@@ -2,6 +2,7 @@ package rss
import (
"git.phc.dm.unipi.it/phc/website/articles"
"git.phc.dm.unipi.it/phc/website/config"
"github.com/gorilla/feeds"
)
@@ -22,7 +23,7 @@ func GenerateRssFeed(entries []*articles.Article, title string, link string, des
&feeds.Item{
Id: entry.Id,
Title: entry.Title,
Link: &feeds.Link{Href: entry.ArticlePath},
Link: &feeds.Link{Href: config.BaseUrl + "/guide" + entry.Id},
Description: entry.Description,
Created: entry.PublishDate,
})