Skip to content

Commit 42fa604

Browse files
test(ssg): ✅ add tests to cover edge cases and the functionality of copy_dir_with_progress
1 parent ad36a2e commit 42fa604

File tree

3 files changed

+191
-103
lines changed

3 files changed

+191
-103
lines changed

README.md

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
alt="Shokunin logo" height="66" align="right" />
44
<!-- markdownlint-enable MD033 MD041 -->
55

6-
# `Shokunin Static Site Generator (SSG)`
6+
# Shokunin Static Site Generator (SSG)
77

8-
A modern, high-performance static site generator crafted in Rust, optimised for content-first development.
8+
A content-first static site generator crafted in Rust, optimized for performance, accessibility, and search engine visibility.
99

1010
<!-- markdownlint-disable MD033 MD041 -->
1111
<center>
@@ -19,43 +19,51 @@ A modern, high-performance static site generator crafted in Rust, optimised for
1919
</center>
2020
<!-- markdownlint-enable MD033 MD041 -->
2121

22-
## Overview
22+
## Overview 🚀
2323

24-
Shokunin is a lightning-fast static site generator (SSG) built with Rust, delivering exceptional performance while maintaining strict accessibility standards. It prioritises content management, search engine optimisation (SEO), and WCAG 2.1 Level AA compliance.
24+
Shokunin is a high-performance static site generator (SSG) engineered in Rust that prioritises:
2525

26-
## Key Features
26+
- Content-first development approach
27+
- Lightning-fast site generation
28+
- WCAG 2.1 Level AA accessibility compliance
29+
- Advanced SEO optimization
30+
- Type-safe operations with comprehensive error handling
2731

28-
- **⚡ Exceptional Performance**: Leverages Rust's zero-cost abstractions for optimal speed
29-
- **📱 Advanced SEO**: Built-in optimisations for maximum search engine visibility
30-
- **🛠️ Versatile Content Support**: Seamlessly handles Markdown, YAML, JSON, and TOML
31-
- **📊 Analytics Integration**: Native support for Google Analytics and Bing Analytics
32-
- **🔄 Automated Feed Generation**: Auto-generates Atom and RSS feeds
33-
- **🎨 Customisable Themes**: Supports bespoke HTML themes and templates
34-
- **📱 Development Tools**: Integrated Rust server for local development
32+
## Key Features 🎯
3533

36-
### Accessibility Features
34+
### Core Capabilities
3735

38-
Shokunin automatically implements WCAG 2.1 Level AA standards through:
36+
- **⚡ Exceptional Performance**: Zero-cost abstractions through Rust
37+
- **📱 SEO Optimization**: Built-in enhancements for search visibility
38+
- **♿ Accessibility**: Automatic WCAG 2.1 Level AA compliance
39+
- **🛠️ Multi-format Support**: Handles Markdown, YAML, JSON, and TOML
40+
- **🔄 Feed Generation**: Automatic Atom and RSS feed creation
41+
- **📊 Analytics**: Native Google and Bing Analytics integration
42+
- **🎨 Theming**: Custom HTML themes and template support
3943

40-
- Semantic HTML structure
41-
- ARIA landmark roles
42-
- Keyboard navigation support
43-
- Screen reader optimisation
44-
- Colour contrast compliance
45-
- Responsive text scaling
46-
- Alt text management
47-
- Clear document hierarchy
48-
- Focus state handling
44+
### Development Features
4945

50-
## Getting Started
46+
- **🔧 CLI Tools**: Comprehensive command-line interface
47+
- **🚀 Dev Server**: Built-in Rust server for local development
48+
- **🔍 Hot Reload**: Automatic content updates during development
49+
- **📝 Type Safety**: Guaranteed memory and thread safety
50+
- **⚡ Async Support**: Full asynchronous operation capabilities
51+
52+
## Getting Started 📦
5153

5254
### Installation
5355

54-
Add Shokunin to your `Cargo.toml`:
56+
Add to your `Cargo.toml`:
5557

5658
```toml
5759
[dependencies]
58-
shokunin = "0.0.31"
60+
ssg = "0.0.31"
61+
```
62+
63+
Or install via Cargo:
64+
65+
```bash
66+
cargo install ssg
5967
```
6068

