-
Notifications
You must be signed in to change notification settings - Fork 71
Build a Website
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
foo
create two foldersscripts
andsrc
. -
Open
foo/src
as a Zim notebook. Make theHome Page
of your notebook a page calledindex
. -
Create a file in
scripts
calledbuild.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 \ src
Use 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.
foo
├── build
│ └── (HTML files)
├── src
│ └── (Zim notebook files)
└── scripts
├── build.sh (for Unix operating systems)
└── build.cmd (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