├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── shadow-cljs.edn ├── site ├── .eslintignore ├── .gitignore ├── .prettierrc ├── LICENSE ├── README.md ├── gatsby-browser.js ├── gatsby-config.js ├── gatsby-node.js ├── gatsby-ssr.js ├── package-lock.json ├── package.json ├── src │ ├── .babelrc │ ├── css │ │ └── layout.css │ └── images │ │ └── gatsby-icon.png └── yarn.lock └── src └── main ├── demo └── gatsby.cljs └── shadow └── gatsby.clj /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | public/js 3 | 4 | /target 5 | /checkouts 6 | /src/gen 7 | 8 | pom.xml 9 | pom.xml.asc 10 | *.iml 11 | *.jar 12 | *.log 13 | .shadow-cljs 14 | .idea 15 | .lein-* 16 | .nrepl-* 17 | .DS_Store 18 | 19 | .hgignore 20 | .hg/ 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Minimal example showing how shadow-cljs could be used together with gatsby to create static sites in CLJS. 2 | 3 | `site` is a directory create by `gatsby new` with all the `.js` files removed. They will instead be generated by `shadow-cljs`. I nested the `site` directory in the `shadow-cljs` project but you can also nest the `shadow-cljs` directory in the gatsby root instead. I do not recommend mixing though. 4 | 5 | ## Run shadow-cljs 6 | 7 | ``` 8 | npm install 9 | npx shadow-cljs watch gatsby 10 | ``` 11 | 12 | ## Run gatsby separately 13 | 14 | ``` 15 | npm install -g gatsby-cli 16 | cd site 17 | npm install 18 | gatsby develop 19 | ``` 20 | 21 | ## When done open in brower 22 | 23 | ``` 24 | open http://localhost:8000 25 | ``` -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shadow-cljs-gatsby", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "asn1.js": { 8 | "version": "4.10.1", 9 | "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", 10 | "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", 11 | "dev": true, 12 | "requires": { 13 | "bn.js": "^4.0.0", 14 | "inherits": "^2.0.1", 15 | "minimalistic-assert": "^1.0.0" 16 | } 17 | }, 18 | "assert": { 19 | "version": "1.4.1", 20 | "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", 21 | "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", 22 | "dev": true, 23 | "requires": { 24 | "util": "0.10.3" 25 | }, 26 | "dependencies": { 27 | "util": { 28 | "version": "0.10.3", 29 | "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", 30 | "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", 31 | "dev": true, 32 | "requires": { 33 | "inherits": "2.0.1" 34 | } 35 | } 36 | } 37 | }, 38 | "async-limiter": { 39 | "version": "1.0.0", 40 | "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", 41 | "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", 42 | "dev": true 43 | }, 44 | "base64-js": { 45 | "version": "1.3.0", 46 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", 47 | "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", 48 | "dev": true 49 | }, 50 | "bn.js": { 51 | "version": "4.11.8", 52 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", 53 | "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", 54 | "dev": true 55 | }, 56 | "brorand": { 57 | "version": "1.1.0", 58 | "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", 59 | "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", 60 | "dev": true 61 | }, 62 | "browserify-aes": { 63 | "version": "1.2.0", 64 | "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", 65 | "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", 66 | "dev": true, 67 | "requires": { 68 | "buffer-xor": "^1.0.3", 69 | "cipher-base": "^1.0.0", 70 | "create-hash": "^1.1.0", 71 | "evp_bytestokey": "^1.0.3", 72 | "inherits": "^2.0.1", 73 | "safe-buffer": "^5.0.1" 74 | } 75 | }, 76 | "browserify-cipher": { 77 | "version": "1.0.1", 78 | "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", 79 | "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", 80 | "dev": true, 81 | "requires": { 82 | "browserify-aes": "^1.0.4", 83 | "browserify-des": "^1.0.0", 84 | "evp_bytestokey": "^1.0.0" 85 | } 86 | }, 87 | "browserify-des": { 88 | "version": "1.0.2", 89 | "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", 90 | "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", 91 | "dev": true, 92 | "requires": { 93 | "cipher-base": "^1.0.1", 94 | "des.js": "^1.0.0", 95 | "inherits": "^2.0.1", 96 | "safe-buffer": "^5.1.2" 97 | } 98 | }, 99 | "browserify-rsa": { 100 | "version": "4.0.1", 101 | "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", 102 | "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", 103 | "dev": true, 104 | "requires": { 105 | "bn.js": "^4.1.0", 106 | "randombytes": "^2.0.1" 107 | } 108 | }, 109 | "browserify-sign": { 110 | "version": "4.0.4", 111 | "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", 112 | "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", 113 | "dev": true, 114 | "requires": { 115 | "bn.js": "^4.1.1", 116 | "browserify-rsa": "^4.0.0", 117 | "create-hash": "^1.1.0", 118 | "create-hmac": "^1.1.2", 119 | "elliptic": "^6.0.0", 120 | "inherits": "^2.0.1", 121 | "parse-asn1": "^5.0.0" 122 | } 123 | }, 124 | "browserify-zlib": { 125 | "version": "0.2.0", 126 | "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", 127 | "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", 128 | "dev": true, 129 | "requires": { 130 | "pako": "~1.0.5" 131 | } 132 | }, 133 | "buffer": { 134 | "version": "4.9.1", 135 | "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", 136 | "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", 137 | "dev": true, 138 | "requires": { 139 | "base64-js": "^1.0.2", 140 | "ieee754": "^1.1.4", 141 | "isarray": "^1.0.0" 142 | } 143 | }, 144 | "buffer-xor": { 145 | "version": "1.0.3", 146 | "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", 147 | "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", 148 | "dev": true 149 | }, 150 | "builtin-status-codes": { 151 | "version": "3.0.0", 152 | "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", 153 | "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", 154 | "dev": true 155 | }, 156 | "cipher-base": { 157 | "version": "1.0.4", 158 | "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", 159 | "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", 160 | "dev": true, 161 | "requires": { 162 | "inherits": "^2.0.1", 163 | "safe-buffer": "^5.0.1" 164 | } 165 | }, 166 | "console-browserify": { 167 | "version": "1.1.0", 168 | "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", 169 | "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", 170 | "dev": true, 171 | "requires": { 172 | "date-now": "^0.1.4" 173 | } 174 | }, 175 | "constants-browserify": { 176 | "version": "1.0.0", 177 | "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", 178 | "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", 179 | "dev": true 180 | }, 181 | "core-util-is": { 182 | "version": "1.0.2", 183 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 184 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", 185 | "dev": true 186 | }, 187 | "create-ecdh": { 188 | "version": "4.0.3", 189 | "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", 190 | "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", 191 | "dev": true, 192 | "requires": { 193 | "bn.js": "^4.1.0", 194 | "elliptic": "^6.0.0" 195 | } 196 | }, 197 | "create-hash": { 198 | "version": "1.2.0", 199 | "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", 200 | "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", 201 | "dev": true, 202 | "requires": { 203 | "cipher-base": "^1.0.1", 204 | "inherits": "^2.0.1", 205 | "md5.js": "^1.3.4", 206 | "ripemd160": "^2.0.1", 207 | "sha.js": "^2.4.0" 208 | } 209 | }, 210 | "create-hmac": { 211 | "version": "1.1.7", 212 | "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", 213 | "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", 214 | "dev": true, 215 | "requires": { 216 | "cipher-base": "^1.0.3", 217 | "create-hash": "^1.1.0", 218 | "inherits": "^2.0.1", 219 | "ripemd160": "^2.0.0", 220 | "safe-buffer": "^5.0.1", 221 | "sha.js": "^2.4.8" 222 | } 223 | }, 224 | "crypto-browserify": { 225 | "version": "3.12.0", 226 | "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", 227 | "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", 228 | "dev": true, 229 | "requires": { 230 | "browserify-cipher": "^1.0.0", 231 | "browserify-sign": "^4.0.0", 232 | "create-ecdh": "^4.0.0", 233 | "create-hash": "^1.1.0", 234 | "create-hmac": "^1.1.0", 235 | "diffie-hellman": "^5.0.0", 236 | "inherits": "^2.0.1", 237 | "pbkdf2": "^3.0.3", 238 | "public-encrypt": "^4.0.0", 239 | "randombytes": "^2.0.0", 240 | "randomfill": "^1.0.3" 241 | } 242 | }, 243 | "date-now": { 244 | "version": "0.1.4", 245 | "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", 246 | "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", 247 | "dev": true 248 | }, 249 | "des.js": { 250 | "version": "1.0.0", 251 | "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", 252 | "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", 253 | "dev": true, 254 | "requires": { 255 | "inherits": "^2.0.1", 256 | "minimalistic-assert": "^1.0.0" 257 | } 258 | }, 259 | "diffie-hellman": { 260 | "version": "5.0.3", 261 | "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", 262 | "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", 263 | "dev": true, 264 | "requires": { 265 | "bn.js": "^4.1.0", 266 | "miller-rabin": "^4.0.0", 267 | "randombytes": "^2.0.0" 268 | } 269 | }, 270 | "domain-browser": { 271 | "version": "1.2.0", 272 | "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", 273 | "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", 274 | "dev": true 275 | }, 276 | "elliptic": { 277 | "version": "6.4.1", 278 | "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", 279 | "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", 280 | "dev": true, 281 | "requires": { 282 | "bn.js": "^4.4.0", 283 | "brorand": "^1.0.1", 284 | "hash.js": "^1.0.0", 285 | "hmac-drbg": "^1.0.0", 286 | "inherits": "^2.0.1", 287 | "minimalistic-assert": "^1.0.0", 288 | "minimalistic-crypto-utils": "^1.0.0" 289 | } 290 | }, 291 | "events": { 292 | "version": "1.1.1", 293 | "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", 294 | "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", 295 | "dev": true 296 | }, 297 | "evp_bytestokey": { 298 | "version": "1.0.3", 299 | "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", 300 | "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", 301 | "dev": true, 302 | "requires": { 303 | "md5.js": "^1.3.4", 304 | "safe-buffer": "^5.1.1" 305 | } 306 | }, 307 | "hash-base": { 308 | "version": "3.0.4", 309 | "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", 310 | "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", 311 | "dev": true, 312 | "requires": { 313 | "inherits": "^2.0.1", 314 | "safe-buffer": "^5.0.1" 315 | } 316 | }, 317 | "hash.js": { 318 | "version": "1.1.5", 319 | "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", 320 | "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", 321 | "dev": true, 322 | "requires": { 323 | "inherits": "^2.0.3", 324 | "minimalistic-assert": "^1.0.1" 325 | }, 326 | "dependencies": { 327 | "inherits": { 328 | "version": "2.0.3", 329 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 330 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 331 | "dev": true 332 | } 333 | } 334 | }, 335 | "hmac-drbg": { 336 | "version": "1.0.1", 337 | "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", 338 | "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", 339 | "dev": true, 340 | "requires": { 341 | "hash.js": "^1.0.3", 342 | "minimalistic-assert": "^1.0.0", 343 | "minimalistic-crypto-utils": "^1.0.1" 344 | } 345 | }, 346 | "https-browserify": { 347 | "version": "1.0.0", 348 | "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", 349 | "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", 350 | "dev": true 351 | }, 352 | "ieee754": { 353 | "version": "1.1.12", 354 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", 355 | "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", 356 | "dev": true 357 | }, 358 | "indexof": { 359 | "version": "0.0.1", 360 | "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", 361 | "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", 362 | "dev": true 363 | }, 364 | "inherits": { 365 | "version": "2.0.1", 366 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", 367 | "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", 368 | "dev": true 369 | }, 370 | "isarray": { 371 | "version": "1.0.0", 372 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 373 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", 374 | "dev": true 375 | }, 376 | "md5.js": { 377 | "version": "1.3.4", 378 | "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", 379 | "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", 380 | "dev": true, 381 | "requires": { 382 | "hash-base": "^3.0.0", 383 | "inherits": "^2.0.1" 384 | } 385 | }, 386 | "miller-rabin": { 387 | "version": "4.0.1", 388 | "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", 389 | "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", 390 | "dev": true, 391 | "requires": { 392 | "bn.js": "^4.0.0", 393 | "brorand": "^1.0.1" 394 | } 395 | }, 396 | "minimalistic-assert": { 397 | "version": "1.0.1", 398 | "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", 399 | "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", 400 | "dev": true 401 | }, 402 | "minimalistic-crypto-utils": { 403 | "version": "1.0.1", 404 | "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", 405 | "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", 406 | "dev": true 407 | }, 408 | "minimist": { 409 | "version": "0.0.8", 410 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 411 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 412 | "dev": true 413 | }, 414 | "mkdirp": { 415 | "version": "0.5.1", 416 | "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 417 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 418 | "dev": true, 419 | "requires": { 420 | "minimist": "0.0.8" 421 | } 422 | }, 423 | "node-libs-browser": { 424 | "version": "2.1.0", 425 | "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", 426 | "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", 427 | "dev": true, 428 | "requires": { 429 | "assert": "^1.1.1", 430 | "browserify-zlib": "^0.2.0", 431 | "buffer": "^4.3.0", 432 | "console-browserify": "^1.1.0", 433 | "constants-browserify": "^1.0.0", 434 | "crypto-browserify": "^3.11.0", 435 | "domain-browser": "^1.1.1", 436 | "events": "^1.0.0", 437 | "https-browserify": "^1.0.0", 438 | "os-browserify": "^0.3.0", 439 | "path-browserify": "0.0.0", 440 | "process": "^0.11.10", 441 | "punycode": "^1.2.4", 442 | "querystring-es3": "^0.2.0", 443 | "readable-stream": "^2.3.3", 444 | "stream-browserify": "^2.0.1", 445 | "stream-http": "^2.7.2", 446 | "string_decoder": "^1.0.0", 447 | "timers-browserify": "^2.0.4", 448 | "tty-browserify": "0.0.0", 449 | "url": "^0.11.0", 450 | "util": "^0.10.3", 451 | "vm-browserify": "0.0.4" 452 | } 453 | }, 454 | "os-browserify": { 455 | "version": "0.3.0", 456 | "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", 457 | "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", 458 | "dev": true 459 | }, 460 | "pako": { 461 | "version": "1.0.6", 462 | "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", 463 | "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", 464 | "dev": true 465 | }, 466 | "parse-asn1": { 467 | "version": "5.1.1", 468 | "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", 469 | "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", 470 | "dev": true, 471 | "requires": { 472 | "asn1.js": "^4.0.0", 473 | "browserify-aes": "^1.0.0", 474 | "create-hash": "^1.1.0", 475 | "evp_bytestokey": "^1.0.0", 476 | "pbkdf2": "^3.0.3" 477 | } 478 | }, 479 | "path-browserify": { 480 | "version": "0.0.0", 481 | "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", 482 | "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", 483 | "dev": true 484 | }, 485 | "pbkdf2": { 486 | "version": "3.0.16", 487 | "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz", 488 | "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", 489 | "dev": true, 490 | "requires": { 491 | "create-hash": "^1.1.2", 492 | "create-hmac": "^1.1.4", 493 | "ripemd160": "^2.0.1", 494 | "safe-buffer": "^5.0.1", 495 | "sha.js": "^2.4.8" 496 | } 497 | }, 498 | "process": { 499 | "version": "0.11.10", 500 | "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", 501 | "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", 502 | "dev": true 503 | }, 504 | "process-nextick-args": { 505 | "version": "2.0.0", 506 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", 507 | "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", 508 | "dev": true 509 | }, 510 | "public-encrypt": { 511 | "version": "4.0.2", 512 | "resolved": "http://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz", 513 | "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", 514 | "dev": true, 515 | "requires": { 516 | "bn.js": "^4.1.0", 517 | "browserify-rsa": "^4.0.0", 518 | "create-hash": "^1.1.0", 519 | "parse-asn1": "^5.0.0", 520 | "randombytes": "^2.0.1" 521 | } 522 | }, 523 | "punycode": { 524 | "version": "1.4.1", 525 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 526 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", 527 | "dev": true 528 | }, 529 | "querystring": { 530 | "version": "0.2.0", 531 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", 532 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", 533 | "dev": true 534 | }, 535 | "querystring-es3": { 536 | "version": "0.2.1", 537 | "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", 538 | "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", 539 | "dev": true 540 | }, 541 | "randombytes": { 542 | "version": "2.0.6", 543 | "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", 544 | "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", 545 | "dev": true, 546 | "requires": { 547 | "safe-buffer": "^5.1.0" 548 | } 549 | }, 550 | "randomfill": { 551 | "version": "1.0.4", 552 | "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", 553 | "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", 554 | "dev": true, 555 | "requires": { 556 | "randombytes": "^2.0.5", 557 | "safe-buffer": "^5.1.0" 558 | } 559 | }, 560 | "readable-stream": { 561 | "version": "2.3.6", 562 | "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 563 | "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 564 | "dev": true, 565 | "requires": { 566 | "core-util-is": "~1.0.0", 567 | "inherits": "~2.0.3", 568 | "isarray": "~1.0.0", 569 | "process-nextick-args": "~2.0.0", 570 | "safe-buffer": "~5.1.1", 571 | "string_decoder": "~1.1.1", 572 | "util-deprecate": "~1.0.1" 573 | }, 574 | "dependencies": { 575 | "inherits": { 576 | "version": "2.0.3", 577 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 578 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 579 | "dev": true 580 | } 581 | } 582 | }, 583 | "readline-sync": { 584 | "version": "1.4.9", 585 | "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.9.tgz", 586 | "integrity": "sha1-PtqOZfI80qF+YTAbHwADOWr17No=", 587 | "dev": true 588 | }, 589 | "ripemd160": { 590 | "version": "2.0.2", 591 | "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", 592 | "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", 593 | "dev": true, 594 | "requires": { 595 | "hash-base": "^3.0.0", 596 | "inherits": "^2.0.1" 597 | } 598 | }, 599 | "safe-buffer": { 600 | "version": "5.1.2", 601 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 602 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 603 | "dev": true 604 | }, 605 | "setimmediate": { 606 | "version": "1.0.5", 607 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", 608 | "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", 609 | "dev": true 610 | }, 611 | "sha.js": { 612 | "version": "2.4.11", 613 | "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", 614 | "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", 615 | "dev": true, 616 | "requires": { 617 | "inherits": "^2.0.1", 618 | "safe-buffer": "^5.0.1" 619 | } 620 | }, 621 | "shadow-cljs": { 622 | "version": "2.6.9", 623 | "resolved": "https://registry.npmjs.org/shadow-cljs/-/shadow-cljs-2.6.9.tgz", 624 | "integrity": "sha512-ov5xtJsT39/DKzK9qxCQ/uTloPXLF0JIBw2knvLPYIY9vEqpBaiehklv442lCDhMvq0Eb55u8m0WjDRmKHA6bw==", 625 | "dev": true, 626 | "requires": { 627 | "mkdirp": "^0.5.1", 628 | "node-libs-browser": "^2.0.0", 629 | "readline-sync": "^1.4.7", 630 | "shadow-cljs-jar": "1.3.0", 631 | "signal-exit": "^3.0.2", 632 | "source-map-support": "^0.4.15", 633 | "ws": "^3.0.0" 634 | } 635 | }, 636 | "shadow-cljs-jar": { 637 | "version": "1.3.0", 638 | "resolved": "https://registry.npmjs.org/shadow-cljs-jar/-/shadow-cljs-jar-1.3.0.tgz", 639 | "integrity": "sha512-KReNVgFVM2ZPPGCP8rsCPqtlee/+SwXyoeEqbAXBO7jlpoNnNee2x4fiRg/Pr/vXGEkV/Ez5l4qdNSU1Na+1Jg==", 640 | "dev": true 641 | }, 642 | "signal-exit": { 643 | "version": "3.0.2", 644 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 645 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", 646 | "dev": true 647 | }, 648 | "source-map": { 649 | "version": "0.5.7", 650 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", 651 | "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", 652 | "dev": true 653 | }, 654 | "source-map-support": { 655 | "version": "0.4.18", 656 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", 657 | "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", 658 | "dev": true, 659 | "requires": { 660 | "source-map": "^0.5.6" 661 | } 662 | }, 663 | "stream-browserify": { 664 | "version": "2.0.1", 665 | "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", 666 | "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", 667 | "dev": true, 668 | "requires": { 669 | "inherits": "~2.0.1", 670 | "readable-stream": "^2.0.2" 671 | } 672 | }, 673 | "stream-http": { 674 | "version": "2.8.3", 675 | "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", 676 | "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", 677 | "dev": true, 678 | "requires": { 679 | "builtin-status-codes": "^3.0.0", 680 | "inherits": "^2.0.1", 681 | "readable-stream": "^2.3.6", 682 | "to-arraybuffer": "^1.0.0", 683 | "xtend": "^4.0.0" 684 | } 685 | }, 686 | "string_decoder": { 687 | "version": "1.1.1", 688 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 689 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 690 | "dev": true, 691 | "requires": { 692 | "safe-buffer": "~5.1.0" 693 | } 694 | }, 695 | "timers-browserify": { 696 | "version": "2.0.10", 697 | "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", 698 | "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", 699 | "dev": true, 700 | "requires": { 701 | "setimmediate": "^1.0.4" 702 | } 703 | }, 704 | "to-arraybuffer": { 705 | "version": "1.0.1", 706 | "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", 707 | "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", 708 | "dev": true 709 | }, 710 | "tty-browserify": { 711 | "version": "0.0.0", 712 | "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", 713 | "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", 714 | "dev": true 715 | }, 716 | "ultron": { 717 | "version": "1.1.1", 718 | "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", 719 | "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", 720 | "dev": true 721 | }, 722 | "url": { 723 | "version": "0.11.0", 724 | "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", 725 | "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", 726 | "dev": true, 727 | "requires": { 728 | "punycode": "1.3.2", 729 | "querystring": "0.2.0" 730 | }, 731 | "dependencies": { 732 | "punycode": { 733 | "version": "1.3.2", 734 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", 735 | "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", 736 | "dev": true 737 | } 738 | } 739 | }, 740 | "util": { 741 | "version": "0.10.4", 742 | "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", 743 | "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", 744 | "dev": true, 745 | "requires": { 746 | "inherits": "2.0.3" 747 | }, 748 | "dependencies": { 749 | "inherits": { 750 | "version": "2.0.3", 751 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 752 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 753 | "dev": true 754 | } 755 | } 756 | }, 757 | "util-deprecate": { 758 | "version": "1.0.2", 759 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 760 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", 761 | "dev": true 762 | }, 763 | "vm-browserify": { 764 | "version": "0.0.4", 765 | "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", 766 | "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", 767 | "dev": true, 768 | "requires": { 769 | "indexof": "0.0.1" 770 | } 771 | }, 772 | "ws": { 773 | "version": "3.3.3", 774 | "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", 775 | "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", 776 | "dev": true, 777 | "requires": { 778 | "async-limiter": "~1.0.0", 779 | "safe-buffer": "~5.1.0", 780 | "ultron": "~1.1.0" 781 | } 782 | }, 783 | "xtend": { 784 | "version": "4.0.1", 785 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", 786 | "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", 787 | "dev": true 788 | } 789 | } 790 | } 791 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shadow-cljs-gatsby", 3 | "version": "0.0.1", 4 | "private": true, 5 | "devDependencies": { 6 | "shadow-cljs": "2.6.9" 7 | }, 8 | "dependencies": {} 9 | } 10 | -------------------------------------------------------------------------------- /shadow-cljs.edn: -------------------------------------------------------------------------------- 1 | ;; shadow-cljs configuration 2 | {:source-paths 3 | ["src/dev" 4 | "src/main" 5 | "src/test"] 6 | 7 | :dependencies 8 | [[reagent "0.8.1"]] 9 | 10 | :builds 11 | {:gatsby {:target :npm-module 12 | :output-dir "site/src/cljs" 13 | :build-hooks 14 | [(shadow.gatsby/create-pages)] 15 | :entries [demo.gatsby]}}} 16 | -------------------------------------------------------------------------------- /site/.eslintignore: -------------------------------------------------------------------------------- 1 | src/cljs 2 | -------------------------------------------------------------------------------- /site/.gitignore: -------------------------------------------------------------------------------- 1 | # Project dependencies 2 | .cache 3 | node_modules 4 | yarn-error.log 5 | 6 | # Build directory 7 | /public 8 | .DS_Store 9 | 10 | # generated by shadow-cljs 11 | /src/cljs 12 | /src/pages 13 | -------------------------------------------------------------------------------- /site/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true, 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /site/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 gatsbyjs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /site/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Gatsby 4 | 5 |

