From 541accd9c249a8b3cf70597a2b516470f6e0067b Mon Sep 17 00:00:00 2001 From: niamtokik Date: Mon, 4 Dec 2023 20:25:04 +0000 Subject: [PATCH] first commit --- .gitignore | 20 ++++++++++++++++++++ LICENSE.md | 20 ++++++++++++++++++++ README.md | 41 +++++++++++++++++++++++++++++++++++++++++ rebar.config | 7 +++++++ src/ecstatic.app.src | 14 ++++++++++++++ src/ecstatic_app.erl | 18 ++++++++++++++++++ src/ecstatic_sup.erl | 35 +++++++++++++++++++++++++++++++++++ 7 files changed, 155 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 rebar.config create mode 100644 src/ecstatic.app.src create mode 100644 src/ecstatic_app.erl create mode 100644 src/ecstatic_sup.erl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..df53f7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +.rebar3 +_build +_checkouts +_vendor +.eunit +*.o +*.beam +*.plt +*.swp +*.swo +.erlang.cookie +ebin +log +erl_crash.dump +.rebar +logs +.idea +*.iml +rebar3.crashdump +*~ diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..5bb8157 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,20 @@ +Copyright 2023 Erlang-Punch + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +“Software”), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8fcfec5 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# ecstatic + +A static website manager made in pure Erlang using htmx/spectre, +greatly inspired by Cryogen and other Clojure static website +generator. + +## Usage + +## Project Structure + +``` +priv/project_name/ +|-- blog/ +| |-- article1.erml +| |-- article2.md +| `-- article3.asciidoc +|-- page/ +| |-- page1.erml +| |-- page2.md +| `-- page3.asciidoc +|-- assets/ +| |-- images/ +| |-- css/ +| |-- js/ +| `-- medias/ +`-- themes/ + `-- custom_theme + |-- index.erml + |-- page.erml + |-- blog.erml + `-- assets/ + |-- images/ + |-- css/ + `-- js/ +``` + +## Note + +This project was not planned at all, it was created when working on +`gabarit` and playing with `Htmx` library. This is a mix of both +world, designed to be small and flexible. diff --git a/rebar.config b/rebar.config new file mode 100644 index 0000000..3648734 --- /dev/null +++ b/rebar.config @@ -0,0 +1,7 @@ +{erl_opts, [debug_info]}. +{deps, []}. + +{shell, [ + % {config, "config/sys.config"}, + {apps, [ecstatic]} +]}. diff --git a/src/ecstatic.app.src b/src/ecstatic.app.src new file mode 100644 index 0000000..acb4f30 --- /dev/null +++ b/src/ecstatic.app.src @@ -0,0 +1,14 @@ +{application, ecstatic, + [{description, "A static web site manager in pure Erlang"}, + {vsn, "0.1.0"}, + {registered, []}, + {mod, {ecstatic_app, []}}, + {applications, + [kernel, + stdlib + ]}, + {env,[]}, + {modules, []}, + {licenses, ["MIT"]}, + {links, []} + ]}. diff --git a/src/ecstatic_app.erl b/src/ecstatic_app.erl new file mode 100644 index 0000000..e66992c --- /dev/null +++ b/src/ecstatic_app.erl @@ -0,0 +1,18 @@ +%%%------------------------------------------------------------------- +%% @doc ecstatic public API +%% @end +%%%------------------------------------------------------------------- + +-module(ecstatic_app). + +-behaviour(application). + +-export([start/2, stop/1]). + +start(_StartType, _StartArgs) -> + ecstatic_sup:start_link(). + +stop(_State) -> + ok. + +%% internal functions diff --git a/src/ecstatic_sup.erl b/src/ecstatic_sup.erl new file mode 100644 index 0000000..2f3ee77 --- /dev/null +++ b/src/ecstatic_sup.erl @@ -0,0 +1,35 @@ +%%%------------------------------------------------------------------- +%% @doc ecstatic top level supervisor. +%% @end +%%%------------------------------------------------------------------- + +-module(ecstatic_sup). + +-behaviour(supervisor). + +-export([start_link/0]). + +-export([init/1]). + +-define(SERVER, ?MODULE). + +start_link() -> + supervisor:start_link({local, ?SERVER}, ?MODULE, []). + +%% sup_flags() = #{strategy => strategy(), % optional +%% intensity => non_neg_integer(), % optional +%% period => pos_integer()} % optional +%% child_spec() = #{id => child_id(), % mandatory +%% start => mfargs(), % mandatory +%% restart => restart(), % optional +%% shutdown => shutdown(), % optional +%% type => worker(), % optional +%% modules => modules()} % optional +init([]) -> + SupFlags = #{strategy => one_for_all, + intensity => 0, + period => 1}, + ChildSpecs = [], + {ok, {SupFlags, ChildSpecs}}. + +%% internal functions