Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
novalagung committed Jun 5, 2020
1 parent 3d3f25b commit a93015e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@

<hr>

* [Course Mendeploy Aplikasi Go ke Docker dan Kubernetes](https://www.udemy.com/course/praktis-belajar-docker-dan-kubernetes-untuk-pemula/)

<hr>

* A. Pemrograman Go Dasar
* [A.1. Belajar Golang GRATIS](1-berkenalan-dengan-golang.md)
* [A.1. Belajar Golang](1-berkenalan-dengan-golang.md)
* [A.2. Instalasi Golang](2-instalasi-golang.md)
* A.3. Setup Project dan GOPATH
* [A.3.A. Go Modules](3-setup-go-project-dengan-go-modules.md)
Expand Down
9 changes: 6 additions & 3 deletions adjustment.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ func postAdjustment() {
}
newTitle = strings.Join(titleParts, ".")
}
if newTitle == "Belajar Golang" {
newTitle = "Belajar Golang Gratis Mulai Dari 0"
}
newTitle = strings.Replace(newTitle, "· GitBook", fmt.Sprintf("- %s", bookName), -1)

// ==== remove the "A.2"-ish from the title
Expand Down Expand Up @@ -143,9 +146,9 @@ func postAdjustment() {
// htmlString = strings.Replace(htmlString, bannerToFind, bannerReplacement, -1)

// ===== inject popup info banner if exists
infoBannerToFind := `</body>`
infoBannerReplacement := `<div class="banner-container" onclick="this.style.display = 'none';"><div><a target="_blank" href="https://www.udemy.com/course/praktis-belajar-docker-dan-kubernetes-untuk-pemula/"><img src="/images/banner.png?v=` + getVersion() + `"></a></div></div><script>var bannerCounter = parseInt(localStorage.getItem("banner-counter")); if (isNaN(bannerCounter)) { bannerCounter = 0; } var bannerEl = document.querySelector('.banner-container'); if (bannerCounter % 5 === 1 && bannerEl) { bannerEl.style.display = 'block'; } localStorage.setItem("banner-counter", String(bannerCounter + 1));</script>` + infoBannerToFind
htmlString = strings.Replace(htmlString, infoBannerToFind, infoBannerReplacement, -1)
// infoBannerToFind := `</body>`
// infoBannerReplacement := `<div class="banner-container" onclick="this.style.display = 'none';"><div><a target="_blank" href="https://www.udemy.com/course/praktis-belajar-docker-dan-kubernetes-untuk-pemula/"><img src="/images/banner.png?v=` + getVersion() + `"></a></div></div><script>var bannerCounter = parseInt(localStorage.getItem("banner-counter")); if (isNaN(bannerCounter)) { bannerCounter = 0; } var bannerEl = document.querySelector('.banner-container'); if (bannerCounter % 5 === 1 && bannerEl) { bannerEl.style.display = 'block'; } localStorage.setItem("banner-counter", String(bannerCounter + 1));</script>` + infoBannerToFind
// htmlString = strings.Replace(htmlString, infoBannerToFind, infoBannerReplacement, -1)

// ==== update file
err = ioutil.WriteFile(path, []byte(htmlString), info.Mode())
Expand Down

0 comments on commit a93015e

Please sign in to comment.