im
Clone
https://git.tahinli.com/Tahinli/im.git
0 watching0 forksRustAGPL-3.0542.8 KiBb9f0726Tahinli27 days ago34 commits
| 1 | //! Build script of the `im` binary. It compiles `style/main.scss` into `OUT_DIR/main.css`, and it |
| 2 | //! emits the build identity and the content hashes that the page links use as cache-busting |
| 3 | //! queries: `IM_MAIN_CSS_V`, `IM_NAV_JS_V`, `IM_PAGES_JS_V` and `IM_BUILD_SHA`. |
| 4 | //! |
| 5 | //! It does not decide what is served: `src/assets.rs` embeds the files. It does not decide what a |
| 6 | //! page links to either: `src/assets.rs` builds the `?v=` URLs from these values. It only compiles |
| 7 | //! and hashes, so a changed file gets a new hash and an unchanged file keeps its URL. |
| 8 | |
| 9 | use ; |
| 10 | |
| 11 | use encode; |
| 12 | use ; |
| 13 | |
| 14 | /// Number of hex characters of the SHA-256 that make a content version. Twelve characters are 48 |
| 15 | /// bits, which is plenty to tell two builds of one file apart. |
| 16 | const VERSION_HEX_LEN: usize = 12; |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | /// The first `VERSION_HEX_LEN` hex characters of the SHA-256 of `bytes`. |
| 55 | |
| 56 | |
| 57 |