Coder Social home page Coder Social logo

swege's Introduction

swege

swege is a Static WEbsite GEnerator written in C.

It leverages the discount library for generating a website from a set of Markdown files.

FEATURES

  • 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.

QUICK START

Install discount from source or using your package manager.

Clone this repository and enter it:

git clone https://github.com/sakhmatd/swege
cd swege

If you wish to enable experimental multithreading support, set THREADS = true in makefile.

Compile and install swege:

Note: If building on BSD, use `gmake` in place of `make` below.

make
sudo make install

Copy the example directory to a location of choice:

cp -r example ~/mycoolsite

Enter your directory, edit swege.cfg and run swege:

cd ~/mycoolsite
$EDITOR swege.cfg
swege

Your website will appear in a directory specified by the configuration file.

FAQ

Q: How do I force a complete rebuild of my website?

  • Run swege rebuild. Alternatively, delete a file called .manifest located in the same directory as swege.cfg 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.

LICENSE

Copyright 2023 Sergei Akhmatdinov

Licensed under the Apache License, Version 2.0 (the "License"); You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

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.

CREDITS

Many thanks to David Parsons for the Discount library.

Thanks to Ivan Kovmir for packaging and continuous contributions.

BUGS/TODO

  • Better documentation.
  • Windows support?

CONTRIBUTING

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.

swege's People

Contributors

kovmir avatar sakhmatd avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

kovmir

swege's Issues

Consider a self-sorting binary manifest file

Using a binary file containing a structure with the filenames for the manifest would be a good idea for performance.

File I/O is somewhat expensive, plus it is currently performing a basic linear search on the entire file each time.

Add a 'rebuild' command

Rather than forcing the user to delete .manifest manually, perhaps it is good to add a swege rebuild command.

Moved files do not register changes

If you move a file inside the website folder and run swege, then it will act like nothing happened telling you that the site is up to date.

If you do the same with a folder, then, inside the destination folder, it will copy the moved one to a new location, but swege will not delete it from the old place.

BSD make compatibility

The following snippet is invalid for BSD make:

ifeq ($(THREADS), true)
	CFLAGS += -DTHREADS
	LIBS += -lpthread
endif

You should either provide a BSD version, or state explicitly that end-users are required to use GNU make.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.