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

Static Site Generator #85

Open
Denperidge opened this issue Nov 2, 2024 · 16 comments
Open

Static Site Generator #85

Denperidge opened this issue Nov 2, 2024 · 16 comments
Assignees

Comments

@Denperidge
Copy link
Contributor

Is there any interest in using a static site generator (e.g. Eleventy, Jekyll) to allow general layout changes to happen easier? Or is the current html system intentional/preferred?

@marclaporte
Copy link
Member

I am interested. Since Cypht is in PHP, I'd prefer something in PHP so we can easily upstream enhancements. Also, Cypht uses Bootstrap, so this would also be our ideal choice. Any SSGs to recommend?

@Denperidge
Copy link
Contributor Author

I have to admit I'm less familiar with PHP SSG's than others, but I can definitely take a look into it! I'm personally partial to Eleventy due to its minimal setup/clutter, but it relies on Node.JS, which not be preferable.

@marclaporte
Copy link
Member

Ok, thanks. Let's first explore PHP options.

@Denperidge
Copy link
Contributor Author

Hi! Some testing out of PHP-powered ssg's found on jamstack.org.

Possibility:

  • Sculpin (composer based, supports HTML, twig & markdown for content. Requires yarn, which requires node.js; and as such has much more overhead than Eleventy's sole node.js requirement, but I am biased).
  • Cecil (PHP based and does not require composer nor yarn. However, content must be written in markdown). I can translate the existing content into Markdown, but this is a limitation that might be relevant for future website development

Not great options:

  • Jigsaw (only Laravel/Blade syntax)
  • Yellow (meant for a different type of website with non-git based editing)
  • Spress (unmaintained)

Feel free to let me know if any of the options sound good, and I'll try to recreate this website into that ssg.

@marclaporte
Copy link
Member

marclaporte commented Dec 14, 2024

  • However, content must be written in markdown). I can translate the existing content into Markdown, but this is a limitation that might be relevant for future website development

Maybe I will regret writing this, but I am OK with that, as I don't expect we need more than Markdown.

@Denperidge
Copy link
Contributor Author

Denperidge commented Dec 14, 2024

Maybe I will regret writing this, but I am OK with that, as I don't expect we need more than Markdown.

Yeah, it’s the weighoff of no extra tool required to build the website vs freedom of content formatting. Unless further notice I’ll try to make a cypht-website fork and you can see how it looks post-markdown-translation.

(Although, now I’m thinking about it, won’t a markdown limitation mess with bootstrap class utility? I’ll try to check if html-in-markdown works for Cecil)

@Denperidge
Copy link
Contributor Author

Denperidge commented Dec 16, 2024

Hey hey! Early draft, but here you go: deployment & repo/branch

  • Created a template with automatic nav generation
  • Recreated three of the pages
  • Discovered the markdown allows HTML (minus comments and without empty lines, but still)
  • Created pretty urls but that's the SSG's work
  • Added GitHub CI for deployment to pages

If the new repo structure looks good to you, I'll move the rest of the content into it! Otherwise, no harm no foul.

@marclaporte
Copy link
Member

Great! Please proceed!

  1. I invited you to the project: https://github.com/orgs/cypht-org/people
  2. https://github.com/Denperidge-Contrib/cypht-website/tree/cecil reports "19 commits behind cypht-org/cypht-website:master" so please check we don't lose anything
  3. I see you are in Belgium. Will you be at FOSDEM? Who can represent Cypht at FOSDEM 2025? (and ideally propose a presentation) cypht#1396

Please merge the code as soon as you are ready. cypht.org auto-updates (not sure the frequency but at least once per day).

If there are any issues, we can iterate after that. It will be much more fun with a SSG :-)

Thank you very much!

@Denperidge
Copy link
Contributor Author

  1. Thank you very much!
  2. Oh that is an oversight on my end. Will make sure to pull before adding more, and double-checking the ones already moved
  3. I hadn't planned on going, but maybe I should! I'd have proposed my help for the FOSDEM issue, but due to my relative inexperience with using the Cypht app itself I wouldn't be much help on that end I'm afraid

Will do! Should be within the next days if that's alright. Public reminder for once this gets merged, gotta remember to change the Pages configuration to "from branch" to "from Actions"

Sounds good 😌

My pleasure!

@marclaporte
Copy link
Member

Super!

I highly recommend FOSDEM! I added info about Cypht related topics: cypht-org/cypht#1396

@Denperidge Denperidge mentioned this issue Dec 17, 2024
11 tasks
@Denperidge
Copy link
Contributor Author

@marclaporte Due to Cecil's pretty urls & GitHub Pages handling of it, as it stands now: cypht.org/security, cypht.org/security/ & cypht.org/securtity/index.htmlwork, but cypht.org/security.html will stop working.

Is this an okay trade-off for pretty urls, or do you prefer if it is turned off for the sake of preserving old links?

@marclaporte
Copy link
Member

I prefer pretty URLs. Can we have 301 redirects?

cypht.org/security, cypht.org/security/ & cypht.org/securtity/index.htmlwork

Is there a canonical tag?

@Denperidge
Copy link
Contributor Author

Denperidge commented Dec 17, 2024

I don't think the redirects are built-in (as its still a static site), but should be doable manually. Either a solution like I've used at https://github.com/Denperidge/cms-cheatsheet/blob/2b8230d5103bf24837ab102fb91e48d2e39949d3/src/redirect.html (HTML page with JS redirect), or we can even let it output the same files to both install.html and install/index.html if wanted

No canonical tag as of now, can be added though! What's your preferred notation?

Edit: I am a fool. it has some stuff built-in. Will try to explore later!

Update: explored, changes visible in PR. Is not a full 301 (since I don't know if that's possibly with a static site unless you use nginx/caddy, but I'd love to be proven wrong), but it does redirect users.

Newer update: everything done aside from canonical url & linking towards them!

@marclaporte
Copy link
Member

No canonical tag as of now, can be added though! What's your preferred notation?

cypht.org/security

@Denperidge
Copy link
Contributor Author

Alright, that's updated, PR is now ready!

@marclaporte
Copy link
Member

Well done! I asked @Baraka24 to review.

Thanks!

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

No branches or pull requests

2 participants