
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
An extremely minimal static site generator.
CLI executable that converts markdown wrapped in a single template to static HTML for simple blogs hosted on GitHub Pages or similar.
The only requirement is Ruby >= 2.7.0.
$ gem install foresite
$ mkdir my_blog # Create a project directory
$ cd my_blog
$ foresite init # Initialize
$ foresite touch "Hello World" # Create markdown post titled "Hello World"
$ foresite build # Converts markdown to HTML
Create a project directory for your site and run foresite init
from within it:
$ mkdir my_blog
$ cd my_blog
$ foresite init
Created md/
Created post/
Created erb/
Created erb/post.md.erb
Created erb/wrapper.html.erb
Created erb/_list.html.erb
Three subdirectories are created, along with three ERB template files.
Some facts:
md
subdirectory will contain markdown files known as posts, which are your site's content.post
subdirectory will contain HTML files generated from the markdown posts with the exception of an index.html
file listing all posts, which will exist in the top-level project directory.erb
subdirectory contains ERB templates you can modify:
post.md.erb
is the default markdown file for every post.wrapper.html.erb
is a HTML wrapper template for every generated HTML file._list.html.erb
is a HTML template partial for the list of posts on the index.html
page.Run foresite touch
to generate a new post in the md
subdirectory. The title is its sole argument.
$ foresite touch "Welcome to my site"
Created md/2023-01-15-welcome-to-my-site.md
$ cat md/2023-01-15-welcome-to-my-site.md
# Welcome to my site
2023-01-15
A single markdown file is created in the md
subdirectory. This file is meant for you to edit.
Some facts:
post.md.erb
is used to when running foresite touch
for the default markdown content. It has two variables, @title
for the post title and @date_ymd
for the created date in ISO 8601 YYYY-MM-DD
format. Modify to have different defaults when running foresite touch
.
wrapper.html.erb
wraps all of your markdown. It has two variables, @title
for the post title that will populate the <title>
tag, and @content
for a given post's HTML (converted from markdown). For the index.html
file, @title
will be nil
, and @content
will be an list of links to all posts in reverse-chronological order. Modify to have different overall page structure, or to add <style>
etc.
_list.html.erb
is used to generate the <ul>
list of posts on the index.html
file. Modify to show posts in a different way.
Run foresite build
to create HTML in the post
subdirectory and the index.html
file:
$ foresite build
Created post/2023-01-15-welcome-to-my-site.html
Created index.html
In this example, two HTML files are created.
Some facts:
md
subdirectory an equivalent HTML file is generated in the post
subdirectory, each wrapped with wrapper template markup.index.html
file shows a list of links to all posts in reverse-chronological order, prefixed with post date.
foresite build
removes and recreates all HTML files in the post
subdirectory as well as the index.html
file.In this example, the index.html
will contain:
<ul>
<li>2023-01-15 <a href="post/2023-01-15-welcome-to-my-site.html">Welcome to my site</a></li>
</ul>
Run foresite watch
to detect changes to markdown or ERB files, build will run automatically. Useful for previewing content locally.
bundle
to install dependenciesbundle exec rake
to run tests & linterTo install this gem from local source, run bundle exec rake install:local
.
Bug reports and pull requests are welcome. The goals of Foresite are:
Read more in the blog post introducing Foresite
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that foresite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.