Rust library to generate static websites
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: easier way to include styles and scripts

+443 -64
+320 -33
Cargo.lock
··· 23 23 source = "registry+https://github.com/rust-lang/crates.io-index" 24 24 checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" 25 25 dependencies = [ 26 - "getrandom", 26 + "getrandom 0.2.15", 27 27 "once_cell", 28 28 "version_check", 29 29 ] ··· 35 35 checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 36 36 dependencies = [ 37 37 "cfg-if", 38 - "getrandom", 38 + "getrandom 0.2.15", 39 39 "once_cell", 40 40 "version_check", 41 41 "zerocopy", ··· 377 377 dependencies = [ 378 378 "castaway", 379 379 "cfg-if", 380 - "itoa", 380 + "itoa 1.0.14", 381 381 "rustversion", 382 382 "ryu", 383 383 "static_assertions", ··· 402 402 "quote", 403 403 "syn 1.0.109", 404 404 ] 405 + 406 + [[package]] 407 + name = "convert_case" 408 + version = "0.4.0" 409 + source = "registry+https://github.com/rust-lang/crates.io-index" 410 + checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 405 411 406 412 [[package]] 407 413 name = "convert_case" ··· 479 485 480 486 [[package]] 481 487 name = "cssparser" 488 + version = "0.27.2" 489 + source = "registry+https://github.com/rust-lang/crates.io-index" 490 + checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" 491 + dependencies = [ 492 + "cssparser-macros", 493 + "dtoa-short", 494 + "itoa 0.4.8", 495 + "matches", 496 + "phf 0.8.0", 497 + "proc-macro2", 498 + "quote", 499 + "smallvec", 500 + "syn 1.0.109", 501 + ] 502 + 503 + [[package]] 504 + name = "cssparser" 482 505 version = "0.33.0" 483 506 source = "registry+https://github.com/rust-lang/crates.io-index" 484 507 checksum = "9be934d936a0fbed5bcdc01042b770de1398bf79d0e192f49fa7faea0e99281e" 485 508 dependencies = [ 486 509 "cssparser-macros", 487 510 "dtoa-short", 488 - "itoa", 489 - "phf", 511 + "itoa 1.0.14", 512 + "phf 0.11.2", 490 513 "smallvec", 491 514 ] 492 515 ··· 496 519 source = "registry+https://github.com/rust-lang/crates.io-index" 497 520 checksum = "556c099a61d85989d7af52b692e35a8d68a57e7df8c6d07563dc0778b3960c9f" 498 521 dependencies = [ 499 - "cssparser", 522 + "cssparser 0.33.0", 500 523 ] 501 524 502 525 [[package]] ··· 567 590 ] 568 591 569 592 [[package]] 593 + name = "derive_more" 594 + version = "0.99.18" 595 + source = "registry+https://github.com/rust-lang/crates.io-index" 596 + checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" 597 + dependencies = [ 598 + "convert_case 0.4.0", 599 + "proc-macro2", 600 + "quote", 601 + "rustc_version", 602 + "syn 2.0.91", 603 + ] 604 + 605 + [[package]] 570 606 name = "digest" 571 607 version = "0.10.7" 572 608 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 608 644 version = "1.13.0" 609 645 source = "registry+https://github.com/rust-lang/crates.io-index" 610 646 checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" 647 + 648 + [[package]] 649 + name = "encoding_rs" 650 + version = "0.8.35" 651 + source = "registry+https://github.com/rust-lang/crates.io-index" 652 + checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 653 + dependencies = [ 654 + "cfg-if", 655 + ] 611 656 612 657 [[package]] 613 658 name = "env_filter" ··· 773 818 ] 774 819 775 820 [[package]] 821 + name = "fxhash" 822 + version = "0.2.1" 823 + source = "registry+https://github.com/rust-lang/crates.io-index" 824 + checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" 825 + dependencies = [ 826 + "byteorder", 827 + ] 828 + 829 + [[package]] 776 830 name = "generic-array" 777 831 version = "0.14.7" 778 832 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 784 838 785 839 [[package]] 786 840 name = "getrandom" 841 + version = "0.1.16" 842 + source = "registry+https://github.com/rust-lang/crates.io-index" 843 + checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 844 + dependencies = [ 845 + "cfg-if", 846 + "libc", 847 + "wasi 0.9.0+wasi-snapshot-preview1", 848 + ] 849 + 850 + [[package]] 851 + name = "getrandom" 787 852 version = "0.2.15" 788 853 source = "registry+https://github.com/rust-lang/crates.io-index" 789 854 checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 790 855 dependencies = [ 791 856 "cfg-if", 792 857 "libc", 793 - "wasi", 858 + "wasi 0.11.0+wasi-snapshot-preview1", 794 859 ] 795 860 796 861 [[package]] ··· 945 1010 946 1011 [[package]] 947 1012 name = "itoa" 1013 + version = "0.4.8" 1014 + source = "registry+https://github.com/rust-lang/crates.io-index" 1015 + checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" 1016 + 1017 + [[package]] 1018 + name = "itoa" 948 1019 version = "1.0.14" 949 1020 source = "registry+https://github.com/rust-lang/crates.io-index" 950 1021 checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" ··· 995 1066 checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 996 1067 997 1068 [[package]] 1069 + name = "lazycell" 1070 + version = "1.3.0" 1071 + source = "registry+https://github.com/rust-lang/crates.io-index" 1072 + checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 1073 + 1074 + [[package]] 998 1075 name = "libc" 999 1076 version = "0.2.169" 1000 1077 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1020 1097 "ahash 0.8.11", 1021 1098 "bitflags 2.6.0", 1022 1099 "const-str", 1023 - "cssparser", 1100 + "cssparser 0.33.0", 1024 1101 "cssparser-color", 1025 1102 "dashmap 5.5.3", 1026 1103 "data-encoding", 1027 - "getrandom", 1104 + "getrandom 0.2.15", 1028 1105 "indexmap", 1029 1106 "itertools 0.10.5", 1030 1107 "lazy_static", ··· 1044 1121 source = "registry+https://github.com/rust-lang/crates.io-index" 1045 1122 checksum = "84c12744d1279367caed41739ef094c325d53fb0ffcd4f9b84a368796f870252" 1046 1123 dependencies = [ 1047 - "convert_case", 1124 + "convert_case 0.6.0", 1048 1125 "proc-macro2", 1049 1126 "quote", 1050 1127 "syn 1.0.109", ··· 1067 1144 checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 1068 1145 1069 1146 [[package]] 1147 + name = "lol_html" 1148 + version = "2.1.0" 1149 + source = "registry+https://github.com/rust-lang/crates.io-index" 1150 + checksum = "2872b88213f3cd4b04f719ec8f2e0b37c98882a7c4aa6fc13ba2f19f5eba1bd2" 1151 + dependencies = [ 1152 + "bitflags 2.6.0", 1153 + "cfg-if", 1154 + "cssparser 0.27.2", 1155 + "encoding_rs", 1156 + "hashbrown 0.15.2", 1157 + "lazy_static", 1158 + "lazycell", 1159 + "memchr", 1160 + "mime", 1161 + "selectors", 1162 + "thiserror 1.0.69", 1163 + ] 1164 + 1165 + [[package]] 1070 1166 name = "matchers" 1071 1167 version = "0.1.0" 1072 1168 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1087 1183 source = "registry+https://github.com/rust-lang/crates.io-index" 1088 1184 checksum = "df518b75016b4289cdddffa1b01f2122f4a49802c93191f3133f6dc2472ebcaa" 1089 1185 dependencies = [ 1090 - "itoa", 1186 + "itoa 1.0.14", 1091 1187 "maud_macros", 1092 1188 ] 1093 1189 ··· 1112 1208 "dyn-eq", 1113 1209 "env_logger", 1114 1210 "log", 1211 + "lol_html", 1115 1212 "maud", 1116 1213 "maudit-macros", 1117 1214 "rayon", ··· 1172 1269 dependencies = [ 1173 1270 "libc", 1174 1271 "log", 1175 - "wasi", 1272 + "wasi 0.11.0+wasi-snapshot-preview1", 1176 1273 "windows-sys 0.52.0", 1177 1274 ] 1275 + 1276 + [[package]] 1277 + name = "nodrop" 1278 + version = "0.1.14" 1279 + source = "registry+https://github.com/rust-lang/crates.io-index" 1280 + checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" 1178 1281 1179 1282 [[package]] 1180 1283 name = "nom" ··· 1551 1654 "oxc_diagnostics", 1552 1655 "oxc_estree", 1553 1656 "oxc_span", 1554 - "phf", 1657 + "phf 0.11.2", 1555 1658 "rustc-hash", 1556 1659 "unicode-id-start", 1557 1660 ] ··· 1593 1696 "oxc_index", 1594 1697 "oxc_span", 1595 1698 "oxc_syntax", 1596 - "phf", 1699 + "phf 0.11.2", 1597 1700 "rustc-hash", 1598 1701 "self_cell", 1599 1702 ] ··· 1640 1743 "oxc_estree", 1641 1744 "oxc_index", 1642 1745 "oxc_span", 1643 - "phf", 1746 + "phf 0.11.2", 1644 1747 "rustc-hash", 1645 1748 "ryu-js", 1646 1749 "unicode-id-start", ··· 1657 1760 "cow-utils", 1658 1761 "dashmap 6.1.0", 1659 1762 "indexmap", 1660 - "itoa", 1763 + "itoa 1.0.14", 1661 1764 "lazy_static", 1662 1765 "oxc-browserslist", 1663 1766 "oxc_allocator", ··· 1684 1787 checksum = "57a3fab85b35924798950cd178f28083449288c3be24323322ad296af62bb30a" 1685 1788 dependencies = [ 1686 1789 "compact_str", 1687 - "itoa", 1790 + "itoa 1.0.14", 1688 1791 "oxc_allocator", 1689 1792 "oxc_ast", 1690 1793 "oxc_data_structures", ··· 1702 1805 checksum = "7645c578d3a5c4cdf667af1ad39765f5f751c4883d251e050d5e1204b5cad0a9" 1703 1806 dependencies = [ 1704 1807 "bitflags 2.6.0", 1705 - "cssparser", 1808 + "cssparser 0.33.0", 1706 1809 "log", 1707 - "phf", 1708 - "phf_codegen", 1810 + "phf 0.11.2", 1811 + "phf_codegen 0.11.2", 1709 1812 "precomputed-hash", 1710 1813 "rustc-hash", 1711 1814 "smallvec", ··· 1762 1865 1763 1866 [[package]] 1764 1867 name = "phf" 1868 + version = "0.8.0" 1869 + source = "registry+https://github.com/rust-lang/crates.io-index" 1870 + checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" 1871 + dependencies = [ 1872 + "phf_macros 0.8.0", 1873 + "phf_shared 0.8.0", 1874 + "proc-macro-hack", 1875 + ] 1876 + 1877 + [[package]] 1878 + name = "phf" 1765 1879 version = "0.11.2" 1766 1880 source = "registry+https://github.com/rust-lang/crates.io-index" 1767 1881 checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" 1768 1882 dependencies = [ 1769 - "phf_macros", 1770 - "phf_shared", 1883 + "phf_macros 0.11.2", 1884 + "phf_shared 0.11.2", 1885 + ] 1886 + 1887 + [[package]] 1888 + name = "phf_codegen" 1889 + version = "0.8.0" 1890 + source = "registry+https://github.com/rust-lang/crates.io-index" 1891 + checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" 1892 + dependencies = [ 1893 + "phf_generator 0.8.0", 1894 + "phf_shared 0.8.0", 1771 1895 ] 1772 1896 1773 1897 [[package]] ··· 1776 1900 source = "registry+https://github.com/rust-lang/crates.io-index" 1777 1901 checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" 1778 1902 dependencies = [ 1779 - "phf_generator", 1780 - "phf_shared", 1903 + "phf_generator 0.11.2", 1904 + "phf_shared 0.11.2", 1905 + ] 1906 + 1907 + [[package]] 1908 + name = "phf_generator" 1909 + version = "0.8.0" 1910 + source = "registry+https://github.com/rust-lang/crates.io-index" 1911 + checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" 1912 + dependencies = [ 1913 + "phf_shared 0.8.0", 1914 + "rand 0.7.3", 1781 1915 ] 1782 1916 1783 1917 [[package]] ··· 1786 1920 source = "registry+https://github.com/rust-lang/crates.io-index" 1787 1921 checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" 1788 1922 dependencies = [ 1789 - "phf_shared", 1790 - "rand", 1923 + "phf_shared 0.11.2", 1924 + "rand 0.8.5", 1925 + ] 1926 + 1927 + [[package]] 1928 + name = "phf_macros" 1929 + version = "0.8.0" 1930 + source = "registry+https://github.com/rust-lang/crates.io-index" 1931 + checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" 1932 + dependencies = [ 1933 + "phf_generator 0.8.0", 1934 + "phf_shared 0.8.0", 1935 + "proc-macro-hack", 1936 + "proc-macro2", 1937 + "quote", 1938 + "syn 1.0.109", 1791 1939 ] 1792 1940 1793 1941 [[package]] ··· 1796 1944 source = "registry+https://github.com/rust-lang/crates.io-index" 1797 1945 checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" 1798 1946 dependencies = [ 1799 - "phf_generator", 1800 - "phf_shared", 1947 + "phf_generator 0.11.2", 1948 + "phf_shared 0.11.2", 1801 1949 "proc-macro2", 1802 1950 "quote", 1803 1951 "syn 2.0.91", 1952 + ] 1953 + 1954 + [[package]] 1955 + name = "phf_shared" 1956 + version = "0.8.0" 1957 + source = "registry+https://github.com/rust-lang/crates.io-index" 1958 + checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" 1959 + dependencies = [ 1960 + "siphasher", 1804 1961 ] 1805 1962 1806 1963 [[package]] ··· 1851 2008 checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 1852 2009 1853 2010 [[package]] 2011 + name = "ppv-lite86" 2012 + version = "0.2.20" 2013 + source = "registry+https://github.com/rust-lang/crates.io-index" 2014 + checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 2015 + dependencies = [ 2016 + "zerocopy", 2017 + ] 2018 + 2019 + [[package]] 1854 2020 name = "precomputed-hash" 1855 2021 version = "0.1.1" 1856 2022 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1878 2044 "quote", 1879 2045 "version_check", 1880 2046 ] 2047 + 2048 + [[package]] 2049 + name = "proc-macro-hack" 2050 + version = "0.5.20+deprecated" 2051 + source = "registry+https://github.com/rust-lang/crates.io-index" 2052 + checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" 1881 2053 1882 2054 [[package]] 1883 2055 name = "proc-macro2" ··· 1925 2097 1926 2098 [[package]] 1927 2099 name = "rand" 2100 + version = "0.7.3" 2101 + source = "registry+https://github.com/rust-lang/crates.io-index" 2102 + checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 2103 + dependencies = [ 2104 + "getrandom 0.1.16", 2105 + "libc", 2106 + "rand_chacha", 2107 + "rand_core 0.5.1", 2108 + "rand_hc", 2109 + "rand_pcg", 2110 + ] 2111 + 2112 + [[package]] 2113 + name = "rand" 1928 2114 version = "0.8.5" 1929 2115 source = "registry+https://github.com/rust-lang/crates.io-index" 1930 2116 checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1931 2117 dependencies = [ 1932 - "rand_core", 2118 + "rand_core 0.6.4", 2119 + ] 2120 + 2121 + [[package]] 2122 + name = "rand_chacha" 2123 + version = "0.2.2" 2124 + source = "registry+https://github.com/rust-lang/crates.io-index" 2125 + checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 2126 + dependencies = [ 2127 + "ppv-lite86", 2128 + "rand_core 0.5.1", 2129 + ] 2130 + 2131 + [[package]] 2132 + name = "rand_core" 2133 + version = "0.5.1" 2134 + source = "registry+https://github.com/rust-lang/crates.io-index" 2135 + checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 2136 + dependencies = [ 2137 + "getrandom 0.1.16", 1933 2138 ] 1934 2139 1935 2140 [[package]] ··· 1939 2144 checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1940 2145 1941 2146 [[package]] 2147 + name = "rand_hc" 2148 + version = "0.2.0" 2149 + source = "registry+https://github.com/rust-lang/crates.io-index" 2150 + checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 2151 + dependencies = [ 2152 + "rand_core 0.5.1", 2153 + ] 2154 + 2155 + [[package]] 2156 + name = "rand_pcg" 2157 + version = "0.2.1" 2158 + source = "registry+https://github.com/rust-lang/crates.io-index" 2159 + checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" 2160 + dependencies = [ 2161 + "rand_core 0.5.1", 2162 + ] 2163 + 2164 + [[package]] 1942 2165 name = "rayon" 1943 2166 version = "1.10.0" 1944 2167 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2073 2296 "futures", 2074 2297 "indexmap", 2075 2298 "itertools 0.13.0", 2076 - "itoa", 2299 + "itoa 1.0.14", 2077 2300 "memchr", 2078 2301 "notify", 2079 2302 "oxc", ··· 2184 2407 source = "git+https://github.com/rolldown/rolldown?rev=f9fc700f00b9a4ef3659c70d2be4d7cd61b492c8#f9fc700f00b9a4ef3659c70d2be4d7cd61b492c8" 2185 2408 dependencies = [ 2186 2409 "anyhow", 2187 - "itoa", 2410 + "itoa 1.0.14", 2188 2411 "rolldown_common", 2189 2412 "rolldown_utils", 2190 2413 "serde_json", ··· 2300 2523 "mime", 2301 2524 "oxc", 2302 2525 "oxc_index", 2303 - "phf", 2526 + "phf 0.11.2", 2304 2527 "rayon", 2305 2528 "regex", 2306 2529 "regress", ··· 2333 2556 checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" 2334 2557 2335 2558 [[package]] 2559 + name = "rustc_version" 2560 + version = "0.4.1" 2561 + source = "registry+https://github.com/rust-lang/crates.io-index" 2562 + checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" 2563 + dependencies = [ 2564 + "semver", 2565 + ] 2566 + 2567 + [[package]] 2336 2568 name = "rustversion" 2337 2569 version = "1.0.18" 2338 2570 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2381 2613 checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" 2382 2614 2383 2615 [[package]] 2616 + name = "selectors" 2617 + version = "0.22.0" 2618 + source = "registry+https://github.com/rust-lang/crates.io-index" 2619 + checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" 2620 + dependencies = [ 2621 + "bitflags 1.3.2", 2622 + "cssparser 0.27.2", 2623 + "derive_more", 2624 + "fxhash", 2625 + "log", 2626 + "matches", 2627 + "phf 0.8.0", 2628 + "phf_codegen 0.8.0", 2629 + "precomputed-hash", 2630 + "servo_arc", 2631 + "smallvec", 2632 + "thin-slice", 2633 + ] 2634 + 2635 + [[package]] 2384 2636 name = "self_cell" 2385 2637 version = "1.1.0" 2386 2638 source = "registry+https://github.com/rust-lang/crates.io-index" 2387 2639 checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" 2640 + 2641 + [[package]] 2642 + name = "semver" 2643 + version = "1.0.24" 2644 + source = "registry+https://github.com/rust-lang/crates.io-index" 2645 + checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" 2388 2646 2389 2647 [[package]] 2390 2648 name = "seq-macro" ··· 2419 2677 checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" 2420 2678 dependencies = [ 2421 2679 "indexmap", 2422 - "itoa", 2680 + "itoa 1.0.14", 2423 2681 "memchr", 2424 2682 "ryu", 2425 2683 "serde", 2426 2684 ] 2427 2685 2428 2686 [[package]] 2687 + name = "servo_arc" 2688 + version = "0.1.1" 2689 + source = "registry+https://github.com/rust-lang/crates.io-index" 2690 + checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" 2691 + dependencies = [ 2692 + "nodrop", 2693 + "stable_deref_trait", 2694 + ] 2695 + 2696 + [[package]] 2429 2697 name = "sha1" 2430 2698 version = "0.10.6" 2431 2699 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2494 2762 checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" 2495 2763 2496 2764 [[package]] 2765 + name = "stable_deref_trait" 2766 + version = "1.2.0" 2767 + source = "registry+https://github.com/rust-lang/crates.io-index" 2768 + checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 2769 + 2770 + [[package]] 2497 2771 name = "static_assertions" 2498 2772 version = "1.1.0" 2499 2773 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2561 2835 ] 2562 2836 2563 2837 [[package]] 2838 + name = "thin-slice" 2839 + version = "0.1.1" 2840 + source = "registry+https://github.com/rust-lang/crates.io-index" 2841 + checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" 2842 + 2843 + [[package]] 2564 2844 name = "thiserror" 2565 2845 version = "1.0.69" 2566 2846 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2852 3132 2853 3133 [[package]] 2854 3134 name = "wasi" 3135 + version = "0.9.0+wasi-snapshot-preview1" 3136 + source = "registry+https://github.com/rust-lang/crates.io-index" 3137 + checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 3138 + 3139 + [[package]] 3140 + name = "wasi" 2855 3141 version = "0.11.0+wasi-snapshot-preview1" 2856 3142 source = "registry+https://github.com/rust-lang/crates.io-index" 2857 3143 checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" ··· 3059 3345 source = "registry+https://github.com/rust-lang/crates.io-index" 3060 3346 checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 3061 3347 dependencies = [ 3348 + "byteorder", 3062 3349 "zerocopy-derive", 3063 3350 ] 3064 3351
+1
crates/framework/Cargo.toml
··· 18 18 rolldown = { git = "https://github.com/rolldown/rolldown", version = "0.1.0", rev = "f9fc700f00b9a4ef3659c70d2be4d7cd61b492c8" } 19 19 tokio = { version = "1", features = ["macros", "rt-multi-thread"] } 20 20 thiserror = "2.0.9" 21 + lol_html = "2.1.0"
+49 -2
crates/framework/src/assets.rs
··· 1 1 use dyn_eq::DynEq; 2 2 use log::info; 3 + use maud::{html, Markup, Render}; 3 4 use rustc_hash::FxHashSet; 4 5 use std::hash::Hash; 5 6 use std::process::Command; ··· 11 12 pub(crate) assets: FxHashSet<Box<dyn Asset>>, 12 13 pub(crate) scripts: FxHashSet<Script>, 13 14 pub(crate) styles: FxHashSet<Style>, 15 + pub(crate) included_styles: Vec<Style>, 16 + pub(crate) included_scripts: Vec<Script>, 14 17 } 15 18 16 19 impl PageAssets { ··· 30 33 script 31 34 } 32 35 36 + pub fn include_script(&mut self, script_path: PathBuf) { 37 + let script = Script { path: script_path }; 38 + 39 + self.scripts.insert(script.clone()); 40 + self.included_scripts.push(script); 41 + } 42 + 33 43 pub fn add_style(&mut self, style_path: PathBuf, tailwind: bool) -> Style { 34 44 let style = Style { 35 45 path: style_path, ··· 40 50 41 51 style 42 52 } 53 + 54 + pub fn include_style(&mut self, style_path: PathBuf, tailwind: bool) { 55 + let style = Style { 56 + path: style_path, 57 + tailwind, 58 + }; 59 + 60 + self.styles.insert(style.clone()); 61 + self.included_styles.push(style); 62 + } 43 63 } 44 64 45 65 pub trait Asset: DynEq { ··· 92 112 } 93 113 } 94 114 115 + impl Render for Image { 116 + fn render(&self) -> Markup { 117 + html! { 118 + img src=(self.url().unwrap()) loading="lazy" decoding="async"; 119 + } 120 + } 121 + } 122 + 95 123 #[derive(Clone, PartialEq, Eq, Hash)] 96 124 #[non_exhaustive] 97 125 pub struct Script { ··· 110 138 } 111 139 112 140 fn hash(&self) -> [u8; 8] { 141 + // TODO: Proper hash 113 142 [0; 8] 114 143 } 115 144 } 116 145 146 + impl Render for Script { 147 + fn render(&self) -> Markup { 148 + html! { 149 + script src=(self.url().unwrap()) r#type="module" {} 150 + } 151 + } 152 + } 153 + 117 154 #[derive(Clone, PartialEq, Eq, Hash)] 118 155 #[non_exhaustive] 119 156 pub struct Style { ··· 133 170 } 134 171 135 172 fn process(&self) -> Option<String> { 173 + // TODO: Detect tailwind automatically 136 174 if self.tailwind { 137 175 let tmp_path = "dist/_tmp/tailwind.css"; 138 176 let start_tailwind = SystemTime::now(); 139 - let tailwind_output = Command::new("tailwindcss") 140 - .arg("--minify") 177 + let tailwind_output = Command::new("tailwindcss") // TODO: Allow custom tailwind binary path 178 + .arg("--minify") // TODO: Allow disabling minification 141 179 .args(["--output", tmp_path]) 142 180 .output() 143 181 .expect("failed to execute process"); ··· 153 191 } 154 192 155 193 fn hash(&self) -> [u8; 8] { 194 + // TODO: Proper hash 156 195 [0; 8] 157 196 } 158 197 } 198 + 199 + impl Render for Style { 200 + fn render(&self) -> Markup { 201 + html! { 202 + link rel="stylesheet" type="text/css" href=(self.url().unwrap()); 203 + } 204 + } 205 + }
+71 -26
crates/framework/src/lib.rs
··· 23 23 use colored::{ColoredString, Colorize}; 24 24 use env_logger::{Builder, Env}; 25 25 use log::{info, trace}; 26 - use page::{FullPage, RouteContext, RouteParams}; 26 + use page::{FullPage, RenderResult, RouteContext, RouteParams}; 27 27 use rolldown::{Bundler, BundlerOptions, InputItem}; 28 28 use rustc_hash::FxHashSet; 29 29 30 30 use assets::Asset; 31 31 use logging::{format_elapsed_time, FormatElapsedTimeOptions}; 32 + 33 + use lol_html::{element, rewrite_str, RewriteStrSettings}; 32 34 33 35 #[macro_export] 34 36 macro_rules! routes { ··· 145 147 assets: &mut page_assets, 146 148 }; 147 149 148 - let (file_path, file) = create_route_file(route, &ctx.params)?; 149 - render_route(file, route, &mut ctx)?; 150 + let (file_path, mut file) = create_route_file(route, &ctx.params)?; 151 + let result = route.render(&mut ctx); 152 + 153 + finish_route( 154 + result, 155 + &mut file, 156 + &page_assets.included_styles, 157 + &page_assets.included_scripts, 158 + ) 159 + .unwrap(); 150 160 151 161 let formatted_elasped_time = 152 162 format_elapsed_time(route_start.elapsed(), &route_format_options)?; 153 - info!(target: "build", "{} -> {} {}", route.route(&ctx.params), file_path.to_string_lossy().dimmed(), formatted_elasped_time); 163 + info!(target: "build", "{} -> {} {}", route.route(&page::RouteParams(FxHashMap::default())), file_path.to_string_lossy().dimmed(), formatted_elasped_time); 154 164 155 165 build_pages_assets.extend(page_assets.assets); 156 166 build_pages_scripts.extend(page_assets.scripts); ··· 165 175 false => { 166 176 info!(target: "build", "{}", route.route_raw().to_string().bold()); 167 177 168 - // Reuse the same PageAssets HashSet for all the routes of a dynamic page 169 - let mut pages_assets = assets::PageAssets::default(); 170 - 171 178 routes.into_iter().for_each(|params| { 179 + let mut pages_assets = assets::PageAssets::default(); 172 180 let route_start = SystemTime::now(); 173 181 let mut ctx = RouteContext { params, assets: &mut pages_assets }; 174 182 175 - let (file_path, file) = create_route_file(route, &ctx.params).unwrap(); 176 - render_route(file, route, &mut ctx).unwrap(); 177 - 178 - let formatted_elasped_time = format_elapsed_time(route_start.elapsed(), &route_format_options).unwrap(); 179 - info!(target: "build", "├─ {} {}", file_path.to_string_lossy().dimmed(), formatted_elasped_time); 183 + let (file_path, mut file) = create_route_file(route, &ctx.params).unwrap(); 184 + let result = route.render(&mut ctx); 180 185 181 186 build_metadata.pages.push(PageOutput { 182 187 route: route.route_raw(), 183 188 file_path: file_path.to_string_lossy().to_string(), 184 - params: Some(ctx.params.0.clone()), 189 + params: Some(ctx.params.0), 185 190 }); 186 - }); 187 191 188 - build_pages_assets.extend(pages_assets.assets); 189 - build_pages_scripts.extend(pages_assets.scripts); 190 - build_pages_styles.extend(pages_assets.styles); 192 + finish_route(result, &mut file, &pages_assets.included_styles, &pages_assets.included_scripts).unwrap(); 193 + 194 + let formatted_elasped_time = format_elapsed_time(route_start.elapsed(), &route_format_options).unwrap(); 195 + info!(target: "build", "├─ {} {}", file_path.to_string_lossy().dimmed(), formatted_elasped_time); 196 + 197 + 198 + build_pages_assets.extend(pages_assets.assets); 199 + build_pages_scripts.extend(pages_assets.scripts); 200 + build_pages_styles.extend(pages_assets.styles); 201 + }); 191 202 } 192 203 } 193 204 } ··· 322 333 Ok((file_path, file)) 323 334 } 324 335 325 - fn render_route( 326 - mut file: File, 327 - route: &dyn page::FullPage, 328 - ctx: &mut RouteContext, 336 + fn finish_route( 337 + render_result: RenderResult, 338 + file: &mut File, 339 + included_styles: &Vec<assets::Style>, 340 + included_scripts: &Vec<assets::Script>, 329 341 ) -> Result<(), Box<dyn std::error::Error>> { 330 - let rendered = route.render(ctx); 331 - match rendered { 332 - page::RenderResult::Html(html) => { 333 - file.write_all(html.into_string().as_bytes())?; 342 + match render_result { 343 + RenderResult::Html(html) => { 344 + let element_content_handlers = vec![ 345 + // Add included scripts and styles to the head 346 + element!("head", |el| { 347 + for style in included_styles { 348 + el.append( 349 + &format!( 350 + "<link rel=\"stylesheet\" href=\"{}\">", 351 + style.url().unwrap() 352 + ), 353 + lol_html::html_content::ContentType::Html, 354 + ); 355 + } 356 + 357 + for script in included_scripts { 358 + el.append( 359 + &format!("<script src=\"{}\"></script>", script.url().unwrap()), 360 + lol_html::html_content::ContentType::Html, 361 + ); 362 + } 363 + 364 + Ok(()) 365 + }), 366 + ]; 367 + 368 + let output = rewrite_str( 369 + &html.into_string(), 370 + RewriteStrSettings { 371 + element_content_handlers, 372 + ..RewriteStrSettings::new() 373 + }, 374 + ) 375 + .unwrap(); 376 + 377 + file.write_all(output.as_bytes())?; 334 378 } 335 - page::RenderResult::Text(text) => { 379 + RenderResult::Text(text) => { 336 380 file.write_all(text.as_bytes())?; 337 381 } 338 382 } 383 + 339 384 Ok(()) 340 385 } 341 386
+2 -3
crates/user-example/src/pages/dynamic.rs
··· 26 26 fn render(&self, ctx: &mut RouteContext) -> RenderResult { 27 27 let params = ctx.params.parse_into::<Params>(); 28 28 let image = ctx.assets.add_image("data/social-card.png".into()); 29 - let style = ctx.assets.add_style("data/tailwind.css".into(), true); 29 + ctx.assets.include_style("data/tailwind.css".into(), true); 30 30 31 31 RenderResult::Html(html! { 32 32 head { 33 33 title { "Index" } 34 - link rel="stylesheet" href=(style.url().unwrap()) {} 35 34 } 36 35 h1 { "Hello, world!" } 37 - img src=(image.path.to_string_lossy()) {} 36 + (image) 38 37 p { (params.page) } 39 38 }) 40 39 }