|
@@ -12,15 +12,15 @@ use write::{write_post, write_post_listing};
|
12
|
12
|
|
13
|
13
|
pub fn build(include_drafts: bool) {
|
14
|
14
|
let cwd = env::current_dir().expect("Couldn't read current directory");
|
15
|
|
- let config = match fs::read_to_string(cwd.join("tlon.toml")) {
|
|
15
|
+ let config = match fs::read_to_string(cwd.join("casaubon.toml")) {
|
16
|
16
|
Ok(contents) => match contents.parse::<Value>() {
|
17
|
17
|
Ok(config) => Config {
|
18
|
18
|
site_name: String::from(config["site_name"].as_str().unwrap()),
|
19
|
19
|
},
|
20
|
|
- Err(_) => panic!("Invalid tlon.toml"),
|
|
20
|
+ Err(_) => panic!("Invalid casaubon.toml"),
|
21
|
21
|
},
|
22
|
22
|
Err(_) => {
|
23
|
|
- panic!("Can't find tlon.toml");
|
|
23
|
+ panic!("Can't find casaubon.toml");
|
24
|
24
|
}
|
25
|
25
|
};
|
26
|
26
|
|
|
@@ -84,10 +84,10 @@ pub fn new(name: &str) {
|
84
|
84
|
|
85
|
85
|
fs::create_dir(&project_path).expect(&format!("Couldn't create directory '{}'", &name));
|
86
|
86
|
fs::write(
|
87
|
|
- project_path.join("tlon.toml"),
|
|
87
|
+ project_path.join("casaubon.toml"),
|
88
|
88
|
format!("site_name = \"{}\"", &name),
|
89
|
89
|
)
|
90
|
|
- .expect("Could not create tlon.toml");
|
|
90
|
+ .expect("Could not create casaubon.toml");
|
91
|
91
|
|
92
|
92
|
for dir in &["drafts", "posts", "public", "templates", "css", "js"] {
|
93
|
93
|
fs::create_dir(&project_path.join(&dir))
|
|
@@ -194,7 +194,7 @@ mod tests {
|
194
|
194
|
);
|
195
|
195
|
assert_eq!(
|
196
|
196
|
format!("site_name = \"{}\"", &uuid),
|
197
|
|
- fs::read_to_string(&project_dir.join("tlon.toml")).unwrap()
|
|
197
|
+ fs::read_to_string(&project_dir.join("casaubon.toml")).unwrap()
|
198
|
198
|
);
|
199
|
199
|
|
200
|
200
|
fs::remove_dir_all(project_dir).unwrap();
|
|
@@ -249,7 +249,7 @@ mod tests {
|
249
|
249
|
"# First post\n\nThis is the first post\n\nIt has multiple paragraphs",
|
250
|
250
|
)
|
251
|
251
|
.unwrap();
|
252
|
|
- fs::write(project_dir.join("tlon.toml"), "site_name = \"Test Site\"").unwrap();
|
|
252
|
+ fs::write(project_dir.join("casaubon.toml"), "site_name = \"Test Site\"").unwrap();
|
253
|
253
|
|
254
|
254
|
build(false);
|
255
|
255
|
|
|
@@ -341,7 +341,7 @@ mod tests {
|
341
|
341
|
"# First draft\n\nThis is the first draft",
|
342
|
342
|
)
|
343
|
343
|
.unwrap();
|
344
|
|
- fs::write(project_dir.join("tlon.toml"), "site_name = \"Test Site\"").unwrap();
|
|
344
|
+ fs::write(project_dir.join("casaubon.toml"), "site_name = \"Test Site\"").unwrap();
|
345
|
345
|
|
346
|
346
|
build(true);
|
347
|
347
|
|