Skip to content
/ nota Public template

Static Markdown Blog/Site using Fulcro & Pathom with no backend

License

Notifications You must be signed in to change notification settings

rafaeldelboni/nota

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nota

nota : mark, token, note, sign.

Static Markdown Blog/Site using Fulcro & Pathom with no backend

Prerequisites

Things you need installed to use this repository

Developers

Commands and alias for tooling while developing nota.

Install dependencies

npm install

Set configurations

Set the resources/config.edn with your keys or the corresponding enviroment variables. The config is generated using shadow-cljs hook, macros and juxt/aero under the hood, check it's documentation for more information on how to use.

Aero's #profile reader conditionals available:

  • :dev for when running locally dev builds
  • :release for compiled final builds.

Where is the index.html?

The index page is being generated by a custom shadow-cljs hook all of this to be possible to use Fingerprint-Hash on the js generated.

Commands

Local build

Start shadow-cljs watching and serving main in localhost:8000

npm run watch

Tests

Start shadow-cljs watching and serving tests in localhost:8022

npm run watch:tests

Run Karma tests targeted for running CI tests with Headless Chrome Driver

npm run ci-tests

Run Babashka script tests

bb tests

Deploy

Build the release package to production deploy

npm run release

CLI Commands

For more information on optional arguments or how to use the commands you can always add an -h at the end of the command. (Eg. bb del:post -h)

Posts

Commands to manage posts markdown files and it's entry in the "database".

New Post

bb new:post "Hello World" -d "Such hello, much world" -t "first markdown"

The following prompt will be shown:

New:
{:post/name "Hello World",
 :post/description "Such hello, much world",
 :post/timestamp 1635110961351,
 :post/path "posts/hello-world.md",
 :post/tags #{"markdown" "first"},
 :slug/id "hello-world"}

Create? (Y/n):

This will create the file resources/public/posts/hello-world.md and add an entry in the database src/data.edn.

Delete Post

bb del:post hello-world

The following prompt will be shown:

Delete:
{:post/name "Hello World",
 :post/description "Such hello, much world",
 :post/timestamp 1635101110744,
 :post/path "posts/hello-world.md",
 :post/tags #{"markdown" "first"}}

Are you sure? (y/N):

This will delete the file resources/public/posts/hello-world.md and remove the entry in the database src/data.edn.

Pages

Commands to manage pages markdown files and it's entry in the "database".

New Page

bb new:page "About me" -s about

The following prompt will be shown:

New:
{:page/name "About me", :page/path "pages/about.md", :slug/id "about"}

Create? (Y/n):

This will create the file resources/public/pages/about.md and add an entry in the database src/data.edn.

Since -s (slug) is optional this command could be

bb new:page "About me"
# =>
New:
{:page/name "About me",
 :page/path "pages/about-me.md",
 :slug/id "about-me"}

Create? (Y/n):

Or even

bb new:page About
# =>
New:
{:page/name "About", :page/path "pages/about.md", :slug/id "about"}

Create? (Y/n):

Is possible to create "hidden" pages adding --hide to the command, this will filter the page from pages list resolver, but anyone will stil be able to access it via url/slug.

Delete Page

bb del:page about

The following prompt will be shown:

Delete:
{:page/name "About", :page/path "pages/about.md"}

Are you sure? (y/N):

This will delete the file resources/public/posts/hello-world.md and remove the entry in the database src/data.edn.

Tags

Tags aren't required to nota work, but you can override it's default behaviour (capitalize tag) to customize the name that will be shown.

New Tags

bb new:tag clojure "Clojure Stuff"

The following prompt will be shown:

New:
{:tag/name "Clojure Stuff", :slug/id "clojure"}

Create? (Y/n):

Delete Tags

bb del:tag clojure
Delete:
{:tag/name "Clojure Stuff"}

Are you sure? (y/N):

Projects using Nota

Acknowledgment

  • fulcro: A library for development of single-page full-stack web applications in clj/cljs
  • pathom: Pathom is a Clojure(script) engine for processing EQL requests
  • shadow-cljs: ClojureScript compilation made easy
  • babashka: Native, fast starting Clojure interpreter for scripting
  • flipps: CSS and Aesthetics
  • font-awesome: Sun and Moon SVGs

License

This is free and unencumbered software released into the public domain.
For more information, please refer to http://unlicense.org