Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Commit

Permalink
prepare to styx 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsagnes committed Jan 14, 2017
1 parent 1d41745 commit 430a2af
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 53 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions example/conf.nix
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down Expand Up @@ -114,5 +114,5 @@
};

};

}
81 changes: 30 additions & 51 deletions example/site.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,77 +3,54 @@
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;


/*-----------------------------------------------------------------------------
Themes setup
-----------------------------------------------------------------------------*/

/* 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"; };
};


Expand All @@ -85,9 +62,9 @@ let

pages = {
index = {
href = "index.html";
path = "/index.html";
template = templates.index;
layout = id;
layout = lib.id;
};
};

Expand All @@ -97,12 +74,14 @@ let
-----------------------------------------------------------------------------*/

pagesList = [ pages.index ];


/*-----------------------------------------------------------------------------
Site rendering
-----------------------------------------------------------------------------*/

in generateSite { inherit files pagesList; }
pagesList = [ pages.index ];

site = lib.generateSite { inherit files pagesList; };

}
5 changes: 5 additions & 0 deletions meta.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ lib }:
{
name = "orbit";
license = lib.licenses.cc-by-30;
}
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Binary file added screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 430a2af

Please sign in to comment.