From 092565cd5bbefe22b107ef85a8183e18b9eed7ed Mon Sep 17 00:00:00 2001 From: Zoey Date: Tue, 17 Aug 2021 10:03:54 -0700 Subject: [PATCH] Build to docs directory --- {site/build => docs}/index.html | 0 {site/build => docs}/static/site.css | 0 site/config.yaml | 1 + src/lib.rs | 7 ++++++- 4 files changed, 7 insertions(+), 1 deletion(-) rename {site/build => docs}/index.html (100%) rename {site/build => docs}/static/site.css (100%) diff --git a/site/build/index.html b/docs/index.html similarity index 100% rename from site/build/index.html rename to docs/index.html diff --git a/site/build/static/site.css b/docs/static/site.css similarity index 100% rename from site/build/static/site.css rename to docs/static/site.css diff --git a/site/config.yaml b/site/config.yaml index 7f3005e..3e7ea38 100644 --- a/site/config.yaml +++ b/site/config.yaml @@ -1,3 +1,4 @@ base_url: "https://zoey.dev" title: zoey.dev description: "Zoey's site." +build: ../docs diff --git a/src/lib.rs b/src/lib.rs index 94ffa55..7d71537 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,6 +22,8 @@ pub struct SiteConfig { pub title: String, /// The site's description? Not sure if this will actually be used or not pub description: String, + /// The site's build directory. Defaults to /build if not specified. + pub build: Option, } /// Struct for the front matter in templates. (nothing here yet) @@ -143,7 +145,10 @@ struct SiteBuilder<'a> { impl<'a> SiteBuilder<'a> { /// Creates a new site builder. pub fn new(site: &'a Site, local_mode: Option) -> Self { - let build_path = site.site_path.join("build"); + let build_path = match &site.config.build { + Some(build) => site.site_path.join(build), + _ => site.site_path.join("build"), + }; Self { matter: Matter::new(),