{"id":14671224,"url":"https://github.com/ferd/blog3r","last_synced_at":"2025-04-10T04:11:25.441Z","repository":{"id":141683285,"uuid":"309769593","full_name":"ferd/blog3r","owner":"ferd","description":"A small static blog engine written as an Erlang compiler plugin","archived":false,"fork":false,"pushed_at":"2024-10-28T12:30:14.000Z","size":277,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T04:11:22.231Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-03T18:10:11.000Z","updated_at":"2024-10-29T21:17:13.000Z","dependencies_parsed_at":"2024-07-16T22:12:43.829Z","dependency_job_id":"ac54d8cc-bb0f-41b9-9982-5d8e682a50c2","html_url":"https://github.com/ferd/blog3r","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Fblog3r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Fblog3r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Fblog3r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Fblog3r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferd","download_url":"https://codeload.github.com/ferd/blog3r/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154991,"owners_count":21056543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-12T04:01:18.562Z","updated_at":"2025-04-10T04:11:25.420Z","avatar_url":"https://github.com/ferd.png","language":"Erlang","funding_links":[],"categories":["Erlang"],"sub_categories":[],"readme":"blog3r\n=====\n\nA rebar plugin attempting to re-make https://github.com/ferd/blogerl but as a rebar3\nplugin for a custom compiler module so that it can reuse the DAG code and do partial\nblog re-builds without having to handle the tracking itself.\n\nThis is still experimental code and I wouldn't expect anyone to use it at this point.\n\nStructure\n---\n\nThe plugin expects to work on the following project structure:\n\n```\n./\n├─rebar.config\n├─src/\n│ └─ some.app.src\n├─templates/\n│ ├─ index.tpl\n│ ├─ rss.tpl\n│ ├─ base.tpl\n│ └─ ...\n├─posts/\n│ ├─ post1.tpl\n│ ├─ post2.tpl\n│ ├─ post3.tpl\n│ └─ ...\n└─compiled/\n  ├─ index.html\n  ├─ feed.rss\n  ├─ post1-generated-slug.html\n  ├─ post2-generated-slug.html\n  ├─ post3-generated-slug.html\n  └─ ...\n```\n\n- A `rebar.config` configuration file\n- The `src/` directory is required strictly for the project to be picked up by rebar3. If you do want to write code snippets and test them to only later import them into the blog, that can be a decent place to do it.\n- The `templates/` directory contains basic Django templates and is used as the `doc_root` (default lookup path) for all inclusions for paths. Only files with the `.tpl` extension are picked up.\n- The `posts/` directory is configurable, and should contain only specific blog posts' template files. Only files with the `.tpl` extension are picked up.\n- The `compiled/` directory is where the plugin currently puts all the rendered posts, at the top level.\n- A `_build` directory will always be generated by rebar3 even though you may not need it.\n\nThere is also an assumed dependency on [pygments](https://pygments.org/) being installed for code highlighting to be done entirely offline. Code declared with `\u003cpre class=\"erlang\"\u003e...\u003c/pre\u003e` will get erlang syntax highlight, for example. Warnings will be output if pygments isn't available.\n\nConfiguration\n---\n\nAdd the plugin to your rebar config, and configure the blogs and blog posts:\n\n```erlang\n{project_plugins, [\n    {blog3r, {git, \"https://github.com/ferd/blog3r.git\", {branch, \"main\"}}}\n]}.\n\n{blog3r, [\n    %% Variables that are defined in all templates\n    {vars, [\n        {url, [{base, \"https://example.org/\"},\n               {img, \"https://example.org/static/img/\"},\n               {js, \"https://example.org/static/js/\"},\n               {css, \"https://example.org/static/css/\"},\n               {erl, \"https://example.org/static/erl/\"}]}\n    ]},\n\n    {sections, #{\n      %% List of all the posts by date, title, and name of the post template\n      %% (entries sorted by newest to oldest)\n      %%       \u003csource\u003e  \u003coutput subdirectory\u003e\n      main =\u003e {\"posts/\", \"/\", [\n          %% Datetime in RFC 2822 format,  Title of the post,  Source file\n          {\"Tue, 20 Oct 2020 10:00:00 EDT\", \"Markdown Test\", \"markdown.tpl\"},\n          {\"Wed, 14 Jul 2010 00:00:00 EST\", \"Second article\", \"second.tpl\"},\n          {\"Tue, 13 Jul 2010 00:00:00 EDT\", \"Hello, World\", \"hello.tpl\"}\n      ]}\n    }},\n\n    %% Define an index of all blog post entries\n    {index, #{\n        %% Name of the index file itself\n        template =\u003e \"index.tpl\",\n        section =\u003e main,\n        out =\u003e \"index.html\"\n    }},\n\n    %% How to generate the RSS Feed. A template should have it\n    %% already set in the project structure.\n    {index, #{\n        template =\u003e \"rss.tpl\",\n        section =\u003e main,\n        out =\u003e \"feed.rss\"\n    }}\n]}.\n\n%% Additional hooks if you want to move static files to the output directory\n%% after each build.\n{pre_hooks, [\n    {compile, \"mkdir -p compiled/static\"}\n]}.\n{post_hooks, [\n    {compile, \"cp -r static/* compiled/static/\"}\n]}.\n\n```\n\n## Plugin Template\n\nIf you declare the plugin globally (in `~/.config/rebar3/rebar.config`), templates for blog projects will be available, setting up a basic structure:\n\n```\n$ rebar3 new blog testblog\n===\u003e Writing testblog/rebar.config\n===\u003e Writing testblog/templates/base.tpl\n...\n===\u003e Writing testblog/src/testblog.app.src\n$ cd testblog\n$ rebar3 compile\n...\n===\u003e Analyzing applications...\n===\u003e Compiling testblog\n```\n\nThe files will be built in `./compiled/`. Edit `rebar.config` to set the proper hostnames and paths since by default, absolute links at `https://example.org` are used. Absolute links are preferred for all link configurations since otherwise, RSS entries containing images will link to the reader app's path and not the original site.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferd%2Fblog3r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferd%2Fblog3r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferd%2Fblog3r/lists"}