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之前運行!