You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
655 B

package main
import (
"encoding/json"
"io/ioutil"
)
//Post is the struct for each post of the blog
type Post struct {
Thumb string `json:"thumb"`
Md string `json:"md"`
}
//Config gets the config.json file into struct
type Config struct {
Title string `json:"title"`
IndexTemplate string `json:"indexTemplate"`
PostThumbTemplate string `json:"postThumbTemplate"`
Posts []Post `json:"posts"`
CopyRaw []string `json:"copyRaw"`
}
var config Config
func readConfig(path string) {
file, err := ioutil.ReadFile(path)
check(err)
content := string(file)
json.Unmarshal([]byte(content), &config)
}