From 9a6d0191d712ea42d93738bbb5e2d0aec6759d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Thu, 22 Aug 2024 20:31:17 +0200 Subject: [PATCH 1/4] Handle new headline state type. --- scripts/generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate.py b/scripts/generate.py index 3405a77..c0395ef 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -736,10 +736,10 @@ def render(headline, doc, graph, headlineLevel, doc_to_headline_remapping): content.append(render(child, doc, headlineLevel=headlineLevel+1, graph=graph, doc_to_headline_remapping=doc_to_headline_remapping)) - if headline.state is None: + if headline.state is None or headline.state.get('name') is None: state = "" else: - state = f'{headline.state}' + state = f'{headline.state["name"]}' if headline.is_todo: todo_state = "todo" From 04fe576385317a441a2ed39cd8464099f3d3e229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Thu, 22 Aug 2024 20:36:51 +0200 Subject: [PATCH 2/4] Add default TODO/DONE states. --- scripts/generate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/generate.py b/scripts/generate.py index c0395ef..c158295 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -109,7 +109,9 @@ def load_all(top_dir_relative): path = os.path.join(root, name) try: - doc = load_org(open(path), extra_cautious=True) + doc = load_org(open(path), + environment={"org-todo-keywords": "TODO(t) NEXT(n) MEETING(m/!) Q(q) PAUSED(p!/!) EVENT(e/!) SOMETIME(s) WAITING(w@/!) TRACK(r/!) | DISCARDED(x@/!) VALIDATING(v!/!) DONE(d!/!)"}, + extra_cautious=True) docs.append(doc) except Exception as err: import traceback From fba35555b345f335423ff48060933e4c2ba7479b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Mon, 28 Oct 2024 02:46:48 +0100 Subject: [PATCH 3/4] Handle 'uindentation' of empty texts.' --- scripts/generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate.py b/scripts/generate.py index c158295..3c9252e 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -476,7 +476,7 @@ def render_block(content, acc, _class, is_code): acc.append('') def unindent(content): - base_indentation = min([ + base_indentation = min([0] + [ len(l) - len(l.lstrip(' ')) for l in content.split('\n') if len(l.strip()) > 0 From 06b5d1b50c6c218921ebe2f0c5fb1b7974e498d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Sun, 9 Feb 2025 11:53:30 +0100 Subject: [PATCH 4/4] Add small readme. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..46c72d7 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Codigo para llevar's generator + +This is the static site generator used to build [Codigo Para Llevar](https://codigoparallevar.com/) (my personal site). It contains: + +- A markdown blog (with content ported from acrylamid). Saved as `/blog/`. +- A set of org-mode based notes. Saved as `/notes/`. + +It also copies over some static assets (css, js, fonts). + +The scripts are hardcoded with the hostnames and paths for my own site, so you might want to update them. + +General documentation is in progress and might be replaced little by little by the more interactive [org-web-editor](https://code.codigoparallevar.com/kenkeiras/org-web-editor) once that one (1) supports all the features here and (2) has support for building static sites.