Skip to content

Commit

Permalink
refactor: content
Browse files Browse the repository at this point in the history
  • Loading branch information
novalagung committed Nov 15, 2024
1 parent bd528cc commit 50dced1
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 16 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -73,10 +68,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/main.go .
rm -f book.json
go run main.go -mode=ebook -adjustment=pre
gitbook install
mkdir _book/
Expand Down
9 changes: 9 additions & 0 deletions etc/book.json → content/book.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
"meta",
"sitemap"
],
"styles": {
"website": "style-website.css"
},
"pdf": {
"margin": {
"left": 10,
"right": 10
}
},
"pluginsConfig": {
"disqus": {
"shortName": "dasarpemrogramangolang"
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions etc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ func webbookPostAdjustment() {
</div>` + 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 := `</head>`
adjustmentCSSReplacement := `<link rel="stylesheet" href="gitbook/style-custom.css?v=` + getVersion() + `">` + adjustmentCSSToFind
htmlString = strings.ReplaceAll(htmlString, adjustmentCSSToFind, adjustmentCSSReplacement)

// ==== inject github stars js script
buttonScriptToFind := `</head>`
buttonScriptReplacement := `<script async defer src="https://buttons.github.io/buttons.js"></script>` + buttonScriptToFind
Expand Down

0 comments on commit 50dced1

Please sign in to comment.