-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add benchmark plugin and update various configurations
- Introduced .gitignore for benchmark plugin to exclude target and node_modules. - Created Cargo.toml for benchmark plugin with necessary dependencies. - Updated .cargo/config.toml to comment out RUST_BACKTRACE. - Removed unused fontawesome module from extensions. - Modified template.yaml to include git_repo in post-processing. - Updated CLI commands for starting the server. - Enhanced error handling in various extensions by including location information. - Added new constants for template and HTML file names in consts.rs. - Updated README with new server command usage.
- Loading branch information
1 parent
4f537e0
commit d18bcbe
Showing
43 changed files
with
811 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
rustflags = [] | ||
|
||
[env] | ||
RUST_BACKTRACE = "1" | ||
# RUST_BACKTRACE = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
target | ||
node_modules | ||
.wrangler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "benchmark" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = [ "Erhan BARIS <[email protected]>" ] | ||
|
||
[dependencies] | ||
lipsum = "0.9.1" | ||
rand = "0.8.5" | ||
rand_hc = "0.3.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use std::fs::File; | ||
use std::io::Write; | ||
use std::path::Path; | ||
|
||
use lipsum::{lipsum, lipsum_with_rng, lipsum_words_with_rng}; | ||
use rand::prelude::*; | ||
|
||
use rand::seq::SliceRandom; | ||
|
||
fn main() { | ||
let lorem_tags = lipsum_with_rng(rand::thread_rng(), 20).replace(",", "").replace(".", ""); | ||
let tags = lorem_tags.split(' ').collect::<Vec<_>>(); | ||
let posts_path = Path::new("/Users/erhanbaris/Downloads/pi_tc/posts"); | ||
|
||
|
||
for i in 0..1_000 { | ||
let title = lipsum_with_rng(rand::thread_rng(), rand::thread_rng().gen_range(5..12)); | ||
let description = lipsum_words_with_rng(rand::thread_rng(), 1000); | ||
let mut post_tags = Vec::new(); | ||
|
||
for _ in 0..rand::thread_rng().gen_range(5..12) { | ||
if let Some(tag) = tags.choose(&mut rand::thread_rng()) { | ||
post_tags.push(tag); | ||
} | ||
} | ||
|
||
let slug = title.to_lowercase().replace(" ", "-").replace(",", "").replace(".", ""); | ||
|
||
let mut file = File::create(posts_path.join(format!("{}.md", i))).unwrap(); | ||
let content = format!("--- | ||
title: {} | ||
slug: {} | ||
lang: en | ||
date: 2024-12-10 17:07:45 | ||
tags: | ||
{} | ||
--- | ||
{} | ||
", title, slug, post_tags.iter().map(|tag| format!(" - {}\r\n", tag)).collect::<Vec<String>>().join(""), description); | ||
|
||
file.write_all(content.as_bytes()).unwrap(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.