6169
### Basic Usage
@@ -65,98 +73,90 @@ use staticdatagen::compiler::service::compile;
6573
use std::{path::Path, error::Error};
6674

6775
fn main() -> Result<(), Box<dyn Error>> {
68-
// Define paths to existing directories
69-
let build_dir = Path::new("./examples/build"); // For temporary build files
70-
let content_dir = Path::new("./examples/content"); // Your markdown content
71-
let public_dir = Path::new("./examples/public"); // Generated site output
72-
let template_dir = Path::new("./examples/templates"); // HTML templates
76+
// Define directory paths
77+
let build_dir = Path::new("./examples/build"); // Build directory
78+
let content_dir = Path::new("./examples/content"); // Content directory
79+
let public_dir = Path::new("./examples/public"); // Public directory
80+
let template_dir = Path::new("./examples/templates"); // Templates
7381

74-
// Generate the static site
82+
// Generate site
7583
compile(build_dir, content_dir, public_dir, template_dir)?;
76-
7784
println!("✨ Site generated successfully!");
7885
Ok(())
7986
}
8087
```
8188

82-
### Command-Line Interface
89+
### CLI Usage
8390

84-
Create a new site with the following command:
91+
Create a new site:
8592

8693
```bash
87-
ssg --content=content \
88-
--template=templates \
89-
--output=output \
90-
--serve=public
91-
```
94+
# Full command syntax
95+
ssg --content=content --template=templates --output=output --serve=public
9296

93-
Or use the shorter form:
94-
95-
```bash
97+
# Short form
9698
ssg -c=content -t=templates -o=output -s=public
97-
```
9899

99-
```bash
100+
# Using cargo run
100101
cargo run --bin ssg -- -c="./examples/content" -t="./examples/templates" -o="./examples/output" -s="./examples/public"
101102
```
102103

103104
### CLI Options
104105

105106
| Option | Short | Description | Required |
106107
|--------|-------|-------------|----------|
107-
| `--content` | `-c` | Content directory path | Yes |
108-
| `--template` | `-t` | Template directory path | Yes |
109-
| `--output` | `-o` | Output directory path | Yes |
110-
| `--serve` | `-s` | Development server path | No |
111-
112-
## Documentation
113-
114-
For comprehensive API documentation, visit [docs.rs/crate/ssg/](https://docs.rs/crate/ssg/).
108+
| `--content` | `-c` | Content path | Yes |
109+
| `--template` | `-t` | Template path | Yes |
110+
| `--output` | `-o` | Output path | Yes |
111+
| `--serve` | `-s` | Server Public path | Yes |
115112

116-
## Examples
113+
## Examples 📚
117114

118-
Explore example implementations:
115+
Try our example implementations:
119116

120-
- Basic Example
121-
122-
```shell
117+
```bash
118+
# Basic example
119+
## Convert Markdown to static sites effortlessly, with templates, organized builds, and instant local hosting.
123120
git clone https://github.com/sebastienrousseau/shokunin.git
124121
cd shokunin
125122
cargo run --example basic
126-
```
127-
128-
- Quick Start Example
129123

130-
```shell
131-
git clone https://github.com/sebastienrousseau/shokunin.git
132-
cd shokunin
124+
# Quick start example
125+
## Create, compile, and host a static site effortlessly with Shokunin: simple setup, error handling, and instant local server for previews.
133126
cargo run --example quickstart
134-
```
135127

136-
- Multilingual Example
137-
138-
```shell
139-
git clone https://github.com/sebastienrousseau/shokunin.git
140-
cd shokunin
128+
# Multilingual example
129+
## Build multilingual static sites effortlessly: generate language-specific sites, create a language selector, and serve all from a single directory.
141130
cargo run --example multilingual
142131
```
143132

144-
## Contributing
133+
## Documentation 📖
134+
135+
- [API Documentation][04]
136+
- [User Guide][00]
137+
- [Contributing Guidelines][05]
138+
139+
## Contributing 🤝
140+
141+
We welcome contributions! Please see our [Contributing Guidelines][05] for details on:
145142

146-
Contributions are welcome! Please feel free to submit a Pull Request.
143+
- Code of Conduct
144+
- Development Process
145+
- Pull Request Guidelines
146+
- Issue Reporting
147147

