flixel |插件| ui |演示|工具|模板|文档| haxeflixel.com
这是haxeflixel.com的来源。它使用11ty进行静态站点的生成,而Bootstrap 5用于造型。
您必须拥有npm / nodejs来编译网站,欢迎拉动请求。
安装nodejs
克隆并运行网站
git clone https://github.com/HaxeFlixel/haxeflixel.com.git
cd haxeflixel.com要安装依赖项并构建站点,请运行以下命令:
# downloads dependencies, and clones flixel-docs
npm install
# runs the start command from package.json, which boots up the static site generator and scss styling for live reload
npm run start打开http:// localhost:8080/
通过修改content/ , content/_layouts/以及content/_scss/ Directories开始破解。当您保存修改的文件时,该网站将重新加载。
有关更多开发信息,请参见贡献代码。
如果您想贡献和改进我们的网站,请在叉子或功能分支上工作。只有工作和测试的更改才会合并为主。使用问题系统进行开发人员的支持,并批准您的更改。
/documentation的文档自动从Flixel-Docs存储库中preinstall提取(通过包装。
请在Flixel-Docs Repo中查看README,以获取有关更新haxeflixel.com/documentation Pages的更多信息。
按照此示例创建/content/demos中的.md文件:
```
---
title: "Demo-Name"
layout: demo
width: 800
height: 500
source: "flixel-demos-subdirectory/Demo-Name"
---
Here goes the actual description of the demo in GitHub-Flavored-Markdown:
* What the demo displays
* Who created it
* What the controls are
* etc
HTML is still allowed and can be used for more advanced descriptions.
```
source指向包含演示的Flixel-Demos的子目录。
width和height默认为640和480,在这种情况下应省略。
Demo-Name.png的演示的屏幕截图到/static/demos/images 。.md文件/content/showcase : ---
layout: showcase
title: "Go! Go! PogoGirl"
itch: https://ohsat-andrej.itch.io/go-go-pogogirl
website: https://www.ohsat.com/game/go-go-pogogirl/
steam: https://store.steampowered.com/app/1681010/Go_Go_PogoGirl/
switch: https://www.nintendo.com/store/products/go-go-pogogirl-switch/
ps4: https://store.playstation.com/en-us/product/UP0891-PPSA10169_00-GOGOPOGOGIRLRATG
xbox: https://www.microsoft.com/store/productid/9P10H7L6QCCJ
date: "2022-02-01"
---
Dates should use YYYY-MM-DD
Note that by adding a URL to one of the supported targets, the icon will automatically become coloured on the
[showcase page](https://haxeflixel.com/showcase) and link to that URL.
*.md文件中使用的相同标题,例如Go! Go! PogoGirl.png to /static/images/showcase 。它们调整大小并裁剪为500x260,因此最好使用相同的比例。尚未正式发布的展示仅在特殊情况下才被接受。游戏果酱的游戏也是如此。
除了正常安装和运行命令(请参阅大约)之外,还有其他有用的命令 /工作流程。
npm install应安装所需的所有内容。使用VSCODE,您还可以安装推荐的扩展程序以进行自动格式化(在文件保存上)。但是,所有工作流程都应完全可以通过CLI使用。
content/_static所有静态文件(通常是 /主要是图像)都将其目录信息保存在网站的根目录中。因此, content/_static/images/将转向out/images ,应从网站中引用/images/ 。
npm run start运行npm run start将启动高度站点和SASS .SCS,并将重新加载更改。
npm test运行npm test将为该项目运行格式和覆盖测试。如果要运行所有测试,则可以简单地运行npm test ( test:js , test:liquid和test:prettier )。
但是,您可以单独运行每个测试。
npm run test:js将通过标准测试JavaScript。要自动修复所有问题,您可以运行npm run NPM运行FIX:JS`
npm run test:liquid将测试该站点是否通过eleventy --dryrun构建。
npm run test:prettier将使用Prettier测试一般样式一致性。您可以运行npm run fix:prettier ,是一种修复矛盾的简便方法。
npm fix运行npm fix将对代码进行自动格式化,以将其与standardjs , .liquidrc和.prettierrc.yaml匹配。通常,您想在提交PR之前运行!