Crates.io | sitesmith |
lib.rs | sitesmith |
version | 0.1.3 |
source | src |
created_at | 2024-06-14 01:09:10.129118 |
updated_at | 2024-06-22 02:00:52.399166 |
description | An automated personal site generator! |
homepage | https://github.com/BradenEverson/sitesmith |
repository | https://github.com/BradenEverson/sitesmith |
max_upload_size | |
id | 1271582 |
size | 18,096 |
SiteSmith is a Rust CLI tool designed to generate a personal website. It reads project and work experience data from JSON files and uses a template to create an HTML website.
cargo install sitesmith
To generate your website, run the sitesmith
CLI tool with the following arguments:
sitesmith --projects <projects.json> --work <work.json> --template <template.html> --output <output.html>
--projects
: Path to the JSON file containing project data.--work
: Path to the JSON file containing work experience data.--template
: Path to the HTML template file.--output
: Path to the output HTML file to be generated.sitesmith --projects projects.json --work work.json --template template.html --output index.html
The projects JSON file should contain an array of project entries. Each entry should have the following structure:
[
{
"name": "Project Name",
"descr": ["Project description item 1", "Project description item 2"],
"extra": ["<p>Additional project information</p>"]
},
...
]
The work JSON file should contain an array of work experience entries. Each entry should have the following structure:
[
{
"name": "Job Title",
"timespan": "Duration",
"location": "Location",
"descr": ["Job description item 1", "Job description item 2"],
"extra": ["<p>Additional job information</p>", "<b>Even more job info!</b>"]
},
...
]
The HTML template should include placeholders for the projects and work experience sections. For example:
<!DOCTYPE html>
<html>
<head>
<title>My Personal Website</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<h1>Welcome to My Personal Website</h1>
</header>
<main>
<section id="projects">
{projects}
</section>
<section id="work">
{work}
</section>
</main>
<footer>
<p>© 2024 Your Name</p>
</footer>
</body>
</html>
The placeholders {projects}
and {work}
will be replaced with the generated HTML content for the projects and work experience respectively.
You can see a live example of a website generated using SiteSmith here.
The source code for this example is available on GitHub: bradeneverson.github.io.
git checkout -b feature-branch
).git commit -am 'Add new feature'
).git push origin feature-branch
).