Commit graph

38 commits

Author SHA1 Message Date
Facundo Olano
d1459f3a37
Set content along with excerpt when rendering posts (#41)
* save content along with excerpt when preparing posts

* add a test
2024-07-03 15:08:53 -03:00
Facundo Olano
7bc5baa253
Minify exclusions (#31)
* add minify exclusions support

* load exclusions

* fix bug

* load minify

* fix yaml type coersion

* skip dot files when building
2024-03-15 19:55:50 -03:00
facundoolano
97cc3937ee print build file errors 2024-03-07 12:50:00 -03:00
facundoolano
6f480dee98 use location instead of hardcoded url in livereload snippets 2024-03-05 16:34:16 -03:00
Facundo Olano
ff28ece092
Add more content for the serve command post (#23)
* document site api

* merge site.Load and site.Build into a single function

* fix tests

* make Site a private struct

* doc

* remove superfluous operation

* smaller tab width in source examples

* remove unnecessary temp var

* add some code snippet

* improve http fs naming

* add a few more code snippets

* cleanup serve code

* add watcher sample to blog post

* improve worker pool sample

* restore watcher close

* remove unused prefix

* some live reload samples in post

* remove outdated  command
2024-03-03 23:19:09 -03:00
Facundo Olano
c02e1fc91e
Add page.previous and page.next liquid variables (#22)
* sort pages

* rename tutorial files to enforce an order

* add prev next props to posts

* test previous next

* prevent nested recursive links between posts

* add a next/prev footer

* make prev/next work as expected for both pages and posts

* remove sort by index

* bold current section in nav
2024-03-02 16:16:40 -03:00
Facundo Olano
adb17ad9d2
run linter in github actions (#20)
* run linter in github actions

* try fixing go mod

* no install go

* again

* maybe this?

* separate install

* no v

* fix lint errors
2024-02-29 19:34:33 -03:00
facundoolano
e7b552b476 fix: close sse client before attempting a reconnection 2024-02-29 13:38:25 -03:00
Facundo Olano
f733c83b1f
start devlog (#18)
* remove sample posts

* init first post

* try not ignoring file creation events

* draft why go section

* more why go

* why cli

* finish first draft

* reconnect with server after lost connection

* corrections

* more corrections

* grammarly

* remove docs section

* update comment

* remove doc index
2024-02-28 10:26:59 -03:00
facundoolano
a7866b7d2c add a simpler templ render interface, support no highlighting 2024-02-27 12:40:40 -03:00
facundoolano
1461945787 assign the proper file modes 2024-02-27 12:30:00 -03:00
Facundo Olano
6f27afacf7
Add drafts support (#17)
* add src and target ext as template methods

* add include drafts config

* default to draft on jorge post

* skip drafts from site indexes and rendering

* fix stat usage for file detection

* add site.Build test

* test build site with and without drafts

* add templ IsPost helper

* document drafts in readme

* document drafts in tutorial
2024-02-27 12:24:45 -03:00
Facundo Olano
e344dcb6ad
Syntax highlighting (#15)
* update markdown and org renderers to use chrome highlighting

* add example code blocks

* fix missing nav in default layout

* remove problematic code nowrap

* add language to tutorial samples

* set theme explicitly

* allow setting highlight theme with config

* fix config key for hl

* try to handle both light dark settings gracefully

* fix some problematic css color settings

* fix missing raw template

* fix weird chroma code height artifacts

* improve tabler rendering in mobile

* remove redundant default
2024-02-27 08:45:29 -03:00
Facundo Olano
924e4629b2
Add smart quotes replacement in output html (#14)
* first basic implementation with gojekyll port

* extract smartify file

* template struct comments

* rename templates package to markup

* move minify file to markup

* move html to markup

* move smartify to markup

* first stab at unit test

* better dash replacement

* do plain replacement of dashes
2024-02-26 12:16:06 -03:00
Facundo Olano
b3594be86c
Refactor CLI using kong (#13)
* use kong for cli parsing

* fix kong usage

* remove conditional

* don't blow up serve if src dir is missing

* load config in main side (boilerplaty)

* fix weird names

* add versions and aliases

* fix version printing

* replace command switch with Run methods

* move subcommand structs to commands package

* distribute commands into files

* add usage to docs

* add flags to configure server
2024-02-24 12:39:45 -03:00
facundoolano
190fa0073a lenient layout loading to prevent errors 2024-02-21 18:46:37 -03:00
Facundo Olano
7094998638
Outline docs site (#11)
* add src_path to template metadata

* tweak init files

* add docs site with initial layout

* add some tweaks to make default layouts more consistent

* index tweaks

* more layout

* stub tutorial entries

* add output in docs index

* fix footer padding

* change listening for serving

* simplify submenu

* remove inline styles
2024-02-21 18:41:03 -03:00
Facundo Olano
20150cf7a3
Add post command (#9)
* rename command to post

* initial jorge post implementation

* fixes

* update comment

* move funs around

* move default front matter to constants

* more docs

* tweak defaults line breaks
2024-02-21 12:56:22 -03:00
facundoolano
2d52e13932 add excerpt test 2024-02-21 11:05:09 -03:00
Facundo Olano
2d84e1f2cb
Add live reload to build command (#7) 2024-02-19 18:03:06 -03:00
facundoolano
5735be769a add a keys filter to make liquid iteration of maps predictable
(fixes random test failure)
2024-02-18 12:14:44 -03:00
Facundo Olano
ccc8bc5e99
Improve local server (#6)
* don't interrupt watcher on error

* don't halt build on missing file

* extract buildFile function

* build the site with concurrent workers

* improve fsnotify event treatment and output
2024-02-17 21:13:50 -03:00
facundoolano
79dbf8129e cheap override of include tag to honor includes dir 2024-02-16 18:39:21 -03:00
Facundo Olano
b3e6c0de8d
rename project to jorge (#4) 2024-02-16 15:29:43 -03:00
facundoolano
663463202c add minifier 2024-02-16 15:14:30 -03:00
Facundo Olano
a4279aae0d
Introduce config mod and struct (#2)
* outline config mod and struct

* replace site interfaces

* load config from config.yml

* adapt commands to load and pass config

* fix test

* fix tests

* use symlinks for static assets

* implement absolute url filter

* doc comment

* fix tests

* remove outdated TODO comments

* Add go build actions workflow (#3)

* Add go build actions workflow

* set go to 1.22
2024-02-16 12:39:19 -03:00
facundoolano
6cc4077816 naive implementation of post excerpts 2024-02-15 18:11:40 -03:00
facundoolano
06016cb2ac improve handling of spurious files when serving 2024-02-15 18:02:24 -03:00
facundoolano
ed258fddc4 add support for data files 2024-02-15 16:01:35 -03:00
facundoolano
180a5c7ac1 fix post url generation 2024-02-15 15:37:19 -03:00
facundoolano
1878db2fc8 move dotfile check 2024-02-15 15:25:44 -03:00
facundoolano
bacc9d9052 add missing error return 2024-02-15 13:43:12 -03:00
Facundo Olano
e5917dc21e
build command refactors (#1)
* extract buildTarget function

* first stab at build target rendering refactor

* more cleanup

* properly separate parse and render stages of liquid templates

* move some more rendering from commands to site

* move org rendering again, to fix bug

* revert more unsatisfactory changes

* move build to site

* markdown support

* remove comments

* fix tests

* markdown test

* cleanup scanner bytes usage

* reuse the template engine
2024-02-14 23:54:46 -03:00
facundoolano
cea4ac7b1c add support for page listing 2024-02-14 00:05:55 -03:00
facundoolano
88efad43db expose site posts and tags to template rendering
Squashed commit of the following:

commit c45734422ef038438a0b6eb4c3065df9cbebcc5e
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 21:27:47 2024 -0300

    tags test passing

commit 88294405603b2103f9f8cba3b130ad2d40e58a36
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 21:12:08 2024 -0300

    ensure posts are sorted by date

commit df7c945fcc1490613b6068da3fc487b9ffa44ba5
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 20:55:51 2024 -0300

    prepare to test tags

commit 3d7c3f380c3933d6cd9f949d3d2cf9ef144bd6ae
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 20:51:08 2024 -0300

    preload context in site fields

commit a3afaacc67a9d748cfd42ecbeb7b2d302c3560b2
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 20:39:42 2024 -0300

    test passing pending refactor

commit 13de5017f654c8d82b1ba7beb01066a9c22f19fc
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 20:18:07 2024 -0300

    add (failing) archive test
2024-02-13 21:32:04 -03:00
facundoolano
526e3c3e5a add tests for site struct
Squashed commit of the following:

commit 288291800c346cc103513169b33dc32e0d2182a0
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 13:36:33 2024 -0300

    test the rest of the pages

commit 184fad8d925b7e2f5e6942b148508d835fda2207
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 13:34:40 2024 -0300

    remove extra new lines

commit 813bc35ba98c13dbf0951638fab6f04db59768b0
Author: facundoolano <facundo.olano@gmail.com>
Date:   Tue Feb 13 13:15:23 2024 -0300

    first portion of site test

commit 766aecb68c74e812bfe65479cd16a97f85dcb86f
Author: facundoolano <facundo.olano@gmail.com>
Date:   Mon Feb 12 16:44:43 2024 -0300

    stub site tests
2024-02-13 13:43:20 -03:00
facundoolano
e821866d5d cleanup directory vars 2024-02-12 16:27:06 -03:00
facundoolano
97b6bc5111 extract site to its own mod 2024-02-12 15:59:18 -03:00