Skip to content

Commit

Permalink
Merge pull request #198 from sebastienrousseau/feat/ssg
Browse files Browse the repository at this point in the history
Feat/ssg
  • Loading branch information
sebastienrousseau authored Mar 2, 2024
2 parents a75c483 + a0dabcd commit 06fb02b
Show file tree
Hide file tree
Showing 18 changed files with 398 additions and 246 deletions.
163 changes: 80 additions & 83 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ name = "ssg"
readme = "README.md"
repository = "https://github.com/sebastienrousseau/shokunin"
rust-version = "1.71.1"
version = "0.0.25"
version = "0.0.26"
include = [
"/CONTRIBUTING.md",
"/LICENSE-APACHE",
Expand Down Expand Up @@ -67,7 +67,8 @@ printpdf = "0.7.0"
pulldown-cmark = "0.10.0"
uuid = { version = "1.7.0", features = ["v4"] }

[target.'cfg(unix)'.dependencies]
# Unix platforms use OpenSSL for now to provide SSL functionality
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
openssl = { version = "0.10.64", features = ["vendored"] }

[dev-dependencies]
Expand Down
81 changes: 81 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Shokunin Static Site Generator (SSG)

The fastest Rust-based Static Site Generator (SSG) for building professional
websites and blogs.

<!-- markdownlint-disable MD033 MD041 -->

<img
align="right"
alt="Logo of the Shokunin Static Site Generator"
height="261"
src="https://kura.pro/shokunin/images/logos/shokunin.svg"
title="Logo of the Shokunin Static Site Generator"
width="261"
/>

<!-- markdownlint-enable MD033 MD041 -->

*Part of the [Mini Functions][0] family of Rust libraries.*

## Example sites

Shokunin empowers building fast, customizable sites through flexible templating.

The table below showcases diverse websites built with Shokunin, demonstrating
its versatility for:

- Blogs and project documentation
- Company websites and personal portfolios
- Even advanced functionalities like dashboards and custom browsing systems.

Get inspired by these examples and explore the potential of Shokunin for your
next project. Each site leverages Shokunin's ability to process metadata and
generate optimized static assets.

Browse the source code for a deeper dive into
their implementations.

| # | Website | Source Code|
|:---|:---|:---:|
| 01 | [https://akande.co/][00] | [Àkàndé Voice Assistant Website][A] |
| 02 | [https://audioanalyser.co/][01] | [Audio Analyser Website][B] |
| 03 | [https://bankingonquantum.com/][02] | [Banking on Quantum Website][C] |
| 04 | [https://bankstatementparser.com/][03] | [Bank Statement Parser Website][D] |
| 05 | [https://dttlib.com/][04] | [DttLib Website][E] |
| 06 | [https://hshlib.one/][05] | [HshLib Website][F] |
| 07 | [https://kaishi.one/][06] | [Kaishi Website][G] |
| 08 | [https://kyberlib.com/][07] | [KyberLib Website][H] |
| 09 | [https://l90s.com/][08] | [L90s Website][I] |
| 10 | [https://pain001.com/][09] | [Pain001 Website][J] |
| 11 | [https://sebastienrousseau.com/][10] | [Sébastien Rousseau Website][K] |
| 12 | [https://shokunin.one/][11] | [Shokunin Website][L] |


[0]: https://minifunctions.com/ "The Rust Mini Functions"

[00]: https://akande.co/
[01]: https://audioanalyser.co/
[02]: https://bankingonquantum.com/
[03]: https://bankstatementparser.com/
[04]: https://dttlib.com/
[05]: https://hshlib.one/
[06]: https://kaishi.one/
[07]: https://kyberlib.com/
[08]: https://l90s.com/
[09]: https://pain001.com/
[10]: https://sebastienrousseau.com/
[11]: https://shokunin.one/

[A]: https://github.com/sebastienrousseau/akande.github.io "Source Code for the Website of Àkàndé Voice Assistant"
[B]: https://github.com/sebastienrousseau/audioanalyser.github.io "Source Code for the Website of Audio Analyser"
[C]: https://github.com/sebastienrousseau/bankingonquantum.github.io "Source Code for the Website of Banking on Quantum"
[D]: https://github.com/sebastienrousseau/bankstatementparser.github.io "Source Code for the Website of Bank Statement Parser"
[E]: https://github.com/sebastienrousseau/dttlib.github.io "Source Code for the Website of DttLib"
[F]: https://github.com/sebastienrousseau/hshlib.github.io "Source Code for the Website of HshLib"
[G]: https://github.com/sebastienrousseau/kaishi.github.io "Source Code for the Website of Kaishi"
[H]: https://github.com/sebastienrousseau/kyberlib.github.io "Source Code for the Website of KyberLib"
[I]: https://github.com/sebastienrousseau/l90s.github.io "Source Code for the Website of L90s"
[J]: https://github.com/sebastienrousseau/pain001.github.io "Source Code for the Website of Pain001"
[K]: https://github.com/sebastienrousseau/sebastienrousseau.github.io "Source Code for the Website of Sébastien Rousseau"
[L]: https://github.com/sebastienrousseau/shokunin.github.io "Source Code for the Website of Shokunin"
58 changes: 33 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,25 @@ templates to help you create high quality websites with ease.
Shokunin Static Site Generator (SSG) feature highlights include:

- Blazing fast and flexible static site generator written in Rust
- Built-in support for [GitHub Flavoured Markdown][12] (GFM).
- Built-in support for Google Analytics and Bing Analytics.
- Compatible with various HTML themes and Premium templates.
- Generates Atom and RSS feeds for your blog posts.
- Generates minified versions for optimal performance and SEO.
- Includes a built-in Rust development server for local development and testing.
- Supports multiple content formats, including Markdown, YAML, JSON, TOML, XML,
etc.
- Built-in support for sitemap generation, robots.txt generation, canonical
name (CNAME) records and custom 404 pages.
- Built-in support for [GitHub Flavoured Markdown][12] (GFM)
- Built-in support for Google Analytics and Bing Analytics
- Experimental support for PDF generation
- Compatible with various HTML themes and premium templates
- Generates Atom and RSS feeds for your blog posts automatically
- Generates minified HTML for optimal performance and SEO
- Includes a built-in Rust development server for local testing
- Supports multiple content formats:
- Markdown
- YAML
- JSON
- TOML
- XML
- Built-in generation for:
- Sitemaps
- robots.txt
- Canonical name (CNAME) records
- Custom 404 pages
- Comprehensive documentation

## Table of Contents

Expand Down Expand Up @@ -142,10 +151,7 @@ You can find our documentation on [docs.rs][9], [lib.rs][10] and [crates.io][8].
### Command Line Interface (CLI)

The Shokunin Static Site Generator (SSG) library runs in a Terminal window and
can be used to generate a static website.

Here’s the first command you can enter in your Terminal window to run Shokunin
Static Site Generator (SSG):
can be used to easily generate a static website. To get started, run:

```shell
ssg --new=docs --content=content --template=template --output=output --serve=public
Expand All @@ -157,21 +163,24 @@ or
ssg -n=docs -c=content -t=template -o=output -s=public
```

This command will create a new website with the name `docs` in the current
directory. It will use the `content` directory to gather the website content
and the `template` directory to generate the website files. It will serve the
website directly from the `mysite` directory.
This creates a new website in a directory called `docs` using the markdown content from the `content` directory and the HTML templates from the `template` directory. The static and compiled HTML files and artefacts are then generated in a `docs` folder.

Shokunin is ideal for hosting your site on GitHub Pages. Simply commit and push the `docs` folder to your main branch, and set the GitHub Pages publishing source to point to that folder.

During development, you can use the `--serve` or `--s` option to start a local development server to preview content changes.

With Shokunin's GFM and theme support, you can focus on writing markdown content while the SSG handles delivering a fast, SEO-friendly site.

#### Arguments

- `-n`, `--new`: The name of the new website. (required)
- `-c`, `--content`: The directory containing the website content. (required)
- `-t`, `--template`: The directory containing the website templates.
- `-n`, `--new`: The name of the folder for your new website. (required)
- `-c`, `--content`: The directory containing the website markdown content. (required)
- `-t`, `--template`: The directory containing the HTML website templates.
(required)
- `-o`, `--output`: The directory where the generated website files will be
saved temporarily. (required)
- `-s`, `--serve`: Run the development server. (optional). The directory from
which the website will be served.
which the website will be served. (optional)

### In your project

Expand All @@ -180,7 +189,7 @@ following to your `Cargo.toml` file:

```toml
[dependencies]
shokunin = "0.0.25"
shokunin = "0.0.26"
```

Add the following to your `main.rs` file:
Expand Down Expand Up @@ -290,14 +299,13 @@ of useful suggestions on how to improve this project.
[14]: https://www.rust-lang.org/learn/get-started "Rust"
[15]: https://codecov.io/github/sebastienrousseau/shokunin?branch=main "Codecov"
[16]: https://www.rust-lang.org/policies/code-of-conduct "Rust's Code of Conduct"
[17]: https://forge.rust-lang.org/release/platform-support.html "Rust Platform Support"

[banner]: https://kura.pro/shokunin/images/titles/title-shokunin.svg "Banner of the Shokunin Static Site Generator"
[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/shokunin?style=for-the-badge&token=wAcpid8YEt 'Codecov'

[crates-badge]: https://img.shields.io/crates/v/ssg.svg?style=for-the-badge 'Crates.io badge'
[divider]: https://kura.pro/common/images/elements/divider.svg "divider"
[docs-badge]: https://img.shields.io/docsrs/ssg.svg?style=for-the-badge 'Docs.rs badge'
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.25-orange.svg?style=for-the-badge 'Lib.rs badge'
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.26-orange.svg?style=for-the-badge 'Lib.rs badge'
[license-badge]: https://img.shields.io/crates/l/ssg.svg?style=for-the-badge 'License badge'
[made-with-rust-badge]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust 'Made With Rust badge'
78 changes: 21 additions & 57 deletions TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,13 @@

<!-- markdownlint-enable MD033 MD041 -->

# Shokunin Static Site Generator (SSG) v0.0.25 🦀
# Shokunin Static Site Generator (SSG) v0.0.26 🦀

The fastest Rust-based Static Site Generator (SSG) for building professional
websites and blogs.

*Part of the [Mini Functions][0] family of Rust libraries.*

<!-- markdownlint-disable MD033 MD041 -->
<center>
<!-- markdownlint-enable MD033 MD041 -->

![Banner of the Shokunin Static Site Generator][banner]

[![Made With Rust][made-with-rust-badge]][14]
[![Crates.io][crates-badge]][8]
[![Lib.rs][libs-badge]][10]
[![Docs.rs][docs-badge]][9]
[![License][license-badge]][3]
[![Codecov][codecov-badge]][15]

[Website][1]
[Documentation][9]
[Report Bug][4]
[Request Feature][4]
[Contributing Guidelines][5]

<!-- markdownlint-disable MD033 MD041 -->
</center>
<!-- markdownlint-enable MD033 MD041 -->

![divider][divider]

## Overview

Shokunin is a lightning-fast static site generator (SSG) that is optimised for
Expand All @@ -56,38 +31,27 @@ templates to help you create high quality websites with ease.
Shokunin Static Site Generator (SSG) feature highlights include:

- Blazing fast and flexible static site generator written in Rust
- Built-in support for [GitHub Flavoured Markdown][12] (GFM).
- Built-in support for Google Analytics and Bing Analytics.
- Compatible with various HTML themes and Premium templates.
- Generates Atom and RSS feeds for your blog posts.
- Generates minified versions for optimal performance and SEO.
- Includes a built-in Rust development server for local development and
testing.
- Supports multiple content formats, including Markdown, YAML, JSON, TOML, XML,
etc.
- Built-in support for sitemap generation, robots.txt generation, canonical
name (CNAME) records and custom 404 pages.
- Built-in support for [GitHub Flavoured Markdown][01] (GFM)
- Built-in support for Google Analytics and Bing Analytics
- Experimental support for PDF generation
- Compatible with various HTML themes and premium templates
- Generates Atom and RSS feeds for your blog posts automatically
- Generates minified HTML for optimal performance and SEO
- Includes a built-in Rust development server for local testing
- Supports multiple content formats:
- Markdown
- YAML
- JSON
- TOML
- XML
- Built-in generation for:
- Sitemaps
- robots.txt
- Canonical name (CNAME) records
- Custom 404 pages
- Comprehensive documentation

[0]: https://minifunctions.com/ "The Rust Mini Functions"
[1]: https://shokunin.one "Shokunin Static Site Generator"
[3]: http://opensource.org/licenses/MIT "MIT license"
[4]: https://github.com/sebastienrousseau/shokunin/issues "Issues"
[5]: https://github.com/sebastienrousseau/shokunin/blob/main/CONTRIBUTING.md "Contributing"
[8]: https://crates.io/crates/ssg "Crate.io"
[9]: https://docs.rs/crate/ssg/ "Docs.rs"
[10]: https://lib.rs/crates/ssg "Lib.rs"
[12]: https://github.github.com/gfm/ "GitHub Flavoured Markdown"
[14]: https://www.rust-lang.org/learn/get-started "Rust"
[15]: https://codecov.io/github/sebastienrousseau/shokunin?branch=main "Codecov"

[banner]: https://kura.pro/shokunin/images/titles/title-shokunin.svg "Banner of the Shokunin Static Site Generator"
[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/shokunin?style=for-the-badge&token=wAcpid8YEt 'Codecov'

[crates-badge]: https://img.shields.io/crates/v/ssg.svg?style=for-the-badge 'Crates.io badge'
[divider]: https://kura.pro/common/images/elements/divider.svg "divider"
[docs-badge]: https://img.shields.io/docsrs/ssg.svg?style=for-the-badge 'Docs.rs badge'
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.25-orange.svg?style=for-the-badge 'Lib.rs badge'
[license-badge]: https://img.shields.io/crates/l/ssg.svg?style=for-the-badge 'License badge'
[made-with-rust-badge]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust 'Made With Rust badge'
[01]: https://github.github.com/gfm/ "GitHub Flavoured Markdown"

## Changelog 📚
2 changes: 1 addition & 1 deletion content/404.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no"
atom_link: "https://kaishi.one/404/rss.xml"
category: "Technology"
docs: "https://validator.w3.org/feed/docs/rss2.html"
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: "The page may have been removed or renamed. Please visit our homepage for more information."
item_guid: "https://kaishi.one/404/rss.xml"
item_link: "https://kaishi.one/404/rss.xml"
Expand Down
2 changes: 1 addition & 1 deletion content/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no" ## The viewpor
atom_link: https://kaishi.one/contact/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: RSS feed for the contact page of the Kaishi website.
item_guid: https://kaishi.one/contact/rss.xml
item_link: https://kaishi.one/contact/rss.xml
Expand Down
2 changes: 1 addition & 1 deletion content/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no" ## The viewpor
atom_link: https://kaishi.one/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: RSS feed for the site
item_guid: https://kaishi.one/rss.xml
item_link: https://kaishi.one/rss.xml
Expand Down
2 changes: 1 addition & 1 deletion content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no" ## The viewpor
atom_link: https://kaishi.one/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: RSS feed for the site
item_guid: https://kaishi.one/rss.xml
item_link: https://kaishi.one/rss.xml
Expand Down
2 changes: 1 addition & 1 deletion content/offline.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no" ## The viewpor
atom_link: https://kaishi.one/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: RSS feed for the site
item_guid: https://kaishi.one/rss.xml
item_link: https://kaishi.one/rss.xml
Expand Down
2 changes: 1 addition & 1 deletion content/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no" ## The viewpor
atom_link: https://kaishi.one/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: RSS feed for the site
item_guid: https://kaishi.one/rss.xml
item_link: https://kaishi.one/rss.xml
Expand Down
2 changes: 1 addition & 1 deletion content/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no" ## The viewpor
atom_link: https://kaishi.one/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: RSS feed for the site
item_guid: https://kaishi.one/rss.xml
item_link: https://kaishi.one/rss.xml
Expand Down
2 changes: 1 addition & 1 deletion content/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no" ## The viewpor
atom_link: https://kaishi.one/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: RSS feed for the site
item_guid: https://kaishi.one/rss.xml
item_link: https://kaishi.one/rss.xml
Expand Down
2 changes: 1 addition & 1 deletion content/terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ viewport: "width=device-width, initial-scale=1, shrink-to-fit=no" ## The viewpor
atom_link: https://kaishi.one/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "Shokunin SSG (version 0.0.25)"
generator: "Shokunin SSG (version 0.0.26)"
item_description: RSS feed for the site
item_guid: https://kaishi.one/rss.xml
item_link: https://kaishi.one/rss.xml
Expand Down
Loading

0 comments on commit 06fb02b

Please sign in to comment.