first commit

This commit is contained in:
niamtokik
2023-12-04 20:25:04 +00:00
commit 541accd9c2
7 changed files with 155 additions and 0 deletions

20
.gitignore vendored Normal file
View File

@@ -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
*~

20
LICENSE.md Normal file
View File

@@ -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.

41
README.md Normal file
View File

@@ -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.

7
rebar.config Normal file
View File

@@ -0,0 +1,7 @@
{erl_opts, [debug_info]}.
{deps, []}.
{shell, [
% {config, "config/sys.config"},
{apps, [ecstatic]}
]}.

14
src/ecstatic.app.src Normal file
View File

@@ -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, []}
]}.

18
src/ecstatic_app.erl Normal file
View File

@@ -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

35
src/ecstatic_sup.erl Normal file
View File

@@ -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