Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to an Elixir SSG (tableau) ?? #1771

Open
1 of 4 tasks
andyl opened this issue Oct 7, 2024 · 9 comments
Open
1 of 4 tasks

Migrate to an Elixir SSG (tableau) ?? #1771

andyl opened this issue Oct 7, 2024 · 9 comments

Comments

@andyl
Copy link

andyl commented Oct 7, 2024

Elixir now has a great Static Site Generator - Tableau written by @mhanberg. IMO Tableau is solid and deserves more attention.

The ElixirLang website is currently rendered with Ruby using Jekyll.

If people are interested in migrating from Jekyll to Tableau, I'll take a crack at it:

  • clone the website
  • migrate to Tableau
  • circulate for review and approval
  • submit PR

People may prefer to stick to the current tooling. If so - no problemo.

But I hope there is consensus to give it a try. It would be great to put up a Tableau showcase, and to give developers another reason to adopt Elixir.

@josevalim
Copy link
Member

Thank you, I'd love to see how it would look like. My initial suggestion is to do the home page and one blog post, and we evaluate from there. Everything else should fall under these two "templates" anyway.

But I recommend waiting 24h before getting started so other team members can jump in.

@mhanberg
Copy link
Member

mhanberg commented Oct 7, 2024

I would recommend a couple of research tasks first

  • see what jekyll plugins are used (might have to write analogous tableau extensions)
  • see what people think about sticking with liquid templates (using the solid package, I have examples of using this with my own blog) or switching to heex

@andyl
Copy link
Author

andyl commented Oct 7, 2024

jekyll plugins

I'll have a look at that.

switching to heex

My first impulse would be to switch to Heex, and adopt mainstream elixir tooling where possible.

@josevalim
Copy link
Member

I would start with liquid/solid because that's a smaller changes and then consider moving to HEEx. Fewer moving pieces at once.

@mhanberg
Copy link
Member

mhanberg commented Oct 7, 2024

The way I used the solid package was to create a sigil, but in order to decrease the size of the diff you might want to just have it read the templates from disk https://github.com/mhanberg/blog/blob/a719f3f9f68d9aeca058a631de780e78841ae715/lib/blog.ex#L126-L154

Either way, you'll see some options I used in that macro as well as how I handled the assigns.

@mhanberg
Copy link
Member

mhanberg commented Oct 7, 2024

There will also be some jekyll-isms like this that you'll have to recreate as a custom Liquid tag

@andyl
Copy link
Author

andyl commented Oct 8, 2024

This eve I did a minimal proof-of-concept - a test migration from Jekyll to Tableau. Click here for the tableau code.

Here's a screenshot of the current work-in-progress:
Screenshot_2024-10-07_18-41-28

After this exercise, I believe that a migration from Jekyll to Tableau is quite feasible.

re: Jekyll plugins - looks to me like the Jekyll plugins are 'site map' and 'RSS feed', which AFAIK exist as Tableau extensions.

re: liquid templates vs HEEX - for me, HEEX is just easier, so that is what I used. In the migration, liquid includes are embedded in Tableau nested layouts, and/or captured as function components. IMO the Tableau/HEEX method of organization is easier to understand.

To finish the migration, I think these are more-or-less the next actions:

  • render the sidebar, page and blog content
  • rewrite custom liquid tags as function components
  • understand what would be needed re: training / adoption for site maintainers
  • implement a CICD process

Per Jose's suggestion, I'll wait a couple days to collect feedback. If the consensus is to move forward, I'll work in my spare time to finish the migration, which might take a couple weeks depending on my schedule.

@josevalim
Copy link
Member

Thank you, that was a nice starting point. Do we need to define modules for each page or can we just point to a directory and have it treat each file in there as its own page?

@andyl
Copy link
Author

andyl commented Oct 8, 2024

Do we need to define modules for each page or can we just point to a directory

The latter. We need to define 2-4 'layout' modules which wrapper each markdown file.

We have a working example of the core layout module - the root layout. This was built by repurposing HTML from the old site. The root layout still needs TLC, but works now as a proof of concept. FYI layouts can be nested.

Markdown files are customized with frontmatter. Here's documentation on Tableau.PageExtension which ingests a markdown file and generates html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants