Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
ce788bfd50 | |||
8147d9bef6 | |||
230a6278cc | |||
da0d65d40b | |||
42d6e0c198 | |||
a2d219b2c0 | |||
e1af2979af | |||
b02a882ed7 |
@ -23,10 +23,6 @@ func GenerateRSS(c *Config, db *DB) (*string, error) {
|
||||
}
|
||||
|
||||
for _, article := range articles {
|
||||
if !article.Published {
|
||||
continue
|
||||
}
|
||||
|
||||
tags, err := db.GetArticleTags(article.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting tags for articles for RSS feed: %v", err)
|
||||
|
@ -521,9 +521,16 @@ func ShowPublishedArticles(c *b.Config, db *b.DB, s *b.CookieStore) http.Handler
|
||||
return
|
||||
}
|
||||
|
||||
filteredArticles := make([]*b.Article, 0)
|
||||
for _, article := range publishedArticles {
|
||||
if article.Title != "Autogenerated cpolis Issue Article" {
|
||||
filteredArticles = append(filteredArticles, article)
|
||||
}
|
||||
}
|
||||
|
||||
tmpl, err := template.ParseFiles(c.WebDir + "/templates/published-articles.html")
|
||||
tmpl = template.Must(tmpl, err)
|
||||
tmpl.ExecuteTemplate(w, "page-content", publishedArticles)
|
||||
tmpl.ExecuteTemplate(w, "page-content", filteredArticles)
|
||||
}
|
||||
}
|
||||
|
||||
@ -572,7 +579,8 @@ func ReviewArticleForDeletion(c *b.Config, db *b.DB, s *b.CookieStore) http.Hand
|
||||
return
|
||||
}
|
||||
|
||||
contentBytes, err := os.ReadFile(article.Link)
|
||||
articleAbsName := fmt.Sprint(c.ArticleDir, "/", article.ID, ".md")
|
||||
contentBytes, err := os.ReadFile(articleAbsName)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
|
@ -43,7 +43,9 @@ chmod +x $CPOLIS_DIR/tailwindcss
|
||||
$CPOLIS_DIR/tailwindcss -i $CPOLIS_DIR/web/static/css/input.css -o $CPOLIS_DIR/web/static/css/style.css
|
||||
|
||||
echo '\nBuilding cpolis...' >&2
|
||||
go build -o $BIN_DIR/cpolis $CPOLIS_DIR/cmd/main.go
|
||||
cd $CPOLIS_DIR
|
||||
go build -o $BIN_DIR/cpolis cmd/main.go
|
||||
cd
|
||||
|
||||
echo '\nSetting up system files...' >&2
|
||||
sudo chown root:root $BIN_DIR/cpolis
|
||||
|
Reference in New Issue
Block a user