My Software > WebMake

WebMake is a simple bash script designed to make designing and then potentially redesigning static webpages to be simple. Use whatever editor you want, whatever design you want, and use macros to process source files into templates.

WebMake also comes with the ability to auto-optimize PNG, GIF, and JPEG images, as well as re-encode media files.


I provide no support or warranty for using this script. This is all on YOU, so be sure to backup your files in case of a mess up. If you face issues, you may email me (located on my About).

Download

Wirlaburla WebMake v5
* Changed 'modes' to be argument flags.
* Arguments are now all processed before action.
* No longer optimizes by default.
* No longer overwrites by default.
* Overwrites now handle every file.
* Added '--process-only' flag to only handle content files.
* Added better checks and print out lines for external tools.
* Changed arguments. Check the help menu for migration.
* Spaces no longer screw things up.
Wirlaburla WebMake v4

Documentation

WebMake v5 by Wirlaburla

options:
        -h, --help
                Show this output.

        --init
                Initialize new project in PROJECTDIR.

        --make
                Builds and generates project output.

        -c, --clean
                Clean project output directory.

        -E, --re-encode
                Re-encode media files with FFMPEG.

        -o, --overwrite
                Overwrite files in output directory.

        -O, --optimize
                Optimize PNG, GIF, and JPEG images.

        -P, --process-only
                Process content files only. Ignores options 'overwrite' and 'optimize'.

        -p=<path>, --project=<path>
                Use defined project directory. (default is "$PWD")

        -x=<paths>, --exclude=<paths>
                Exclude paths from make. Separator is ':'. (defualt is )

example: webmake <options>

Initializing a project

WebMake will default to using your current working directory unless PROJECTDIR or the --project argument are specified. A simple argument is all that is needed to turn the defined project directory into a starter project.

webmake --init

The --init argument will create the default templates and src directories and write the default template and index content file in the working project directory.

Writing a project

The basis for WebMake is its template and content files.

Templates

Templates always go into the templates directory and usually will contain everything but the primary focus and attributes of a page. To be a template, areas were different content would go is instead replaced with a macro ($macro$). The macro will be replaced with the a content files section of the same name on build.

An example of a template file named default.html:

Content files

Content files are formatted files containing sections that will replace macros in their defined template. The template they use is always on the first line of the file, with anything after the new-line being defined sections. Content files always use the extension .cnt, and will adopt the extension of their defined template on build.

An example of a content file named index.cnt:

Making a project

If you simply want to process your entire project without any additional options, the --make argument is all you need. However, WebMake has a few additional options for optimizing your project and its assets for web use.

Optimizing PNG, GIF, and JPEG

optipng, gifsicle, and jpegoptim is required for PNG, GIF, and JPEG respectively.

webmake --make -O

Re-encoding media files

webmake --make -E

Processing and outputting only content files

webmake --make --clean -P

Modifying

Contributions are allowed an encouraged, although selective. You may contact me with your own edits if you wish for them to be released here in a new version.

If you modify any version of this script, please be sure to include attributions to me and anyone else before releasing it on your own.

Support

If you want to show support for this simple tool, please throw a link to here somewhere on your own site. I greatly appreciate it.


(c)2024 Wirlaburla