swege is a Static WEbsite GEnerator written in C.
It leverages the discount library for generating a website from a set of Markdown files.
- Under 500 lines of C!
- Incremental updates!
- Pretty fast!
- Almost no dependencies except for discount.
- Portable-ish, tested on GNU/Linux, FreeBSD and Mac OS X (10.13 or higher). Should theoretically work on other *nixes and Windows through MinGW.
Clone this repository and enter it:
git clone https://github.com/sakhmatd/swege cd swege
Compile and install swege:
make sudo make install
Copy the example directory to a location of choice:
cp -r example ~/mycoolsite
Enter your directory, edit swege.ini and run swege:
cd ~/mycoolsite $EDITOR swege.ini swege
Your website will appear in a directory specified by the configuration file.
Q: How do I force a complete rebuild of my website?
swege rebuild. Alternatively, delete a file called
.manifestlocated in the same directory as swege.ini and run swege again.
Q: How does swege determine the title of my webpage?
swege reads the first line of your .md file to determine the title. If your page begins with a main heading, swege will use the heading as the title:
# This will serve as the title
If you want to have a title different from your main heading or do not wish to use a heading, you could provide a title using
title: This will serve as the title
The example site uses both methods.
Copyright 2022 Sergei Akhmatdinov
Licensed under the Apache License, Version 2.0 (the "License"); You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contains parts of ini.h, licensed under the BSD 3-clause license.
Many thanks to David Parsons for the Discount library.
Thanks to @unInstance for several contributions.
- Better documentation.
- Windows support?
Contributions are welcome no matter who you are and where you come from.
When submitting PRs, please maintain the coding style used for the project.