Static HTML Website (alpha version) (#136)

This is a minimal alpha version of the book as static html website. More
stuff needs to be added, but should be okay for a working prototype.
Fixes #128
This commit is contained in:
Hendrik Kleinwaechter
2023-07-03 09:21:25 +02:00
committed by GitHub
parent ab608c7311
commit bcfe67d4df
4 changed files with 33 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ jobs:
mv kindlegen /usr/bin mv kindlegen /usr/bin
cd book cd book
make bake make bake
make website
- name: Release baked book to S3 - name: Release baked book to S3
uses: shallwefootball/s3-upload-action@master uses: shallwefootball/s3-upload-action@master
with: with:
@@ -27,10 +28,26 @@ jobs:
aws_bucket: ${{ secrets.AWS_BUCKET }} aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: book/release source_dir: book/release
destination_dir: release destination_dir: release
- name: Release website
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ secrets.AWS_BUCKET_WEBSITE }}
source_dir: book/html
destination_dir: static_html_root
- name: Invalidate Cloudfront book cache - name: Invalidate Cloudfront book cache
uses: chetan/invalidate-cloudfront-action@v2 uses: chetan/invalidate-cloudfront-action@v2
env: env:
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION }} DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_BOOK }}
PATHS: "/*"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Invalidate Cloudfront website cache
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_WEBSITE }}
PATHS: "/*" PATHS: "/*"
AWS_REGION: "us-east-1" AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}

1
.gitignore vendored
View File

@@ -55,5 +55,6 @@ book_sans_serif/
book_serif/ book_serif/
release_sans_serif/ release_sans_serif/
book/book_sans_serif-epub/ book/book_sans_serif-epub/
book/static_website_html/
epub/ epub/
*.opf *.opf

View File

@@ -75,6 +75,10 @@ There's an additional enhanced accessibility version using a sans serif font:
* [Download compiled .mobi version](https://www.the-bread-code.io/book-sans-serif.mobi) * [Download compiled .mobi version](https://www.the-bread-code.io/book-sans-serif.mobi)
* [Download compiled .azw3 version](https://www.the-bread-code.io/book-sans-serif.azw3) * [Download compiled .azw3 version](https://www.the-bread-code.io/book-sans-serif.azw3)
## Online HTML version (WIP)
Head over to [https://www.the-sourdough-framework.com](https://www.the-sourdough-framework.com)
## Hardcover version ## Hardcover version
There is a hardcover version of the book available for purchase. [You can There is a hardcover version of the book available for purchase. [You can

View File

@@ -5,6 +5,7 @@ CLEAN := latexmk -cd -c -use-make
EBOOK_CONVERT := kindlegen EBOOK_CONVERT := kindlegen
CHECK_1 := lacheck CHECK_1 := lacheck
CHECK_2 := chktex CHECK_2 := chktex
WEBSITE_DIR := static_website_html
ifdef DEBUG ifdef DEBUG
EBOOK += -a debug EBOOK += -a debug
@@ -218,6 +219,15 @@ release_sans_serif: build_sans_serif_pdf build_sans_serif_ebook | make_release_d
cp epub/book_sans_serif.epub release/TheBreadCode-The-Sourdough-Framework-sans-serif.epub cp epub/book_sans_serif.epub release/TheBreadCode-The-Sourdough-Framework-sans-serif.epub
cp epub/book_sans_serif.azw3 release/TheBreadCode-The-Sourdough-Framework-sans-serif.azw3 cp epub/book_sans_serif.azw3 release/TheBreadCode-The-Sourdough-Framework-sans-serif.azw3
.PHONY: website
website:
if command -v cowsay &> /dev/null; then\
cowsay "baking the website";\
fi
rm -rf $(WEBSITE_DIR)
make4ht -uf html5+tidy+common_domfilters -d $(WEBSITE_DIR) book.tex
mv $(WEBSITE_DIR)/bookli1.html $(WEBSITE_DIR)/index.html
# Debug Stuff from now on # Debug Stuff from now on
.PHONY: show_tools_version .PHONY: show_tools_version
show_tools_version: # Show version of tools used on the build machine show_tools_version: # Show version of tools used on the build machine