~melchizedek6809/nujel.net

39bb61e4850866262e1d505d010fad16b7c9473b — Ben (X13/Arch) 2 years ago 857e474
Minor code refactor
4 files changed, 10 insertions(+), 14 deletions(-)

M main.nuj
M ssg/content.nuj
M ssg/deployment.nuj
M ssg/navigation.nuj
M main.nuj => main.nuj +9 -10
@@ 4,21 4,20 @@
;;; Most functionality is separated into modules that can be found under /ssg/

[import [rainbow] :ansi]
[require "ssg/context"]
[require "ssg/content"]
[require "ssg/loader"]
[require "ssg/deployment"]
[import [get :as context/get] "ssg/context"]
[import [build :as content/build add-resources] "ssg/content"]
[import [add-default :as loader/add-default] "ssg/loader"]
[import [deploy] "ssg/deployment"]
[import [load-builtin-themes] "ssg/theme"]

[defn main [args]
      :export
      [pfmtln "Welcome to the {} SSG" [rainbow "Nujel"]]
      [when [and [car args] [string? [car args]]] [cd [car args]]]
      [println [cwd]]

      [-> [ssg/context/get "./"]
          ssg/loader/add-default
      [-> [context/get "./"]
          loader/add-default
          load-builtin-themes
          ssg/content/build
          ssg/content/add-resources
          ssg/deployment/deploy]]
          content/build
          add-resources
          deploy]]

M ssg/content.nuj => ssg/content.nuj +0 -1
@@ 36,7 36,6 @@
[defn build [ctx]
      "Build everything"
      :export
      [println ctx]
      [def content-frontmatter @[]]
      [build-content ctx
                     [tree/ref ctx :content-root-dir]

M ssg/deployment.nuj => ssg/deployment.nuj +1 -1
@@ 1,5 1,5 @@
[defn deploy [ctx]
      "Deploy everything for CTX"
      :export
      [pfmtln "Deploying: {ctx}"]
      [pfmtln "Deploying!"]
      [return ctx]]

M ssg/navigation.nuj => ssg/navigation.nuj +0 -2
@@ 20,8 20,6 @@
          [when-not [tree/ref nav cur-href] [tree/set! nav cur-href @[:prev #nil :next #nil]]]
          [tree/set! [tree/ref nav cur-href] :next next-href]]
        [cdr! c]]

      [pfmtln "\n\n{:?}\n\n" nav]
      [tree/set! ctx :prev-next-nav nav]]

[defn build [ctx depth]