coignard / weblog

A stupidly simple plain text-based blog engine. No HTML, CSS, or JS included.
https://renecoignard.com
MIT License
45 stars 4 forks source link

TL;DR Static site generator support - GitHub Pages #39

Open ghost opened 1 week ago

ghost commented 1 week ago

Greetings,

Can you please make it possible to use this awesome weblog software as a static site generator, like with Jekyll(Ruby), for deploying the blog through services like GitHub Pages/Cloudflare Pages/Codeberg Pages etc ?

If yes, then please let me know, when it's ready for testing, I shall test it and find any bugs. If you need help, please let me know how weblog works and any resources to learn php and nginx (networking etc).

If no, please help me in understanding how did you implement the following:

  1. Around 32 character per line on mobile and then the line break and repeat, until last line of the post/ paragraph.
  2. Different formats of the index.html / homepage for mobile and desktop. (format even changes from mobile to desktop when desktop mode is enabled) How did you achive this?
  3. What custom format guide are you using, to format the posts/pages/website.

I am trying to implement plaintext weblog concept in Ruby language through Jekyll+Liquid. Here is the github repository. Here is the website/ github page Demo.

I appreciate your work for the open source community. And I really love this project and the philosophy behind it. I have read some interesting posts on your website too and discovered the cute easter egg as well.
All the best for the future development.

Thankyou for reading. <3

coignard commented 1 week ago

Hi there,

Thank you for your suggestion! It's a great idea, and I actually considered implementing it in the past. However, I don't have the time to work on this feature at the moment. Essentially, what would need to be done is to adapt the current engine to generate all files for all accessible paths.

While I don't plan on adding static generation in the near future, I would be more than happy if someone else wanted to take this on!

coignard commented 1 week ago

Regarding your specific questions:

  1. Around 32 characters per line on mobile and then line break/repeat until the last line of the post/paragraph:

    • This feature is managed by the TextUtils class in the formatParagraph method. It calculates the line width and applies it when formatting text.
    • The width is adjusted for mobile devices using the Validator::isMobileDevice method which, if it detects a mobile device, halves the line width plus a few additional characters.
    • Text is split into lines according to the calculated width and then reassembled, maintaining word boundaries whenever possible.
  2. Different formats of homepage for mobile and desktop:

    • The format is dynamically adjusted based on whether the request comes from a mobile device, determined by the user agent string.
    • The configurations such as lineWidth, showCategory, showDate, etc., are adjusted within the Config class upon calling the handleMobileDevice method.
    • Depending on these configuration settings, the rendering adjusts elements to fit within the constraints set for mobile or desktop views.
  3. Custom format guide to format the posts/pages/website:

    • The custom format guide is implemented through various utility methods in the TextUtils and StringUtils classes, as well as configuration settings stored in the Config class.
    • For example:
      • Text is centered using centerText.
      • Quotes and lists are formatted via formatQuote and formatList, respectively.
      • Special characters and beautification are handled in beautifyText.

Thank you for your interest in my project!

ghost commented 1 week ago

Thankyou for the detailed explaination. I shall keep the issue open, incase someone else decides to take this on!

Meanwhile, I will try my best to understand, tinker and implement the features. Maybe I will learn PHP in holidays.