feeds: fix articles Link(s)

feat/db
Francesco Minnocci 2 years ago
parent 684859c197
commit 1ddc71f64b
Signed by: BachoSeven
GPG Key ID: 2BE4AB7FDAD828A4

@ -1,6 +1,6 @@
# Server config # Server config
MODE=development MODE=development
HOST=:8000 HOST=:8080
# Separate services # Separate services
GIT_URL=https://git.phc.dm.unipi.it GIT_URL=https://git.phc.dm.unipi.it
@ -9,6 +9,9 @@ CHAT_URL=https://chat.phc.dm.unipi.it
# Other # Other
EMAIL=macchinisti@lists.dm.unipi.it EMAIL=macchinisti@lists.dm.unipi.it
# Base URL
BASE_URL=https://phc.dm.unipi.it
# Lista Utenti # Lista Utenti
USER_PAGES_BASE_URL=https://poisson.phc.dm.unipi.it/~ USER_PAGES_BASE_URL=https://poisson.phc.dm.unipi.it/~

@ -16,6 +16,8 @@ var GitUrl string
var ChatUrl string var ChatUrl string
var Email string var Email string
var BaseUrl string
var UserPagesBaseUrl string var UserPagesBaseUrl string
var AuthServiceHost string var AuthServiceHost string
@ -47,6 +49,9 @@ func Load() {
loadEnv(&ChatUrl, "CHAT_URL", "https://chat.example.org") loadEnv(&ChatUrl, "CHAT_URL", "https://chat.example.org")
loadEnv(&Email, "EMAIL", "mail@example.org") loadEnv(&Email, "EMAIL", "mail@example.org")
// Base URL
loadEnv(&BaseUrl, "BASE_URL", "localhost:8080")
// Poisson // Poisson
loadEnv(&UserPagesBaseUrl, "USER_PAGES_BASE_URL", "https://poisson.phc.dm.unipi.it/~") loadEnv(&UserPagesBaseUrl, "USER_PAGES_BASE_URL", "https://poisson.phc.dm.unipi.it/~")
@ -63,6 +68,8 @@ func Object() util.Map {
"ChatUrl": ChatUrl, "ChatUrl": ChatUrl,
"Email": Email, "Email": Email,
"BaseUrl": BaseUrl,
"UserPagesBaseUrl": UserPagesBaseUrl, "UserPagesBaseUrl": UserPagesBaseUrl,
"AuthServiceHost": AuthServiceHost, "AuthServiceHost": AuthServiceHost,

@ -2,6 +2,7 @@ package rss
import ( import (
"git.phc.dm.unipi.it/phc/website/articles" "git.phc.dm.unipi.it/phc/website/articles"
"git.phc.dm.unipi.it/phc/website/config"
"github.com/gorilla/feeds" "github.com/gorilla/feeds"
) )
@ -22,7 +23,7 @@ func GenerateRssFeed(entries []*articles.Article, title string, link string, des
&feeds.Item{ &feeds.Item{
Id: entry.Id, Id: entry.Id,
Title: entry.Title, Title: entry.Title,
Link: &feeds.Link{Href: entry.ArticlePath}, Link: &feeds.Link{Href: config.BaseUrl + "/guide" + entry.Id},
Description: entry.Description, Description: entry.Description,
Created: entry.PublishDate, Created: entry.PublishDate,
}) })

Loading…
Cancel
Save