crystal_china
Version, currently master branch1 version
- master branchlatestOct 11, 2026
github.com/crystal-china/website
Crystal China website
Installation
# Add this to your shard.yml
dependencies:
crystal_china:
github: crystal-china/website
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.20.0- License
- MIT
- Author
- Billy.Zheng
- Target
crystal_chinafrom src/crystal_china.cr
Dependencies
Runtime Dependencies
- jwt*github: crystal-community/jwt
- avram*github: luckyframework/avram
- cache*github: crystal-cache/cache
- lucky*github: luckyframework/lucky
- markd*github: icyleaf/markd
- carbon*github: luckyframework/carbon
- captcha*github: crystal-china/captcha
- rosetta*github: wout/rosetta
- sanitize*github: straight-shoota/sanitize
- authentic*github: luckyframework/authentic
- lucky_env*github: luckyframework/lucky_env
- lucky_task*github: luckyframework/lucky_task
- multi_auth*github: zw963/multi_auth
- tartrazine*github: ralsina/tartrazine
- time_in_words*github: crystal-china/time_in_words
- cron_scheduler*github: kostya/cron_scheduler
- carbon_smtp_adapter*github: luckyframework/carbon_smtp_adapter
- baked_file_system_mounter*github: crystal-china/baked_file_system_mounter
Development Dependencies
- timecop*github: crystal-community/timecop.crdev
- lucky_flow*github: luckyframework/lucky_flow, branch: masterdev
README
The website for https://crystal-china.org
Development dependencies
- Crystal
- pg
- bun
- podman (or docker)
Development
-
First, install Crystal. You can check out the instructions here: https://crystal-lang.org/install/
-
Run
crystal run script/setup.cr, Just make sure you’ve gotpgandbuninstalled before running this. -
Finally, run
lucky dev, and you're all set!
Deployment
The application is deployed as a static binary with its frontend assets baked in. Markdown documents deliberately remain outside the binary so they can be updated without recompiling the application.
-
Run
bun run prodto build and precompress the frontend assets intopublic/assets. -
Build the static binary with
script/build_amd64_static_binary.sh. This requires Podman or Docker.Alternatively, use the sb_static script with Zig. See Use Zig CC as an alternative linker for details.
-
Synchronize
public/markdowns/withrsync -a --delete(apply--deleteonly to that directory) andpublic/sitemap.xmlwithrsync -a. Missing or blanknavigation.ymlmeans no Sidebar or Pager. Ifnavigation.ymlorindex.mdis missing,/docs/indexshows a setup page listing the missing files; no files are created automatically.The setup page includes file format examples and a "Generate starter files" button for signed-in administrators listed in
ADMIN_EMAILS. The button creates only missing files and never overwrites existing files. The server needs write permission forpublic/markdowns/to use it. -
Copy
bin/crystal_chinaandbin/tasksto the server and configure the environment in.env; see .env.sample. The deployed application has the following relevant structure:. ├── .env ├── bin │ ├── crystal_china │ └── tasks └── public ├── markdowns │ ├── navigation.yml │ └── ... └── sitemap.xml -
Run
bin/tasks db.migrateandbin/tasks db.sync_doc_contentto populate the PGroonga-backed document search index. The sync task is safe to rerun after Markdown changes. -
Add a systemd service to start the server. See crystal_china.service. Procodile can be used instead.
-
Optionally, use Nginx as a reverse proxy. Configuration examples are available in the nginx folder.
Updating documentation
- Edit files under
public/markdowns/and updatenavigation.ymlwhen the page should appear in the Sidebar and Pager. - Synchronize the complete directory with
rsync -a --delete public/markdowns/ .../public/markdowns/so removed Markdown files also disappear from the server. - Run
bin/tasks db.sync_doc_contenton the server to update searchable content, then refresh the document page. Recompiling or restarting the application is not required.
A Markdown file omitted from navigation.yml remains directly accessible and searchable, but it will not appear in the Sidebar or Pager. Visiting a document also syncs its content into the search index.
Contributing
- Fork it (https://github.com/zw963/website/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Billy.Zheng - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Oct 11, 2026
- Crystal
>= 1.20.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/crystal-china/website
Metadata
- Created
- Aug 12, 2026
- Updated
- Oct 12, 2026
- Synced
- Oct 12, 2026
- Versions
- 1