Skip to content

Commit

Permalink
index changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Mar 6, 2025
1 parent 75a7c75 commit aa4a45b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 243 deletions.
6 changes: 3 additions & 3 deletions html/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
<a href="/search">Search</a>
<button id="install" hidden>Install PWA</button>
</div>
<div id="title">Home</div>
<div id="desc"></div>
<div id="content"><h1 id="what-is-the-reminder">What is the Reminder?</h1>
<div id="title">Welcome</div>
<div id="desc">The reminder is a web app and API for the Quran, Hadith and names of Allah.</div>
<div id="content"><h1 id="what-is-the-reminder">Why is it called the Reminder?</h1>

<p>The &ldquo;Reminder&rdquo; often refers to the Quran, which is described as a guidance, warning, and message for humanity. It is meant to remind people of the teachings of Allah, serving as a source of reflection and spiritual guidance.</p>

Expand Down
222 changes: 0 additions & 222 deletions html/files/search.html

This file was deleted.

20 changes: 2 additions & 18 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,10 @@ func main() {
if *GenerateFlag {
fmt.Println("Generating html")

var about string

for _, q := range questions {
a, _ := gen(idx, q)
about += fmt.Sprintf("# %s", q)
about += fmt.Sprintln()
about += fmt.Sprintf("%s", a)
about += fmt.Sprintln()
}

// generate api doc
ap := api.Load()
apiHtml := html.RenderTemplate("API", "", ap.Markdown())
ihtml := html.RenderTemplate("Home", "", about)
shtml := html.RenderHTML("Search", "", html.Search)

// write html files
os.WriteFile(filepath.Join(".", "html", "files", "api.html"), []byte(apiHtml), 0644)
os.WriteFile(filepath.Join(".", "html", "files", "index.html"), []byte(ihtml), 0644)
os.WriteFile(filepath.Join(".", "html", "files", "search.html"), []byte(shtml), 0644)

// write json files
os.WriteFile(filepath.Join(".", "html", "files", "quran.json"), q.JSON(), 0644)
Expand Down Expand Up @@ -200,10 +185,8 @@ func main() {
}

// load the data from html

apiHtml := files.Get("api.html")
ihtml := files.Get("index.html")
shtml := files.Get("search.html")
otf := files.Get("arabic.otf")
qjson := files.Get("quran.json")
njson := files.Get("names.json")
Expand Down Expand Up @@ -348,6 +331,7 @@ func main() {
})

http.HandleFunc("/search", func(w http.ResponseWriter, r *http.Request) {
shtml := html.RenderHTML("Search", "", html.Search)
w.Write([]byte(shtml))
})

Expand Down

0 comments on commit aa4a45b

Please sign in to comment.