Compare commits
No commits in common. "9f2855c89177bfa3020bbb01fc7c684ecc3e705b" and "994b67b4f2824866fabc87be9854556eaddbfbaf" have entirely different histories.
9f2855c891
...
994b67b4f2
158
.drone.yml
158
.drone.yml
|
|
@ -15,12 +15,10 @@ steps:
|
|||
path: /drone/cache/
|
||||
commands:
|
||||
- ls -la /drone/cache/.m2
|
||||
- clj -Sdeps '{:mvn/local-repo "/drone/cache/.m2/repository" :gitlibs-dir "/drone/cache/.gitlibs"}' -P -M:blog:clojure-demos:dev:shadow-cljs-run:poly
|
||||
- clj -Sdeps '{:mvn/local-repo "/drone/cache/.m2/repository"}' -P -M:blog:clojure-demos:dev:shadow-cljs-run
|
||||
|
||||
# Detect which bases changed since the last release tag (v[0-9]*).
|
||||
# Deployables here are bases (not projects), so we use changed-bases; a change
|
||||
# to a shared component or to any file outside bases/ affects every base.
|
||||
- name: detect-changes
|
||||
# --- Blog ---
|
||||
- name: build-blog
|
||||
pull: always
|
||||
image: clojure:tools-deps
|
||||
depends_on:
|
||||
|
|
@ -30,121 +28,81 @@ steps:
|
|||
- name: cache
|
||||
path: /drone/cache/
|
||||
commands:
|
||||
- |
|
||||
clj -Sdeps '{:mvn/local-repo "/drone/cache/.m2/repository" :gitlibs-dir "/drone/cache/.gitlibs"}' -M:poly ws get:changes:changed-bases since:release out:changed-bases.json
|
||||
clj -Sdeps '{:mvn/local-repo "/drone/cache/.m2/repository" :gitlibs-dir "/drone/cache/.gitlibs"}' -M:poly ws get:changes:changed-components since:release out:changed-components.json
|
||||
clj -Sdeps '{:mvn/local-repo "/drone/cache/.m2/repository" :gitlibs-dir "/drone/cache/.gitlibs"}' -M:poly ws get:changes:changed-files since:release out:changed-files.json
|
||||
sed -e 's/\[//g' -e 's/\]//g' -e 's/[" ]//g' -e 's/,/\n/g' changed-bases.json > changed-bases.txt
|
||||
sed -e 's/\[//g' -e 's/\]//g' -e 's/[" ]//g' -e 's/,/\n/g' changed-components.json > changed-components.txt
|
||||
sed -e 's/\[//g' -e 's/\]//g' -e 's/[" ]//g' -e 's/,/\n/g' changed-files.json > changed-files.txt
|
||||
if [ -s changed-components.txt ] || grep -v '^bases/' changed-files.txt | grep -q .; then
|
||||
echo all > changed-bases.txt
|
||||
fi
|
||||
echo "changed bases: $(tr '\n' ' ' < changed-bases.txt)"
|
||||
- clj -M:blog:shadow-cljs-run release blog
|
||||
|
||||
- name: build-and-deploy-blog
|
||||
- name: deploy-blog
|
||||
pull: True
|
||||
image: appleboy/drone-scp
|
||||
depends_on:
|
||||
- build-blog
|
||||
settings:
|
||||
host: blog.digitaloctave.com
|
||||
port: 22
|
||||
username:
|
||||
from_secret: ssh_user
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
target: /var/www/new-blog/
|
||||
source: /drone/src/bases/do-blog/resources/public/*
|
||||
strip_components: 6
|
||||
|
||||
# --- Clojure Demos ---
|
||||
- name: build-clojure-demos
|
||||
pull: always
|
||||
image: clojure:tools-deps
|
||||
depends_on:
|
||||
- detect-changes
|
||||
- fetch-clojure-deps
|
||||
- fetch-npm-deps
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /drone/cache/
|
||||
environment:
|
||||
SSH_USER:
|
||||
from_secret: ssh_user
|
||||
SSH_KEY:
|
||||
from_secret: ssh_key
|
||||
commands:
|
||||
- |
|
||||
if grep -qx 'all' changed-bases.txt || grep -qx 'do-blog' changed-bases.txt; then
|
||||
echo "Building do-blog"
|
||||
clj -Sdeps '{:mvn/local-repo "/drone/cache/.m2/repository" :gitlibs-dir "/drone/cache/.gitlibs"}' -M:blog:shadow-cljs-run release blog
|
||||
echo "Deploying do-blog"
|
||||
command -v scp >/dev/null 2>&1 || { apt-get update -qq && apt-get install -y -qq openssh-client >/dev/null; }
|
||||
mkdir -p ~/.ssh && printf '%s\n' "$SSH_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
||||
scp -o StrictHostKeyChecking=no -r bases/do-blog/resources/public/* "$SSH_USER@blog.digitaloctave.com:/var/www/new-blog/"
|
||||
else
|
||||
echo "No changes affecting do-blog, skipping build and deploy"
|
||||
fi
|
||||
- clj -M:clojure-demos:shadow-cljs-run release clojure-demos
|
||||
|
||||
- name: build-and-deploy-clojure-demos
|
||||
- name: deploy-clojure-demos
|
||||
pull: True
|
||||
image: appleboy/drone-scp
|
||||
depends_on:
|
||||
- build-clojure-demos
|
||||
settings:
|
||||
host: clojure-demos.digitaloctave.com
|
||||
port: 22
|
||||
username:
|
||||
from_secret: ssh_user
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
target: /var/www/clojure-demos/
|
||||
source: /drone/src/bases/clojure-demos/resources/public/*
|
||||
strip_components: 6
|
||||
|
||||
# --- Portfolio ---
|
||||
- name: build-portfolio
|
||||
pull: always
|
||||
image: clojure:tools-deps
|
||||
depends_on:
|
||||
- build-and-deploy-blog
|
||||
- fetch-clojure-deps
|
||||
- fetch-npm-deps
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /drone/cache/
|
||||
environment:
|
||||
SSH_USER:
|
||||
from_secret: ssh_user
|
||||
SSH_KEY:
|
||||
from_secret: ssh_key
|
||||
commands:
|
||||
- |
|
||||
if grep -qx 'all' changed-bases.txt || grep -qx 'clojure-demos' changed-bases.txt; then
|
||||
echo "Building clojure-demos"
|
||||
clj -Sdeps '{:mvn/local-repo "/drone/cache/.m2/repository" :gitlibs-dir "/drone/cache/.gitlibs"}' -M:clojure-demos:shadow-cljs-run release clojure-demos
|
||||
echo "Deploying clojure-demos"
|
||||
command -v scp >/dev/null 2>&1 || { apt-get update -qq && apt-get install -y -qq openssh-client >/dev/null; }
|
||||
mkdir -p ~/.ssh && printf '%s\n' "$SSH_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
||||
scp -o StrictHostKeyChecking=no -r bases/clojure-demos/resources/public/* "$SSH_USER@clojure-demos.digitaloctave.com:/var/www/clojure-demos/"
|
||||
else
|
||||
echo "No changes affecting clojure-demos, skipping build and deploy"
|
||||
fi
|
||||
- clj -M:dev:shadow-cljs-run release ui
|
||||
|
||||
- name: build-and-deploy-portfolio
|
||||
pull: always
|
||||
image: clojure:tools-deps
|
||||
- name: deploy-portfolio
|
||||
pull: True
|
||||
image: appleboy/drone-scp
|
||||
depends_on:
|
||||
- build-and-deploy-clojure-demos
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /drone/cache/
|
||||
environment:
|
||||
SSH_USER:
|
||||
- build-portfolio
|
||||
settings:
|
||||
host: digitaloctave.com
|
||||
port: 22
|
||||
username:
|
||||
from_secret: ssh_user
|
||||
SSH_KEY:
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
commands:
|
||||
- |
|
||||
if grep -qx 'all' changed-bases.txt || grep -qx 'portfolio' changed-bases.txt; then
|
||||
echo "Building portfolio"
|
||||
clj -Sdeps '{:mvn/local-repo "/drone/cache/.m2/repository" :gitlibs-dir "/drone/cache/.gitlibs"}' -M:dev:shadow-cljs-run release ui
|
||||
echo "Deploying portfolio"
|
||||
command -v scp >/dev/null 2>&1 || { apt-get update -qq && apt-get install -y -qq openssh-client >/dev/null; }
|
||||
mkdir -p ~/.ssh && printf '%s\n' "$SSH_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
||||
scp -o StrictHostKeyChecking=no -r development/resources/public/* "$SSH_USER@digitaloctave.com:/var/www/portfolio/"
|
||||
else
|
||||
echo "No changes affecting portfolio, skipping build and deploy"
|
||||
fi
|
||||
|
||||
# Tag a new release so the next build only builds changes since this tag.
|
||||
# Only runs on push events (never on the tag event it creates, avoiding a loop).
|
||||
- name: tag-release
|
||||
pull: always
|
||||
image: clojure:tools-deps
|
||||
depends_on:
|
||||
- build-and-deploy-portfolio
|
||||
when:
|
||||
event: [push]
|
||||
commands:
|
||||
- |
|
||||
if [ ! -s changed-bases.txt ]; then
|
||||
echo "Nothing changed, skipping release tag"
|
||||
exit 0
|
||||
fi
|
||||
git config user.email "ci@drone.local"
|
||||
git config user.name "Drone CI"
|
||||
if [ -n "$DRONE_NETRC_MACHINE" ]; then
|
||||
printf 'machine %s login %s password %s\n' "$DRONE_NETRC_MACHINE" "$DRONE_NETRC_USERNAME" "$DRONE_NETRC_PASSWORD" > ~/.netrc
|
||||
chmod 600 ~/.netrc
|
||||
fi
|
||||
VERSION=$(( $(git tag -l 'v[0-9]*' | wc -l) + 1 ))
|
||||
echo "Tagging release v$VERSION"
|
||||
git tag -a "v$VERSION" -m "[skip ci] Release v$VERSION"
|
||||
git push origin "v$VERSION"
|
||||
target: /var/www/portfolio/
|
||||
source: /drone/src/development/resources/public/*
|
||||
strip_components: 5
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
|
|
|
|||
|
|
@ -26,13 +26,6 @@
|
|||
artifacts
|
||||
projects/**/pom.xml
|
||||
|
||||
# do-blog static pages (generated by com.oly.static-sites.do-blog.ssr)
|
||||
/bases/do-blog/resources/public/index.html
|
||||
/bases/do-blog/resources/public/about/
|
||||
/bases/do-blog/resources/public/archive/
|
||||
/bases/do-blog/resources/public/chess/
|
||||
/bases/do-blog/resources/public/posts/
|
||||
|
||||
# nrepl
|
||||
.nrepl-port
|
||||
|
||||
|
|
|
|||
|
|
@ -271,42 +271,7 @@
|
|||
|
||||
|
||||
(defn grouped-lists-page [data]
|
||||
(ui/grouped-articles-list {:title "Clojure on the JVM"
|
||||
:groups
|
||||
[{:title "Clojure on the JVM"
|
||||
:articles [{:title "Clojure"
|
||||
:description "The original language running on the jvm with access to the java eco system"
|
||||
:icon-image "https://clojure.org/images/clojure-logo-120b.png"
|
||||
:page "clojure-basics"}
|
||||
{:title "Clojurescript"
|
||||
:description "Clojure running in the browser or on top of node, with access to the js eco system."
|
||||
:icon-image "https://clojurescript.org/images/cljs-logo-60b.png"
|
||||
:page "clojurescript-basics"}
|
||||
{:title "ClojureCLR"
|
||||
:description "Clojure running on microsofts CLR with access to .net ecosystem"
|
||||
:icon-image "https://clojure.org/images/clojure-logo-120b.png"
|
||||
:page "clojureclr-basics"}
|
||||
{:title "ClojureDart"
|
||||
:description "Clojure for dart, use clojure to build apps using flutter"
|
||||
:page "clojuredart-info"}]}
|
||||
{:title "Clojure for GO Lang"
|
||||
:articles [ {:title "Let GO"
|
||||
:description "Clojure for go, use clojure to build apps using go runtime"
|
||||
:page "clojureletgo-info"}]}
|
||||
{:title "Clojure for python"
|
||||
:articles [ {:title "Let GO"
|
||||
:description "Clojure for go, use clojure to build apps using go runtime"
|
||||
:page "clojureletgo-info"}]}
|
||||
{:title "Clojure native"
|
||||
:articles [ {:title "Ferret"
|
||||
:description "Clojure for go, use clojure to build apps using go runtime"
|
||||
:page "clojureletgo-info"}]}
|
||||
|
||||
]}
|
||||
)
|
||||
|
||||
|
||||
#_[articles
|
||||
[articles
|
||||
{:title (-> data :title)
|
||||
:body (-> data :intro)
|
||||
:articles
|
||||
|
|
|
|||
|
|
@ -1,22 +1,6 @@
|
|||
(ns com.oly.static-sites.clojure-demos.routes
|
||||
(:require [spec-tools.data-spec :as ds]))
|
||||
|
||||
{:title "Clojure Demos"
|
||||
:groups [{:title "Dialects & Interop"
|
||||
:articles [{:title "Clojure"
|
||||
:description "The original language running on the jvm with access to the java eco system"
|
||||
:img-src "https://clojure.org/images/clojure-logo-120b.png"}
|
||||
{:title "Clojurescript"
|
||||
:description "Clojure running in the browser or on top of node, with access to the js eco system."
|
||||
:img-src "https://clojurescript.org/images/cljs-logo-60b.png"}]}
|
||||
{:title "DSL's"
|
||||
:articles [{:title "Hiccup HTML Demo"
|
||||
:description "Hiccup is a DSL for generating HTML it uses data structures over strings to generate html"
|
||||
:icon-image "https://miro.medium.com/max/1400/1*CEYFj5R57UFyCXts2nsBqA.png"}
|
||||
{:title "Honey SQL Demo"
|
||||
:description "Similar to honey but for SQL allows you to split apart your complex queries into parts and compose them together."
|
||||
:icon-image "https://miro.medium.com/max/1400/1*CEYFj5R57UFyCXts2nsBqA.png"}]}]}
|
||||
|
||||
|
||||
;; put constant data here
|
||||
(def site-data
|
||||
|
|
@ -26,27 +10,26 @@
|
|||
:pages {:dialects {:title "Dialects & Interop"
|
||||
:intro "Clojure has the ability to run on multiple technology stacks, this allows code reuse and consistency regardless of which eco system you want to make use of."
|
||||
:key :dialects
|
||||
:demos [{:title "CLojure"
|
||||
:articles [{:title "Clojure"
|
||||
:description "The original language running on the jvm with access to the java eco system"
|
||||
:icon-image "https://clojure.org/images/clojure-logo-120b.png"
|
||||
:page "clojure-basics"}
|
||||
{:title "Clojurescript"
|
||||
:description "Clojure running in the browser or on top of node, with access to the js eco system."
|
||||
:icon-image "https://clojurescript.org/images/cljs-logo-60b.png"
|
||||
:page "clojurescript-basics"}
|
||||
{:title "ClojureCLR"
|
||||
:description "Clojure running on microsofts CLR with access to .net ecosystem"
|
||||
:icon-image "https://clojure.org/images/clojure-logo-120b.png"
|
||||
:page "clojureclr-basics"}
|
||||
{:title "ClojureDart"
|
||||
:description "Clojure for dart, use clojure to build apps using flutter"
|
||||
:page "clojuredart-info"}
|
||||
{:title "Let GO"
|
||||
:description "Clojure for go, use clojure to build apps using go runtime"
|
||||
:page "clojureletgo-info"}
|
||||
:demos [{:title "Clojure"
|
||||
:description "The original language running on the jvm with access to the java eco system"
|
||||
:icon-image "https://clojure.org/images/clojure-logo-120b.png"
|
||||
:page "clojure-basics"}
|
||||
{:title "Clojurescript"
|
||||
:description "Clojure running in the browser or on top of node, with access to the js eco system."
|
||||
:icon-image "https://clojurescript.org/images/cljs-logo-60b.png"
|
||||
:page "clojurescript-basics"}
|
||||
{:title "ClojureCLR"
|
||||
:description "Clojure running on microsofts CLR with access to .net ecosystem"
|
||||
:icon-image "https://clojure.org/images/clojure-logo-120b.png"
|
||||
:page "clojureclr-basics"}
|
||||
{:title "ClojureDart"
|
||||
:description "Clojure for dart, use clojure to build apps using flutter"
|
||||
:page "clojuredart-info"}
|
||||
{:title "LetGO"
|
||||
:description "Clojure for go, use clojure to build apps using go runtime"
|
||||
:page "clojureletgo-info"}
|
||||
|
||||
]}]
|
||||
]
|
||||
|
||||
}
|
||||
:dsl {:title "DSL's"
|
||||
|
|
@ -142,7 +125,7 @@
|
|||
|
||||
["/dialects/"
|
||||
{:name :dialects
|
||||
:view :grouped-lists}]
|
||||
:view :list}]
|
||||
|
||||
["/examples/"
|
||||
{:name :examples
|
||||
|
|
|
|||
|
|
@ -3,13 +3,15 @@
|
|||
org.clojure/core.async {:mvn/version "1.6.673"}
|
||||
org.clojure/clojurescript {:mvn/version "1.11.60"}
|
||||
|
||||
no.cjohansen/replicant {:mvn/version "2026.07.1"}
|
||||
reagent/reagent {:mvn/version "1.1.1"}
|
||||
tick/tick {:mvn/version "0.5.0"}
|
||||
metosin/reitit {:mvn/version "0.5.18"}
|
||||
|
||||
cljs-ajax/cljs-ajax {:mvn/version "0.8.4"}
|
||||
|
||||
datascript/datascript {:mvn/version "1.4.0"}
|
||||
olymk2/tachyon-reagent {:git/url "https://gitlab.com/olymk2/tachyon-reagent.git"
|
||||
:sha "e422af7b41266f7bc90ab78a24fb93f32be61385"}
|
||||
olymk2/cl-eorg {:git/url "https://gitlab.com/olymk2/cl-org.git"
|
||||
:sha "13e57f11da75516844922fe28bfd6aa7692b7c34"}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
#+TITLE: Chocolate melt pudding
|
||||
#+DATE: 2025-10-31 12:00:00 UTC
|
||||
#+HTML_DOCTYPE: <!DOCTYPE html>
|
||||
#+DESCRIPTION: puddings
|
||||
#+FILETAGS: recipe:puddings
|
||||
#+CATEGORY: recipe
|
||||
#+SLUG: chocolate-melt-pudding
|
||||
|
||||
|
||||
* Info
|
||||
Serves 4
|
||||
|
||||
* Ingredients
|
||||
- 110g (4 oz) pudding rice
|
||||
- 25g (1 oz) granulated sugar
|
||||
- 25g (1 oz) margarine or butter
|
||||
- 12L (2 pt) milk
|
||||
- ground cinnamon, nutmeg or vanilla extract (optional)
|
||||
* Instructions
|
||||
1. Use some of the butter to grease the bowl of the slow cooker.
|
||||
2. Add milk, rice, sugar and remaining butter and either ground cinnamon, nutmeg or vanilla extract.
|
||||
3. Give the contents a stir and replace the lid.
|
||||
4. Turn the slow cooker onto high and cook for 3-4 hours or until the rice as absorbed the liquid.
|
||||
5. Stir around halfway through.
|
||||
|
|
@ -7,9 +7,6 @@
|
|||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css" />
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.12.0/css/tachyons.min.css" />
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<style type="text/css">
|
||||
.font { font-family: "Roboto Slab", serif !important; }
|
||||
</style>
|
||||
<style type="text/css" media="screen">
|
||||
#loading {
|
||||
-webkit-animation: rotation 2s infinite linear;
|
||||
|
|
@ -28,9 +25,7 @@
|
|||
</head>
|
||||
|
||||
<body class="ma0 pa0 h-100">
|
||||
<!-- Everything between the app markers is replaced by the static generator
|
||||
(com.oly.static-sites.do-blog.ssr). -->
|
||||
<div id="app" class="ma0 pa0 h-100"><!--app-->
|
||||
<div id="app" class="ma0 pa0 h-100">
|
||||
<section id="startup" class="h-100">
|
||||
<noscript>
|
||||
You need to enable JavaScript to run this app.
|
||||
|
|
@ -43,7 +38,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!--/app--></div>
|
||||
</div>
|
||||
<script src="/js/base.js" type="text/javascript"></script>
|
||||
<script src="/js/app.js" type="text/javascript"></script>
|
||||
</body>
|
||||
|
|
@ -1,83 +1,253 @@
|
|||
(ns com.oly.static-sites.do-blog.core
|
||||
(:require [ajax.core :refer [GET text-response-format]]
|
||||
[com.oly.static-sites.do-blog.theme :refer [tachyon-theme]]
|
||||
[cl-eorg.html :refer [org->to-hiccup]]
|
||||
[cl-eorg.parser :as parser]
|
||||
[cljs.reader :as reader]
|
||||
[clojure.walk :as walk]
|
||||
[replicant.dom :as r]
|
||||
[datascript.core :as d]
|
||||
[clojure.string :as str]
|
||||
[reagent.core :as r]
|
||||
[reagent.dom :as dom]
|
||||
[reitit.frontend :as rf]
|
||||
[reitit.frontend.easy :as rfe]
|
||||
[com.oly.static-sites.do-blog.routes :refer [router normalize-match]]
|
||||
[com.oly.static-sites.do-blog.views :as views]
|
||||
[tachyons.cards :refer [profile-card]]
|
||||
[clojure.core.async :refer [<! >! chan go]]
|
||||
[tick.core :as t]
|
||||
[tick.timezone]
|
||||
[tick.locale-en-us]
|
||||
;; [cljsjs.js-joda-timezone]
|
||||
;; [henryw374.js-joda-locale_en-us]
|
||||
[com.oly.static-sites.do-blog.pages.components.core :refer [ui-tags title-text-image article-list-author-media-flipped]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.database
|
||||
:refer [state load-index! latest-article org->document]]
|
||||
[com.oly.static-sites.do-blog.pages.chess-board :as chess]
|
||||
[com.oly.static-sites.do-blog.pages.chess.state :as chess-state]
|
||||
[com.oly.static-sites.do-blog.pages.chess.vstate :as viking-state])
|
||||
(:require-macros [cl-eorg.macros :refer [org-doc->move-process]]))
|
||||
:refer [state document conn schema latest-article search-articles]]
|
||||
;; [com.oly.static-sites.ui-hiccup.interface :refer [board square]]
|
||||
;; [com.oly.static-sites.do-blog.pages.chess.render :refer [draw-board]]
|
||||
;; [com.oly.static-sites.do-blog.pages.chess.state :refer [start-state]]
|
||||
[com.oly.static-sites.do-blog.pages.home :refer [home-page]]
|
||||
[com.oly.static-sites.do-blog.pages.article :refer [article-page]]
|
||||
[com.oly.static-sites.do-blog.pages.archive :refer [archive-page]]
|
||||
[com.oly.static-sites.do-blog.pages.chess-board :refer [chess-page]]
|
||||
[com.oly.static-sites.do-blog.pages.about :refer [about-page]])
|
||||
(:require-macros [cl-eorg.macros :refer [org-doc->move-process inline-filelist-map]]))
|
||||
|
||||
|
||||
;(set! js/JSJoda (.use js/JSJoda js/JSJodaLocale))
|
||||
|
||||
(inline-filelist-map "bases/do-blog/resources/documents/")
|
||||
|
||||
;; Copy org documents into public/ and write org-meta-index.edn at compile time.
|
||||
(org-doc->move-process
|
||||
"bases/do-blog/resources/documents/"
|
||||
"bases/do-blog/resources/public/documents/")
|
||||
|
||||
;; Rendering
|
||||
(d/listen!
|
||||
conn
|
||||
(fn [tx-report]
|
||||
;; Only update if data was modified
|
||||
(when (:tx-data tx-report)
|
||||
(swap! state update :new-data inc))))
|
||||
|
||||
(defn render! []
|
||||
;; Nothing to render until the first route has resolved; until then the
|
||||
;; static (server generated) HTML stays in place.
|
||||
(when (:route @state)
|
||||
(r/render (js/document.getElementById "app") (views/app @state))))
|
||||
(defn convert-date [text]
|
||||
(when text
|
||||
(let [parts (-> text
|
||||
clojure.string/trim
|
||||
(clojure.string/split #" "))]
|
||||
(-> (t/date (first parts))))))
|
||||
|
||||
;; Event handling for data driven handlers, e.g. [[:search/set-terms :event.target/value]]
|
||||
|
||||
(defn interpolate [event actions]
|
||||
(walk/postwalk
|
||||
(fn [x]
|
||||
(case x
|
||||
:event.target/value (.. event -target -value)
|
||||
x))
|
||||
actions))
|
||||
(defn href
|
||||
"Build up path to document"
|
||||
[doc]
|
||||
(str (rfe/href :posts {:path ""}) (:relative-path doc)))
|
||||
|
||||
(defn handle-action [[action & args]]
|
||||
(case action
|
||||
:search/set-terms (swap! state assoc-in [:search :terms] (first args))
|
||||
(js/console.warn "Unknown action" (pr-str action))))
|
||||
(defn fetch-document-cb [doc callback]
|
||||
(GET (str "/documents/" doc)
|
||||
{:response-format (text-response-format)
|
||||
:handler callback}))
|
||||
|
||||
(defn dispatch [{:replicant/keys [dom-event]} actions]
|
||||
(run! handle-action (interpolate dom-event actions)))
|
||||
(defn org-dsl-render
|
||||
"Render and store parsed documents"
|
||||
[doc]
|
||||
(swap! state assoc-in [:document :body] (parser/parse doc))
|
||||
(swap! state assoc-in [:document :hiccup] (into [:div] (vec (rest (org->to-hiccup tachyon-theme (-> @state :document :body))))))
|
||||
(swap! state assoc-in [:document :details] (parser/filter-root-nodes [] (-> @state :document :body))))
|
||||
|
||||
;; Navigation
|
||||
(defn render-doc-from-path [path]
|
||||
(if path
|
||||
(let [comm (r/atom (chan))]
|
||||
(fetch-document-cb path #(go (>! @comm %)))
|
||||
(go (reset! document (<! @comm))
|
||||
(swap! state assoc :search {:terms nil :results []})
|
||||
(org-dsl-render @document)))
|
||||
(prn (str "render from path nothing found ") path)))
|
||||
|
||||
(defn fetch-text [path on-success]
|
||||
(GET path {:response-format (text-response-format)
|
||||
:handler on-success
|
||||
:error-handler #(js/console.error "Failed to fetch" path (clj->js %))}))
|
||||
|
||||
(defn show-route! [match & {:as extra}]
|
||||
(swap! state merge {:route match :search {:terms ""}} extra))
|
||||
(def router
|
||||
(rf/router
|
||||
[["/"
|
||||
{:name :homepage
|
||||
:init 'switch-to-latest
|
||||
:view #'home-page}]
|
||||
["/archive/{*tag}"
|
||||
{:name :archive
|
||||
:view #'archive-page}]
|
||||
["/tags/{*path}"
|
||||
{:name :tags
|
||||
:view 'post
|
||||
:parameters {:path string?}}]
|
||||
["/chess"
|
||||
{:name :chess
|
||||
:view #'chess-page}]
|
||||
["/about"
|
||||
{:name :about
|
||||
:view #'about-page}]
|
||||
#_["/book/{*path}"
|
||||
{:name :book
|
||||
:view 'book
|
||||
:parameters {:path string?}}]
|
||||
["/posts/{*path}"
|
||||
{:name :posts
|
||||
:view #'article-page
|
||||
:state render-doc-from-path
|
||||
:parameters {:path string?}}]]))
|
||||
|
||||
(defn show-document! [match relative-path]
|
||||
(if relative-path
|
||||
(fetch-text (str "/documents/" relative-path)
|
||||
#(show-route! match :document (org->document %)))
|
||||
(js/console.warn "No document found for" (pr-str (:path match)))))
|
||||
(defn switch-to-latest
|
||||
[path-params]
|
||||
(-> (latest-article)
|
||||
(render-doc-from-path)))
|
||||
|
||||
(defn on-navigate [raw-match]
|
||||
(when-let [match (normalize-match raw-match)]
|
||||
(case (-> match :data :name)
|
||||
:homepage (show-document! match (latest-article))
|
||||
:posts (show-document! match (-> match :path-params :path))
|
||||
:chess (do (chess/start! match)
|
||||
(show-route! match))
|
||||
(show-route! match))))
|
||||
(defn select-initial-page
|
||||
[path-params]
|
||||
(if path-params
|
||||
(render-doc-from-path path-params)
|
||||
(-> (latest-article)
|
||||
(render-doc-from-path))))
|
||||
|
||||
(defn ^:dev/after-load reload! []
|
||||
(render!))
|
||||
(defn ui-search [search]
|
||||
[:div
|
||||
[:input.w-100.center.input-reset.ba.b--black-20.pa2.mb2
|
||||
{:type "text"
|
||||
:placeholder "Search"
|
||||
:on-change (fn [evt]
|
||||
(swap! state assoc :search {:active true})
|
||||
(swap! state assoc :search {:terms (-> evt .-target .-value)}))}]])
|
||||
|
||||
(defn ui-sidebar [{:keys [sidebar body]}]
|
||||
(let [search (r/atom "")]
|
||||
(fn [{:keys [sidebar body]}]
|
||||
[:div.h-100.flex.items-stretch
|
||||
[:div.dn.db-l.pa3.bg-blue {:style {:flex-basis "20rem" :flex-grow "1"}} sidebar]
|
||||
[:div.ma3.pa3 {:style {:flex-basis "0" :flex-grow "999"}}
|
||||
[ui-search search]
|
||||
body]])))
|
||||
|
||||
#_(defn ui-tags [meta]
|
||||
[:div (map-indexed
|
||||
(fn [idx tag]
|
||||
[:span.mr2 {:key idx}
|
||||
[pill-grow
|
||||
{:href (rfe/href :archive {:tag tag})
|
||||
:text tag}]])
|
||||
(-> meta :filetags extract-tags))])
|
||||
|
||||
#_(defn title-text-image [{:keys [title content] :as optional} tags]
|
||||
[:article.lh-copy.f4.mt-0
|
||||
[:h1.f2 title]
|
||||
(when tags
|
||||
[ui-tags tags])
|
||||
(when (:img-src optional)
|
||||
[:img.w-100.f5.measure {:src (:img-src optional) :alt (:img-alt optional)}])
|
||||
content])
|
||||
|
||||
(defn layout [content]
|
||||
(let [search (r/cursor state [:search :terms])
|
||||
active-search (r/cursor state [:search :active])
|
||||
org-index (r/cursor state [:index])]
|
||||
(fn [content]
|
||||
|
||||
[:<>
|
||||
[:link {:rel "stylesheet" :href "https://unpkg.com/tachyons@4.12.0/css/tachyons.min.css"}]
|
||||
[:link {:rel "stylesheet" :href "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/fontawesome.min.css"}]
|
||||
[:style
|
||||
".font{font-family: \"Roboto Slab\",serif !important;}"
|
||||
".r90{transition: all 3s; transform-style: preserve-3d; transform-origin: top left; transform: rotate3d(0,1,0,180deg); backface-visibility: visible;}
|
||||
|
||||
|
||||
.r180-back{transition: all 3s; transform-style: preserve-3d; transform-origin: top left; transform: rotate3d(0,1,0,180deg); backface-visibility: visible;}
|
||||
.r180-front{transition: all 3s; transform-style: preserve-3d; transform-origin: top left; transform: rotate3d(0,1,0,180deg); backface-visibility: hidden;}
|
||||
.r0{transition: all 3s; transform-style: preserve-3d; transform-origin: top left; transform: rotate3d(0,1,0,0deg); backface-visibility: visible;}"]
|
||||
[:div.font.h-100
|
||||
[ui-sidebar
|
||||
{:body [:div (when (true? @active-search)
|
||||
[article-list-author-media-flipped
|
||||
"Articles"
|
||||
(search-articles {:search @search})])
|
||||
content
|
||||
]
|
||||
:sidebar [:div
|
||||
[profile-card {:name "Oly" :tagline "Earthling, Software Engineer" :img-src "/images/default/me.png"}]
|
||||
[:ul.list.pl0.measure.center
|
||||
[:li.lh-copy.pv3.b--black-30.ba.bt-0.bl-0.br-0
|
||||
[:a.black.f3.link.hover-green
|
||||
{:href (rfe/href :homepage)} "Home"]]
|
||||
[:li.lh-copy.pv3.b--black-30.ba.bt-0.bl-0.br-0
|
||||
[:a.black.f3.link.hover-green
|
||||
{:href (rfe/href :archive {:tag ""})} "Past articles"]]
|
||||
[:li.lh-copy.pv3.b--black-30.ba.bt-0.bl-0.br-0
|
||||
[:a.black.f3.link.hover-green
|
||||
{:href (rfe/href :chess)} "Chess"]]
|
||||
[:li.lh-copy.pv3.b--black-30.ba.bt-0.bl-0.br-0
|
||||
[:a.black.f3.link.hover-green
|
||||
{:href (rfe/href :about)} "About"]]
|
||||
#_[:li.lh-copy.pv3.b--black-30.ba.bt-0.bl-0.br-0
|
||||
[:a.black.f3.link.hover-green
|
||||
{:href (rfe/href :book {:path ""})} "Book test"]]]]}]]])))
|
||||
|
||||
(defn ^:dev/after-load reagent-render [hiccup]
|
||||
(swap! state update :refresh inc)
|
||||
(dom/render [hiccup] (js/document.getElementById "app")))
|
||||
|
||||
|
||||
(defn render-page []
|
||||
(let [current-page (r/cursor state [:current-route])
|
||||
update (r/cursor state [:refresh])]
|
||||
;; load in the latest document
|
||||
(fn []
|
||||
@update
|
||||
(swap! state assoc :search {:active false})
|
||||
(when (-> @current-page :data :init)
|
||||
((-> @current-page :data :init) nil)
|
||||
((-> @current-page :data :init) (-> @current-page :parameters :path :path)))
|
||||
(when (-> @current-page :data :state)
|
||||
((-> @current-page :data :state) (-> @current-page :parameters :path :path)))
|
||||
[layout [(-> @current-page :data :view) (-> @current-page)]])))
|
||||
|
||||
(defn init []
|
||||
(r/set-dispatch! dispatch)
|
||||
(add-watch state ::render (fn [_ _ _ _] (render!)))
|
||||
(add-watch chess-state/game-state ::render (fn [_ _ _ _] (render!)))
|
||||
(add-watch viking-state/game-state ::render (fn [_ _ _ _] (render!)))
|
||||
(fetch-text "/documents/org-meta-index.edn"
|
||||
(fn [response]
|
||||
(load-index! (reader/read-string response))
|
||||
(rfe/start! router on-navigate {:use-fragment false}))))
|
||||
(rfe/start!
|
||||
router
|
||||
(fn [m]
|
||||
(prn m)
|
||||
(swap! state assoc
|
||||
:current-route m)
|
||||
(switch-to-latest (-> @state :current-route :parameters :path :path))
|
||||
)
|
||||
{:use-fragment false})
|
||||
|
||||
(GET "/documents/org-meta-index.edn"
|
||||
{:handler (fn [response]
|
||||
(->> (reader/read-string response)
|
||||
;; filter out missing dates
|
||||
(filter (fn [doc] (some? (:date doc))))
|
||||
(mapv #(assoc % :tags (into [] (:filetags %))))
|
||||
(mapv #(assoc % :date (convert-date (:date %))))
|
||||
(swap! state assoc :index))
|
||||
(d/reset-conn! conn (d/empty-db schema))
|
||||
(d/transact! conn (:index @state))
|
||||
(select-initial-page (-> @state :current-route :parameters :path :path)))})
|
||||
(reagent-render render-page))
|
||||
|
||||
;;(comment )
|
||||
;; (-> @state :document)
|
||||
;; (latest-article)
|
||||
|
||||
; (switch-to-latest)
|
||||
;; (org->to-hiccup tachyon-theme (-> @state :document :body))
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.about)
|
||||
|
||||
(defn about-page [_state]
|
||||
[:div "hi2"])
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.about)
|
||||
|
||||
(defn about-page [{:keys [path-params] :as route}]
|
||||
(fn [{:keys [path-params] :as route}]
|
||||
[:div "hi2"]))
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.archive
|
||||
(:require [com.oly.static-sites.do-blog.routes :refer [post-href]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [format-date]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.database :refer [search-articles]]
|
||||
[com.oly.static-sites.do-blog.pages.components.core :refer [definition-list]]))
|
||||
|
||||
(defn archive-page [{:keys [route search]}]
|
||||
(let [articles (search-articles (merge {:search (:terms search)}
|
||||
(:path-params route)))]
|
||||
[:div
|
||||
[:h1 "Past articles"]
|
||||
(definition-list
|
||||
{:list
|
||||
(for [doc articles]
|
||||
{:text [:div
|
||||
[:a.f4.lh-copy {:href (post-href (:relative-path doc))}
|
||||
(str (format-date (:date doc)) " " (:title doc))]]})})]))
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.archive
|
||||
(:require [reagent.core :as r]
|
||||
[reitit.frontend.easy :as rfe]
|
||||
[tachyons.definition-lists :refer [simple]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [format-date]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.database :refer [search-articles state]]))
|
||||
|
||||
(defn archive-page [{:keys [path-params] :as route}]
|
||||
(let [search (r/cursor state [:search :terms])
|
||||
org-index (r/reaction (search-articles (merge {:search @search} path-params)))]
|
||||
(fn [{:keys [path-params] :as route}]
|
||||
[:div {:key "search"}
|
||||
[:h1 "Past articles"]
|
||||
[simple
|
||||
{:list
|
||||
(map-indexed (fn [idx doc]
|
||||
{:text [:div [:a.f4.lh-copy {:href (str (rfe/href :posts {:path ""}) (:relative-path doc))
|
||||
:key idx}
|
||||
(str (format-date (:date doc))
|
||||
#_(convert-date (:date doc)) " " (:title doc))]]})
|
||||
@org-index)}]])))
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.article
|
||||
(:require [com.oly.static-sites.do-blog.pages.components.core :refer [title-text-image]]))
|
||||
|
||||
(defn article-page [{:keys [document]}]
|
||||
(title-text-image
|
||||
{:title (-> document :details :title)
|
||||
:content (-> document :hiccup)}
|
||||
(-> document :details)))
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.article
|
||||
(:require [reagent.core :as r]
|
||||
[reitit.frontend.easy :as rfe]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [format-date]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.database :refer [search-articles state]]
|
||||
[com.oly.static-sites.do-blog.pages.components.core :refer [ui-tags title-text-image article-list-author-media-flipped]]))
|
||||
|
||||
|
||||
(defn article-page [{:keys [path-params] :as route}]
|
||||
(let [document (r/cursor state [:document])]
|
||||
(fn [{:keys [path-params] :as route}]
|
||||
[:<>
|
||||
[title-text-image
|
||||
{:title (-> @document :details :title)
|
||||
:content (-> @document :hiccup)}
|
||||
(-> @document :details)]])))
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.chess.state)
|
||||
(ns com.oly.static-sites.do-blog.pages.chess.state
|
||||
(:require [reagent.core :as r]))
|
||||
|
||||
(def white-circle "○ ")
|
||||
(def white-square "⬜")
|
||||
|
|
@ -32,7 +33,7 @@
|
|||
;(def alternate-color (alternate-black-white))
|
||||
(def board {:tile-size [8 8]})
|
||||
(defonce game-state
|
||||
(atom {:player-one {}
|
||||
(r/atom {:player-one {}
|
||||
:player-two {}
|
||||
:board []}))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.chess.vstate)
|
||||
(ns com.oly.static-sites.do-blog.pages.chess.vstate
|
||||
(:require [reagent.core :as r]))
|
||||
|
||||
|
||||
(def black-viking-rook "♜")
|
||||
(def black-viking-king "♚")
|
||||
|
||||
(defonce game-state
|
||||
(atom {:player-one {}
|
||||
(r/atom {:player-one {}
|
||||
:player-two {}
|
||||
:board []}))
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
[com.oly.static-sites.do-blog.pages.chess.state
|
||||
:refer [find-piece game-state start-state translate-char->piece]]
|
||||
[com.oly.static-sites.do-blog.pages.chess.vstate :as v]
|
||||
[com.oly.static-sites.do-blog.views :as views]
|
||||
[com.oly.static-sites.ui-hiccup.interface :refer [board]]))
|
||||
|
||||
;;/addwidget https://blog-test.digitaloctave.com/chess?widgetId=dochess
|
||||
|
|
@ -182,36 +181,30 @@
|
|||
(enhance-board click-square)
|
||||
(place-pieces-on-board start-state click-square))}))
|
||||
|
||||
(defn start!
|
||||
"Reset the boards when navigating to the chess page."
|
||||
[{:keys [query-params]}]
|
||||
(defn chess-page [{:keys [path-params query-params] :as route}]
|
||||
(if (:pieces query-params)
|
||||
(chess-board-setup (chars->map (:pieces query-params)))
|
||||
(chess-board-setup start-state)))
|
||||
(chess-board-setup start-state))
|
||||
(fn [{:keys [path-params] :as route}]
|
||||
[:div
|
||||
(let [[pos piece] (get-selected-square game-state)]
|
||||
[:div
|
||||
[:div (str @widget)]
|
||||
[:div (if (-> @game-state :player-one :selected)
|
||||
"Whites turn"
|
||||
"Black turn")]
|
||||
[:div "Player one " (str (mapv :type (-> @game-state :player-one :pieces)))]
|
||||
[:div "Player two " (str (mapv :type (-> @game-state :player-two :pieces)))]
|
||||
[:div (str "pos = " pos)]
|
||||
[:div (str (:type piece))]
|
||||
[:div (str piece)]
|
||||
[:div (str "move = " (fetch-selected-piece-moves
|
||||
[pos piece]
|
||||
(-> @game-state :board)))]])
|
||||
|
||||
(defn chess-page [_state]
|
||||
[:div
|
||||
(let [[pos piece] (get-selected-square game-state)]
|
||||
[:div
|
||||
[:div (str @widget)]
|
||||
[:div (if (-> @game-state :player-one :selected)
|
||||
"Whites turn"
|
||||
"Black turn")]
|
||||
[:div "Player one " (str (mapv :type (-> @game-state :player-one :pieces)))]
|
||||
[:div "Player two " (str (mapv :type (-> @game-state :player-two :pieces)))]
|
||||
[:div (str "pos = " pos)]
|
||||
[:div (str (:type piece))]
|
||||
[:div (str piece)]
|
||||
[:div (str "move = " (fetch-selected-piece-moves
|
||||
[pos piece]
|
||||
(-> @game-state :board)))]])
|
||||
|
||||
[:div (board 8 (-> @game-state :board))]
|
||||
[:div "Viking chess board"]
|
||||
[:div (board 11 (-> @v/game-state :board))]])
|
||||
|
||||
(defmethod views/page :chess [state]
|
||||
(chess-page state))
|
||||
[:div (board 8 (-> @game-state :board))]
|
||||
[:div "Viking chess board"]
|
||||
[:div (board 11 (-> @v/game-state :board))]]))
|
||||
|
||||
(comment
|
||||
(board-test 5)
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.components.core
|
||||
"Pure hiccup components, shared between the browser and static generation.
|
||||
Components are plain functions: call them, don't put them in a vector head."
|
||||
(:require [com.oly.static-sites.do-blog.routes :refer [archive-href post-href]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [extract-tags format-date]]))
|
||||
|
||||
;; Ported from tachyon-reagent
|
||||
(defn pill-grow [{:keys [href text]}]
|
||||
[:a.f6.grow.no-underline.br-pill.ph3.pv2.mb2.dib.white.bg-black {:href href}
|
||||
text])
|
||||
|
||||
(defn profile-card [{:keys [img-src img-alt name tagline]}]
|
||||
[:article.mw5.center.bg-white.br3.pa3.pa4-ns.mv3.ba.b--black-10
|
||||
[:div.tc
|
||||
[:img.br-100.h4.w4.dib.ba.b--black-05.pa2
|
||||
{:src img-src
|
||||
:alt img-alt}]
|
||||
[:h1.f3.mb2 name]
|
||||
[:h2.f5.fw4.gray.mt0 tagline]]])
|
||||
|
||||
(defn definition-list [{:keys [list]}]
|
||||
[:dl.lh-title.pa4.mt0
|
||||
(mapcat (fn [{:keys [title text]}]
|
||||
[[:dt.f6.b title]
|
||||
[:dd.ml0 text]])
|
||||
list)])
|
||||
|
||||
(defn ui-tags [meta]
|
||||
[:div
|
||||
(for [tag (-> meta :filetags extract-tags)]
|
||||
[:span.mr2 {:replicant/key tag}
|
||||
(pill-grow {:href (archive-href tag)
|
||||
:text tag})])])
|
||||
|
||||
(defn article-list-author-media-flipped [title articles]
|
||||
[:section.mw7.center
|
||||
(when title [:h2.athelas.ph3.ph0-l title])
|
||||
(for [{:keys [title relative-path description date author alt thumbnail]} articles]
|
||||
[:article.pv4.bb.b--black-10.ph3.ph0-l
|
||||
{:replicant/key relative-path}
|
||||
[:div.flex.flex-column.flex-row-ns
|
||||
[:div.w-100.w-60-ns.pr3-ns.order-2.order-1-ns
|
||||
[:a {:href (post-href relative-path)}
|
||||
[:h1.f3.athelas.mt0.lh-title title]]
|
||||
[:p.f5.f4-l.lh-copy.athelas description]]
|
||||
(when thumbnail
|
||||
[:div.pl3-ns.order-1.order-2-ns.mb4.mb0-ns.w-100.w-40-ns
|
||||
[:img.db {:src thumbnail
|
||||
:alt alt}]])]
|
||||
[:p.f6.lh-copy.gray.mv0 (when author (str "By " author))
|
||||
(when date [:time.f6.db.gray (format-date date)])]])])
|
||||
|
||||
(defn title-text-image [{:keys [title content] :as optional} tags]
|
||||
[:article.lh-copy.f4.mt-0
|
||||
[:h1.f2 title]
|
||||
(when tags
|
||||
(ui-tags tags))
|
||||
(when (:img-src optional)
|
||||
[:img.w-100.f5.measure {:src (:img-src optional) :alt (:img-alt optional)}])
|
||||
content])
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.components.core
|
||||
(:require [reitit.frontend.easy :as rfe]
|
||||
[tachyons.buttons :refer [pill-grow]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [extract-tags format-date]]
|
||||
))
|
||||
|
||||
(defn ui-tags [meta]
|
||||
[:div (map-indexed
|
||||
(fn [idx tag]
|
||||
[:span.mr2 {:key idx}
|
||||
[pill-grow
|
||||
{:href (rfe/href :archive {:tag tag})
|
||||
:text tag}]])
|
||||
(-> meta :filetags extract-tags))])
|
||||
|
||||
(defn article-list-author-media-flipped [title articles]
|
||||
[:section.mw7.center
|
||||
(when title [:h2.athelas.ph3.ph0-l title])
|
||||
(map-indexed (fn [idx {:keys [title relative-path description date author src alt thumbnail] :as article}]
|
||||
[:article.pv4.bb.b--black-10.ph3.ph0-l
|
||||
{:keys idx}
|
||||
[:div.flex.flex-column.flex-row-ns
|
||||
[:div.w-100.w-60-ns.pr3-ns.order-2.order-1-ns
|
||||
[:a {:href (str (rfe/href :posts {:path ""}) relative-path)}
|
||||
[:h1.f3.athelas.mt0.lh-title title]]
|
||||
[:p.f5.f4-l.lh-copy.athelas description]]
|
||||
(when thumbnail [:div.pl3-ns.order-1.order-2-ns.mb4.mb0-ns.w-100.w-40-ns
|
||||
[:img.db {:src thumbnail
|
||||
:alt alt}]])]
|
||||
[:p.f6.lh-copy.gray.mv0 (when author (str "By " author))
|
||||
(when date [:time.f6.db.gray (format-date date)])]])
|
||||
articles)])
|
||||
|
||||
(defn title-text-image [{:keys [title content] :as optional} tags]
|
||||
[:article.lh-copy.f4.mt-0
|
||||
[:h1.f2 title]
|
||||
(when tags
|
||||
[ui-tags tags])
|
||||
(when (:img-src optional)
|
||||
[:img.w-100.f5.measure {:src (:img-src optional) :alt (:img-alt optional)}])
|
||||
content])
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.helpers.database
|
||||
(:require [clojure.string :as str]
|
||||
[datascript.core :as d]
|
||||
[cl-eorg.html :refer [org->to-hiccup]]
|
||||
[cl-eorg.parser :as parser]
|
||||
[com.oly.static-sites.do-blog.theme :refer [tachyon-theme]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [ltrim-slash convert-date]]))
|
||||
|
||||
(defonce schema {:tags {:db/cardinality :db.cardinality/many}})
|
||||
(defonce conn (d/create-conn schema))
|
||||
|
||||
(defonce state
|
||||
(atom {:route nil
|
||||
:search {:terms ""}
|
||||
:document {:details nil :hiccup nil}}))
|
||||
|
||||
(def db-search
|
||||
'{:find [(pull ?e [*])]
|
||||
:in [$]
|
||||
:where
|
||||
[[?e :title ?title]
|
||||
[(get-else $ ?e :description :nil) ?description]
|
||||
[?e :date ?date]
|
||||
[(get-else $ ?e :thumbnail :nil) ?thumbnail]
|
||||
[?e :relative-path ?path]]})
|
||||
|
||||
(defn db-search-filter
|
||||
"Add where clauses to the datalog query when supplied"
|
||||
[{:keys [search tag]}]
|
||||
(let [re-search (when-not (str/blank? search)
|
||||
(re-pattern (str "(?i)" search)))]
|
||||
(cond-> db-search
|
||||
(not (str/blank? tag))
|
||||
(update-in [:where] #(conj % ['?e :tags tag]))
|
||||
re-search
|
||||
(update-in [:where] #(conj % [`(~'re-find ~re-search ~'?title)])))))
|
||||
|
||||
(defn search-articles [search]
|
||||
(->> (d/q (db-search-filter search) @conn)
|
||||
(flatten)
|
||||
(sort-by :date)
|
||||
reverse
|
||||
(map #(assoc % :relative-path (ltrim-slash (:relative-path %))))))
|
||||
|
||||
(defn latest-article
|
||||
"Relative path of the most recent article."
|
||||
[]
|
||||
(->> (search-articles {:search ""})
|
||||
first
|
||||
:relative-path))
|
||||
|
||||
(defn prepare-index
|
||||
"Clean up the raw org-meta-index entries ready for datascript."
|
||||
[entries]
|
||||
(->> entries
|
||||
;; filter out missing dates
|
||||
(filter (fn [doc] (some? (:date doc))))
|
||||
(mapv #(assoc % :tags (vec (:filetags %))))
|
||||
(mapv #(assoc % :date (convert-date (:date %))))))
|
||||
|
||||
(defn load-index!
|
||||
"Replace the article database with the parsed index entries."
|
||||
[entries]
|
||||
(let [index (prepare-index entries)]
|
||||
(d/reset-conn! conn (d/empty-db schema))
|
||||
(d/transact! conn index)
|
||||
index))
|
||||
|
||||
(defn org->document
|
||||
"Parse org text into the document map used by the views."
|
||||
[text]
|
||||
(let [body (parser/parse text)]
|
||||
{:hiccup (into [:div] (rest (org->to-hiccup tachyon-theme body)))
|
||||
:details (parser/filter-root-nodes [] body)}))
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.helpers.database
|
||||
(:require [clojure.string :as str]
|
||||
[reagent.core :as r]
|
||||
[datascript.core :as d]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [ltrim-slash]]))
|
||||
|
||||
(defonce schema {:tags {:db/cardinality :db.cardinality/many}})
|
||||
(defonce conn (d/create-conn schema))
|
||||
(defonce document (r/atom {}))
|
||||
(defonce state
|
||||
(r/atom {:index []
|
||||
:refresh 1
|
||||
:search {:terms ""
|
||||
:results []}
|
||||
:document {:details nil :body nil}
|
||||
:latest nil
|
||||
:current-doc ""
|
||||
:new-data 0
|
||||
:current-key :org-01}))
|
||||
|
||||
;(def not-empty? (complement empty?))
|
||||
|
||||
(def db-search
|
||||
'{:find [(pull ?e [*])]
|
||||
:in [$]
|
||||
:where
|
||||
[[?e :title ?title]
|
||||
[(get-else $ ?e :description :nil) ?description]
|
||||
[?e :date ?date]
|
||||
[(get-else $ ?e :thumbnail :nil) ?thumbnail]
|
||||
[?e :relative-path ?path]]})
|
||||
|
||||
(defn check-match [re-patt title]
|
||||
(re-find re-patt title))
|
||||
|
||||
(defn db-search-filter
|
||||
"Add where clauses to the datalog query when supplied"
|
||||
[{:keys [search tag]}]
|
||||
(let [re-search (if (not (str/blank? search)) #_(js/RegEx (str "(?i)" search))
|
||||
(re-pattern (str "(?i)" search)) nil)]
|
||||
(cond-> db-search
|
||||
(not (str/blank? tag))
|
||||
(update-in [:where] #(conj % ['?e :tags tag]))
|
||||
re-search
|
||||
(update-in [:where] #(conj % [`(~'re-find ~re-search ~'?title)])))))
|
||||
|
||||
(defn search-articles [search]
|
||||
(->>
|
||||
(d/q (db-search-filter search) @conn)
|
||||
(flatten)
|
||||
(sort-by :date)
|
||||
reverse
|
||||
(map #(assoc %1 :relative-path (ltrim-slash (:relative-path %1))))))
|
||||
|
||||
(defn latest-article
|
||||
"Just return the first item from search articles."
|
||||
[]
|
||||
(->> (search-articles {:search ""})
|
||||
first
|
||||
:relative-path))
|
||||
|
||||
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.helpers.utils
|
||||
(:require
|
||||
[clojure.string :as str]
|
||||
[tick.core :as t]
|
||||
[tick.locale-en-us]
|
||||
[tick.timezone]))
|
||||
|
||||
(defonce date-format (t/formatter "yyyy-MMM-dd"))
|
||||
|
||||
(defn format-date [date]
|
||||
(when date
|
||||
(t/format date-format date)))
|
||||
|
||||
(defn convert-date
|
||||
"Convert an org date string like \"2020-06-27 12:00:00 UTC\" to a tick date."
|
||||
[text]
|
||||
(when-not (str/blank? text)
|
||||
(-> text str/trim (str/split #" ") first t/date)))
|
||||
|
||||
(defn ltrim-slash "Trim a leading slash" [text] (str/replace text #"^/" ""))
|
||||
|
||||
(defn extract-tags
|
||||
"Org filetags come either as \":a:b:\" strings or as a collection."
|
||||
[tags]
|
||||
(cond
|
||||
(string? tags) (->> (str/split tags #":") (remove str/blank?) vec)
|
||||
(coll? tags) (vec tags)
|
||||
:else []))
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.helpers.utils
|
||||
(:require
|
||||
[clojure.string :as str]
|
||||
[tick.core :as t]
|
||||
[tick.locale-en-us]
|
||||
[tick.timezone]))
|
||||
|
||||
(defonce date-format (t/formatter "yyyy-MMM-dd"))
|
||||
|
||||
(defn format-date [text]
|
||||
(when text
|
||||
(t/format date-format text)))
|
||||
|
||||
(defn ltrim-slash "Right trim a leading slash" [text] (str/replace text #"^/" ""))
|
||||
|
||||
(defn extract-tags [text]
|
||||
(->> (clojure.string/split text #_(:filetags %) #":")
|
||||
(reduce (fn [m a] (conj m a)) [])
|
||||
vec))
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.home
|
||||
(:require [com.oly.static-sites.do-blog.pages.components.core :refer [title-text-image]]))
|
||||
|
||||
(defn home-page [{:keys [document]}]
|
||||
[:div
|
||||
(title-text-image
|
||||
{:title (-> document :details :title)
|
||||
:content (-> document :hiccup)}
|
||||
(-> document :details))])
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
(ns com.oly.static-sites.do-blog.pages.home
|
||||
(:require [reagent.core :as r]
|
||||
[reitit.frontend.easy :as rfe]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [format-date]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.database :refer [search-articles state]]
|
||||
[com.oly.static-sites.do-blog.pages.components.core :refer [ui-tags title-text-image article-list-author-media-flipped]]))
|
||||
|
||||
(defn home-page [{:keys [path] :as route}]
|
||||
(let [search (r/cursor state [:search :terms])
|
||||
latest (r/cursor state [:document])]
|
||||
(fn []
|
||||
[:<>
|
||||
[:div
|
||||
(if (empty? @search)
|
||||
[title-text-image
|
||||
{:title (-> @latest :details :title)
|
||||
:content (-> @latest :hiccup)}
|
||||
(-> @latest :details)]
|
||||
[article-list-author-media-flipped
|
||||
"Articles"
|
||||
(search-articles {:search @search})])]])))
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.routes
|
||||
"Route table shared by the browser app and the static HTML generator.
|
||||
|
||||
Every page is generated as <path>/index.html, so URLs end in a slash
|
||||
(static file servers redirect /foo to /foo/ when foo is a directory)."
|
||||
(:require [clojure.string :as str]
|
||||
[reitit.core :as rc]))
|
||||
|
||||
(def routes
|
||||
[["/" {:name :homepage}]
|
||||
["/archive/{*tag}" {:name :archive}]
|
||||
["/chess/" {:name :chess}]
|
||||
["/about/" {:name :about}]
|
||||
["/posts/{*path}" {:name :posts}]])
|
||||
|
||||
(def router (rc/router routes))
|
||||
|
||||
(defn href
|
||||
"Path for a named route, usable both in the browser and on the JVM."
|
||||
([route-name] (href route-name nil))
|
||||
([route-name params]
|
||||
(some-> (rc/match-by-name router route-name params)
|
||||
(rc/match->path))))
|
||||
|
||||
(defn- with-slash [path]
|
||||
(if (str/ends-with? path "/") path (str path "/")))
|
||||
|
||||
(defn post-href [relative-path]
|
||||
(with-slash (str "/posts/" relative-path)))
|
||||
|
||||
(defn archive-href [tag]
|
||||
(with-slash (str "/archive/" tag)))
|
||||
|
||||
(defn normalize-match
|
||||
"Strip trailing slashes from catch-all path params."
|
||||
[match]
|
||||
(when match
|
||||
(update match :path-params update-vals #(str/replace % #"/+$" ""))))
|
||||
|
||||
(defn match-path
|
||||
"Resolve a path to a normalized route match."
|
||||
[path]
|
||||
(normalize-match (rc/match-by-path router path)))
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.ssr
|
||||
"Generate static HTML for every blog route using the same views as the
|
||||
browser app. The client takes over when the JavaScript loads.
|
||||
|
||||
The page shell comes from resources/do-blog/index.template.html; every page,
|
||||
including public/index.html, is generated output.
|
||||
|
||||
Run after the shadow-cljs build has written documents/org-meta-index.edn:
|
||||
clj -M:blog -m com.oly.static-sites.do-blog.ssr"
|
||||
(:require [clojure.edn :as edn]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.string :as str]
|
||||
[replicant.string :as rs]
|
||||
[com.oly.static-sites.do-blog.routes :refer [match-path post-href archive-href href]]
|
||||
[com.oly.static-sites.do-blog.views :as views]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.database
|
||||
:refer [load-index! latest-article org->document]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.utils :refer [extract-tags]]))
|
||||
|
||||
(def default-public-dir "bases/do-blog/resources/public")
|
||||
(def default-template "bases/do-blog/resources/do-blog/index.template.html")
|
||||
|
||||
(def app-content #"(?s)<!--app-->.*?<!--/app-->")
|
||||
|
||||
(defn render-into-template [template html]
|
||||
(str/replace template app-content
|
||||
(str/re-quote-replacement (str "<!--app-->" html "<!--/app-->"))))
|
||||
|
||||
(defn read-document [public-dir relative-path]
|
||||
(org->document (slurp (io/file public-dir "documents" relative-path))))
|
||||
|
||||
(defn page-state [url document]
|
||||
{:route (match-path url)
|
||||
:search {:terms ""}
|
||||
:document document})
|
||||
|
||||
(defn pages
|
||||
"Every [url state] pair to generate."
|
||||
[public-dir index]
|
||||
(let [doc (memoize #(read-document public-dir %))
|
||||
latest (latest-article)
|
||||
tags (->> index (mapcat (comp extract-tags :filetags)) distinct)]
|
||||
(concat
|
||||
[["/" (page-state "/" (doc latest))]
|
||||
[(href :about) (page-state (href :about) nil)]
|
||||
[(href :chess) (page-state (href :chess) nil)]
|
||||
[(archive-href "") (page-state (archive-href "") nil)]]
|
||||
(for [tag tags
|
||||
:let [url (archive-href tag)]]
|
||||
[url (page-state url nil)])
|
||||
(for [{:keys [relative-path]} index
|
||||
:let [path (str/replace relative-path #"^/" "")
|
||||
url (post-href path)]]
|
||||
[url (page-state url (doc path))]))))
|
||||
|
||||
(defn url->file [public-dir url]
|
||||
(io/file public-dir (str (str/replace url #"^/" "") "index.html")))
|
||||
|
||||
(defn generate!
|
||||
([] (generate! default-public-dir default-template))
|
||||
([public-dir template-file]
|
||||
(let [template (slurp template-file)
|
||||
index (load-index! (edn/read-string (slurp (io/file public-dir "documents" "org-meta-index.edn"))))
|
||||
results (doall
|
||||
(for [[url state] (pages public-dir index)]
|
||||
(try
|
||||
(let [file (url->file public-dir url)]
|
||||
(io/make-parents file)
|
||||
(spit file (render-into-template template (rs/render (views/app state))))
|
||||
{:url url})
|
||||
(catch Exception e
|
||||
{:url url :error (ex-message e)}))))
|
||||
errors (filter :error results)]
|
||||
(println "Generated" (- (count results) (count errors)) "pages into" public-dir)
|
||||
(doseq [{:keys [url error]} errors]
|
||||
(println " FAILED" url "-" error))
|
||||
results)))
|
||||
|
||||
(defn -main [& [public-dir template-file]]
|
||||
(let [errors (filter :error (generate! (or public-dir default-public-dir)
|
||||
(or template-file default-template)))]
|
||||
(shutdown-agents)
|
||||
(System/exit (if (seq errors) 1 0))))
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
(ns com.oly.static-sites.do-blog.theme
|
||||
(:require [clojure.set :as set]
|
||||
[clojure.string :as str]))
|
||||
(ns com.oly.static-sites.do-blog.theme)
|
||||
|
||||
(defn link-handler [v & _]
|
||||
(defn link-handler [v d]
|
||||
(if (-> v second :img)
|
||||
(conj [:img] (-> (dissoc (set/rename-keys (second v) {:href :src}) :img)
|
||||
(update :src #(str/replace % #"\.\./" ""))))
|
||||
(conj [:img] (-> (dissoc (clojure.set/rename-keys (second v) {:href :src}) :img)
|
||||
(update :src #(clojure.string/replace % #"\.\./" "")) )
|
||||
)
|
||||
(conj [:a] (second v))))
|
||||
|
||||
|
||||
|
|
@ -58,4 +57,5 @@
|
|||
:LINE :p.f5.f4-ns.lh-copy.mt0
|
||||
:BULLETS-ORDERED :ol
|
||||
:BULLETS :ul
|
||||
:BULLET :li})
|
||||
:BULLET :li
|
||||
})
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
(ns com.oly.static-sites.do-blog.views
|
||||
"Top level view: a pure function from app state to hiccup.
|
||||
Rendered with replicant.dom in the browser and replicant.string on the JVM."
|
||||
(:require [clojure.string :as str]
|
||||
[com.oly.static-sites.do-blog.routes :refer [href]]
|
||||
[com.oly.static-sites.do-blog.pages.helpers.database :refer [search-articles]]
|
||||
[com.oly.static-sites.do-blog.pages.components.core
|
||||
:refer [profile-card article-list-author-media-flipped]]
|
||||
[com.oly.static-sites.do-blog.pages.home :refer [home-page]]
|
||||
[com.oly.static-sites.do-blog.pages.article :refer [article-page]]
|
||||
[com.oly.static-sites.do-blog.pages.archive :refer [archive-page]]
|
||||
[com.oly.static-sites.do-blog.pages.about :refer [about-page]]))
|
||||
|
||||
(defmulti page
|
||||
"Render the body for the current route. Browser-only pages (e.g. chess)
|
||||
add their own methods."
|
||||
(fn [state] (-> state :route :data :name)))
|
||||
|
||||
(defmethod page :homepage [state] (home-page state))
|
||||
(defmethod page :posts [state] (article-page state))
|
||||
(defmethod page :archive [state] (archive-page state))
|
||||
(defmethod page :about [state] (about-page state))
|
||||
(defmethod page :default [_state] [:div])
|
||||
|
||||
(defn ui-search [terms]
|
||||
[:div
|
||||
[:input.w-100.center.input-reset.ba.b--black-20.pa2.mb2
|
||||
{:type "text"
|
||||
:placeholder "Search"
|
||||
:value (or terms "")
|
||||
:on {:input [[:search/set-terms :event.target/value]]}}]])
|
||||
|
||||
(defn nav-link [route-name params text]
|
||||
[:li.lh-copy.pv3.b--black-30.ba.bt-0.bl-0.br-0
|
||||
[:a.black.f3.link.hover-green {:href (href route-name params)} text]])
|
||||
|
||||
(defn sidebar []
|
||||
[:div
|
||||
(profile-card {:name "Oly"
|
||||
:tagline "Earthling, Software Engineer"
|
||||
:img-src "/images/default/me.png"})
|
||||
[:ul.list.pl0.measure.center
|
||||
(nav-link :homepage nil "Home")
|
||||
(nav-link :archive {:tag ""} "Past articles")
|
||||
(nav-link :chess nil "Chess")
|
||||
(nav-link :about nil "About")]])
|
||||
|
||||
(defn layout [{:keys [search]} content]
|
||||
(let [terms (:terms search)]
|
||||
[:div.font.h-100
|
||||
[:div.h-100.flex.items-stretch
|
||||
[:div.dn.db-l.pa3.bg-blue {:style {:flex-basis "20rem" :flex-grow "1"}}
|
||||
(sidebar)]
|
||||
[:div.ma3.pa3 {:style {:flex-basis "0" :flex-grow "999"}}
|
||||
(ui-search terms)
|
||||
(if (str/blank? terms)
|
||||
content
|
||||
(article-list-author-media-flipped
|
||||
"Articles"
|
||||
(search-articles {:search terms})))]]]))
|
||||
|
||||
(defn app [state]
|
||||
(layout state (page state)))
|
||||
9
bb.edn
9
bb.edn
|
|
@ -1,9 +0,0 @@
|
|||
{:paths []
|
||||
:tasks {blog-watch (shell "clj -M:blog:shadow-cljs-run watch blog")
|
||||
|
||||
blog-generate {:doc "Render static HTML for every blog page (needs documents/org-meta-index.edn from a blog build)"
|
||||
:task (shell "clj -M:blog -m com.oly.static-sites.do-blog.ssr")}
|
||||
|
||||
blog-release {:doc "Release build of the blog JS, then generate the static HTML"
|
||||
:task (do (shell "clj -M:blog:shadow-cljs-run release blog")
|
||||
(run 'blog-generate))}}}
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
(if (= (-> piece :colour) :white) " white white-80" " black black-80" )
|
||||
|
||||
)
|
||||
:on {:click #(when on-click (on-click % sq))}}
|
||||
:on-click #(on-click % sq)}
|
||||
[:p.v-mid.ma0.pa0.f2 (-> piece :character)]])
|
||||
|
||||
(defn board [size items]
|
||||
|
|
|
|||
10
deps.edn
10
deps.edn
|
|
@ -15,26 +15,26 @@
|
|||
thheller/shadow-cljs {:mvn/version "3.3.6"}
|
||||
;;refactor-nrepl/refactor-nrepl {:mvn/version "3.9.0"}
|
||||
;;cider/cider-nrepl {:mvn/version "0.43.1"}
|
||||
no.cjohansen/portfolio {:mvn/version "2026.03.1"}
|
||||
reagent/reagent {:mvn/version "1.1.1"}
|
||||
djblue/portal {:mvn/version "0.48.0"}}}
|
||||
no.cjohansen/portfolio {:mvn/version "2026.03.1"}
|
||||
djblue/portal {:mvn/version "0.48.0"}}}
|
||||
|
||||
:blog {:extra-paths ["components/ui-hiccup/src"
|
||||
"components/ui-tachyon/src"
|
||||
"development/src" "bases/do-blog/src"
|
||||
"bases/do-blog/test"]
|
||||
:extra-deps {
|
||||
org.clojure/clojure {:mvn/version "1.12.0"}
|
||||
org.clojure/core.async {:mvn/version "1.6.673"}
|
||||
org.clojure/clojurescript {:mvn/version "1.12.134"}
|
||||
|
||||
no.cjohansen/replicant {:mvn/version "2026.07.1"}
|
||||
reagent/reagent {:mvn/version "1.1.1"}
|
||||
tick/tick {:mvn/version "0.5.0"}
|
||||
metosin/reitit {:mvn/version "0.5.18"}
|
||||
|
||||
cljs-ajax/cljs-ajax {:mvn/version "0.8.4"}
|
||||
|
||||
datascript/datascript {:mvn/version "1.4.0"}
|
||||
olymk2/tachyon-reagent {:git/url "https://gitlab.com/olymk2/tachyon-reagent.git"
|
||||
:sha "e422af7b41266f7bc90ab78a24fb93f32be61385"}
|
||||
olymk2/cl-eorg {:git/url "https://gitlab.com/olymk2/cl-org.git"
|
||||
:sha "13e57f11da75516844922fe28bfd6aa7692b7c34"}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
:clojure-demos {:output-dir "bases/clojure-demos/resources/public/js"
|
||||
;:asset-path "."
|
||||
:target :browser
|
||||
:compiler-options {:infer-externs :auto :output-feature-set :es2018 :externs ["datascript/externs.js"]
|
||||
:compiler-options {:infer-externs :auto :output-feature-set :es6 :externs ["datascript/externs.js"]
|
||||
:warnings {:undeclared-var false}}
|
||||
:modules {:base {:entries []}
|
||||
:app {:init-fn com.oly.static-sites.clojure-demos.core/startup!
|
||||
|
|
|
|||
Loading…
Reference in New Issue