This repo contains the webpage for translation and source images of the lianhuanhua comics.
These steps are only required once, to install the requirements on your local machine:
brew install pandoc hugoBefore you can get local copy of the webpage up and running on your machine you need to clone this repo. The hugo-book theme is installed as a submodule.
git clone --recurse-submodules --remote-submodules https://github.com/readchina/comics.gitIf you forgot to include the submodule flags when cloning the repo run the following:
git submodule update --init
within the submodule we are on the feature/prev-next branch
To Build a local dev version run:
hugo server -D (-D will also build drafts)
You should see something like this:
| EN
-------------------+------
Pages | 57
Paginator pages | 0
Non-page files | 0
Static files | 218
Processed images | 0
Aliases | 11
Sitemaps | 1
Cleaned | 0
Built in 150 ms
Watching for changes in /Users/hal1000/Documents/GitHub/comics/{archetypes,content,static,themes}
Watching for config changes in /Users/hal1000/Documents/GitHub/comics/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stopThe page is visible in your browser at http://localhost:1313/
As always avoid spaces in file or folder names: -> zhu fu/zhu fu Version 2022.mdzhufu/zhufu.md. You must stick with the project layout of this repo. Contents go into content/docs/ folder. Create a new folder when adding a comic.
mkdir content/docs/new-comicStart by saving the word file in the folder you just created. Then use pandoc to convert the original document into markdown.
pandoc -s content/docs/new-comic/*.docx --wrap=none -t markdown -o new-comic/new-comic.mdEach comic needs to be inside a top level folder using the translated title for the comic (no spaces), e.g. the-watch/_index.md.
Each file is then split into:
_index.md(contains the introduction and references)A-translation-notes.mdB-front-and-back-cover.mdB-frontmatter.mdB-page-XX.md
The basic template for a translation page is
---
title: Page XX
---

{{< columns >}}
<!-- source -->
<--->
<!-- translation -->
{{< /columns >}}Use regex to create the proper markup inside the full newcomic.md file.
To create empty template files:
touch B-page-{01..78}.md Then copy each page/panel into the new file.
Images go inside a folder with the comic name inside static/images:
static
└── images
├── biao
│ ├── seifert0726_biao_0001_0.jpg
│ ├── seifert0726_biao_0003_0.jpg
│ ├── …
└── niqiu
├── seifert0397_nqkg_0001_0.jpg
├── seifert0397_nqkg_0003_0.jpg
├── …To include images in your markdown use:
Deployments is fully automated on GitHub Actions. In cases where you need to debug the build, run:
hugoThis will create a public/ folder containing the compiled webpage. You should delete this folder after debugging as Hugo will not remove its contents before subsequent builds.