diff --git a/README.md b/README.md index 7861033..4cee553 100644 --- a/README.md +++ b/README.md @@ -7,42 +7,46 @@ Fediverse Fanzine For template engine [bash-tpl](https://github.com/TekWizely/bash-tpl) is used. Bash-tpl template engine allows for bash injections into templates. I hope that most of options required are displayed in the example, since I have no idea what kind of design is coveted for fedizine. Templating is split into 3 stages. -0. Template and files preparation -1. Template script generation +0. Template and structure preparation +1. Data population 2. Template population -### Template and files preparation -As an example a file [fedizine_template_example.html](fedizine_template_example.html) is provided. For now there's nothing fancy, it is just a modified index.html page. +### 0. Template and structure preparation +Curently there are two monthly templates: [fedizine_monthly_template.html](fedizine_monthly_template.html) and [fedizine_monthly_template.md](fedizine_monthly_template.md). Those desribe a montly edition of fedizine. -The template expects a folder named "contestants" in the same directory as itself. Contestants folder would hold a bunch of other directories, one per contestant. Names of those folders are not used in templating, but imagine you'd want something readable. +First action to be done is to call `generate_templates.sh`. -Every contestant folder should contain a `bio.txt` file. File's full name would be `contestants\%some_folder%\bio.txt`. - -Such file should have following lines in following order: -1. Contestant name -2. Contestant bio written in a single line (no line breaks allowed); sorry it is scuffed for the first version -3. A line describing an artwork -4. A line describing an artwork -5. A line describint an artwork -6. .... - -An amount of artworks isn't actually limited to just two. -`A line describing an artwork` would be broken up by `"` delimiter. Which means it sould look somewhat like this: `"ref1.webp" "Short description" "Alt text"` -1. First entry is file name. **Note that the file not listed in bio.txt will not be displayed in the final html** -2. Second entry is short visible description. It will be written next to the file. -3. Third entry is the image alt text. - -### Template script generation -Once template file is sufficiently prepared, you can create a generation script with this command: ``` -./bash-tpl fedizie_template.html > fedizine_generate.sh && chmod +x fedizine_generate.sh +generate_templates.sh april 6 ``` -This script doesn't require `bash-tpl` or template file and can be transferred elsewhere at will. +`generate_templates.sh` expects two arguments: folder name and amount of contestants. +After calling the script folder `april` will be created with proper folder structure inside. There would be two template scripts and a `template_data` folder. + +**Note that running generate_templates.sh on an already created folder structure whould not destroy edits in generated files** + +### 1. Data population +After folder structure is created, head to `template_data` and edit `title.txt`. It contains overall data for this months edition of fedizine. +Next step is to descend into `contestants` folder. It contains folders named `contestant_1...n`. Each describes one of the fedizine authors. Note that you can rename those folders however you like. +Descend into `contestant_...` folder. It would contain a `bio.txt` which holds contestant name and small one liner description. Then it also contains two folders: `wholesome` and `lewd`. Wholesome folder should contain **SFW** works while lewd is designated for **NSFW**. + +Do not hesitate to leave folders open or delete them. I left checks in place. ### Template population -Once folder structure and data are prepared and template script is generated, put template script in the same directory where `contestants` folder would be and execute command: +Once all data put in it's respective places, run `generate_files.sh`. + ``` -./fedizine_generate.sh > generated.html +generate_files.sh april ``` -This will create `generated.html` file which should be served to the end user. \ No newline at end of file +This will parse `april` folder and create 4 files in `april`: +- fedizine.html +- fedizine.md +- fedizine-html.pdf +- fedizine-md.pdf + +fedizine.html - contains html template presumable for a web server +fedizine.md - contains markdown, used mainly for pdf generation +fedizine-html.pdf - a pdf file generated from fedizine.html +fedizine-md.pdf - a pdf file generated from fedizine.md + +**Note! Pandoc does not crunch .webp format. If any of the images are .webp, pdf generation WILL fail.** \ No newline at end of file diff --git a/contestants/contestant1/bio.txt b/contestants/contestant1/bio.txt deleted file mode 100644 index 1aea1d3..0000000 --- a/contestants/contestant1/bio.txt +++ /dev/null @@ -1,4 +0,0 @@ -Contestant name -Contestant bio written in a signle string without any line breaks. -ref1.webp"Short description" "Alt text" -ref2.webp"Short description 2" "Alt text 2" diff --git a/contestants/contestant1/ref1.webp b/contestants/contestant1/ref1.webp deleted file mode 100644 index 8970573..0000000 Binary files a/contestants/contestant1/ref1.webp and /dev/null differ diff --git a/contestants/contestant1/ref2.webp b/contestants/contestant1/ref2.webp deleted file mode 100644 index ba69643..0000000 Binary files a/contestants/contestant1/ref2.webp and /dev/null differ diff --git a/contestants/contestant2/bio.txt b/contestants/contestant2/bio.txt deleted file mode 100644 index 24a2661..0000000 --- a/contestants/contestant2/bio.txt +++ /dev/null @@ -1,4 +0,0 @@ -Contestant name -Contestant bio written in a signle string without any line breaks. -ref3.webp "Short description" "Alt text" -ref4.webp "Short description 2" "Alt text 2" diff --git a/contestants/contestant2/ref3.webp b/contestants/contestant2/ref3.webp deleted file mode 100644 index 6836fdb..0000000 Binary files a/contestants/contestant2/ref3.webp and /dev/null differ diff --git a/contestants/contestant2/ref4.webp b/contestants/contestant2/ref4.webp deleted file mode 100644 index 84eb67a..0000000 Binary files a/contestants/contestant2/ref4.webp and /dev/null differ diff --git a/fedizine_monthly_template.html b/fedizine_monthly_template.html new file mode 100644 index 0000000..18926be --- /dev/null +++ b/fedizine_monthly_template.html @@ -0,0 +1,98 @@ + + +% + TITLE_PATH="./template_data/title.txt" + readarray -t FEDIZINE_TITLE < ${TITLE_PATH} +% +
+ + +<% ${FEDIZINE_TITLE[2]} %>
+ +Email: waifuism@tutanota.com
+ Misskey: @waifu@mai.waifuism.life
A monthly multi‑page fanzine made on the fedi and for the fedi.
- -If you're interested in participating, reach out before starting to draw, and share your ideas. Release date is TBD, but you'll have a few weeks to work. More updates will be posted soon.
-A foxgirl milf Pleroma‑tan
- -Attempts to get around these rules will be ignored.
- -Page size: A4 (210 × 297 mm)
- Resolution: 300 ppi
- 2552 × 3578 px
- Preferred format: PNG
Email: waifuism@tutanota.com
- Misskey: @waifu@mai.waifuism.life