mosquito is simple and easy, you only need a couple of minutes to have a fully operational website running onyour computer. Just follow these steps :
- Download the latest mosquito release from the project repository : https://github.com/alterebro/mosquito/releases/latest and unzip the package or clone it
git clone --depth=1 git://github.com/alterebro/mosquito.git
- Open a terminal and go wherever you have put the unpacked mosquito files
- Run the build script
$ php -f index.php build
This command will generate the static site on the folder
- Preview your generated site, with the following command
$ php -S localhost:8000 -t dist
a local web server will start on the URL http://localhost:8000
- That's all, now you can modify the contents of the site by creating/editing markdown files on the
Using this other option is even faster, open a terminal, run the following one-liner command and you'll have a mosquito site running on the URL http://localhost:8000 in a matter of seconds.
mkdir mosquito && curl -L https://github.com/alterebro/mosquito/tarball/v0.2.0 | tar zx -C mosquito --strip-components=1 && cd mosquito && php -f index.php build && php -S localhost:8000 -t dist
The line above execute the following commands altogether:
# It creates the mosquito folder $ mkdir mosquito # Downloads the mosquito files and extracts them on the previous created folder $ curl -L https://github.com/alterebro/mosquito/tarball/v0.2.0 | tar zx -C mosquito --strip-components=1 # It gets inside the created folder $ cd mosquito # Builds and generates the Static Site. $ php -f index.php build # Starts a web server on http://localhost:8000 $ php -S localhost:8000 -t dist
Later on, the two commands you'll be using will be the last two:
- To generate the Static Site
php -f index.php build
- To Start a local web server for testing
php -S localhost:8000 -t dist
By default, the site is generated on the
/distfolder, if you change that on the settings, you should also change it on the command.
- To stop anytime the local web server created with the command above, you can do it with the keyboard shortcut
ctrl + c
The content you create has to be stored on the
/content folder (you can change this on the settings), simply create and modify your content in markdown files with a
.md extension, store them on the content folder and mosquito will parse it and create the HTML page. Just remember when you create a subfolder, it has to have a
index.md file within it.
The main configuration of mosquito is done on the
index.php file located on the root of the project folder. Open the file and you'll see at the top of the code an array named
$_CONFIG, that stores the main settings of the mosquito app. There you'll be able to change according to your needs.