From 5b2d243bdbfa7a3db180880d1d3f02f3a201f2f4 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 30 Jul 2024 18:15:28 +0100 Subject: [PATCH] blog: refactor consts --- blog.go | 10 ++++++---- mataroa.go | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/blog.go b/blog.go index c63fa4a..208ab87 100644 --- a/blog.go +++ b/blog.go @@ -32,10 +32,11 @@ import ( "github.com/yuin/goldmark" ) -const blogBaseUrl= "https://github.com/thiagokokada/blog" -const blogMainUrl = blogBaseUrl + "/blob/main" -const blogRawUrl = blogBaseUrl + "/raw/main" -const readmeTemplate = `# Blog +const ( + blogBaseUrl = "https://github.com/thiagokokada/blog" + blogMainUrl = blogBaseUrl + "/blob/main/" + blogRawUrl = blogBaseUrl + "/raw/main/" + readmeTemplate = `# Blog Mirror of my blog in https://kokada.capivaras.dev/. @@ -45,6 +46,7 @@ Mirror of my blog in https://kokada.capivaras.dev/. %s ` +) type post struct { title string diff --git a/mataroa.go b/mataroa.go index 59a2874..06e5a86 100644 --- a/mataroa.go +++ b/mataroa.go @@ -29,9 +29,11 @@ import ( "github.com/yuin/goldmark" ) -const mataroaBaseUrl = "https://kokada.capivaras.dev" -const mataroaApiUrl = mataroaBaseUrl + "/api/" -const mataroaBlogUrl = mataroaBaseUrl + "/blog/" +const ( + mataroaBaseUrl = "https://kokada.capivaras.dev" + mataroaApiUrl = mataroaBaseUrl + "/api/" + mataroaBlogUrl = mataroaBaseUrl + "/blog/" +) var mataroaToken = os.Getenv("MATAROA_TOKEN")