Ajouter templating go

Déplacer embed/ vers public/

Ajouter public/js et public/scss

Ajouter templating pour public/html/*.gohtml

Ajouter --build à procédure dans README.md

Déplacer contenu de index.html vers template `index-html`

Ajouter middleware RemoveTrailingSlash

Déplacer anonymous function de route `/` vers handler `handleIndex`
This commit is contained in:
Victor Lacasse-Beaudoin 2023-03-21 18:37:51 -04:00
parent bcd9fd49b1
commit 1022dd05db
10 changed files with 60 additions and 21 deletions

15
public/html/index.gohtml Normal file
View file

@ -0,0 +1,15 @@
{{ define "index-html" }}
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>AGECEM</title>
<style>
body {text-align: center;}
</style>
</head>
<body>
<h1>Association Générale Étudiante du Cégep Édouard-Montpetit</h1>
</body>
</html>
{{ end }}

0
public/js/index.js Normal file
View file

10
public/public.go Normal file
View file

@ -0,0 +1,10 @@
package public
import "embed"
//go:embed html/* scss/* js/*
var embedFS embed.FS
func GetEmbedFS() embed.FS {
return embedFS
}

0
public/scss/index.scss Normal file
View file