Build a Website - jaap-karssenberg/zim-wiki GitHub Wiki
You can use Zim to create a web site. Here is one simple way to do it:
-
Create a new folder for the project. We'll call it
foo. -
Under
foocreate two foldersscriptsandsrc. -
Open
foo/srcas a Zim notebook. Make theHome Pageof your notebook a page calledindex. -
Create a file in
scriptscalledbuild.sh:#!/bin/bash cd "`dirname "$0"`" cd .. mkdir -p build cd build [ -e _resources ] && rm -rf * cd .. zim --export \ --format=html --template=Print \ --output=./build --index-page=sitemap \ srcUse your command prompt or file manager to make this file executable.
Put whatever text and images you want in your Zim notebook in the src folder. When you're ready, run build.sh to convert the notebook to HTML in the build folder. You can browse your web site in there.
To publish your web site, just upload the contents of the build folder to your hosting provider.
Project Folder Layout
foo
├── build
│ └── (HTML files)
├── src
│ └── (Zim notebook files)
└── scripts
├── build.sh (for Unix operating systems)
└── build.cmd (for Windows)
Alternate Build Script for Windows
If you're using Windows, you should use this batch file build.cmd in the scripts folder instead of build.sh from above:
@echo off
set ZIM=C:\Program Files (x86)\Zim Desktop Wiki\zim.exe
if not exist "%ZIM%" set ZIM=C:\Program Files\Zim Desktop Wiki\zim.exe
if not exist "%ZIM%" set ZIM=zim.exe
cd /d "%~dp0"
cd ..
mkdir build 2>NUL
cd build
if exist _resources del /s /q *.* >NUL
cd ..
"%ZIM%" --export ^
--format=html --template=Print ^
--output=./build --index-page=sitemap ^
src