148-
## License
148+
## License 📄
149149

150-
This project is licensed under either of
150+
This project is dual-licensed under:
151151

152152
- [Apache License, Version 2.0][10]
153-
- [MIT license][11]
153+
- [MIT License][11]
154154

155155
at your option.
156156

157-
## Acknowledgements
157+
## Acknowledgements 🙏
158158

159-
Special thanks to all contributors who have helped build the `ssg` library.
159+
Special thanks to all contributors who have helped build Shokunin.
160160

161161
[00]: https://shokunin.one
162162
[01]: https://lib.rs/crates/ssg
@@ -176,5 +176,5 @@ Special thanks to all contributors who have helped build the `ssg` library.
176176
[crates-badge]: https://img.shields.io/crates/v/ssg.svg?style=for-the-badge&color=fc8d62&logo=rust
177177
[docs-badge]: https://img.shields.io/badge/docs.rs-ssg-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
178178
[github-badge]: https://img.shields.io/badge/github-sebastienrousseau/ssg-8da0cb?style=for-the-badge&labelColor=555555&logo=github
179-
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.1-orange.svg?style=for-the-badge
179+
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.31-orange.svg?style=for-the-badge
180180
[made-with-rust]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust

TEMPLATE.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!-- markdownlint-disable MD033 MD041 -->
22
<img src="https://kura.pro/shokunin/images/logos/shokunin.svg"
3-
alt="NucleusFlow logo" height="66" align="right" />
3+
alt="Shokunin logo" height="66" align="right" />
44
<!-- markdownlint-enable MD033 MD041 -->
55

6-
# `Shokunin Static Site Generator (SSG)`
6+
# Shokunin Static Site Generator (SSG)
77

8-
A Content-First Open Source Static Site Generator (SSG) crafted in Rust.
8+
A content-first static site generator crafted in Rust, optimized for performance, accessibility, and search engine visibility.
99

1010
<!-- markdownlint-disable MD033 MD041 -->
1111
<center>
@@ -19,19 +19,15 @@ A Content-First Open Source Static Site Generator (SSG) crafted in Rust.
1919
</center>
2020
<!-- markdownlint-enable MD033 MD041 -->
2121

22-
## Overview
22+
## Overview 🚀
2323

24-
Shokunin is a lightning-fast static site generator (SSG) optimised for search engine visibility (SEO) and compliant with WCAG 2.1 Level AA accessibility standards.
24+
Shokunin is a high-performance static site generator (SSG) engineered in Rust that prioritises:
2525

26-
## Features
27-
28-
- **⚡ Blazing Fast Performance**: Built in Rust for optimal speed and efficiency
29-
- **📱 SEO Optimised**: Built-in features for maximum search engine visibility
30-
- **🛠️ Multiple Content Formats**: Support for Markdown, YAML, JSON, and TOML
31-
- **📊 Analytics Ready**: Built-in support for Google Analytics and Bing Analytics
32-
- **🔄 Automated Feeds**: Automatic generation of Atom and RSS feeds
33-
- **🎨 Flexible Theming**: Compatible with custom HTML themes and templates
34-
- **📱 Development Server**: Built-in Rust server for local testing
26+
- Content-first development approach
27+
- Lightning-fast site generation
28+
- WCAG 2.1 Level AA accessibility compliance
29+
- Advanced SEO optimization
30+
- Type-safe operations with comprehensive error handling
3531

3632
[00]: https://shokunin.one
3733
[01]: https://lib.rs/crates/ssg
@@ -49,7 +45,7 @@ Shokunin is a lightning-fast static site generator (SSG) optimised for search en
4945
[crates-badge]: https://img.shields.io/crates/v/ssg.svg?style=for-the-badge&color=fc8d62&logo=rust
5046
[docs-badge]: https://img.shields.io/badge/docs.rs-ssg-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
5147
[github-badge]: https://img.shields.io/badge/github-sebastienrousseau/ssg-8da0cb?style=for-the-badge&labelColor=555555&logo=github
52-
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.1-orange.svg?style=for-the-badge
48+
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.31-orange.svg?style=for-the-badge
5349
[made-with-rust]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust
5450

5551
## Changelog 📚

0 commit comments

Comments
 (0)