From 3b4c71094f2a379599fa794e135997917d6183f0 Mon Sep 17 00:00:00 2001 From: shaurya gupta Date: Fri, 14 Aug 2020 22:57:55 +0530 Subject: [PATCH 1/3] Multi site RFC --- guide/rfc-multi-site.md | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 guide/rfc-multi-site.md diff --git a/guide/rfc-multi-site.md b/guide/rfc-multi-site.md new file mode 100644 index 000000000..af00552fe --- /dev/null +++ b/guide/rfc-multi-site.md @@ -0,0 +1,52 @@ +# Generating multiple sites + +In order to support subset as a blog (see [#222](https://github.com/srid/neuron/issues/222)), we need the ability to configure multiple sites (e.g. one for your local notes and another for your blog) as well as the ability to publish only a subset of the Zettelkasten (e.g. your blog might only publish zettels tagged `blog`). + +## Filtering zettels while generating + +For this, we add a new config parameter `filterZettels` with the same syntax as we use for queries. Only zettel matching this query will be included while generating the site. + +## Multiple site configuration + +To configure multiple sites, we modify the existing configuration format. + +- At the top level, we have the following fields: +|Field name|Description| +|---|---| +|**`minVersion`**|The minimum neuron version your site must be generated with. (optional)| +|**`sites`**|A mapping of site identifier and site config.| + +- Each site config can have these optional parameters: +|Field name|Description| +|---|---| +|**`siteTitle`**|Your Neuron site's title| +|**`author`**|Author name| +|**`siteBaseUrl`**|The base URL of your published Neuron site. Setting the base URL will enable [breadcrumbs](https://developers.google.com/search/docs/data-types/breadcrumb) in your site's structured data| +|**`theme`**|Color scheme to use for your site. Value must be [one of the color names](https://semantic-ui.com/usage/theming.html#sitewide-defaults) supported by SemanticUI.| +|**`aliases`**|Setup custom redirects in the statically generated site.| +|**`editUrl`**|The URL (without the zettel filename) to edit zettels.| +|**`formats`**|Formats other than Markdown to use; eg: `["markdown", "org"]`| +|**`filterZettels`**|Query used to filter the zettels| + +For backwards compatability, in absence of the `sites` field, we conside a single site implictly named `default`. All fields that are allowed at the top level (in the new config format) as well as for individual site config can be used here. + +## Example +```json +{ minVersion = "0.4.0.0" +, sites = + { default = + { siteTitle = "My local Zettelkasten" + , siteBaseUrl = Some "127.0.0.1:8080" + , theme = "brown" + } + , blog = + { siteTitle = "My blog" + , siteBaseUrl = Some "https://somecollege.edu/~john/neuron" + , theme = "blue" + , aliases = [ "thesis-portal:2011402" ] + , editUrl = Some "https://github.com/john/website/edit/master/notes/" + , filterZettels = "" + } + } +} +``` From 6217ae904414907ba9956e11b6f881337e7af0bc Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 14 Aug 2020 21:08:15 -0400 Subject: [PATCH 2/3] Fix code block language --- guide/rfc-multi-site.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/rfc-multi-site.md b/guide/rfc-multi-site.md index af00552fe..800e89fc8 100644 --- a/guide/rfc-multi-site.md +++ b/guide/rfc-multi-site.md @@ -31,7 +31,7 @@ To configure multiple sites, we modify the existing configuration format. For backwards compatability, in absence of the `sites` field, we conside a single site implictly named `default`. All fields that are allowed at the top level (in the new config format) as well as for individual site config can be used here. ## Example -```json +```dhall { minVersion = "0.4.0.0" , sites = { default = From 149bbd08ad129a5c2e4ae59079fd5f196aaf19c7 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 14 Aug 2020 21:08:47 -0400 Subject: [PATCH 3/3] Fix tables --- guide/rfc-multi-site.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guide/rfc-multi-site.md b/guide/rfc-multi-site.md index 800e89fc8..c02109159 100644 --- a/guide/rfc-multi-site.md +++ b/guide/rfc-multi-site.md @@ -11,12 +11,14 @@ For this, we add a new config parameter `filterZettels` with the same syntax as To configure multiple sites, we modify the existing configuration format. - At the top level, we have the following fields: + |Field name|Description| |---|---| |**`minVersion`**|The minimum neuron version your site must be generated with. (optional)| |**`sites`**|A mapping of site identifier and site config.| - Each site config can have these optional parameters: + |Field name|Description| |---|---| |**`siteTitle`**|Your Neuron site's title|