From 892d798d5d56099f2aad1d8883395bc2063447d9 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 6 Nov 2017 21:43:14 -0700 Subject: [PATCH] fix(new): Pages start as md by default This is to make our life easier for future changes so we can assume what the extension should be. Eventually we'll need to make this complex again. --- src/new.rs | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/new.rs b/src/new.rs index f560aea..e10f674 100644 --- a/src/new.rs +++ b/src/new.rs @@ -50,20 +50,15 @@ draft: true Welcome to the first post ever on cobalt.rs! "; -const INDEX_LIQUID: &'static [u8] = b"extends: default.liquid +const INDEX_MD: &'static [u8] = b"extends: default.liquid --- -
-

Blog!

- -
- {% for post in posts %} -
-

{{post.title}}

-

{{ post.title }}

-
- {% endfor %} -
-
+## Blog! + +{% for post in posts %} +#### {{post.title}} + +#### [{{ post.title }}]({{ post.path }}) +{% endfor %} "; pub fn create_new_project>(dest: P) -> Result<()> { @@ -74,7 +69,7 @@ pub fn create_new_project_for_path(dest: &Path) -> Result<()> { fs::create_dir_all(dest)?; create_file(&dest.join(".cobalt.yml"), COBALT_YML)?; - create_file(&dest.join("index.liquid"), INDEX_LIQUID)?; + create_file(&dest.join("index.md"), INDEX_MD)?; fs::create_dir_all(&dest.join("_layouts"))?; create_file(&dest.join("_layouts/default.liquid"), DEFAULT_LAYOUT)?; @@ -91,7 +86,7 @@ pub fn create_new_document(doc_type: &str, name: &str, config: &Config) -> Resul let full_path = &path.join(&config.posts.dir).join(name); match doc_type { - "page" => create_file(name, INDEX_LIQUID)?, + "page" => create_file(name, INDEX_MD)?, "post" => create_file(full_path, POST_MD)?, _ => bail!("Unsupported document type {}", doc_type), }