Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from gazes-media/main
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
garder500 authored Dec 1, 2023
2 parents 4898099 + 1b14c18 commit 55c4e73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ COPY --from=build /bin/server /bin/
ADD public /bin/public
# Expose the port that the application listens on.
EXPOSE 5454

WORKDIR /bin
# What the container should run when it is started.
ENTRYPOINT [ "/bin/server" ]
ENTRYPOINT [ "./server" ]
24 changes: 10 additions & 14 deletions functions/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,20 @@ const (
Keywords = "Animes, Streaming, Anime, Manga, Scan, Scans, Scans VF, Scans VOSTFR, Scans FR, Naruto, One Piece, Bleach, Fairy Tail, Dragon Ball Super, Dragon Ball Z, Dragon Ball GT, Dragon Ball, Dragon Ball Kai, Dragon Ball Z Kai, Dragon Ball Z Kai The Final Chapters, Dragon Ball Z Kai The Final Chapters VF, Dragon Ball Z Kai The Final Chapters VOSTFR, Dragon Ball Z Kai The Final Chapters FR, Dragon Ball Z Kai VF, Dragon Ball Z Kai VOSTFR, Dragon Ball Z Kai FR, Dragon Ball Super VF, Dragon Ball Super VOSTFR, Dragon Ball Super FR, Dragon Ball GT VF, Dragon Ball GT VOSTFR, Dragon Ball GT FR, Dragon Ball VF, Dragon Ball VOSTFR, Dragon Ball FR, Dragon Ball Z VF, Dragon Ball Z VOSTFR, Dragon Ball Z FR, Dragon Ball Z Kai VF, Dragon Ball Z Kai VOSTFR, Dragon Ball Z Kai FR, Dragon Ball Z Kai The Final Chapters VF, Dragon Ball Z Kai The Final Chapters VOSTFR, Dragon Ball Z Kai The Final Chapters FR, Dragon Ball Z Kai The Final Chapters VF, Dragon Ball Z Kai The Final Chapters VOSTFR, Dragon Ball Z Kai The Final Chapters FR"
)



func getWorkdir() string {
workdir,err := os.Getwd()
if err != nil {
panic(err)
}
return workdir
workdir, err := os.Getwd()
if err != nil {
panic(err)
}
return workdir
}

func GetFs(workdir string) fs.FS {
return os.DirFS(workdir+ "/public")
return os.DirFS(workdir + "/public")
}

var Fsys = GetFs(getWorkdir())


func getMetaTemplate() *template.Template {
meta, err := template.ParseFS(Fsys, "meta.html")
if err != nil {
Expand All @@ -46,17 +43,16 @@ func getHtmlTemplate() *template.Template {
return html
}


func ReplaceHtml(title, description, image, tags, videoUri string) []byte {
meta := getMetaTemplate()

var metaTags strings.Builder
meta.Execute(&metaTags, struct {
Title string
Description string
Image string
Tags string
VideoUri string
VideoUri string
}{
Title: title,
Description: description,
Expand All @@ -76,9 +72,9 @@ func ReplaceHtml(title, description, image, tags, videoUri string) []byte {
}

func metaVideo(url string) string {
if(url == "") {
if url == "" {
return ""
}
}
return `<meta property="og:video" content="` + url + `">
<meta property="og:video:secure_url" content="` + url + `">
<meta property="og:video:type" content="text/html">
Expand Down

0 comments on commit 55c4e73

Please sign in to comment.