On this page:
1.1 Installing Frog
1.2 Updating Frog
1.3 Starting a new blog project
1.3.1 Project file tree
1.3.2 frog.rkt
1.4 Creating blog posts

1 Quick start

1.1 Installing Frog

  1. Install Racket.

    On macOS you will need to add /Applications/Racket\ 6.8/bin (or similar) to your PATH in order to be able to run things like racket or raco at the command line.

  2. Install Frog:

    $ raco pkg install frog

  3. Optional: Install Pygments if you want syntax highlighting for fenced code blocks:

    $ sudo easy_install --upgrade Pygments

    Why --upgrade? You probably want the most recent version of Pygments because new languages are constantly being added. For example, Racket is supported starting in Pygments 1.6.

    If that fails, try again after installing easy_install:

    $ sudo apt-get install python-setuptools

1.2 Updating Frog

To update Frog and its dependencies:

$ raco pkg update --update-deps frog

1.3 Starting a new blog project

Creating a new blog project is 3 easy steps:

  1. Create a subdirectory.

    $ mkdir frog-project

  2. Go there.

    $ cd frog-project

  3. Tell Frog to create default files and directories.

    $ raco frog --init

    Creating files in /tmp/frog-project/:









    Project ready. Try `raco frog -bp` to build and preview.

You can go ahead and build/preview this to get a feel for the default starting point:

$ raco frog -bp

Frog 0.26

Launching /usr/bin/python pipe.py

Your Web application is running at http://localhost:3000/index.html.

Stop this program at any time to terminate the Web Server.

  C-c C-c

Web Server stopped.

1.3.1 Project file tree

Here is the file tree that raco frog --init creates for you and Frog expects:


  # Files provided by you:

  frog.rkt      # frog.rkt

  _src/         # default; see current-source-dir in frog.rkt

    page-template.html  # entire page layout: Page template

    post-template.html  # <article> layout: Post template

    index-template.html # index pages: Index template


      # You’ll create these using raco frog -n <post-title>




    # Zero or more other .md files, for non-post pages.

    # May be in subdirs.


    bootstrap.min.css        # get these files

    bootstrap.min.css.map    # from http://getbootstrap.com

    pygments.css             # style code elements from Pygments

    custom.css               # other styles you provide; may be empty



    jquery-3.2.1.slim.min.js # local copy of jQuery for Bootstrap

    bootstrap.bundle.min.js  # from http://getbootstrap.com/




Here are the files created by Frog when you run raco frog -b to (re)build the blog:

project/  # default; see current-output-dir in frog.rkt

  .frog/build   # a cache to support minimal rebuilds





  # Post pages are in subdirs.

  # Exact layout depends on current-permalink in frog.rkt.













Although the Frog example project has copies for example purposes, for your own project you should get the official/latest Bootstrap 4 files directly from Bootstrap.

To design a Bootstrap 4 "theme", try Bootstrap Magic. Also, http://bootswatch.com/ has some ready-made themes.

For examples of "pygments.css" code highlighting styles see https://github.com/richleland/pygments-css.

1.3.2 frog.rkt

When you used raco frog --init it created a "frog.rkt" file in your project directory. If you upgrade from an older version of Frog that used a ".frogrc" file: The first time the newer version of Frog runs, it automatically creates an equivalent "frog.rkt" from your ".frogrc". Thereafter the ".frogrc" is ignored, and may be deleted.

Your "frog.rkt" lets you use simple Racket code to configure and customize your blog.

 #lang frog/config package: frog

The frog/config language provides bindings from:

Furthermore, the frog/config language ensures that you define three functions that are used by Frog:


(init)  any

This is called once, early when Frog starts.

You can set various parameters provided by frog/params. To start, you might only need to set a few:


(enhance-body xs)  (listof xexpr/c)

  xs : (listof xexpr/c)
This is called for each post or non-post page, giving you the opportunity to modify the xexpr?s representing the content.

You may call functions provided by frog/enhance-body. You may also require and use functions provided by a third-party package.


(clean)  any

Called during raco frog --clean.

1.4 Creating blog posts

A typical workflow:

1. Create a new post with raco frog -n "My Post Title". The name of the new .md file is displayed to stdout.

2. Edit the .md file in your preferred plain text editor.

3. Regenerate your site and preview it with raco frog -bp. (You might repeat steps 2 and 3 a few times until you’re satisfied.)

4. Deploy. If you’re using GitHub Pages, you can commit and push to update your site. If you’re using some other method, you can copy or rsync the files to your static file server.