banner
lca

lca

真正的不自由,是在自己的心中设下牢笼。

Ctfd Category Pagination Settings

wallhaven-x8jl83


Friends who have set up ctfd may know that if there are many questions in ctfd, all the questions will be displayed on one page. At this time, a classification pagination plugin is needed. After searching on the Internet, I found a project that can meet the requirements, which has a similar effect to ctfshow and buuoj.

Project address: https://github.com/frankli0324/ctfd-pages-theme

After taking a look, many people encountered npm errors in this project. I also tried several times and encountered npm errors. I don't know what those errors mean. Although there are errors, you can ignore them and still achieve the desired effect.

Here is a process for setting up. I directly modified the files in the core directory based on ctfd-pages-theme. Only two files need to be replaced.

  1. CTFd/themes/core/assets/js/pages/challenges.js

image-20230413101907721

  1. CTFd/themes/core/templates/challenges.html

image-20230413101836328

If you directly modify the challenges.* files in the core directory, you can ignore the instructions in the ctfd-pages-theme project to "replace webpack.config.js with the webpack.config.js in the repository and build using npm". You can directly use the original webpack.config.js file.

After the preparatory work is done, you can start building with npm.

  1. Install npm
sudo apt install npm
  1. After installing npm, set the npm source
npm config set registry https://registry.npm.taobao.org
  1. Build
npm i && npm run build
  1. If the build fails with the following error, there is a problem with the npm build

image-20230413102305982

But if there is green text above the error message.

image-20230413102416219

It means that the pages classification page can be used. Why is there an error? After checking, it may be related to the admin theme, but this message can be ignored.

image-20230413102516465

  1. The last step is to re-run docker-compose and restart the ctfd container.
sudo docker-compose up -d
sudo docker restart 13d

image-20230413102700327

The effect is as follows:

image-20230413102729337

end...

Image source: https://wallhaven.cc/

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.