diff --git a/theme.nix b/conf.nix similarity index 100% rename from theme.nix rename to conf.nix diff --git a/example/conf.nix b/example/conf.nix index 6b9a8ae..8fc2c3e 100644 --- a/example/conf.nix +++ b/example/conf.nix @@ -1,6 +1,6 @@ { # URL of the site, must be set to the url of the domain the site will be deployed - siteUrl = "http://yourdomain.com"; + siteUrl = "https://styx-static.github.io/styx-theme-orbit"; # Theme settings theme = { @@ -114,5 +114,5 @@ }; }; - + } diff --git a/example/site.nix b/example/site.nix index 7b628a4..7e0f49e 100644 --- a/example/site.nix +++ b/example/site.nix @@ -3,38 +3,16 @@ Initialization of Styx, should not be edited -----------------------------------------------------------------------------*/ - -{ lib, styx, styx-themes, runCommand, writeText -, renderDrafts ? false -, siteUrl ? null +{ lib, styx, runCommand, writeText +, styx-themes +, extraConf ? {} }@args: -let styxLib = import "${styx}/share/styx/lib" { - inherit lib; - pkgs = { inherit styx runCommand writeText; }; -}; -in with styxLib; - -let +rec { - /* Configuration loading - */ - conf = let - conf = import ./conf.nix; - themesConf = styxLib.themes.loadConf themes; - mergedConf = recursiveUpdate themesConf conf; - in - overrideConf mergedConf args; - - /* Load themes templates + /* Library loading */ - templates = styxLib.themes.loadTemplates { - inherit themes defaultEnvironment customEnvironments; - }; - - /* Load themes static files - */ - files = styxLib.themes.loadFiles themes; + styxLib = import styx.lib args; /*----------------------------------------------------------------------------- @@ -42,38 +20,37 @@ let -----------------------------------------------------------------------------*/ - /* Themes used + /* list the themes to load, paths or packages can be used + items at the end of the list have higher priority */ - themes = [ ../. ]; - - -/*----------------------------------------------------------------------------- - Template environments + themes = [ + ../. + ]; ------------------------------------------------------------------------------*/ - - /* Default template environment + /* Loading the themes data */ - defaultEnvironment = { inherit conf data templates; lib = styxLib; }; + themesData = styxLib.themes.load { + inherit styxLib themes; + templates.extraEnv = { inherit data pages; }; + conf.extra = [ (import ./conf.nix) extraConf ]; + }; - /* Custom environments for specific templates + /* Bringing the themes data to the scope */ - customEnvironments = { - }; + inherit (themesData) conf lib files templates; /*----------------------------------------------------------------------------- Data This section declares the data used by the site - the data set is included in the default template environment -----------------------------------------------------------------------------*/ - data = { + data = with lib; { # data in markdown format - experiences = sortBy "index" "asc" (styxLib.data.loadDir { dir = ./data/experiences; }); - projects = sortBy "index" "asc" (styxLib.data.loadDir { dir = ./data/projects; }); - summary = styxLib.data.loadFile { dir = ./data; file = "summary.md"; }; + experiences = sortBy "index" "asc" (loadDir { dir = ./data/experiences; }); + projects = sortBy "index" "asc" (loadDir { dir = ./data/projects; }); + summary = loadFile { dir = ./data; file = "summary.md"; }; }; @@ -85,9 +62,9 @@ let pages = { index = { - href = "index.html"; + path = "/index.html"; template = templates.index; - layout = id; + layout = lib.id; }; }; @@ -97,12 +74,14 @@ let -----------------------------------------------------------------------------*/ - pagesList = [ pages.index ]; - /*----------------------------------------------------------------------------- Site rendering -----------------------------------------------------------------------------*/ -in generateSite { inherit files pagesList; } + pagesList = [ pages.index ]; + + site = lib.generateSite { inherit files pagesList; }; + +} diff --git a/meta.nix b/meta.nix new file mode 100644 index 0000000..3e3f34a --- /dev/null +++ b/meta.nix @@ -0,0 +1,5 @@ +{ lib }: +{ + name = "orbit"; + license = lib.licenses.cc-by-30; +} diff --git a/readme.md b/readme.md index d4b2c4b..e5be838 100644 --- a/readme.md +++ b/readme.md @@ -19,3 +19,7 @@ For example, to change the title in the navigation: ## License The original template is released under the Creative Commons Attribution 3.0 License. Please keep the original attribution link when using for your own project. If you'd like to use the template without the attribution, you can check out other license options via template author's website: themes.3rdwavemedia.com + +## Preview + +![Preview](/screen.png) diff --git a/screen.png b/screen.png new file mode 100644 index 0000000..01d0f2d Binary files /dev/null and b/screen.png differ