Giter Club home page Giter Club logo

rib-sample's Introduction

rib-sample

Sample site for the Rib static site generator.

Prerequisites

First, install the Nix package manager:

bash <(curl https://nixos.org/nix/install)

Optionally, enable the Nix cache if you would like to speed up local builds:

# If you do not already have cachix, install it:
nix-env -iA cachix -f https://cachix.org/api/v1/install
# Enable nix cache for rib
cachix use srid

Running

To build and run the site:

nix-shell --run 'ghcid -T ":main -wS"'

This launches a web server at http://localhost:8080 serving the statically generated content. Changing either ./src/Main.hs or the content in ./content reloads everything.

Use a custom rib and port

You might have a local checkout of rib with certain modifications. And you might want to run ghcid with the server running at a different port. Both of this can achieved using the following command:

# Assuming rib is cloned at ../rib
nix-shell --arg rib ../rib --run 'ghcid -T ":main -ws :8081"'

IDE support

The .vscode directory contains the necessary settings to work with a rib project.

  • Ensure that Nix is installed
  • Run code . to open the project in VSCode, and install the recommended extensions.
    • The default settings have auto-format enabled.

Building the executable

A fully built executable can be produced using nix-build:

$ nix-build 
...
$ ./result/bin/rib-sample --help
Usage: rib-sample [--rebuild-all] [-w|--watch] [(-s|--serve [HOST]:PORT) | -S]
                  [--quiet] [--input-dir INPUTDIR] [--output-dir OUTPUTDIR]
  Generate a static site at OUTPUTDIR using input from INPUTDIR

Available options:
  --rebuild-all            Rebuild all sources
  -w,--watch               Watch for changes and regenerate
  -s,--serve [HOST]:PORT   Run a HTTP server on the generated directory
  -S                       Like `-s 127.0.0.1:8080`
  --quiet                  Log nothing
  --input-dir INPUTDIR     Directory containing the source files (default:
                           content)
  --output-dir OUTPUTDIR   Directory where files will be generated (default:
                           dest)
  -h,--help                Show this help text

rib-sample's People

Contributors

nimor111 avatar srid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kalhauge nimor111

rib-sample's Issues

Which revision to use for rib-0.12

I try to build rib-sample but this requires newer version of rib than one on Hackage.
Which revision should I use for rib-0.12?

I'm happy if there are release tags like β€œrib-0.12” etc.

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.