We're thrilled to announce the release of SuCoS v4.1.0! This version brings exciting new features and improvements that will enhance your static site generation experience.
We've added two new Liquid templates, term.liquid and taxonomy.liquid, to further extend the list of available templates for theming. If these templates are missing, they will default to list.liquid. These new templates provide you with more flexibility and control when customizing the look and feel of your taxonomy and term pages.
term.liquid is used to customize the appearance of a single term page, such as a tag or category. You can now access term-specific data and tailor the layout to better suit the content.
taxonomy.liquid is used to customize the appearance of a taxonomy listing page, such as a list of all tags or categories. This template allows you to create a unique layout for each taxonomy type, making it easier for users to navigate and find the content they're looking for.
Case-Insensitive YAML Front Matter and Site Settings
In our ongoing efforts to improve usability, we've made YAML front matter and site settings case-insensitive. This change will make it easier for you to configure your site and reduce the potential for errors.
Previously, the YAML front matter and site settings were only valid if they used CamelCase to match the C# class properties counterparts. For example, to set the site title, you would need to use Title in your YAML configuration:
---
Title: My Page
---
With the new case-insensitive feature, you can now use any case when defining your YAML front matter and site settings. The following examples are now all valid and will correctly set the site title:
---
title: My Page 1
---
---
TITLE: My Page 1
---
---
tiTle: My Page 1
---
This change applies to all properties in the sucos.yaml and any content page.
Notice: in case of repeating values, the last one will prevail.
---
title: My Page 1
TITLE: My Page 2
tiTle: My Page 3 # This one will be used since it's the last
---
From a user's perspective, this might seem like a simple release, but don't be fooled! We've been hard at work behind the scenes to bring you significant improvements in both speed and stability.
We are excited to announce that JetBrains has kindly provided us with a license for their powerful C# IDE, Rider, and their static code analyzer, Qodana. This has allowed us to dive deep into our codebase and optimize it for even better performance.
Server Crash on Constant File Changes
Ever noticed that the app would sometimes crash when you were rapidly making changes to a content file? We've tracked down the issue and it turns out that each file change was triggering a duplicate server reload, eventually overwhelming the app. But worry no more - we've fixed this bug, and your rapid-fire edits should now be smooth sailing.
Stay tuned for more exciting updates in the near future!
We understand that reading through raw git logs can be a daunting task, so we've taken the time to create a changelog that's both human and machine-readable. This new changelog is handcrafted by our team to provide you with a clear and concise overview of each update. We hope you find it helpful!
Due to the ReadyToRun and Multiple themes features, there are some changes that users must be aware when upgrading their sites. More on that later.
Features
ReadyToRun
Recent DotNet versions allow a hybrid approach between compiled vs JIT compilation. It is called ReadyToRun. It tries to optimize the code converting some into native code and also make some inferences about the JIT optimizations.
The main advantage is speed. It will probably be about 2 times faster. It will also pave the way to further attempt to complete AOT compilation #35 , which would bring even more speed and smaller size.
However, it required some changes, specially in the YAML parser, because it needed to avoid Reflection.
BREAKING CHANGE: all page and site settings (YAML) that are not de default variables will be ignored. Only custom data present under Params: will be kept into your pages. Before, unknown values were automatically placed under Params, even if placed elsewhere.
Multiple themes
SuCoS now allow sites to install multiple themes (but still only use one). They will be placed inside a themes/ folder (or overwriting it using ThemeDir variable in the site settings sucus.yaml). It will also allow using nested git repositories and splitting the theme into other remote repositories.
BREAKING CHANGE: until now, the theme data was supposed to be placed in theme/ folder. Now, one must create a themes/ folder and put the theme data into a folder within it, like themes/my-theme
new theme terminal command
You can now scaffold the theme structure using the new SuCoS new theme command. It will -still- not populate with any generic theme, but it's the plan for the future.
CODE_OF_CONDUCT and CONTRIBUTING
The source code now has CODE_OF_CONDUCT and CONTRIBUTING documents. The first state the expected conduct for everything in the project, from users or maintainers. Respect, tolerance and a bit o humor are a must. The second contains instructions on ways to start contributing and making changes for yourself. Further instructions are in developer section of this site.
Fixes
404 page Exception
When using live server, if the 404 page is hit (non-existing page), the server was raising an exception and crashing.
Return 0 (success) for help and version
when calling SuCoS version or SuCoS help terminal commands, it was crashing.
Internal Organization
Some changes in the code that do not change the behavior of the app.
Nuke build project is now merged inside .nuke
All app commands are placed in Commands folder
Updated dependencies and libraries
Fixes and enhancements in code comments and code style
As I've mentioned in the v2.2.0 post, I forgot to mark the release as breaking change. It was so impactful that I was not able to even update this very site. Now I've decided to mark as a new version, signalling the need of changes of any client site.
Create a Site via Terminal
SuCoS newsite -o <PATH> will create a simple blank site.
Lighter Container Images
Using containers to build your site is one of many usages of the program. GitLab, GitHub, Netlify and Cloudflare allow specifying the site builder.
The base image will impact in the speed that the provider will download it to build your site. It was never a big size but it exposes the software to potential vulnerabilities.
The new images (now using both Microsoft modified Ubuntu and Alpine) are smaller and have less stuff into them. Win-win. For those that are using the latest, nothing changes.
Check Your Links (Beta)
It's now possible to check all the links of your site using the checklinks command. There are flags to check only internal or external links and to skip any given URL that are problematic. It's useful for the build process, making sure that your site is all valid.
Note
The "internal" flag, that scans the filesystem instead the URL might not work if your site uses Aliases or changes the name of the content.
Hold onto your hats, folks! It's time to celebrate a major milestone - our very own Static Site Generator (SSG) built with C# has officially turned one! As we blow out the candles and sing "Happy Birthday," let's take a moment to reflect on the wild ride that our SSG has been on since its inception on April 1st, 2023.
Our SSG was born out of a desire to test and improve my C# skills, as well as a growing frustration with the template system used by Hugo, a popular SSG built with Golang. I wanted to create a solution that addressed a problem that I was personally facing. And so, the idea of our SSG was conceived!
Present
When it came to choosing a template system for our SSG, I opted for Liquid templates. Their popularity and user-friendly nature made them an ideal choice for our SSG. They provided the flexibility and ease of use that I was looking for, making it a perfect fit for our SSG.
As for performance, DotNet (6, 7, and now, 8) has been instrumental in making our SSG the powerhouse that it is today. The C# team's continued efforts to enhance the performance of DotNet have made it a viable option for performance-critical programs. This has significantly improved the speed and efficiency of our SSG, making it a reliable choice for developers.
As mostly a one-man project, the use of AI was a very important motivator for diving into unknown territory. ChatGPT, Copilot, Bard, Gemini, and Mistral were mainly used to generate test suites, analyze and suggest optimizations in the code, and suggest libraries that might help.
Future
While our SSG has come a long way in its first year, there's still work to be done. In the coming months, I plan to implement key features such as pagination, multi-language, and image manipulation and conversion. My "ultimate" goal is to port my personal blog to our SSG, and I'm confident that these improvements will make that possible.
My wife thought it was an April Fool's joke when I started our SSG. But here we are, a year later, celebrating the first birthday of a project that has grown beyond my wildest dreams. It's been a year of learning, growth, and innovation, and I can't wait to see what the future holds for our SSG.
Now the build command is implicit. Also, the --source option is now an argument, so one can call either build or serve and then the path directly. As before, the default is to assume the current path (./). The usage of --source or -s is still possible and will take precedent, for compatibility’s sake.
Now you can build a site just by calling SuCoS.
Elegant Crashes
When something goes wrong in the build or serve processes (and it most definitively, will), the program crashes. Well, we are not fixing anything here, but at least print the sh*t in a very delicate manner!
After some weeks of development hiatus after the sad passing of my dog Mage Merlin, I'm back developing my juice. 2.2.0 was supposed to be 3.0.0 due the disrupting changes for the page resources. I hope anyone using the system found their way.
Branch (also called page bundles): content with filenames as index.md or _image.md. They are the hub and all other files in the folder will be considered as its resources.
We're replacing the outdated Microsoft.AspNetCore, that is going to be deprecated, with System.Net for the live server.
We've updated some key packages:
Fluid.Core* from 2.4.0 to 2.5.0
Markdig* from 0.31.0 to 0.33.0
Microsoft.NET.Test.Sdk* from to 17.7.2
Nuke.Common* from 7.0.2 to 7.0.6
Serilog* from 3.0.0 to 3.0.1
YamlDotNet* from 13.1.0 to 13.7.1
For smoother unit testing and URL generation, we're making sure everything uses Unix path style, especially when dealing with code that relies on paths.
Despite not being marked as a BREAKING CHANGE, it includes a breaking change.
Warning
It was supposed to be published in 2023-08-17.
Despite not being marked as a BREAKING CHANGE, it includes a breaking change.
Intro
Due to a familiar problem, the death of (from 3) my dog Mage Merlin, I've basically stopped everything I was developing for weeks. I'm still managing to resume all the stuff. I was working in a feature of Page Resources (embed pictures, PDFs, videos, etc.) into pages. It was incomplete, but I decided to publish the WIP, so users might get any potential new feature.
Each page can have extra content, like image files, video, audio, PDF, and even other markdown pages. They are called page Resources. It's available on Bundle pages (see the 2.2.1 post).
Version Merlin
I dedicate this release to my 4-pawns son, Mago Merlin Harigaya Massa 🐕. RIP my boy.