Skip to content

171 website refactoring#178

Merged
MxHonesty merged 4 commits intomainfrom
171-website-refactoring
Sep 4, 2025
Merged

171 website refactoring#178
MxHonesty merged 4 commits intomainfrom
171-website-refactoring

Conversation

@VladSteopoaie
Copy link
Copy Markdown
Contributor

This PR adds some invisible refactoring to the website. The changes include:

  • archetypes (renamed the default archetype as writeup, more intuitive) - this will slightly change the way we add writeups, from hugo new CTFName/writeup.md to hugo new --kind writeup CTFName/writeup.md (I will update the wiki once this PR is approved)
  • added the type: writeup line to every ctf related file in content/, this change will make sure that hugo will use the newly added writeup layout
  • added the writeup layout, for the moment it's a copy of the default layout, but this will let us customize the writeup pages in the future without interfering with the default layout

This PR is necessary because newly created writeups will automatically have the type: writeup line so we don't have to add them manually in the future.

…stuff: "

- Added 'type: writeup' to all writeups .md - Added the ctf and writeup archetypes - Added the writeup layout
@VladSteopoaie VladSteopoaie self-assigned this Aug 21, 2025
@VladSteopoaie VladSteopoaie added the refactor 🔨 refactor or improvement label Aug 21, 2025
@VladSteopoaie VladSteopoaie linked an issue Aug 21, 2025 that may be closed by this pull request
@VladSteopoaie VladSteopoaie linked an issue Aug 21, 2025 that may be closed by this pull request
…useless for now and modified the index acordingly.
…inux for now). Updated term.html for the new structure. Updated the writeup archetype for the new structure.
@VladSteopoaie
Copy link
Copy Markdown
Contributor Author

I added some new changes which are useful for maintainability:

  • I created a special folder content/ctfs where we can store all the ctfs. This will make the content folder cleaner and easier to manage
  • I also created a new ctfs layout, which does nothing, but I could not start hugo without it.
  • modified index.html, term.html and the writeup archetype according to the new changes.
  • created a bash script create.sh to automate the process of adding ctfs and writeups

@VladSteopoaie
Copy link
Copy Markdown
Contributor Author

Testing steps for reviewers:

  • run the server to see if it works
  • enter on all pages (home, about, events, tags, one tag page, one ctf page, one writeup page) look if you see any visual anomalies
  • use the create.sh script to create a new CTF and some writeups to it and check to see if they were added correctly and if hugo renders them
  • any additional step is welcomed

I did this steps myself, but it would be nice to have someone else look at it in case I missed something.

@Stefan-Radu
Copy link
Copy Markdown
Member

tried to test, but i get this error when building:

❯ hugo server
Watching for changes in /home/zenbassi/hex/dothidden/{archetypes,assets,content,layouts,static}
Watching for config changes in /home/zenbassi/hex/dothidden/config.yaml
Start building sites … 
hugo v0.148.2+extended+withdeploy linux/amd64 BuildDate=unknown

Built in 247 ms
Error: error building site: render: failed to render pages: render of "/ctf" failed: "/home/zenbassi/hex/dothidden/layouts/_default/list.html:17:21": execute of template failed: template: list.html:17:21: executing "main" at <sort .Params.Tags>: error calling sort: sequence must be provided

hugo version 0.148

It's not really uncommon for them to introduce breaking changes as far as I could see.

I assume it works on your machine? @VladSteopoaie

@MxHonesty
Copy link
Copy Markdown
Contributor

MxHonesty commented Sep 4, 2025

Tested and all looks good to me. Thanks for the contribution.

@MxHonesty MxHonesty self-requested a review September 4, 2025 15:45
@MxHonesty
Copy link
Copy Markdown
Contributor

Also tested on latest hugo, seems to work fine

@MxHonesty MxHonesty merged commit 1c93e01 into main Sep 4, 2025
@MxHonesty MxHonesty deleted the 171-website-refactoring branch September 4, 2025 16:10
@VladSteopoaie VladSteopoaie mentioned this pull request Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 🔨 refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor website to make it more maintainable

3 participants