6 |

7 | Gatsby's default starter 8 |

9 | 10 | Kick off your project with this default boilerplate. This barebones starter ships with the main Gatsby configuration files you might need. 11 | 12 | _Have another more specific idea? You may want to check out our vibrant collection of [official and community-created starters](https://next.gatsbyjs.org/docs/gatsby-starters/)._ 13 | 14 | ## 🚀 Quick start 15 | 16 | 1. **Install the Gatsby CLI.** 17 | 18 | The Gatsby CLI helps you create new sites using Gatsby starters (like this one!) 19 | 20 | ```sh 21 | # install the Gatsby CLI globally 22 | npm install -g gatsby-cli 23 | ``` 24 | 25 | 2. **Create a Gatsby site.** 26 | 27 | Use the Gatsby CLI to create a new site, specifying the default starter. 28 | 29 | ```sh 30 | # create a new Gatsby site using the default starter 31 | gatsby new my-default-starter 32 | ``` 33 | 34 | 3. **Start developing.** 35 | 36 | Navigate into your new site’s directory and start it up. 37 | 38 | ```sh 39 | cd my-default-starter/ 40 | gatsby develop 41 | ``` 42 | 43 | 4. **Open the source code and start editing!** 44 | 45 | Your site is now running at `http://localhost:8000`! 46 | 47 | *Note: You'll also see a second link: `http://localhost:8000___graphql`. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://next.gatsbyjs.org/tutorial/part-five/#introducing-graphiql).* 48 | 49 | Open the the `my-default-starter` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time! 50 | 51 | ## 🧐 What's inside? 52 | 53 | A quick look at the top-level files and directories you'll see in a Gatsby project. 54 | 55 | . 56 | ├── node_modules 57 | ├── src 58 | ├── .gitignore 59 | ├── .prettierrc 60 | ├── gatsby-browser.js 61 | ├── gatsby-config.js 62 | ├── gatsby-node.js 63 | ├── gatsby-ssr.js 64 | ├── LICENSE 65 | ├── package-lock.json 66 | ├── package.json 67 | ├── README.md 68 | └── yarn.lock 69 | 70 | 1. **`/node_modules`**: The directory where all of the modules of code that your project depends on (npm packages) are automatically installed. 71 | 72 | 2. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser), like your site header, or a page template. “Src” is a convention for “source code”. 73 | 74 | 3. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for. 75 | 76 | 4. **`.prettierrc`**: This is a configuration file for a tool called [Prettier](https://prettier.io/), which is a tool to help keep the formatting of your code consistent. 77 | 78 | 5. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://next.gatsbyjs.org/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser. 79 | 80 | 6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://next.gatsbyjs.org/docs/gatsby-config/) for more detail). 81 | 82 | 7. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby node APIs](https://next.gatsbyjs.org/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. 83 | 84 | 8. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://next.gatsbyjs.org/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering. 85 | 86 | 9. **`LICENSE`**: Gatsby is licensed under the MIT license. 87 | 88 | 10. **`package-lock.json`** (See `package.json` below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You won’t change this file directly). 89 | 90 | 11. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project. 91 | 92 | 12. **`README.md`**: A text file containing useful reference information about your project. 93 | 94 | 13. **`yarn.lock`**: [Yarn](https://yarnpkg.com/) is a package manager alternative to npm. You can use either yarn or npm, though all of the Gatsby docs reference npm. This file serves essentially the same purpose as `package-lock.json`, just for a different package management system. 95 | 96 | ## 🎓 Learning Gatsby 97 | 98 | Looking for more guidance? Full documentation for Gatsby lives [on the website](https://next.gatsbyjs.org/). Here are some places to start: 99 | 100 | - **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://next.gatsbyjs.org/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process. 101 | 102 | - **To dive straight into code samples head [to our documentation](https://next.gatsbyjs.org/docs/).** In particular, check out the “Guides”, API reference, and “Advanced Tutorials” sections in the sidebar. 103 | 104 | ## 💫 Deploy 105 | 106 | [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/gatsbyjs/gatsby-starter-default) 107 | -------------------------------------------------------------------------------- /site/gatsby-browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Implement Gatsby's Browser APIs in this file. 3 | * 4 | * See: https://www.gatsbyjs.org/docs/browser-apis/ 5 | */ 6 | 7 | // You can delete this file if you're not using it 8 | -------------------------------------------------------------------------------- /site/gatsby-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | siteMetadata: { 3 | title: 'Gatsby Default Starter', 4 | description: "This is where I write my thoughts." 5 | }, 6 | plugins: [ 7 | 'gatsby-plugin-react-helmet', 8 | { 9 | resolve: `gatsby-plugin-manifest`, 10 | options: { 11 | name: 'gatsby-starter-default', 12 | short_name: 'starter', 13 | start_url: '/', 14 | background_color: '#663399', 15 | theme_color: '#663399', 16 | display: 'minimal-ui', 17 | icon: 'src/images/gatsby-icon.png', // This path is relative to the root of the site. 18 | }, 19 | }, 20 | 'gatsby-plugin-offline', 21 | ], 22 | } 23 | -------------------------------------------------------------------------------- /site/gatsby-node.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Implement Gatsby's Node APIs in this file. 3 | * 4 | * See: https://www.gatsbyjs.org/docs/node-apis/ 5 | */ 6 | 7 | // You can delete this file if you're not using it 8 | -------------------------------------------------------------------------------- /site/gatsby-ssr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Implement Gatsby's SSR (Server Side Rendering) APIs in this file. 3 | * 4 | * See: https://www.gatsbyjs.org/docs/ssr-apis/ 5 | */ 6 | 7 | // You can delete this file if you're not using it 8 | -------------------------------------------------------------------------------- /site/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-starter-default", 3 | "description": "Gatsby default starter", 4 | "version": "1.0.0", 5 | "author": "Kyle Mathews ", 6 | "dependencies": { 7 | "gatsby": "^2.0.0", 8 | "gatsby-plugin-manifest": "^2.0.2", 9 | "gatsby-plugin-offline": "^2.0.5", 10 | "gatsby-plugin-react-helmet": "^3.0.0", 11 | "react": "^16.5.1", 12 | "react-dom": "^16.5.1", 13 | "react-helmet": "^5.2.0" 14 | }, 15 | "keywords": [ 16 | "gatsby" 17 | ], 18 | "license": "MIT", 19 | "scripts": { 20 | "build": "gatsby build", 21 | "develop": "gatsby develop", 22 | "format": "prettier --write '**/*.js'", 23 | "test": "echo \"Error: no test specified\" && exit 1" 24 | }, 25 | "devDependencies": { 26 | "prettier": "^1.14.2" 27 | }, 28 | "repository": { 29 | "type": "git", 30 | "url": "https://github.com/gatsbyjs/gatsby-starter-default" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /site/src/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "ignore": [ 3 | "*.js" 4 | ] 5 | } 6 | 7 | -------------------------------------------------------------------------------- /site/src/css/layout.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-family: sans-serif; 3 | -ms-text-size-adjust: 100%; 4 | -webkit-text-size-adjust: 100%; 5 | } 6 | body { 7 | margin: 0; 8 | } 9 | article, 10 | aside, 11 | details, 12 | figcaption, 13 | figure, 14 | footer, 15 | header, 16 | main, 17 | menu, 18 | nav, 19 | section, 20 | summary { 21 | display: block; 22 | } 23 | audio, 24 | canvas, 25 | progress, 26 | video { 27 | display: inline-block; 28 | } 29 | audio:not([controls]) { 30 | display: none; 31 | height: 0; 32 | } 33 | progress { 34 | vertical-align: baseline; 35 | } 36 | [hidden], 37 | template { 38 | display: none; 39 | } 40 | a { 41 | background-color: transparent; 42 | -webkit-text-decoration-skip: objects; 43 | } 44 | a:active, 45 | a:hover { 46 | outline-width: 0; 47 | } 48 | abbr[title] { 49 | border-bottom: none; 50 | text-decoration: underline; 51 | text-decoration: underline dotted; 52 | } 53 | b, 54 | strong { 55 | font-weight: inherit; 56 | font-weight: bolder; 57 | } 58 | dfn { 59 | font-style: italic; 60 | } 61 | h1 { 62 | font-size: 2em; 63 | margin: .67em 0; 64 | } 65 | mark { 66 | background-color: #ff0; 67 | color: #000; 68 | } 69 | small { 70 | font-size: 80%; 71 | } 72 | sub, 73 | sup { 74 | font-size: 75%; 75 | line-height: 0; 76 | position: relative; 77 | vertical-align: baseline; 78 | } 79 | sub { 80 | bottom: -.25em; 81 | } 82 | sup { 83 | top: -.5em; 84 | } 85 | img { 86 | border-style: none; 87 | } 88 | svg:not(:root) { 89 | overflow: hidden; 90 | } 91 | code, 92 | kbd, 93 | pre, 94 | samp { 95 | font-family: monospace, monospace; 96 | font-size: 1em; 97 | } 98 | figure { 99 | margin: 1em 40px; 100 | } 101 | hr { 102 | box-sizing: content-box; 103 | height: 0; 104 | overflow: visible; 105 | } 106 | button, 107 | input, 108 | optgroup, 109 | select, 110 | textarea { 111 | font: inherit; 112 | margin: 0; 113 | } 114 | optgroup { 115 | font-weight: 700; 116 | } 117 | button, 118 | input { 119 | overflow: visible; 120 | } 121 | button, 122 | select { 123 | text-transform: none; 124 | } 125 | [type=reset], 126 | [type=submit], 127 | button, 128 | html [type=button] { 129 | -webkit-appearance: button; 130 | } 131 | [type=button]::-moz-focus-inner, 132 | [type=reset]::-moz-focus-inner, 133 | [type=submit]::-moz-focus-inner, 134 | button::-moz-focus-inner { 135 | border-style: none; 136 | padding: 0; 137 | } 138 | [type=button]:-moz-focusring, 139 | [type=reset]:-moz-focusring, 140 | [type=submit]:-moz-focusring, 141 | button:-moz-focusring { 142 | outline: 1px dotted ButtonText; 143 | } 144 | fieldset { 145 | border: 1px solid silver; 146 | margin: 0 2px; 147 | padding: .35em .625em .75em; 148 | } 149 | legend { 150 | box-sizing: border-box; 151 | color: inherit; 152 | display: table; 153 | max-width: 100%; 154 | padding: 0; 155 | white-space: normal; 156 | } 157 | textarea { 158 | overflow: auto; 159 | } 160 | [type=checkbox], 161 | [type=radio] { 162 | box-sizing: border-box; 163 | padding: 0; 164 | } 165 | [type=number]::-webkit-inner-spin-button, 166 | [type=number]::-webkit-outer-spin-button { 167 | height: auto; 168 | } 169 | [type=search] { 170 | -webkit-appearance: textfield; 171 | outline-offset: -2px; 172 | } 173 | [type=search]::-webkit-search-cancel-button, 174 | [type=search]::-webkit-search-decoration { 175 | -webkit-appearance: none; 176 | } 177 | ::-webkit-input-placeholder { 178 | color: inherit; 179 | opacity: .54; 180 | } 181 | ::-webkit-file-upload-button { 182 | -webkit-appearance: button; 183 | font: inherit; 184 | } 185 | html { 186 | font: 112.5%/1.45em georgia, serif; 187 | box-sizing: border-box; 188 | overflow-y: scroll; 189 | } 190 | * { 191 | box-sizing: inherit; 192 | } 193 | *:before { 194 | box-sizing: inherit; 195 | } 196 | *:after { 197 | box-sizing: inherit; 198 | } 199 | body { 200 | color: hsla(0, 0%, 0%, 0.8); 201 | font-family: georgia, serif; 202 | font-weight: normal; 203 | word-wrap: break-word; 204 | font-kerning: normal; 205 | -moz-font-feature-settings: "kern", "liga", "clig", "calt"; 206 | -ms-font-feature-settings: "kern", "liga", "clig", "calt"; 207 | -webkit-font-feature-settings: "kern", "liga", "clig", "calt"; 208 | font-feature-settings: "kern", "liga", "clig", "calt"; 209 | } 210 | img { 211 | max-width: 100%; 212 | margin-left: 0; 213 | margin-right: 0; 214 | margin-top: 0; 215 | padding-bottom: 0; 216 | padding-left: 0; 217 | padding-right: 0; 218 | padding-top: 0; 219 | margin-bottom: 1.45rem; 220 | } 221 | h1 { 222 | margin-left: 0; 223 | margin-right: 0; 224 | margin-top: 0; 225 | padding-bottom: 0; 226 | padding-left: 0; 227 | padding-right: 0; 228 | padding-top: 0; 229 | margin-bottom: 1.45rem; 230 | color: inherit; 231 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 232 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 233 | font-weight: bold; 234 | text-rendering: optimizeLegibility; 235 | font-size: 2.25rem; 236 | line-height: 1.1; 237 | } 238 | h2 { 239 | margin-left: 0; 240 | margin-right: 0; 241 | margin-top: 0; 242 | padding-bottom: 0; 243 | padding-left: 0; 244 | padding-right: 0; 245 | padding-top: 0; 246 | margin-bottom: 1.45rem; 247 | color: inherit; 248 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 249 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 250 | font-weight: bold; 251 | text-rendering: optimizeLegibility; 252 | font-size: 1.62671rem; 253 | line-height: 1.1; 254 | } 255 | h3 { 256 | margin-left: 0; 257 | margin-right: 0; 258 | margin-top: 0; 259 | padding-bottom: 0; 260 | padding-left: 0; 261 | padding-right: 0; 262 | padding-top: 0; 263 | margin-bottom: 1.45rem; 264 | color: inherit; 265 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 266 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 267 | font-weight: bold; 268 | text-rendering: optimizeLegibility; 269 | font-size: 1.38316rem; 270 | line-height: 1.1; 271 | } 272 | h4 { 273 | margin-left: 0; 274 | margin-right: 0; 275 | margin-top: 0; 276 | padding-bottom: 0; 277 | padding-left: 0; 278 | padding-right: 0; 279 | padding-top: 0; 280 | margin-bottom: 1.45rem; 281 | color: inherit; 282 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 283 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 284 | font-weight: bold; 285 | text-rendering: optimizeLegibility; 286 | font-size: 1rem; 287 | line-height: 1.1; 288 | } 289 | h5 { 290 | margin-left: 0; 291 | margin-right: 0; 292 | margin-top: 0; 293 | padding-bottom: 0; 294 | padding-left: 0; 295 | padding-right: 0; 296 | padding-top: 0; 297 | margin-bottom: 1.45rem; 298 | color: inherit; 299 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 300 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 301 | font-weight: bold; 302 | text-rendering: optimizeLegibility; 303 | font-size: 0.85028rem; 304 | line-height: 1.1; 305 | } 306 | h6 { 307 | margin-left: 0; 308 | margin-right: 0; 309 | margin-top: 0; 310 | padding-bottom: 0; 311 | padding-left: 0; 312 | padding-right: 0; 313 | padding-top: 0; 314 | margin-bottom: 1.45rem; 315 | color: inherit; 316 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 317 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 318 | font-weight: bold; 319 | text-rendering: optimizeLegibility; 320 | font-size: 0.78405rem; 321 | line-height: 1.1; 322 | } 323 | hgroup { 324 | margin-left: 0; 325 | margin-right: 0; 326 | margin-top: 0; 327 | padding-bottom: 0; 328 | padding-left: 0; 329 | padding-right: 0; 330 | padding-top: 0; 331 | margin-bottom: 1.45rem; 332 | } 333 | ul { 334 | margin-left: 1.45rem; 335 | margin-right: 0; 336 | margin-top: 0; 337 | padding-bottom: 0; 338 | padding-left: 0; 339 | padding-right: 0; 340 | padding-top: 0; 341 | margin-bottom: 1.45rem; 342 | list-style-position: outside; 343 | list-style-image: none; 344 | } 345 | ol { 346 | margin-left: 1.45rem; 347 | margin-right: 0; 348 | margin-top: 0; 349 | padding-bottom: 0; 350 | padding-left: 0; 351 | padding-right: 0; 352 | padding-top: 0; 353 | margin-bottom: 1.45rem; 354 | list-style-position: outside; 355 | list-style-image: none; 356 | } 357 | dl { 358 | margin-left: 0; 359 | margin-right: 0; 360 | margin-top: 0; 361 | padding-bottom: 0; 362 | padding-left: 0; 363 | padding-right: 0; 364 | padding-top: 0; 365 | margin-bottom: 1.45rem; 366 | } 367 | dd { 368 | margin-left: 0; 369 | margin-right: 0; 370 | margin-top: 0; 371 | padding-bottom: 0; 372 | padding-left: 0; 373 | padding-right: 0; 374 | padding-top: 0; 375 | margin-bottom: 1.45rem; 376 | } 377 | p { 378 | margin-left: 0; 379 | margin-right: 0; 380 | margin-top: 0; 381 | padding-bottom: 0; 382 | padding-left: 0; 383 | padding-right: 0; 384 | padding-top: 0; 385 | margin-bottom: 1.45rem; 386 | } 387 | figure { 388 | margin-left: 0; 389 | margin-right: 0; 390 | margin-top: 0; 391 | padding-bottom: 0; 392 | padding-left: 0; 393 | padding-right: 0; 394 | padding-top: 0; 395 | margin-bottom: 1.45rem; 396 | } 397 | pre { 398 | margin-left: 0; 399 | margin-right: 0; 400 | margin-top: 0; 401 | padding-bottom: 0; 402 | padding-left: 0; 403 | padding-right: 0; 404 | padding-top: 0; 405 | margin-bottom: 1.45rem; 406 | font-size: 0.85rem; 407 | line-height: 1.42; 408 | background: hsla(0, 0%, 0%, 0.04); 409 | border-radius: 3px; 410 | overflow: auto; 411 | word-wrap: normal; 412 | padding: 1.45rem; 413 | } 414 | table { 415 | margin-left: 0; 416 | margin-right: 0; 417 | margin-top: 0; 418 | padding-bottom: 0; 419 | padding-left: 0; 420 | padding-right: 0; 421 | padding-top: 0; 422 | margin-bottom: 1.45rem; 423 | font-size: 1rem; 424 | line-height: 1.45rem; 425 | border-collapse: collapse; 426 | width: 100%; 427 | } 428 | fieldset { 429 | margin-left: 0; 430 | margin-right: 0; 431 | margin-top: 0; 432 | padding-bottom: 0; 433 | padding-left: 0; 434 | padding-right: 0; 435 | padding-top: 0; 436 | margin-bottom: 1.45rem; 437 | } 438 | blockquote { 439 | margin-left: 1.45rem; 440 | margin-right: 1.45rem; 441 | margin-top: 0; 442 | padding-bottom: 0; 443 | padding-left: 0; 444 | padding-right: 0; 445 | padding-top: 0; 446 | margin-bottom: 1.45rem; 447 | } 448 | form { 449 | margin-left: 0; 450 | margin-right: 0; 451 | margin-top: 0; 452 | padding-bottom: 0; 453 | padding-left: 0; 454 | padding-right: 0; 455 | padding-top: 0; 456 | margin-bottom: 1.45rem; 457 | } 458 | noscript { 459 | margin-left: 0; 460 | margin-right: 0; 461 | margin-top: 0; 462 | padding-bottom: 0; 463 | padding-left: 0; 464 | padding-right: 0; 465 | padding-top: 0; 466 | margin-bottom: 1.45rem; 467 | } 468 | iframe { 469 | margin-left: 0; 470 | margin-right: 0; 471 | margin-top: 0; 472 | padding-bottom: 0; 473 | padding-left: 0; 474 | padding-right: 0; 475 | padding-top: 0; 476 | margin-bottom: 1.45rem; 477 | } 478 | hr { 479 | margin-left: 0; 480 | margin-right: 0; 481 | margin-top: 0; 482 | padding-bottom: 0; 483 | padding-left: 0; 484 | padding-right: 0; 485 | padding-top: 0; 486 | margin-bottom: calc(1.45rem - 1px); 487 | background: hsla(0, 0%, 0%, 0.2); 488 | border: none; 489 | height: 1px; 490 | } 491 | address { 492 | margin-left: 0; 493 | margin-right: 0; 494 | margin-top: 0; 495 | padding-bottom: 0; 496 | padding-left: 0; 497 | padding-right: 0; 498 | padding-top: 0; 499 | margin-bottom: 1.45rem; 500 | } 501 | b { 502 | font-weight: bold; 503 | } 504 | strong { 505 | font-weight: bold; 506 | } 507 | dt { 508 | font-weight: bold; 509 | } 510 | th { 511 | font-weight: bold; 512 | } 513 | li { 514 | margin-bottom: calc(1.45rem / 2); 515 | } 516 | ol li { 517 | padding-left: 0; 518 | } 519 | ul li { 520 | padding-left: 0; 521 | } 522 | li > ol { 523 | margin-left: 1.45rem; 524 | margin-bottom: calc(1.45rem / 2); 525 | margin-top: calc(1.45rem / 2); 526 | } 527 | li > ul { 528 | margin-left: 1.45rem; 529 | margin-bottom: calc(1.45rem / 2); 530 | margin-top: calc(1.45rem / 2); 531 | } 532 | blockquote *:last-child { 533 | margin-bottom: 0; 534 | } 535 | li *:last-child { 536 | margin-bottom: 0; 537 | } 538 | p *:last-child { 539 | margin-bottom: 0; 540 | } 541 | li > p { 542 | margin-bottom: calc(1.45rem / 2); 543 | } 544 | code { 545 | font-size: 0.85rem; 546 | line-height: 1.45rem; 547 | } 548 | kbd { 549 | font-size: 0.85rem; 550 | line-height: 1.45rem; 551 | } 552 | samp { 553 | font-size: 0.85rem; 554 | line-height: 1.45rem; 555 | } 556 | abbr { 557 | border-bottom: 1px dotted hsla(0, 0%, 0%, 0.5); 558 | cursor: help; 559 | } 560 | acronym { 561 | border-bottom: 1px dotted hsla(0, 0%, 0%, 0.5); 562 | cursor: help; 563 | } 564 | abbr[title] { 565 | border-bottom: 1px dotted hsla(0, 0%, 0%, 0.5); 566 | cursor: help; 567 | text-decoration: none; 568 | } 569 | thead { 570 | text-align: left; 571 | } 572 | td, 573 | th { 574 | text-align: left; 575 | border-bottom: 1px solid hsla(0, 0%, 0%, 0.12); 576 | font-feature-settings: "tnum"; 577 | -moz-font-feature-settings: "tnum"; 578 | -ms-font-feature-settings: "tnum"; 579 | -webkit-font-feature-settings: "tnum"; 580 | padding-left: 0.96667rem; 581 | padding-right: 0.96667rem; 582 | padding-top: 0.725rem; 583 | padding-bottom: calc(0.725rem - 1px); 584 | } 585 | th:first-child, 586 | td:first-child { 587 | padding-left: 0; 588 | } 589 | th:last-child, 590 | td:last-child { 591 | padding-right: 0; 592 | } 593 | tt, 594 | code { 595 | background-color: hsla(0, 0%, 0%, 0.04); 596 | border-radius: 3px; 597 | font-family: "SFMono-Regular", Consolas, "Roboto Mono", "Droid Sans Mono", 598 | "Liberation Mono", Menlo, Courier, monospace; 599 | padding: 0; 600 | padding-top: 0.2em; 601 | padding-bottom: 0.2em; 602 | } 603 | pre code { 604 | background: none; 605 | line-height: 1.42; 606 | } 607 | code:before, 608 | code:after, 609 | tt:before, 610 | tt:after { 611 | letter-spacing: -0.2em; 612 | content: " "; 613 | } 614 | pre code:before, 615 | pre code:after, 616 | pre tt:before, 617 | pre tt:after { 618 | content: ""; 619 | } 620 | @media only screen and (max-width: 480px) { 621 | html { 622 | font-size: 100%; 623 | } 624 | } 625 | -------------------------------------------------------------------------------- /site/src/images/gatsby-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thheller/gatsby-cljs/039d7280f4a0458188787fd64c062d0c2d23f6e5/site/src/images/gatsby-icon.png -------------------------------------------------------------------------------- /src/main/demo/gatsby.cljs: -------------------------------------------------------------------------------- 1 | (ns demo.gatsby 2 | (:require 3 | [reagent.core :as r] 4 | ["react-helmet" :default Helmet] 5 | ["gatsby" :as g])) 6 | 7 | ;; can include images+css this way 8 | (js/require "../css/layout.css") 9 | 10 | (defn header [{:keys [title] :as props}] 11 | [:div {:style {:background "rebeccapurple" 12 | :margin-bottom "1.45rem"}} 13 | [:div {:style {:margin "0 auto" 14 | :max-width 960 15 | :padding "1.45rem 1.0875rem"}} 16 | [:h1 {:style {:margin 0}} 17 | ;; only using my helper fn since I have no clue how to do it in pure react 18 | [:> g/Link {:to "/" :style {:color "white" :textDecoration "none"}} title]]]]) 19 | 20 | (defn layout* [props & body] 21 | (r/as-element 22 | [:<> 23 | [:> Helmet {:title "hello world" :meta []}] 24 | (header {:title "hello world"}) 25 | (into 26 | [:div.page-content {:style {:margin "0 auto" 27 | :max-width 960 28 | :padding "0px 1.0875rem 1.45rem" 29 | :paddingTop 0}}] 30 | body)])) 31 | 32 | 33 | (defn layout [props & body] 34 | (apply layout* props body) 35 | ;; gatsby wants to extract the graphql from the AST but doesn't understand CLJS code 36 | ;; AFAICT there is no way to get queries in otherwise 37 | #_[:> g/StaticQuery 38 | {:query (g/graphql "query SiteTitleQuery { site { siteMetadata { title }}}") 39 | :render 40 | (fn [data] 41 | (apply layout* (assoc props :data data) body))}]) 42 | 43 | (defn page-index 44 | {:export true 45 | :gatsby/page "index" 46 | :gatsby/graphql 47 | "query IndexQuery { 48 | site { 49 | siteMetadata { 50 | description 51 | } 52 | } 53 | }"} 54 | [props] 55 | (layout {} 56 | [:h1 "Hi people!"] 57 | 58 | [:p "Welcome to your new Gatsby site."] 59 | [:p "Now go build something great with ClojureScript."] 60 | 61 | [:> g/Link {:to "/page-2/"} "Go to page 2"])) 62 | 63 | (defn page-2 64 | {:export true 65 | :gatsby/page "page-2"} 66 | [props] 67 | (layout {} 68 | [:h2 "Hi from the second page"] 69 | [:p "Welcome to page 2"] 70 | 71 | [:> g/Link {:to "/"} "Go back to the homepage"])) 72 | 73 | (defn page-404 74 | {:export true 75 | :gatsby/page "404"} 76 | [props] 77 | (r/as-element 78 | [:h1 "404!"])) -------------------------------------------------------------------------------- /src/main/shadow/gatsby.clj: -------------------------------------------------------------------------------- 1 | (ns shadow.gatsby 2 | (:require [clojure.java.io :as io] 3 | [cljs.compiler :as cljs-comp] 4 | [clojure.string :as str])) 5 | 6 | (defn all-vars [state] 7 | (for [[ns ns-info] (get-in state [:compiler-env :cljs.analyzer/namespaces]) 8 | ns-def (-> ns-info :defs vals)] 9 | ns-def)) 10 | 11 | (defn create-pages 12 | {:shadow.build/stage :flush} 13 | [state] 14 | (doseq [ns-def (all-vars state) 15 | :when (get-in ns-def [:meta :gatsby/page])] 16 | 17 | (let [{:gatsby/keys [page graphql]} 18 | (:meta ns-def) 19 | 20 | page-ns 21 | (-> ns-def :name namespace cljs-comp/munge) 22 | 23 | page-var 24 | (-> ns-def :name name cljs-comp/munge) 25 | 26 | content 27 | (str 28 | (when graphql 29 | "import { graphql } from \"gatsby\";") 30 | 31 | "\nexport {" page-var " as default} from \"../cljs/" page-ns ".js\";" 32 | (when graphql 33 | (str "\nexport const query = graphql`" graphql "`;"))) 34 | 35 | out-dir 36 | (io/file "site" "src" "pages") 37 | 38 | out-file 39 | (io/file out-dir (str page ".js"))] 40 | 41 | (io/make-parents out-file) 42 | (spit out-file content) 43 | )) 44 | state) --------------------------------------------------------------------------------