diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index a3b929641..c5c44caac 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -21,13 +21,8 @@ jobs:
run: |
rm -f README.md
mv content/* .
- mv etc/cover_small.jpg .
- mv etc/cover_square.png .
- mv etc/cover.jpg .
- mv etc/style-custom.css .
+ mv book.json etc/
mv etc/main.go .
- mv etc/robots.txt .
- mv etc/script-gitbook-plugin-disqus.js .
npm install -g gitbook-cli
gitbook install
cd ~/.gitbook/versions/3.2.3 && npm i npm@5
@@ -73,12 +68,12 @@ jobs:
run: |
rm -f README.md
mv content/* .
- mv etc/cover_small.jpg .
- mv etc/cover_square.png .
- mv etc/cover.jpg .
mv etc/main.go .
- go run main.go -mode=ebook -adjustment=pre
+ rm -f book.json
gitbook install
+ cd ~/.gitbook/versions/3.2.3 && npm i npm@5
+ cd ${{ github.workspace }}
+ go run main.go -mode=ebook -adjustment=pre
mkdir _book/
- name: 'Generating ebook in pdf'
run: gitbook pdf ./ ./_book/dasarpemrogramangolang.pdf
diff --git a/content/2-instalasi-golang.md b/content/2-instalasi-golang.md
index a6d02da7a..93cdcfbfa 100644
--- a/content/2-instalasi-golang.md
+++ b/content/2-instalasi-golang.md
@@ -1,4 +1,4 @@
-# A.2. Instalasi Golang (Stable & Unstable)
+# A.2. Instalasi Golang
Hal pertama yang perlu dilakukan sebelum bisa menggunakan Go adalah meng-*install*-nya terlebih dahulu. Panduan instalasi sebenarnya sudah disediakan di situs resmi Go [http://golang.org/doc/install#install](http://golang.org/doc/install#install).
diff --git a/content/SUMMARY.md b/content/SUMMARY.md
index 2f6d90ac3..0f9ae94ff 100644
--- a/content/SUMMARY.md
+++ b/content/SUMMARY.md
@@ -18,7 +18,7 @@
* A. Pemrograman Go Dasar
* [A.1. Belajar Golang](1-berkenalan-dengan-golang.md)
- * [A.2. Instalasi Golang (Stable & Unstable)](2-instalasi-golang.md)
+ * [A.2. Instalasi Golang](2-instalasi-golang.md)
* [A.3. Setup Go Modules](A-setup-go-project-dengan-go-modules.md)
* [A.4. Setup GOPATH dan Workspace](A-gopath-dan-workspace.md)
* [A.5. Instalasi Editor](A-instalasi-editor.md)
diff --git a/etc/book.json b/content/book.json
similarity index 86%
rename from etc/book.json
rename to content/book.json
index dfc2a902a..88f3b46fd 100644
--- a/etc/book.json
+++ b/content/book.json
@@ -7,6 +7,15 @@
"meta",
"sitemap"
],
+ "styles": {
+ "website": "style-website.css?v=2"
+ },
+ "pdf": {
+ "margin": {
+ "left": 10,
+ "right": 10
+ }
+ },
"pluginsConfig": {
"disqus": {
"shortName": "dasarpemrogramangolang"
diff --git a/etc/cover.jpg b/content/cover.jpg
similarity index 100%
rename from etc/cover.jpg
rename to content/cover.jpg
diff --git a/etc/cover_small.jpg b/content/cover_small.jpg
similarity index 100%
rename from etc/cover_small.jpg
rename to content/cover_small.jpg
diff --git a/etc/cover_square.png b/content/cover_square.png
similarity index 100%
rename from etc/cover_square.png
rename to content/cover_square.png
diff --git a/etc/robots.txt b/content/robots.txt
similarity index 100%
rename from etc/robots.txt
rename to content/robots.txt
diff --git a/etc/script-gitbook-plugin-disqus.js b/content/script-gitbook-plugin-disqus.js
similarity index 100%
rename from etc/script-gitbook-plugin-disqus.js
rename to content/script-gitbook-plugin-disqus.js
diff --git a/etc/style-custom.css b/content/style-website.css
similarity index 80%
rename from etc/style-custom.css
rename to content/style-website.css
index 16a5bb455..1935eed7b 100644
--- a/etc/style-custom.css
+++ b/content/style-website.css
@@ -32,23 +32,10 @@ body .book.font-family-1, .book-summary {
}
.page-inner {
- max-width: fit-content;
+ max-width: none;
padding: 20px 100px 40px 100px;
}
-/* disable word wrap at left sidebar */
-.book-summary ul.summary li a, .book-summary ul.summary li span {
- text-overflow: initial;
- white-space: normal;
- line-height: 1.4em;
- padding: 9px 15px;
-}
-
-/* sidebar background */
-.book-summary {
- background-color: #ffffff;
-}
-
/* sidebar ads animation */
/* .book-summary .summary > li:nth-child(8) a {
color: white;
@@ -81,18 +68,64 @@ body .book.font-family-1, .book-summary {
background: hsla(0,0%,53%,.1);
}
-/* sidebar active link */
-.book-summary li.active>a:before {
- content: " ";
+/* sidebar background */
+.book-summary {
+ background-color: #ffffff;
+}
+
+/* sidebar items */
+.book-summary ul.summary li a, .book-summary ul.summary li span {
+ text-overflow: initial;
+ white-space: normal;
+ line-height: 1.4em;
+ padding: 9px 10px 9px 6px;
+}
+.book-summary ul.summary li.chapter {
+ position: relative;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+.book-summary ul.summary > li.chapter:before {
position: absolute;
- right: 0;
- top: 0;
- bottom: 0;
+ content: " ";
+ background-color: #F4F4F5;
width: 2px;
- background-color: #008cff;
+ left: 27px;
+ top: 39px;
+ bottom: 0px;
}
-.book-summary li.active>a {
+.book-summary ul.summary li.chapter span {
+ font-weight: 600;
+}
+.book-summary ul.summary li.chapter a {
+ text-indent: -41px;
+ padding-left: 51px;
+}
+.book-summary ul.summary li.chapter a:hover, .book-summary ul.summary li.chapter.active a {
+ background-color: #F4F4F5;
font-weight: bold;
+ border-radius: 6px;
+ text-decoration: none;
+}
+.book-summary ul.summary li span:before {
+ content: "📄";
+ margin-right: 2px;
+ font-size: 1.2em;
+}
+.book-summary ul.summary li.divider {
+ margin: 18px 0 7px;
+}
+
+/* docsearch */
+#book-doc-search-input {
+ padding: 5px;
+}
+#book-doc-search-input .DocSearch-Button {
+ border-radius: 6px;
+ background-color: #F4F4F5;
+}
+#book-doc-search-input .DocSearch-Button:hover {
+ box-shadow: inset 0 0 0 2px #008cff;
}
/* make the sidebar wider, and adjust the content to match it */
@@ -220,6 +253,12 @@ ins.adsbygoogle {
}
}
+/* content */
+.markdown-section h1 {
+ font-size: 3em;
+ font-weight: 400;
+ margin-bottom: 0.4em;
+}
.markdown-section hr,
.ebook-wrapper hr {
height: 1px !important;
diff --git a/etc/main.go b/etc/main.go
index 7198e1662..ba73a6d74 100644
--- a/etc/main.go
+++ b/etc/main.go
@@ -178,13 +178,6 @@ func webbookPostAdjustment() {
` + buttonToFind
htmlString = strings.ReplaceAll(htmlString, buttonToFind, buttonReplacement)
- // ==== inject adjustment css
- adjustmentCSSBuf, _ := os.ReadFile("./style-custom.css")
- os.WriteFile("./_book/gitbook/style-custom.css", adjustmentCSSBuf, 0644)
- adjustmentCSSToFind := ``
- adjustmentCSSReplacement := `` + adjustmentCSSToFind
- htmlString = strings.ReplaceAll(htmlString, adjustmentCSSToFind, adjustmentCSSReplacement)
-
// ==== inject github stars js script
buttonScriptToFind := ``
buttonScriptReplacement := `` + buttonScriptToFind