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 d691de5
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 18 deletions.
15 changes: 5 additions & 10 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,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
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.
2 changes: 1 addition & 1 deletion etc/style-custom.css → content/style-website.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ body .book.font-family-1, .book-summary {
}

.page-inner {
max-width: fit-content;
max-width: none;
padding: 20px 100px 40px 100px;
}

Expand Down
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 d691de5

Please sign in to comment.