From 44bdd413fb5069e85d1541f3ecf752d80aef224a Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Thu, 28 Mar 2024 19:59:22 +1100 Subject: [PATCH] Major rewrite (!) (#2130) --- .babelrc | 11 - .dockerignore | 1 - .eslintrc.cjs | 37 + .gitattributes | 1 - .../images/gitpod_preview_tut.png | Bin {_docs => .github}/images/screenshot.png | Bin .github/workflows/build.yml | 41 +- .gitignore | 35 +- .gitpod.yml | 15 - .node-version | 2 +- .prettierignore | 6 + .prettierrc | 4 +- .projections.json | 13 - .vscode/extensions.json | 4 + .vscode/launch.json | 11 + .vscode/markdown.code-snippets | 8 + 404.html | 5 - CONTRIBUTING.md | 2 +- Dockerfile | 11 - Gemfile | 9 +- Gemfile.lock | 288 +- LICENSE | 21 - Makefile | 19 - README.md | 8 +- _config.yml | 67 - _data/assets.yml | 2 - _data/carbon.yml | 2 - _data/categories.yml | 30 - _data/codefund.yml | 2 - _data/content.yml | 51 - _data/disqus.yml | 2 - _data/google_analytics.yml | 4 - _includes/2017/announcements-list.html | 10 - _includes/2017/article-schema.html | 34 - _includes/2017/comments-area.html | 22 - _includes/2017/foot.html | 3 - _includes/2017/head.html | 24 - _includes/2017/headline-pub.html | 7 - _includes/2017/meta-vars.html | 41 - _includes/2017/pages-list-item.html | 14 - _includes/2017/related-posts-item.html | 12 - _includes/2017/related-posts.html | 62 - _includes/2017/search-footer.html | 12 - _includes/2017/search-form.html | 19 - _includes/2017/top-nav.html | 35 - _includes/about-the-site.html | 20 - _includes/foot.html | 14 - _includes/head.html | 12 - _includes/meta.html | 85 - _includes/polyfills.html | 9 - _includes/site-header.html | 6 - _includes/social-list.html | 12 - _includes/values/description.html | 17 - _includes/values/title.html | 11 - _layouts/2017/home.html | 78 - _layouts/2017/not_found.html | 26 - _layouts/2017/sheet.html | 54 - _layouts/blank.html | 1 - _layouts/default-ad.html | 30 - _layouts/default.html | 28 - _layouts/home.html | 30 - _layouts/redirect.html | 11 - _parcel/_base.scss | 3 - _parcel/app.js | 30 - _parcel/behaviors/anchors.js | 46 - _parcel/behaviors/dismiss.js | 22 - _parcel/behaviors/dismissable.js | 17 - _parcel/behaviors/disqus.js | 32 - _parcel/behaviors/h3-section-list.js | 32 - _parcel/behaviors/no-preview.js | 16 - _parcel/behaviors/search-form.js | 17 - _parcel/behaviors/search-input.js | 24 - _parcel/behaviors/searchable-header.js | 23 - _parcel/behaviors/searchable-item.js | 13 - _parcel/critical-home.js | 2 - _parcel/critical-home.scss | 16 - _parcel/critical-sheet.js | 2 - _parcel/critical-sheet.scss | 21 - _parcel/critical.js | 27 - _parcel/helpers/dom.js | 62 - _parcel/helpers/noop.js | 1 - _parcel/helpers/permutate.js | 72 - _parcel/helpers/search.js | 43 - _parcel/initializers/onmount.js | 12 - _parcel/initializers/prism.js | 1 - .../__snapshots__/index.test.js.snap | 274 - _parcel/wrapify/__tests__/index.test.js | 88 - _parcel/wrapify/index.js | 119 - _sass/.gitignore | 0 _sass/2015/base/normalize.scss | 427 - _sass/2015/base/typography.sass | 58 - _sass/2015/base/utils.sass | 41 - _sass/2015/components/about-the-site.sass | 105 - _sass/2015/components/big-button.sass | 66 - _sass/2015/components/brief-intro.sass | 8 - _sass/2015/components/full-image.sass | 38 - _sass/2015/components/hint.sass | 14 - _sass/2015/components/hljs.sass | 78 - _sass/2015/components/next-article.sass | 142 - _sass/2015/components/post-headline.sass | 64 - _sass/2015/components/post-icon.sass | 58 - _sass/2015/components/post-index.sass | 73 - _sass/2015/components/post-list.sass | 23 - _sass/2015/components/site-header.sass | 17 - _sass/2015/components/social-list.sass | 73 - _sass/2015/elements/body.sass | 157 - _sass/2015/elements/code.sass | 119 - _sass/2015/elements/table.sass | 73 - _sass/2015/helpers/blink.sass | 11 - _sass/2015/helpers/general.sass | 27 - _sass/2015/helpers/margins.sass | 43 - _sass/2015/style.sass | 57 - _sass/2017/base/fade.scss | 30 - _sass/2017/components/push-button.scss | 3 - _sass/2017/style.scss | 51 - _support/cf-prime.sh | 16 - _support/cf-purge.sh | 23 - _support/smoke_test.sh | 32 - assets/2015/style.sass | 4 - assets/2017/style.scss | 8 - assets/print.css | 48 - assets/script.js | 43 - assets/style.css | 201 - astro.config.mjs | 24 + data/search-index.json | 21 - docker-compose.yml | 19 - netlify.toml | 258 +- package.json | 113 +- playwright.config.ts | 20 + pnpm-lock.yaml | 7826 +++++++++++++++ powerline.txt | 14 - public/_headers | 2 + _redirects => public/_redirects | 0 {assets => public/assets}/favicon.png | Bin robots.txt => public/robots.txt | 0 sitemap.xml | 10 - src/analytics/CloudflareAnalytics.astro | 11 + src/analytics/GoogleAnalytics.astro | 25 + src/components/BaseLayout.astro | 42 + src/components/SEO/SEO.astro | 46 + src/components/SocialList.astro | 52 + src/components/TopNav.astro | 67 + src/components/V2017/CarbonBox.astro | 17 + src/components/V2017/PushButton.astro | 16 + src/components/V2017Home/Announcements.astro | 34 + src/components/V2017Home/FeaturedPages.astro | 17 + src/components/V2017Home/PageListItem.astro | 22 + src/components/V2017Sheet.astro | 124 + src/components/V2017Sheet/CommentsArea.astro | 60 + src/components/V2017Sheet/NoticeBox.astro | 12 + .../V2017Sheet/RelatedPostItem.astro | 35 + src/components/V2017Sheet/RelatedPosts.astro | 93 + src/components/V2017Sheet/SearchFooter.astro | 22 + src/components/V2017Sheet/SearchForm.astro | 69 + .../V2017Sheet/SearchForm.script.ts | 25 + .../components/gaEnabled.tsx | 0 src/config.ts | 75 + src/env.d.ts | 1 + src/lib/domutils/onScrollVisible.ts | 20 + .../__snapshots__/fuseSearch.test.ts.snap | 34 + src/lib/fuseSearch/fuseSearch.test.ts | 37 + src/lib/fuseSearch/fuseSearch.ts | 48 + src/lib/kramdown.ts | 58 + src/lib/links.ts | 17 + src/lib/page.test.ts | 89 + src/lib/page.ts | 78 + src/lib/page/accessors.ts | 24 + src/lib/page/queries.ts | 122 + src/lib/render.test.ts | 89 + src/lib/render.ts | 119 + src/lib/seo/__snapshots__/seo.test.ts.snap | 136 + src/lib/seo/jsonJd.test.ts | 53 + src/lib/seo/jsonLd.ts | 59 + src/lib/seo/seo.test.ts | 58 + src/lib/seo/seo.ts | 151 + src/pages/404.astro | 33 + src/pages/[...slug].astro | 23 + src/pages/__tests__/searchindex.json.test.ts | 14 + src/pages/__tests__/sitemap.xml.test.ts | 21 + src/pages/index.astro | 102 + src/pages/searchindex.json.ts | 16 + src/pages/sitemap.xml.ts | 26 + src/pages/test_scenarios/seo_tags_test.astro | 5 + src/ruby/cache_kramdown.rb | 28 + src/ruby/kramdown.rb | 4 + src/ruby/renderer.rb | 42 + src/ruby/renderer.test.rb | 71 + src/sass/2017/_utils.scss | 11 + {_sass => src/sass}/2017/base/base.scss | 6 +- .../2017/components/announcements-item.scss | 6 +- .../2017/components/announcements-list.scss | 0 .../sass}/2017/components/attribute-peg.scss | 0 src/sass/2017/components/autocomplete.scss | 26 + .../sass}/2017/components/back-button.scss | 0 .../sass}/2017/components/body-area.scss | 0 .../sass}/2017/components/comments-area.scss | 0 .../2017/components/comments-details.scss | 0 .../2017/components/comments-section.scss | 0 .../sass}/2017/components/h2-section.scss | 0 .../2017/components/h3-section-list.scss | 37 +- .../sass}/2017/components/h3-section.scss | 3 +- .../sass}/2017/components/headline-pub.scss | 9 +- .../sass}/2017/components/hint-mark.scss | 0 .../sass}/2017/components/home-button.scss | 0 .../sass}/2017/components/intro-content.scss | 0 .../sass}/2017/components/main-heading.scss | 0 .../2017/components/missing-message.scss | 0 .../sass}/2017/components/notice-box.scss | 0 .../sass}/2017/components/page-actions.scss | 0 .../sass}/2017/components/pages-list.scss | 0 .../sass}/2017/components/pre-footer.scss | 0 .../sass/2017/components}/push-button.scss | 4 +- .../2017/components/related-post-item.scss | 0 .../2017/components/related-post-list.scss | 0 .../2017/components/related-posts-area.scss | 0 .../components/related-posts-callout.scss | 5 +- .../2017/components/related-posts-group.scss | 0 .../components/related-posts-section.scss | 0 .../sass}/2017/components/search-box.scss | 8 + .../sass}/2017/components/search-footer.scss | 0 .../sass}/2017/components/site-header.scss | 0 .../sass}/2017/components/top-nav.scss | 4 +- .../sass}/2017/components/top-sheet.scss | 17 +- {_sass => src/sass}/2017/markdown/a-em.scss | 0 {_sass => src/sass}/2017/markdown/code.scss | 5 +- .../sass}/2017/markdown/headings.scss | 0 .../sass}/2017/markdown/local-anchor.scss | 8 +- {_sass => src/sass}/2017/markdown/p.scss | 0 {_sass => src/sass}/2017/markdown/table.scss | 4 +- {_sass => src/sass}/2017/markdown/ul.scss | 14 +- src/sass/2017/placeholders/push-button.scss | 1 + .../sass}/2017/utils/_font-size.scss | 2 +- .../sass/2017/utils/_gutter.scss | 2 +- .../sass/2017/utils/_heading-style.scss | 0 .../sass/2017/utils/_section-gutter.scss | 0 .../2017/utils/_section-with-container.scss | 0 {_sass => src/sass}/2017/variables.scss | 34 +- src/sass/full.scss | 50 + .../vendor/ionicons-inline/ionicons.scss | 0 .../vendor/modularscale/_modularscale.scss | 42 +- .../sass}/vendor/sanitize.css/sanitize.scss | 6 +- {_parcel => src/scripts/v2017}/_utils.scss | 1 - src/scripts/v2017/behaviors_2/anchors.js | 53 + src/scripts/v2017/behaviors_2/dismiss.js | 20 + src/scripts/v2017/behaviors_2/dismissable.js | 15 + src/scripts/v2017/behaviors_2/disqus.js | 30 + src/scripts/v2017/behaviors_2/no-preview.js | 14 + .../scripts/v2017}/helpers/data.js | 0 .../scripts/v2017}/helpers/dismiss.js | 0 .../scripts/v2017}/helpers/inject_disqus.js | 0 .../scripts/v2017}/helpers/preview.js | 0 {_parcel => src/scripts/v2017}/helpers/qs.js | 0 .../scripts/v2017}/helpers/store.js | 0 src/types/JsonLdDocument.ts | 28 + src/types/SheetFrontmatter.ts | 30 + test/basicPage.e2e.ts | 54 + test/e2eUtils.ts | 40 + test/index.e2e.ts | 112 + tests/basic.md | 9 + tests/keywords_test.md | 17 + tsconfig.json | 11 + vite.config.js | 14 + yarn.lock | 8754 ----------------- 263 files changed, 11279 insertions(+), 13673 deletions(-) delete mode 100644 .babelrc delete mode 100644 .dockerignore create mode 100644 .eslintrc.cjs delete mode 100644 .gitattributes rename {_docs => .github}/images/gitpod_preview_tut.png (100%) rename {_docs => .github}/images/screenshot.png (100%) delete mode 100644 .gitpod.yml create mode 100644 .prettierignore delete mode 100644 .projections.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/markdown.code-snippets delete mode 100644 404.html delete mode 100644 Dockerfile delete mode 100644 LICENSE delete mode 100644 Makefile delete mode 100644 _config.yml delete mode 100644 _data/assets.yml delete mode 100644 _data/carbon.yml delete mode 100644 _data/categories.yml delete mode 100644 _data/codefund.yml delete mode 100644 _data/content.yml delete mode 100644 _data/disqus.yml delete mode 100644 _data/google_analytics.yml delete mode 100644 _includes/2017/announcements-list.html delete mode 100644 _includes/2017/article-schema.html delete mode 100644 _includes/2017/comments-area.html delete mode 100644 _includes/2017/foot.html delete mode 100644 _includes/2017/head.html delete mode 100644 _includes/2017/headline-pub.html delete mode 100644 _includes/2017/meta-vars.html delete mode 100644 _includes/2017/pages-list-item.html delete mode 100644 _includes/2017/related-posts-item.html delete mode 100644 _includes/2017/related-posts.html delete mode 100644 _includes/2017/search-footer.html delete mode 100644 _includes/2017/search-form.html delete mode 100644 _includes/2017/top-nav.html delete mode 100644 _includes/about-the-site.html delete mode 100644 _includes/foot.html delete mode 100644 _includes/head.html delete mode 100644 _includes/meta.html delete mode 100644 _includes/polyfills.html delete mode 100644 _includes/site-header.html delete mode 100644 _includes/social-list.html delete mode 100644 _includes/values/description.html delete mode 100644 _includes/values/title.html delete mode 100644 _layouts/2017/home.html delete mode 100644 _layouts/2017/not_found.html delete mode 100644 _layouts/2017/sheet.html delete mode 100644 _layouts/blank.html delete mode 100644 _layouts/default-ad.html delete mode 100644 _layouts/default.html delete mode 100644 _layouts/home.html delete mode 100644 _layouts/redirect.html delete mode 100644 _parcel/_base.scss delete mode 100644 _parcel/app.js delete mode 100644 _parcel/behaviors/anchors.js delete mode 100644 _parcel/behaviors/dismiss.js delete mode 100644 _parcel/behaviors/dismissable.js delete mode 100644 _parcel/behaviors/disqus.js delete mode 100644 _parcel/behaviors/h3-section-list.js delete mode 100644 _parcel/behaviors/no-preview.js delete mode 100644 _parcel/behaviors/search-form.js delete mode 100644 _parcel/behaviors/search-input.js delete mode 100644 _parcel/behaviors/searchable-header.js delete mode 100644 _parcel/behaviors/searchable-item.js delete mode 100644 _parcel/critical-home.js delete mode 100644 _parcel/critical-home.scss delete mode 100644 _parcel/critical-sheet.js delete mode 100644 _parcel/critical-sheet.scss delete mode 100644 _parcel/critical.js delete mode 100644 _parcel/helpers/dom.js delete mode 100644 _parcel/helpers/noop.js delete mode 100644 _parcel/helpers/permutate.js delete mode 100644 _parcel/helpers/search.js delete mode 100644 _parcel/initializers/onmount.js delete mode 100644 _parcel/initializers/prism.js delete mode 100644 _parcel/wrapify/__tests__/__snapshots__/index.test.js.snap delete mode 100644 _parcel/wrapify/__tests__/index.test.js delete mode 100644 _parcel/wrapify/index.js delete mode 100644 _sass/.gitignore delete mode 100644 _sass/2015/base/normalize.scss delete mode 100644 _sass/2015/base/typography.sass delete mode 100644 _sass/2015/base/utils.sass delete mode 100644 _sass/2015/components/about-the-site.sass delete mode 100644 _sass/2015/components/big-button.sass delete mode 100644 _sass/2015/components/brief-intro.sass delete mode 100644 _sass/2015/components/full-image.sass delete mode 100644 _sass/2015/components/hint.sass delete mode 100644 _sass/2015/components/hljs.sass delete mode 100644 _sass/2015/components/next-article.sass delete mode 100644 _sass/2015/components/post-headline.sass delete mode 100644 _sass/2015/components/post-icon.sass delete mode 100644 _sass/2015/components/post-index.sass delete mode 100644 _sass/2015/components/post-list.sass delete mode 100644 _sass/2015/components/site-header.sass delete mode 100644 _sass/2015/components/social-list.sass delete mode 100644 _sass/2015/elements/body.sass delete mode 100644 _sass/2015/elements/code.sass delete mode 100644 _sass/2015/elements/table.sass delete mode 100644 _sass/2015/helpers/blink.sass delete mode 100644 _sass/2015/helpers/general.sass delete mode 100644 _sass/2015/helpers/margins.sass delete mode 100644 _sass/2015/style.sass delete mode 100644 _sass/2017/base/fade.scss delete mode 100644 _sass/2017/components/push-button.scss delete mode 100644 _sass/2017/style.scss delete mode 100755 _support/cf-prime.sh delete mode 100755 _support/cf-purge.sh delete mode 100644 _support/smoke_test.sh delete mode 100644 assets/2015/style.sass delete mode 100644 assets/2017/style.scss delete mode 100644 assets/print.css delete mode 100644 assets/script.js delete mode 100644 assets/style.css create mode 100644 astro.config.mjs delete mode 100644 data/search-index.json delete mode 100644 docker-compose.yml create mode 100644 playwright.config.ts create mode 100644 pnpm-lock.yaml delete mode 100644 powerline.txt create mode 100644 public/_headers rename _redirects => public/_redirects (100%) rename {assets => public/assets}/favicon.png (100%) rename robots.txt => public/robots.txt (100%) delete mode 100644 sitemap.xml create mode 100644 src/analytics/CloudflareAnalytics.astro create mode 100644 src/analytics/GoogleAnalytics.astro create mode 100644 src/components/BaseLayout.astro create mode 100644 src/components/SEO/SEO.astro create mode 100644 src/components/SocialList.astro create mode 100644 src/components/TopNav.astro create mode 100644 src/components/V2017/CarbonBox.astro create mode 100644 src/components/V2017/PushButton.astro create mode 100644 src/components/V2017Home/Announcements.astro create mode 100644 src/components/V2017Home/FeaturedPages.astro create mode 100644 src/components/V2017Home/PageListItem.astro create mode 100644 src/components/V2017Sheet.astro create mode 100644 src/components/V2017Sheet/CommentsArea.astro create mode 100644 src/components/V2017Sheet/NoticeBox.astro create mode 100644 src/components/V2017Sheet/RelatedPostItem.astro create mode 100644 src/components/V2017Sheet/RelatedPosts.astro create mode 100644 src/components/V2017Sheet/SearchFooter.astro create mode 100644 src/components/V2017Sheet/SearchForm.astro create mode 100644 src/components/V2017Sheet/SearchForm.script.ts rename _parcel/behaviors/main-body.js => src/components/gaEnabled.tsx (100%) create mode 100644 src/config.ts create mode 100644 src/env.d.ts create mode 100644 src/lib/domutils/onScrollVisible.ts create mode 100644 src/lib/fuseSearch/__snapshots__/fuseSearch.test.ts.snap create mode 100644 src/lib/fuseSearch/fuseSearch.test.ts create mode 100644 src/lib/fuseSearch/fuseSearch.ts create mode 100644 src/lib/kramdown.ts create mode 100644 src/lib/links.ts create mode 100644 src/lib/page.test.ts create mode 100644 src/lib/page.ts create mode 100644 src/lib/page/accessors.ts create mode 100644 src/lib/page/queries.ts create mode 100644 src/lib/render.test.ts create mode 100644 src/lib/render.ts create mode 100644 src/lib/seo/__snapshots__/seo.test.ts.snap create mode 100644 src/lib/seo/jsonJd.test.ts create mode 100644 src/lib/seo/jsonLd.ts create mode 100644 src/lib/seo/seo.test.ts create mode 100644 src/lib/seo/seo.ts create mode 100644 src/pages/404.astro create mode 100644 src/pages/[...slug].astro create mode 100644 src/pages/__tests__/searchindex.json.test.ts create mode 100644 src/pages/__tests__/sitemap.xml.test.ts create mode 100644 src/pages/index.astro create mode 100644 src/pages/searchindex.json.ts create mode 100644 src/pages/sitemap.xml.ts create mode 100644 src/pages/test_scenarios/seo_tags_test.astro create mode 100644 src/ruby/cache_kramdown.rb create mode 100644 src/ruby/kramdown.rb create mode 100644 src/ruby/renderer.rb create mode 100644 src/ruby/renderer.test.rb create mode 100644 src/sass/2017/_utils.scss rename {_sass => src/sass}/2017/base/base.scss (96%) rename {_sass => src/sass}/2017/components/announcements-item.scss (87%) rename {_sass => src/sass}/2017/components/announcements-list.scss (100%) rename {_sass => src/sass}/2017/components/attribute-peg.scss (100%) create mode 100644 src/sass/2017/components/autocomplete.scss rename {_sass => src/sass}/2017/components/back-button.scss (100%) rename {_sass => src/sass}/2017/components/body-area.scss (100%) rename {_sass => src/sass}/2017/components/comments-area.scss (100%) rename {_sass => src/sass}/2017/components/comments-details.scss (100%) rename {_sass => src/sass}/2017/components/comments-section.scss (100%) rename {_sass => src/sass}/2017/components/h2-section.scss (100%) rename {_sass => src/sass}/2017/components/h3-section-list.scss (69%) rename {_sass => src/sass}/2017/components/h3-section.scss (99%) rename {_sass => src/sass}/2017/components/headline-pub.scss (92%) rename {_sass => src/sass}/2017/components/hint-mark.scss (100%) rename {_sass => src/sass}/2017/components/home-button.scss (100%) rename {_sass => src/sass}/2017/components/intro-content.scss (100%) rename {_sass => src/sass}/2017/components/main-heading.scss (100%) rename {_sass => src/sass}/2017/components/missing-message.scss (100%) rename {_sass => src/sass}/2017/components/notice-box.scss (100%) rename {_sass => src/sass}/2017/components/page-actions.scss (100%) rename {_sass => src/sass}/2017/components/pages-list.scss (100%) rename {_sass => src/sass}/2017/components/pre-footer.scss (100%) rename {_sass/2017/placeholders => src/sass/2017/components}/push-button.scss (92%) rename {_sass => src/sass}/2017/components/related-post-item.scss (100%) rename {_sass => src/sass}/2017/components/related-post-list.scss (100%) rename {_sass => src/sass}/2017/components/related-posts-area.scss (100%) rename {_sass => src/sass}/2017/components/related-posts-callout.scss (89%) rename {_sass => src/sass}/2017/components/related-posts-group.scss (100%) rename {_sass => src/sass}/2017/components/related-posts-section.scss (100%) rename {_sass => src/sass}/2017/components/search-box.scss (89%) rename {_sass => src/sass}/2017/components/search-footer.scss (100%) rename {_sass => src/sass}/2017/components/site-header.scss (100%) rename {_sass => src/sass}/2017/components/top-nav.scss (96%) rename {_sass => src/sass}/2017/components/top-sheet.scss (75%) rename {_sass => src/sass}/2017/markdown/a-em.scss (100%) rename {_sass => src/sass}/2017/markdown/code.scss (94%) rename {_sass => src/sass}/2017/markdown/headings.scss (100%) rename {_sass => src/sass}/2017/markdown/local-anchor.scss (81%) rename {_sass => src/sass}/2017/markdown/p.scss (100%) rename {_sass => src/sass}/2017/markdown/table.scss (96%) rename {_sass => src/sass}/2017/markdown/ul.scss (63%) create mode 100644 src/sass/2017/placeholders/push-button.scss rename {_sass => src/sass}/2017/utils/_font-size.scss (62%) rename _sass/2017/utils/gutter.scss => src/sass/2017/utils/_gutter.scss (72%) rename _sass/2017/utils/heading-style.scss => src/sass/2017/utils/_heading-style.scss (100%) rename _sass/2017/utils/section-gutter.scss => src/sass/2017/utils/_section-gutter.scss (100%) rename _sass/2017/utils/section-with-container.scss => src/sass/2017/utils/_section-with-container.scss (100%) rename {_sass => src/sass}/2017/variables.scss (77%) create mode 100644 src/sass/full.scss rename {_sass => src/sass}/vendor/ionicons-inline/ionicons.scss (100%) rename {_sass => src/sass}/vendor/modularscale/_modularscale.scss (90%) rename {_sass => src/sass}/vendor/sanitize.css/sanitize.scss (98%) rename {_parcel => src/scripts/v2017}/_utils.scss (82%) create mode 100644 src/scripts/v2017/behaviors_2/anchors.js create mode 100644 src/scripts/v2017/behaviors_2/dismiss.js create mode 100644 src/scripts/v2017/behaviors_2/dismissable.js create mode 100644 src/scripts/v2017/behaviors_2/disqus.js create mode 100644 src/scripts/v2017/behaviors_2/no-preview.js rename {_parcel => src/scripts/v2017}/helpers/data.js (100%) rename {_parcel => src/scripts/v2017}/helpers/dismiss.js (100%) rename {_parcel => src/scripts/v2017}/helpers/inject_disqus.js (100%) rename {_parcel => src/scripts/v2017}/helpers/preview.js (100%) rename {_parcel => src/scripts/v2017}/helpers/qs.js (100%) rename {_parcel => src/scripts/v2017}/helpers/store.js (100%) create mode 100644 src/types/JsonLdDocument.ts create mode 100644 src/types/SheetFrontmatter.ts create mode 100644 test/basicPage.e2e.ts create mode 100644 test/e2eUtils.ts create mode 100644 test/index.e2e.ts create mode 100644 tests/basic.md create mode 100644 tests/keywords_test.md create mode 100644 tsconfig.json create mode 100644 vite.config.js delete mode 100644 yarn.lock diff --git a/.babelrc b/.babelrc deleted file mode 100644 index cf97ee5ce..000000000 --- a/.babelrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "useBuiltIns": "entry", - "targets": "> 2%" - } - ] - ] -} diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 3c3629e64..000000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 000000000..4878736d8 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,37 @@ +/* eslint-env node */ +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:astro/recommended', + 'prettier' + ], + env: { + browser: true // enables window, document, etc + }, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + root: true, + ignorePatterns: ['dist/**'], + + overrides: [ + { + files: ['*.test.ts'], + rules: { + '@typescript-eslint/no-explicit-any': 'off' + } + }, + { + files: ['*.astro'], + parser: 'astro-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser', + extraFileExtensions: ['.astro'] + } + // rules: { + // override/add rules settings here, such as: + // "astro/no-set-html-directive": "error" + // }, + } + ] +} diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index cdfdd3780..000000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -yarn.lock binary diff --git a/_docs/images/gitpod_preview_tut.png b/.github/images/gitpod_preview_tut.png similarity index 100% rename from _docs/images/gitpod_preview_tut.png rename to .github/images/gitpod_preview_tut.png diff --git a/_docs/images/screenshot.png b/.github/images/screenshot.png similarity index 100% rename from _docs/images/screenshot.png rename to .github/images/screenshot.png diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2845375b2..cd406e3b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,22 +1,35 @@ -name: Build and test -on: [push, pull_request] - +name: Run tests +on: [push] jobs: build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - - name: Use Node.js - uses: actions/setup-node@v4 - - - name: Use Ruby - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: bundler-cache: true + - uses: actions/setup-node@v4 + with: + node-version-file: .node-version + - uses: pnpm/action-setup@v3 + with: { run_install: false } - - run: yarn install --frozen-lockfile - - run: yarn build - - run: yarn test - - run: yarn test:smoke + # https://github.com/pnpm/action-setup?tab=readme-ov-file#use-cache-to-reduce-installation-time + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Install playwright browsers + run: pnpm playwright install --with-deps chromium + - name: Run tests + run: pnpm run ci diff --git a/.gitignore b/.gitignore index 0457cc012..7386c531a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,26 @@ -_output -_site -.jekyll-metadata -/node_modules -/vendor -.idea/ -.cache/ +# build output +dist/ +# generated types +.astro/ -# Generated by 'yarn dev' -/_includes/2017/critical/* -/assets/packed/* +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +.cache + +# playwright +test-results diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 150a4ceee..000000000 --- a/.gitpod.yml +++ /dev/null @@ -1,15 +0,0 @@ -image: gitpod/workspace-full - -ports: - - port: 4001 - onOpen: open-preview - -tasks: - - init: yarn install && bundle install - command: env PORT=4001 yarn run dev - -github: - # Prebuild the docker image for gitpod - https://www.gitpod.io/docs/prebuilds/ - prebuilds: - # enable for the master/default branch - master: true diff --git a/.node-version b/.node-version index 3c5535cf6..726a201e6 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18.19.1 +20.11.1 \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..99f751ef5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +src/sass/vendor +vendor +.cache +dist +*.md +pnpm-lock.yaml diff --git a/.prettierrc b/.prettierrc index 4f49fe278..805cac99d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { "semi": false, "singleQuote": true, - "jsxSingleQuote": true, - "trailingComma": "none" + "trailingComma": "none", + "plugins": ["prettier-plugin-astro"] } diff --git a/.projections.json b/.projections.json deleted file mode 100644 index c41da12cc..000000000 --- a/.projections.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "*.md": { - "type": "cheat", - "template": [ - "---", - "title: {basename|capitalize}", - "category: Ruby", - "layout: 2017/sheet", - "updated: DATE", - "---" - ] - } -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..22a15055d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..d64220976 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/.vscode/markdown.code-snippets b/.vscode/markdown.code-snippets new file mode 100644 index 000000000..eda17ca6a --- /dev/null +++ b/.vscode/markdown.code-snippets @@ -0,0 +1,8 @@ +{ + "Test snip": { + "prefix": ["about"], + "body": "Copyright. Foo Corp 2028", + "description": "Adds copyright...", + "scope": "markdown" + } +} diff --git a/404.html b/404.html deleted file mode 100644 index 1e5d479be..000000000 --- a/404.html +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: 2017/not_found -type: error -permalink: /404.html ---- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f465ff1b1..09a5281f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ Or using a button:
To preview the website you need to first build it then you can navigate to file that you are trying to contribute and preview directly. - + ## Starting a local instance diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 817e26443..000000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ruby:2.7.1 -RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -RUN apt-get update -qq && apt-get install -qq --no-install-recommends \ - nodejs \ - yarn \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /app -WORKDIR /app diff --git a/Gemfile b/Gemfile index f9ae6e134..68b151608 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,4 @@ -source 'https://rubygems.org' -gem 'webrick' -gem 'github-pages', group: :jekyll_plugins -gem 'json' -gem 'csv' +source "https://rubygems.org" +gem "minitest" +gem "kramdown" +gem "kramdown-parser-gfm" diff --git a/Gemfile.lock b/Gemfile.lock index c6b78164a..fdfea67c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,293 +1,21 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3) - base64 - bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) - base64 (0.2.0) - bigdecimal (3.1.6) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.11.1) - colorator (1.1.0) - commonmarker (0.23.10) - concurrent-ruby (1.2.3) - connection_pool (2.4.1) - csv (3.2.8) - dnsruby (1.70.0) - simpleidn (~> 0.2.1) - drb (2.2.0) - ruby2_keywords - em-websocket (0.5.3) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0) - ethon (0.16.0) - ffi (>= 1.15.0) - eventmachine (1.2.7) - execjs (2.9.1) - faraday (2.9.0) - faraday-net_http (>= 2.0, < 3.2) - faraday-net_http (3.1.0) - net-http - ffi (1.16.3) - forwardable-extended (2.6.0) - gemoji (3.0.1) - github-pages (228) - github-pages-health-check (= 1.17.9) - jekyll (= 3.9.3) - jekyll-avatar (= 0.7.0) - jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.4.0) - jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.15.1) - jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.13.0) - jekyll-include-cache (= 0.2.1) - jekyll-mentions (= 1.6.0) - jekyll-optional-front-matter (= 0.3.2) - jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.3.0) - jekyll-redirect-from (= 0.16.0) - jekyll-relative-links (= 0.6.1) - jekyll-remote-theme (= 0.4.3) - jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.8.0) - jekyll-sitemap (= 1.4.0) - jekyll-swiss (= 1.0.0) - jekyll-theme-architect (= 0.2.0) - jekyll-theme-cayman (= 0.2.0) - jekyll-theme-dinky (= 0.2.0) - jekyll-theme-hacker (= 0.2.0) - jekyll-theme-leap-day (= 0.2.0) - jekyll-theme-merlot (= 0.2.0) - jekyll-theme-midnight (= 0.2.0) - jekyll-theme-minimal (= 0.2.0) - jekyll-theme-modernist (= 0.2.0) - jekyll-theme-primer (= 0.6.0) - jekyll-theme-slate (= 0.2.0) - jekyll-theme-tactile (= 0.2.0) - jekyll-theme-time-machine (= 0.2.0) - jekyll-titles-from-headings (= 0.5.3) - jemoji (= 0.12.0) - kramdown (= 2.3.2) - kramdown-parser-gfm (= 1.1.0) - liquid (= 4.0.4) - mercenary (~> 0.3) - minima (= 2.5.1) - nokogiri (>= 1.13.6, < 2.0) - rouge (= 3.26.0) - terminal-table (~> 1.4) - github-pages-health-check (1.17.9) - addressable (~> 2.3) - dnsruby (~> 1.60) - octokit (~> 4.0) - public_suffix (>= 3.0, < 5.0) - typhoeus (~> 1.3) - html-pipeline (2.14.3) - activesupport (>= 2) - nokogiri (>= 1.4) - http_parser.rb (0.8.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - jekyll (3.9.3) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (>= 0.7, < 2) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (>= 1.17, < 3) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-avatar (0.7.0) - jekyll (>= 3.0, < 5.0) - jekyll-coffeescript (1.1.1) - coffee-script (~> 2.2) - coffee-script-source (~> 1.11.1) - jekyll-commonmark (1.4.0) - commonmarker (~> 0.22) - jekyll-commonmark-ghpages (0.4.0) - commonmarker (~> 0.23.7) - jekyll (~> 3.9.0) - jekyll-commonmark (~> 1.4.0) - rouge (>= 2.0, < 5.0) - jekyll-default-layout (0.1.4) - jekyll (~> 3.0) - jekyll-feed (0.15.1) - jekyll (>= 3.7, < 5.0) - jekyll-gist (1.5.0) - octokit (~> 4.2) - jekyll-github-metadata (2.13.0) - jekyll (>= 3.4, < 5.0) - octokit (~> 4.0, != 4.4.0) - jekyll-include-cache (0.2.1) - jekyll (>= 3.7, < 5.0) - jekyll-mentions (1.6.0) - html-pipeline (~> 2.3) - jekyll (>= 3.7, < 5.0) - jekyll-optional-front-matter (0.3.2) - jekyll (>= 3.0, < 5.0) - jekyll-paginate (1.1.0) - jekyll-readme-index (0.3.0) - jekyll (>= 3.0, < 5.0) - jekyll-redirect-from (0.16.0) - jekyll (>= 3.3, < 5.0) - jekyll-relative-links (0.6.1) - jekyll (>= 3.3, < 5.0) - jekyll-remote-theme (0.4.3) - addressable (~> 2.0) - jekyll (>= 3.5, < 5.0) - jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) - rubyzip (>= 1.3.0, < 3.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-seo-tag (2.8.0) - jekyll (>= 3.8, < 5.0) - jekyll-sitemap (1.4.0) - jekyll (>= 3.7, < 5.0) - jekyll-swiss (1.0.0) - jekyll-theme-architect (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.6.0) - jekyll (> 3.5, < 5.0) - jekyll-github-metadata (~> 2.9) - jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-titles-from-headings (0.5.3) - jekyll (>= 3.3, < 5.0) - jekyll-watch (2.2.1) - listen (~> 3.0) - jemoji (0.12.0) - gemoji (~> 3.0) - html-pipeline (~> 2.2) - jekyll (>= 3.0, < 5.0) - json (2.7.1) - kramdown (2.3.2) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.4) - listen (3.8.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - minima (2.5.1) - jekyll (>= 3.5, < 5.0) - jekyll-feed (~> 0.9) - jekyll-seo-tag (~> 2.1) - minitest (5.21.2) - mutex_m (0.2.0) - net-http (0.4.1) - uri - nokogiri (1.16.1-aarch64-linux) - racc (~> 1.4) - nokogiri (1.16.1-arm-linux) - racc (~> 1.4) - nokogiri (1.16.1-arm64-darwin) - racc (~> 1.4) - nokogiri (1.16.1-x86-linux) - racc (~> 1.4) - nokogiri (1.16.1-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.16.1-x86_64-linux) - racc (~> 1.4) - octokit (4.25.1) - faraday (>= 1, < 3) - sawyer (~> 0.9) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (4.0.7) - racc (1.7.3) - rb-fsevent (0.11.2) - rb-inotify (0.10.1) - ffi (~> 1.0) - rexml (3.2.6) - rouge (3.26.0) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.9.2) - addressable (>= 2.3.5) - faraday (>= 0.17.3, < 3) - simpleidn (0.2.1) - unf (~> 0.1.4) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - typhoeus (1.4.1) - ethon (>= 0.9.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.9.1) - unicode-display_width (1.8.0) - uri (0.13.0) - webrick (1.8.1) + minitest (5.18.0) + rexml (3.2.5) PLATFORMS - aarch64-linux - arm-linux - arm64-darwin - x86-linux - x86_64-darwin + aarch64-linux-android x86_64-linux DEPENDENCIES - csv - github-pages - json - webrick + kramdown + kramdown-parser-gfm + minitest BUNDLED WITH - 2.5.3 + 2.4.1 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 24898c35b..000000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Rico Sta. Cruz and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Makefile b/Makefile deleted file mode 100644 index 317584336..000000000 --- a/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -npmbin := ./node_modules/.bin -PORT ?= 3000 -HOST ?= 127.0.0.1 - -help: - @echo - @echo Makefile targets - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' - @echo - -# Builds intermediate files. Needs a _site built first though -update: _site - -# Builds _site -_site: - yarn build - -dev: - yarn dev diff --git a/README.md b/README.md index 7056eeb55..01e00eabe 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,10 @@ TL;DR for developer documentation - a ridiculous collection of cheatsheets -

-See test builds -GitHub pages deploy status -Netlify deploy status -

-

- +
devhints.io

diff --git a/_config.yml b/_config.yml deleted file mode 100644 index dc0c94a81..000000000 --- a/_config.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Jekyll configuration - -whitelist: - - jekyll-redirect-from - - jekyll-github-metadata - -plugins: - - jekyll-redirect-from - - jekyll-github-metadata - -exclude: - - .babelrc - - .cache - - CNAME - - CONTRIBUTING.md - - cssnano.config.js - - docker_compose.yml - - Dockerfile - - Gemfile - - Gemfile.lock - - Makefile - - node_modules - - package.json - - package-lock.json - - postcss.config.js - - README.md - - vendor - - webpack.config.js - - yarn-error.log - - yarn.lock - -# Markdown - -highlighter: false -markdown: kramdown -kramdown: - input: GFM - hard_wrap: false - parse_block_html: true - syntax_highlighter_opts: - disable: true - -# Defaults - -defaults: - - scope: - path: '' - type: pages - values: - layout: 'default' - og_type: article - type: article - category: 'Others' - excerpt_separator: '' - prism_languages: [] - -# Site info - -url: https://devhints.io -title: Devhints.io cheatsheets - -# GitHub metadata -# https://help.github.com/articles/repository-metadata-on-github-pages/ - -repository: rstacruz/cheatsheets -include: - - _redirects diff --git a/_data/assets.yml b/_data/assets.yml deleted file mode 100644 index e5cf4e94a..000000000 --- a/_data/assets.yml +++ /dev/null @@ -1,2 +0,0 @@ -# No trailing slash -preview_host: https://assets.devhints.io/previews diff --git a/_data/carbon.yml b/_data/carbon.yml deleted file mode 100644 index 536d89c68..000000000 --- a/_data/carbon.yml +++ /dev/null @@ -1,2 +0,0 @@ -enabled: true -src: https://cdn.carbonads.com/carbon.js?serve=CE7IK5QM&placement=devhintsio diff --git a/_data/categories.yml b/_data/categories.yml deleted file mode 100644 index ac9bbafc5..000000000 --- a/_data/categories.yml +++ /dev/null @@ -1,30 +0,0 @@ -enabled: true -names: - - Analytics - - Ansible - - Apps - - C-like - - CLI - - CSS - - Databases - - Devops - - Elixir - - Git - - HTML - - Java & JVM - - JavaScript - - JavaScript libraries - - Jekyll - - Ledger - - Markup - - macOS - - Node.js - - PHP - - Python - - Rails - - React - - Ruby - - Ruby libraries - - Vim - - Fitness - - Others diff --git a/_data/codefund.yml b/_data/codefund.yml deleted file mode 100644 index 5d5dd6f4a..000000000 --- a/_data/codefund.yml +++ /dev/null @@ -1,2 +0,0 @@ -enabled: true -# token: "c2c8bc62-c275-4c7a-a304-74335c5a1cd0" diff --git a/_data/content.yml b/_data/content.yml deleted file mode 100644 index c17e567fa..000000000 --- a/_data/content.yml +++ /dev/null @@ -1,51 +0,0 @@ -home: - title: "Rico's cheatsheets" - tagline: | - Hey! I'm @rstacruz and this is a modest collection of cheatsheets I've written. - -top_nav: - title: Devhints.io - edit: Edit - edit_on_github: Edit this page on GitHub - -sheet: - suffix: cheatsheet - -social_list: - default_description: 'Ridiculous collection of web development cheatsheets' - description: 'The ultimate cheatsheet for TITLE.' - facebook_share: Share on Facebook - twitter_share: Share on Twitter - -related_posts_callout: - description: Over SIZE curated cheatsheets, by developers for developers. - link: Devhints home - -related_posts_group: - top: Top cheatsheets - other: Other cheatsheets - category: Other CATEGORY cheatsheets - -search_form: - default_placeholder: Search SIZE+ cheatsheets - home_placeholder: Search... - prefix: devhints.io - -comments_area: - suffix: for this cheatsheet. - link: 'Write yours!' - -not_found: - title: Not found - description: Sorry, we don't have a cheatsheet for this yet. Try searching! - home: Back to home - -announcement: - # id: 2017-10-26-twitter - id: 2023-12-14 - title: | - We're on Twitter ♥️ - body: | - Follow [@devhints](https://twitter.com/devhints) on X/Twitter for daily "today I learned" snippets. - - Also: I've started a new blog with some insights on web development. Have a look! [**ricostacruz.com/posts**](https://ricostacruz.com/posts?utm_source=devhints) diff --git a/_data/disqus.yml b/_data/disqus.yml deleted file mode 100644 index 5fe82b1ce..000000000 --- a/_data/disqus.yml +++ /dev/null @@ -1,2 +0,0 @@ -enabled: true -host: devhints.disqus.com diff --git a/_data/google_analytics.yml b/_data/google_analytics.yml deleted file mode 100644 index abe040941..000000000 --- a/_data/google_analytics.yml +++ /dev/null @@ -1,4 +0,0 @@ -enabled: true -hostname: devhints.io -id: "G-N7TC6B227L" -# id: "UA-106902774-1" diff --git a/_includes/2017/announcements-list.html b/_includes/2017/announcements-list.html deleted file mode 100644 index 8d24ac01f..000000000 --- a/_includes/2017/announcements-list.html +++ /dev/null @@ -1,10 +0,0 @@ -{% if site.data.content.announcement %} -
-
-

{{ site.data.content.announcement.title }}

-
{{ site.data.content.announcement.body | markdownify }}
- -
-
-{% endif %} - diff --git a/_includes/2017/article-schema.html b/_includes/2017/article-schema.html deleted file mode 100644 index f5722b00f..000000000 --- a/_includes/2017/article-schema.html +++ /dev/null @@ -1,34 +0,0 @@ - - diff --git a/_includes/2017/comments-area.html b/_includes/2017/comments-area.html deleted file mode 100644 index 28dd4b09a..000000000 --- a/_includes/2017/comments-area.html +++ /dev/null @@ -1,22 +0,0 @@ -{% assign identifier = include.page.url | remove: '.html' | remove_first: '/' %} -{% if site.data.disqus.enabled %} -
-
-
- - - 0 Comments - - {{ site.data.content.comments_area.suffix }} - {{ site.data.content.comments_area.link }} - -
-
-
-
-
-
-
- -
-{% endif %} diff --git a/_includes/2017/foot.html b/_includes/2017/foot.html deleted file mode 100644 index 038762af7..000000000 --- a/_includes/2017/foot.html +++ /dev/null @@ -1,3 +0,0 @@ - - -{% for lang in page.prism_languages %}{% endfor %} diff --git a/_includes/2017/head.html b/_includes/2017/head.html deleted file mode 100644 index a5b05d464..000000000 --- a/_includes/2017/head.html +++ /dev/null @@ -1,24 +0,0 @@ -{% include meta.html %} -{% include polyfills.html %} - - -{% if include.critical == 'home' -%}{% -endif -%}{% -if include.critical == 'sheet' -%}{% -endif %} - - - - - - - diff --git a/_includes/2017/headline-pub.html b/_includes/2017/headline-pub.html deleted file mode 100644 index 6f0913b96..000000000 --- a/_includes/2017/headline-pub.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/_includes/2017/meta-vars.html b/_includes/2017/meta-vars.html deleted file mode 100644 index 577e5e72c..000000000 --- a/_includes/2017/meta-vars.html +++ /dev/null @@ -1,41 +0,0 @@ -{% comment %} - -This partial assigns these variables: - - meta_image: "https://assets.devhints.io/previews/react.jpg" - meta_description: "A comprehensive cheatsheet for React." - meta_title: "React cheatsheet" - depth: "1" - base: "./" - timestamp: "293048189123" - page_url: "https://devhints.io/react" - -It emits some blank lines because Jekyll, lol. - -{% endcomment %} - -{% assign depth = page.url | split: '/' | size | minus: 1 %} - -{% assign base = '' %} -{% if depth <= 1 %}{% assign base = '.' %} -{% elsif depth == 2 %}{% assign base = '..' %} -{% elsif depth == 3 %}{% assign base = '../..' %} -{% elsif depth == 4 %}{% assign base = '../../..' %}{% endif %} - -{% assign timestamp = site.time | date: "%Y%m%d%H%M%S" %} - -{% if site.data.assets.preview_host %}{% capture meta_image %}{% - if page.url == '/' -%}{{ site.data.assets.preview_host }}/index.jpg?t={{ timestamp }}{% - else -%}{{ site.data.assets.preview_host }}{{ include.page.url | remove: '.html' }}.jpg?t={{ timestamp }}{% - endif -%}{% endcapture %}{% endif %} - -{% capture meta_title %}{% include values/title.html page=include.page %}{% endcapture %} -{% assign meta_title = meta_title | strip_newlines %} - -{% capture meta_description %}{% include values/description.html page=include.page %}{% endcapture %} -{% assign meta_description = meta_description | strip_newlines %} - -{% capture page_url %}{{ site.url }}{{ page.url | remove: '.html' }}{% endcapture %} diff --git a/_includes/2017/pages-list-item.html b/_includes/2017/pages-list-item.html deleted file mode 100644 index 63db99cd6..000000000 --- a/_includes/2017/pages-list-item.html +++ /dev/null @@ -1,14 +0,0 @@ -{% assign slug = include.page.url | remove: '.html' | remove_first: '/' %} - - - {{ slug }} - - {% if include.page.layout == '2017/sheet' %} - - {% endif %} - - {{ include.page.title }} {{ include.page.redirect_to }} - - diff --git a/_includes/2017/related-posts-item.html b/_includes/2017/related-posts-item.html deleted file mode 100644 index 2fbb9c62d..000000000 --- a/_includes/2017/related-posts-item.html +++ /dev/null @@ -1,12 +0,0 @@ -
  • - - {{ include.page.title }} - - cheatsheet - - {% if include.page.layout == '2017/sheet' %} - - {% endif %} - - -
  • diff --git a/_includes/2017/related-posts.html b/_includes/2017/related-posts.html deleted file mode 100644 index d9d9e3304..000000000 --- a/_includes/2017/related-posts.html +++ /dev/null @@ -1,62 +0,0 @@ -{% assign category_pages = site.pages - | where: "category", include.page.category - | where_exp: "page", "page.url != include.page.url" - | where_exp: "page", "page.deprecated != true" - | where_exp: "page", "page.redirect_to == null" - | sort: "weight", "last" -%} -{% assign top_pages = site.pages - | where_exp: "page", "page.url != include.page.url" - | where_exp: "page", "page.deprecated != true" - | sort: "weight", "last" -%} -{% assign size = site.pages | size %} - diff --git a/_includes/2017/search-footer.html b/_includes/2017/search-footer.html deleted file mode 100644 index a350b29f9..000000000 --- a/_includes/2017/search-footer.html +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/_includes/2017/search-form.html b/_includes/2017/search-form.html deleted file mode 100644 index acc46d274..000000000 --- a/_includes/2017/search-form.html +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/_includes/2017/top-nav.html b/_includes/2017/top-nav.html deleted file mode 100644 index c063925d0..000000000 --- a/_includes/2017/top-nav.html +++ /dev/null @@ -1,35 +0,0 @@ -{% comment %} -Params: -- noshare -- noedit -- noback -{% endcomment %} - diff --git a/_includes/about-the-site.html b/_includes/about-the-site.html deleted file mode 100644 index afdbbb249..000000000 --- a/_includes/about-the-site.html +++ /dev/null @@ -1,20 +0,0 @@ -
    -
    -

    - {{ site.title }} is a collection of cheatsheets I've written over the years. - Suggestions and corrections? Send them in. - - I'm Rico Sta. Cruz. - Check out my Today I learned blog for more. -

    - - {% if page.url != '/index.html' %} -

    - -

    - {% endif %} - -

    -

    -
    -
    diff --git a/_includes/foot.html b/_includes/foot.html deleted file mode 100644 index 6315d0df8..000000000 --- a/_includes/foot.html +++ /dev/null @@ -1,14 +0,0 @@ - {% include about-the-site.html %} - - -{% comment %}{% endcomment %} -{% for lang in page.hljs_languages %} - -{% endfor %} - - - - - - - diff --git a/_includes/head.html b/_includes/head.html deleted file mode 100644 index 76458931c..000000000 --- a/_includes/head.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - {% include meta.html %} - {% include polyfills.html %} - - - - - - -
    diff --git a/_includes/meta.html b/_includes/meta.html deleted file mode 100644 index 336dd6d19..000000000 --- a/_includes/meta.html +++ /dev/null @@ -1,85 +0,0 @@ -{% include 2017/meta-vars.html page=page %} - - - - - -{% if meta_title %} - {{ meta_title | escape }} - - - -{% endif %} - -{% if meta_image %} - - - - -{% endif %} - -{% if meta_description %} - - - -{% endif %} - - - -{% if page.url == '/' %} - - -{% endif %} - -{% if page.author %} -{% for author in site.authors | where: "name", page.author %} - - {% if author.ogp %} - - {% endif %} -{% endfor %} -{% endif %} - -{% if site.title %} - -{% endif %} - -{% if site.facebook.app_id %} - -{% endif %} - -{% if site.facebook.admin %} - -{% endif %} - -{% if page.date %} - -{% endif %} - -{% if page.category %} - -{% endif %} - -{% if page.tags %} -{% for tag in page.tags %} - -{% endfor %} -{% endif %} - -{% if site.data.google_analytics.enabled %} - - -{% endif %} - -{% if depth %} - -{% endif %} - - - diff --git a/_includes/polyfills.html b/_includes/polyfills.html deleted file mode 100644 index 7a3672090..000000000 --- a/_includes/polyfills.html +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/_includes/site-header.html b/_includes/site-header.html deleted file mode 100644 index f5dcec38c..000000000 --- a/_includes/site-header.html +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/_includes/social-list.html b/_includes/social-list.html deleted file mode 100644 index 78a0113f3..000000000 --- a/_includes/social-list.html +++ /dev/null @@ -1,12 +0,0 @@ -{% if include.page.type == 'home' %} -{% assign description = site.data.content.social_list.default_description %} -{% else %} -{% assign description = site.data.content.social_list.description | replace: "TITLE", include.page.title %} -{% endif %} - diff --git a/_includes/values/description.html b/_includes/values/description.html deleted file mode 100644 index 267d7d7aa..000000000 --- a/_includes/values/description.html +++ /dev/null @@ -1,17 +0,0 @@ -{% - if page.description and page.intro -%}{{ page.description }} {{ page.intro | markdownify | strip_html }}{% - elsif page.description -%}{{ page.description }} · One-page guide to {{ page.title }}{% - elsif page.keywords and page.intro -%}{{ page.keywords | join: ' · ' }} · {{ page.intro | markdownify | strip_html }}{% - elsif page.keywords -%}{{ page.keywords | join: ' · ' }} · One-page guide to {{ page.title }}{% - elsif page.intro -%}One-page guide to {{ page.title }}: usage, examples, and more. {{ page.intro | markdownify | strip_html }}{% - elsif page.type == 'article' -%}The one-page guide to {{ page.title }}: usage, examples, links, snippets, and more.{% - else -%}The one-page guide to {{ page.title }}: usage, examples, links, snippets, and more.{% - endif -%} diff --git a/_includes/values/title.html b/_includes/values/title.html deleted file mode 100644 index bfc2ea1c6..000000000 --- a/_includes/values/title.html +++ /dev/null @@ -1,11 +0,0 @@ -{% - if page.full_title -%}{{ page.full_title }}{% - elsif page.type == 'article' -%}{{ page.title }} cheatsheet{% - elsif page.title -%}{{ page.title }}{% - else -%}{{ site.title }}{% - endif -%} diff --git a/_layouts/2017/home.html b/_layouts/2017/home.html deleted file mode 100644 index 352b54cf2..000000000 --- a/_layouts/2017/home.html +++ /dev/null @@ -1,78 +0,0 @@ - - - -{% assign featured_pages = site.pages - | where_exp: "page", "page.tags contains 'Featured'" -%} -{% assign recent_pages = site.pages - | where_exp: "page", "page.updated" - | sort: "updated", "first" -%} -{% include 2017/head.html critical='home' %} - - - -{% include 2017/top-nav.html page=page is_home=true noedit=true noback=true %} - -
    - - -
    - {% for page in featured_pages %} - {% include 2017/pages-list-item.html page=page class='item top-sheet' %} - {% endfor %} - -

    - Recently updated -

    - - {% for page in recent_pages reversed %} - {% if forloop.index <= 18 %} - {% include 2017/pages-list-item.html page=page class='article item' %} - {% endif %} - {% endfor %} - - - {% for category in site.data.categories.names %} -

    - {{ category }} -

    - - {% for page in site.pages %} - {% if page.category == category %} - {% if page.title %} - {% include 2017/pages-list-item.html page=page class='article item' %} - {% endif %} - {% endif %} - {% endfor %} - {% endfor %} - -
    -

    See something missing?

    -

    - Request cheatsheet -

    -
    -
    -
    - -{% include 2017/announcements-list.html %} - -{% include 2017/foot.html %} - - diff --git a/_layouts/2017/not_found.html b/_layouts/2017/not_found.html deleted file mode 100644 index 3950b7229..000000000 --- a/_layouts/2017/not_found.html +++ /dev/null @@ -1,26 +0,0 @@ - - - -{% include 2017/head.html %} - - - -{% include 2017/top-nav.html page=page noshare=true %} - -
    - -
    - -{% include 2017/foot.html %} - - - diff --git a/_layouts/2017/sheet.html b/_layouts/2017/sheet.html deleted file mode 100644 index 0073d7b0d..000000000 --- a/_layouts/2017/sheet.html +++ /dev/null @@ -1,54 +0,0 @@ - - - -{% include 2017/head.html critical='sheet' %} -{% include 2017/article-schema.html page=page %} - - - -{% include 2017/top-nav.html page=page %} - -
    - - - {% if page.tags contains 'WIP' %} - - {% endif %} - - {% if page.deprecated_by %} - - {% endif %} - - {% if page.intro %} -
    - {{ page.intro | markdownify }} -
    - {% endif %} - -
    - {{ content }} -
    -
    - - - -{% include 2017/comments-area.html page=page %} -{% include 2017/search-footer.html %} -{% include 2017/related-posts.html page=page %} -{% include 2017/foot.html %} - - - diff --git a/_layouts/blank.html b/_layouts/blank.html deleted file mode 100644 index b92f65223..000000000 --- a/_layouts/blank.html +++ /dev/null @@ -1 +0,0 @@ -{{content}} diff --git a/_layouts/default-ad.html b/_layouts/default-ad.html deleted file mode 100644 index 79b88aec5..000000000 --- a/_layouts/default-ad.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -type: article ---- -{% include head.html %} -{% include site-header.html %} - -
    -
    - {% include social-list.html page=page class="-collapse" %} - -
    -

    -

    {{ page.title }}

    -
    - - {% if site.data.carbon.enabled %} -
    - -
    - {% endif %} - -
    - {{ content }} -
    - - {% include social-list.html page=page %} -
    -
    - -{% include foot.html %} diff --git a/_layouts/default.html b/_layouts/default.html deleted file mode 100644 index d76d0fa5f..000000000 --- a/_layouts/default.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -type: article ---- -{% include head.html %} -{% include site-header.html %} - -{% include 2017/article-schema.html page=page %} - -
    -
    -
    -

    -

    {{ page.title }}

    - -
    - {% include 2017/headline-pub.html %} -
    -
    - -
    - {{ content }} -
    - - {% include social-list.html page=page %} -
    -
    - -{% include foot.html %} diff --git a/_layouts/home.html b/_layouts/home.html deleted file mode 100644 index 129954589..000000000 --- a/_layouts/home.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -html_class: home -type: home ---- -{% include head.html %} -{% include site-header.html %} - -{% for category in site.data.categories.names %} -
    -

    {{ category }}

    -
    -
    - {% for page in site.pages %} - {% if page.category == category %} - - {{ page.title }} - {{ page.url | remove: '.html' | remove: '/' }} - - {% endif %} - {% endfor %} -
    -{% endfor %} - -{% if site.data.carbon.enabled %} -
    - -
    -{% endif %} - -{% include foot.html %} diff --git a/_layouts/redirect.html b/_layouts/redirect.html deleted file mode 100644 index 5aaedf9ec..000000000 --- a/_layouts/redirect.html +++ /dev/null @@ -1,11 +0,0 @@ - -{% assign target = page.redirect.to | remove: '.html' | replace: 'cheatsheets/cheatsheets', 'cheatsheets' %} - - - Redirecting… - - -

    Redirecting...

    - Click here if you are not redirected. - - diff --git a/_parcel/_base.scss b/_parcel/_base.scss deleted file mode 100644 index bcc8adff9..000000000 --- a/_parcel/_base.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Base -@import '../_sass/2017/base/base.scss'; -@import '../_sass/2017/base/fade.scss'; diff --git a/_parcel/app.js b/_parcel/app.js deleted file mode 100644 index 24a50911c..000000000 --- a/_parcel/app.js +++ /dev/null @@ -1,30 +0,0 @@ -// Prismjs -import 'prismjs' -import 'prismjs/plugins/line-highlight/prism-line-highlight.min.js' -import 'prismjs/components/prism-jsx.min.js' -import 'prismjs/components/prism-bash.min.js' -import 'prismjs/components/prism-scss.min.js' -import 'prismjs/components/prism-css.min.js' -import 'prismjs/components/prism-elixir.min.js' -import 'prismjs/components/prism-ruby.min.js' - -// Initializers -import './initializers/prism' -import './initializers/onmount' - -// Behaviors -import './behaviors/anchors' -import './behaviors/dismissable' -import './behaviors/dismiss' -import './behaviors/disqus' -import './behaviors/h3-section-list' -import './behaviors/main-body' -import './behaviors/no-preview' -import './behaviors/searchable-header' -import './behaviors/searchable-item' -import './behaviors/search-form' -import './behaviors/search-input' - -// CSS -import 'prismjs/plugins/line-highlight/prism-line-highlight.css' -import 'hint.css/hint.min.css' diff --git a/_parcel/behaviors/anchors.js b/_parcel/behaviors/anchors.js deleted file mode 100644 index efe8f7ca4..000000000 --- a/_parcel/behaviors/anchors.js +++ /dev/null @@ -1,46 +0,0 @@ -import onmount from 'onmount' -import prepend from 'dom101/prepend' - -const DEFAULTS = { - // select elements to put anchor on - rule: 'h2[id]', - // class name for anchor - className: 'local-anchor anchor', - // text of anchor - text: '#', - // append before or after innerText? - shouldAppend: false -} - -/* - * Behavior: Add local anchors - */ - -onmount('[data-js-anchors]', function () { - const data = JSON.parse(this.getAttribute('data-js-anchors') || '{}') - const rules = Array.isArray(data) - ? data.length - ? data - : [DEFAULTS] - : [Object.assign({}, DEFAULTS, data)] - - for (const { rule, className, text, shouldAppend } of rules) { - for (const el of this.querySelectorAll(rule)) { - if (!el.hasAttribute('id')) { - continue - } - - const id = el.getAttribute('id') - const anchor = document.createElement('a') - anchor.setAttribute('href', `#${id}`) - anchor.setAttribute('class', className) - anchor.innerText = String(text || DEFAULTS.text) - - if (shouldAppend) { - el.appendChild(anchor) - } else { - prepend(el, anchor) - } - } - } -}) diff --git a/_parcel/behaviors/dismiss.js b/_parcel/behaviors/dismiss.js deleted file mode 100644 index 8dba8cd44..000000000 --- a/_parcel/behaviors/dismiss.js +++ /dev/null @@ -1,22 +0,0 @@ -import closest from 'dom101/closest' -import remove from 'dom101/remove' -import on from 'dom101/on' -import { getData } from '../helpers/data' -import onmount from 'onmount' -import * as Dismiss from '../helpers/dismiss' - -/** - * Dismiss button - */ - -onmount('[data-js-dismiss]', function () { - const parent = closest(this, '[data-js-dismissable]') - const dismissable = getData(parent, 'js-dismissable') - const id = (dismissable && dismissable.id) || '' - - on(this, 'click', (e) => { - Dismiss.setDismissed(id) - e.preventDefault() - if (parent) remove(parent) - }) -}) diff --git a/_parcel/behaviors/dismissable.js b/_parcel/behaviors/dismissable.js deleted file mode 100644 index f2708f4ee..000000000 --- a/_parcel/behaviors/dismissable.js +++ /dev/null @@ -1,17 +0,0 @@ -import onmount from 'onmount' -import remove from 'dom101/remove' -import removeClass from 'dom101/remove-class' - -import { getData } from '../helpers/data' -import { isDismissed } from '../helpers/dismiss' -import { isPreview } from '../helpers/preview' - -onmount('[data-js-dismissable]', function () { - const id = getData(this, 'js-dismissable').id || '' - - if (isPreview() || isDismissed(id)) { - remove(this) - } else { - removeClass(this, '-hide') - } -}) diff --git a/_parcel/behaviors/disqus.js b/_parcel/behaviors/disqus.js deleted file mode 100644 index cec0da85d..000000000 --- a/_parcel/behaviors/disqus.js +++ /dev/null @@ -1,32 +0,0 @@ -import onmount from 'onmount' -import injectDisqus from '../helpers/inject_disqus' - -/** - * Delay disqus by some time. It's at the bottom of the page, there's no need - * for it to load fast. This will give more time to load more critical assets. - */ - -const DISQUS_DELAY = 100 - -/** - * Injects Disqus onto the page. - */ - -onmount('[data-js-disqus]', function () { - const data = JSON.parse(this.getAttribute('data-js-disqus')) - const $parent = this.parentNode - $parent.setAttribute('hidden', true) - - window.disqus_config = function () { - this.page.url = data.url - this.page.identifier = data.identifier - } - - // Disqus takes a while to load, don't do it so eagerly. - window.addEventListener('load', () => { - setTimeout(() => { - injectDisqus(data.host) - $parent.removeAttribute('hidden') - }, DISQUS_DELAY) - }) -}) diff --git a/_parcel/behaviors/h3-section-list.js b/_parcel/behaviors/h3-section-list.js deleted file mode 100644 index 9a6bd5598..000000000 --- a/_parcel/behaviors/h3-section-list.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable no-new */ - -import Isotope from 'isotope-layout' -import onmount from 'onmount' -import on from 'dom101/on' -import qsa from 'dom101/query-selector-all' - -/* - * Behavior: Isotope - */ - -onmount('[data-js-h3-section-list]', function () { - const iso = new Isotope(this, { - itemSelector: '.h3-section', - transitionDuration: 0 - }) - - const images = qsa('img', this) - - images.forEach((image) => { - on(image, 'load', () => { - iso.layout() - }) - }) - - // Insurance against weirdness on pages like devhints.io/vim, where the - // critical path CSS may look different from the final CSS (because of the - // tables). - on(window, 'load', () => { - iso.layout() - }) -}) diff --git a/_parcel/behaviors/no-preview.js b/_parcel/behaviors/no-preview.js deleted file mode 100644 index bd759986e..000000000 --- a/_parcel/behaviors/no-preview.js +++ /dev/null @@ -1,16 +0,0 @@ -import remove from 'dom101/remove' -import onmount from 'onmount' -import addClass from 'dom101/add-class' - -import { isPreview } from '../helpers/preview' - -/* - * Behavior: Things to remove when preview mode is on - */ - -onmount('[data-js-no-preview]', function (b) { - if (isPreview()) { - remove(this) - addClass(document.documentElement, 'PreviewMode') - } -}) diff --git a/_parcel/behaviors/search-form.js b/_parcel/behaviors/search-form.js deleted file mode 100644 index d89a9e6d5..000000000 --- a/_parcel/behaviors/search-form.js +++ /dev/null @@ -1,17 +0,0 @@ -import onmount from 'onmount' -import on from 'dom101/on' - -/** - * Submitting the search form - */ - -onmount('[data-js-search-form]', function () { - on(this, 'submit', (e) => { - e.preventDefault() - - const link = document.querySelector('a[data-search-index]:not([hidden])') - const href = link && link.getAttribute('href') - - if (href) window.location = href - }) -}) diff --git a/_parcel/behaviors/search-input.js b/_parcel/behaviors/search-input.js deleted file mode 100644 index ae17e0ac7..000000000 --- a/_parcel/behaviors/search-input.js +++ /dev/null @@ -1,24 +0,0 @@ -import onmount from 'onmount' -import * as Search from '../helpers/search' -import qs from '../helpers/qs' -import on from 'dom101/on' - -onmount('[data-js-search-input]', function () { - on(this, 'input', () => { - const val = this.value - - if (val === '') { - Search.showAll() - } else { - Search.show(val) - } - }) - - const query = (qs(window.location.search) || {}).q - if (query && query.length) { - this.value = query - setTimeout(() => { - Search.show(query) - }) - } -}) diff --git a/_parcel/behaviors/searchable-header.js b/_parcel/behaviors/searchable-header.js deleted file mode 100644 index b569921dc..000000000 --- a/_parcel/behaviors/searchable-header.js +++ /dev/null @@ -1,23 +0,0 @@ -import onmount from 'onmount' -import { nextUntil } from '../helpers/dom' -import matches from 'dom101/matches' - -// Ensure that search-index is set first -import './searchable-item' - -/** - * Propagate item search indices to headers - */ - -onmount('[data-js-searchable-header]', function () { - const els = nextUntil(this, '[data-js-searchable-header]').filter((el) => - matches(el, '[data-search-index]') - ) - - const keywords = els - .map((n) => n.getAttribute('data-search-index')) - .join(' ') - .split(' ') - - this.setAttribute('data-search-index', keywords.join(' ')) -}) diff --git a/_parcel/behaviors/searchable-item.js b/_parcel/behaviors/searchable-item.js deleted file mode 100644 index 0f45f10d6..000000000 --- a/_parcel/behaviors/searchable-item.js +++ /dev/null @@ -1,13 +0,0 @@ -import onmount from 'onmount' -import permutate from '../helpers/permutate' - -/** - * Sets search indices (`data-search-index` attribute) - */ - -onmount('[data-js-searchable-item]', function () { - const data = JSON.parse(this.getAttribute('data-js-searchable-item') || '{}') - const words = permutate(data) - - this.setAttribute('data-search-index', words.join(' ')) -}) diff --git a/_parcel/critical-home.js b/_parcel/critical-home.js deleted file mode 100644 index 796412935..000000000 --- a/_parcel/critical-home.js +++ /dev/null @@ -1,2 +0,0 @@ -import 'sanitize.css' -import './critical-home.scss' diff --git a/_parcel/critical-home.scss b/_parcel/critical-home.scss deleted file mode 100644 index 2442a64b0..000000000 --- a/_parcel/critical-home.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import './_utils.scss'; -@import './_base.scss'; - -// Components -@import '../_sass/2017/components/attribute-peg.scss'; -@import '../_sass/2017/components/announcements-item.scss'; -@import '../_sass/2017/components/announcements-list.scss'; -@import '../_sass/2017/components/back-button.scss'; -@import '../_sass/2017/components/body-area.scss'; -@import '../_sass/2017/components/headline-pub.scss'; -@import '../_sass/2017/components/page-actions.scss'; -@import '../_sass/2017/components/pages-list.scss'; -@import '../_sass/2017/components/search-box.scss'; -@import '../_sass/2017/components/site-header.scss'; -@import '../_sass/2017/components/top-nav.scss'; -@import '../_sass/2017/components/top-sheet.scss'; diff --git a/_parcel/critical-sheet.js b/_parcel/critical-sheet.js deleted file mode 100644 index 55c92a58c..000000000 --- a/_parcel/critical-sheet.js +++ /dev/null @@ -1,2 +0,0 @@ -import 'sanitize.css' -import './critical-sheet.scss' diff --git a/_parcel/critical-sheet.scss b/_parcel/critical-sheet.scss deleted file mode 100644 index f8a55be0a..000000000 --- a/_parcel/critical-sheet.scss +++ /dev/null @@ -1,21 +0,0 @@ -@import './_utils.scss'; -@import './_base.scss'; - -// Markdown -@import '../_sass/2017/markdown/a-em.scss'; -@import '../_sass/2017/markdown/code.scss'; -@import '../_sass/2017/markdown/headings.scss'; -@import '../_sass/2017/markdown/local-anchor.scss'; -@import '../_sass/2017/markdown/p.scss'; -@import '../_sass/2017/markdown/table.scss'; -@import '../_sass/2017/markdown/ul.scss'; - -// Components -@import '../_sass/2017/components/back-button.scss'; -@import '../_sass/2017/components/body-area.scss'; -@import '../_sass/2017/components/h3-section.scss'; -@import '../_sass/2017/components/h3-section-list.scss'; -@import '../_sass/2017/components/headline-pub.scss'; -@import '../_sass/2017/components/main-heading.scss'; -@import '../_sass/2017/components/page-actions.scss'; -@import '../_sass/2017/components/top-nav.scss'; diff --git a/_parcel/critical.js b/_parcel/critical.js deleted file mode 100644 index b92f80be7..000000000 --- a/_parcel/critical.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This is the "critical path" JavaScript that will be included INLINE on every - * page. Keep this as small as possible! - */ - -import wrapify from './wrapify' -import addClass from 'dom101/add-class' -import on from 'dom101/on' - -// Transform the main body markup to make it readable. -const body = document.querySelector('[data-js-main-body]') - -if (body) { - wrapify(body) - addClass(body, '-wrapified') -} - -// Be "done" when we're done, or after a certain timeout. -on(window, 'load', done) -setTimeout(done, 5000) - -let isDone -function done() { - if (isDone) return - addClass(document.documentElement, 'LoadDone') - isDone = true -} diff --git a/_parcel/helpers/dom.js b/_parcel/helpers/dom.js deleted file mode 100644 index 723c41fc5..000000000 --- a/_parcel/helpers/dom.js +++ /dev/null @@ -1,62 +0,0 @@ -import matches from 'dom101/matches' - -/* - * Just like jQuery.append - */ - -export function appendMany(el, children) { - children.forEach((child) => { - el.appendChild(child) - }) -} - -/* - * Just like jQuery.nextUntil - */ - -export function nextUntil(el, selector) { - const nextEl = el.nextSibling - return nextUntilTick(nextEl, selector, []) -} - -function nextUntilTick(el, selector, acc) { - if (!el) return acc - - const isMatch = matches(el, selector) - if (isMatch) return acc - - return nextUntilTick(el.nextSibling, selector, [...acc, el]) -} - -/* - * Just like jQuery.before - */ - -export function before(reference, newNode) { - reference.parentNode.insertBefore(newNode, reference) -} - -/* - * Like jQuery.children('selector') - */ - -export function findChildren(el, selector) { - return [].slice.call(el.children).filter((child) => matches(child, selector)) -} - -/** - * Creates a div - * @private - * - * @example - * - * createDiv({ class: 'foo' }) - */ - -export function createDiv(props) { - const d = document.createElement('div') - Object.keys(props).forEach((key) => { - d.setAttribute(key, props[key]) - }) - return d -} diff --git a/_parcel/helpers/noop.js b/_parcel/helpers/noop.js deleted file mode 100644 index f52fd393b..000000000 --- a/_parcel/helpers/noop.js +++ /dev/null @@ -1 +0,0 @@ -/* blank */ diff --git a/_parcel/helpers/permutate.js b/_parcel/helpers/permutate.js deleted file mode 100644 index 2bbb4e9ca..000000000 --- a/_parcel/helpers/permutate.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Permutates a searcheable item. - * - * permutate({ - * slug: 'hello-world', - * category: 'greetings' - * }) - */ - -export default function permutate(data) { - let words = [] - if (data.slug) { - words = words.concat(permutateString(data.slug)) - } - if (data.category) { - words = words.concat(permutateString(data.category)) - } - return words -} - -/** - * Permutates strings. - * - * @example - * permutateString('hi joe') - * => ['h', 'hi', 'j', 'jo', 'joe'] - */ - -export function permutateString(str) { - let words = [] - let inputs = splitwords(str) - - inputs.forEach((word) => { - words = words.concat(permutateWord(word)) - }) - - return words -} - -/** - * Permutates a word. - * - * @example - * permutateWord('hello') - * => ['h', 'he', 'hel', 'hell', 'hello'] - */ - -export function permutateWord(str) { - let words = [] - const len = str.length - for (var i = 1; i <= len; ++i) { - words.push(str.substr(0, i)) - } - return words -} - -/** - * Helper for splitting to words. - * - * @example - * splitWords('Hello, world!') - * => ['hello', 'world'] - */ - -export function splitwords(str) { - const words = str - .toLowerCase() - .split(/[ /\-_]/) - .filter((k) => k && k.length !== 0) - - return words -} diff --git a/_parcel/helpers/search.js b/_parcel/helpers/search.js deleted file mode 100644 index 65036a269..000000000 --- a/_parcel/helpers/search.js +++ /dev/null @@ -1,43 +0,0 @@ -import { splitwords } from './permutate' -import qsa from 'dom101/query-selector-all' - -/** - * Show everything. - * - * @example - * Search.showAll() - */ - -export function showAll() { - qsa('[data-search-index]').forEach((el) => { - el.removeAttribute('hidden') - el.style.removeProperty('display') - }) -} - -/** - * Search for a given keyword. - * - * @example - * Search.show('hello') - */ - -export function show(val) { - const keywords = splitwords(val) - - if (!keywords.length) return showAll() - - const selectors = keywords - .map((k) => `[data-search-index~=${JSON.stringify(k)}]`) - .join('') - - qsa('[data-search-index]').forEach((el) => { - el.setAttribute('hidden', true) - el.style.setProperty('display', "none") - }) - - qsa(selectors).forEach((el) => { - el.removeAttribute('hidden') - el.style.removeProperty('display') - }) -} diff --git a/_parcel/initializers/onmount.js b/_parcel/initializers/onmount.js deleted file mode 100644 index 26958618a..000000000 --- a/_parcel/initializers/onmount.js +++ /dev/null @@ -1,12 +0,0 @@ -import ready from 'dom101/ready' -import onmount from 'onmount' - -/** - * Behavior: Wrapping - */ - -ready(() => { - setTimeout(() => { - onmount() - }) -}) diff --git a/_parcel/initializers/prism.js b/_parcel/initializers/prism.js deleted file mode 100644 index b32e140f8..000000000 --- a/_parcel/initializers/prism.js +++ /dev/null @@ -1 +0,0 @@ -window.Prism = require('prismjs') diff --git a/_parcel/wrapify/__tests__/__snapshots__/index.test.js.snap b/_parcel/wrapify/__tests__/__snapshots__/index.test.js.snap deleted file mode 100644 index 8a48b6043..000000000 --- a/_parcel/wrapify/__tests__/__snapshots__/index.test.js.snap +++ /dev/null @@ -1,274 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`h2 + pre 1`] = ` -
    - - -
    -

    - heading -

    -
    - - -
    -
    -
    -            (code)
    -          
    - - -
    -
    -
    -
    -
    -`; - -exports[`h3 with class 1`] = ` -
    - - -
    -
    -
    -

    - install -

    -
    - - -

    - (install) -

    - - -
    -
    -
    -
    -
    -`; - -exports[`multiple h2s 1`] = ` -
    - - -
    -

    - multiple h2 -

    -
    -
    -
    -

    - - - -

    -
    -
    -

    - install -

    -
    - - -

    - (install) -

    - - - -
    -
    -
    -

    - usage -

    -
    - - -

    - (usage) -

    - - - -
    -
    -
    -
    -
    -

    - getting started -

    -
    -
    -
    -

    - - - -

    -
    -
    -

    - first -

    -
    - - -

    - (first) -

    - - - -
    -
    -
    -

    - second -

    -
    - - -

    - (second) -

    - - -
    -
    -
    -
    -
    -`; - -exports[`simple usage 1`] = ` -
    - - -
    -

    - simple usage -

    -
    -
    -
    -

    - - - -

    -
    -
    -

    - install -

    -
    - - -

    - (install) -

    - - - -
    -
    -
    -

    - usage -

    -
    - - -

    - (usage) -

    - - -
    -
    -
    -
    -
    -`; diff --git a/_parcel/wrapify/__tests__/index.test.js b/_parcel/wrapify/__tests__/index.test.js deleted file mode 100644 index 019161994..000000000 --- a/_parcel/wrapify/__tests__/index.test.js +++ /dev/null @@ -1,88 +0,0 @@ -/* eslint-env jest */ -import wrapify from '../index' - -it( - 'simple usage', - run( - ` -
    -

    simple usage

    - -

    install

    -

    (install)

    - -

    usage

    -

    (usage)

    -
    -`, - (root) => { - expect( - root.querySelectorAll('.h2-section .h3-section-list .h3-section').length - ).toEqual(2) - } - ) -) - -it( - 'h3 with class', - run( - ` -
    -

    install

    -

    (install)

    -
    -`, - (root) => { - expect(root.querySelectorAll('div.h3-section.-hello').length).toEqual(1) - expect( - root.querySelectorAll('div.h3-section-list.-hello').length - ).toEqual(1) - } - ) -) - -it( - 'multiple h2s', - run(` -
    -

    multiple h2

    - -

    install

    -

    (install)

    - -

    usage

    -

    (usage)

    - -

    getting started

    - -

    first

    -

    (first)

    - -

    second

    -

    (second)

    -
    -`) -) - -function run(input, fn) { - return function () { - const div = document.createElement('div') - div.innerHTML = input - - const root = div.children[0] - wrapify(root) - expect(root).toMatchSnapshot() - - if (fn) fn(root) - } -} - -it( - 'h2 + pre', - run(` -
    -

    heading

    -
    (code)
    -
    -`) -) diff --git a/_parcel/wrapify/index.js b/_parcel/wrapify/index.js deleted file mode 100644 index 0af5fbaf1..000000000 --- a/_parcel/wrapify/index.js +++ /dev/null @@ -1,119 +0,0 @@ -import matches from 'dom101/matches' -import addClass from 'dom101/add-class' -import { - appendMany, - nextUntil, - before, - findChildren, - createDiv -} from '../helpers/dom' - -/** - * Wraps h2 sections into h2-section. - * Wraps h3 sections into h3-section. - * - * @private - */ - -export default function wrapify(root) { - // These are your H2 sections. Returns a list of .h2-section nodes. - const sections = wrapifyH2(root) - - // For each h2 section, wrap the H3's in them - sections.forEach((section) => { - const bodies = findChildren(section, '[data-js-h3-section-list]') - bodies.forEach((body) => { - wrapifyH3(body) - }) - }) -} - -/** - * Wraps h2 sections into h2-section. - * Creates and HTML structure like so: - * - * .h2-section - * h2. - * (title) - * .body.h3-section-list. - * (body goes here) - * - * @private - */ - -function wrapifyH2(root) { - return groupify(root, { - tag: 'h2', - wrapperFn: () => createDiv({ class: 'h2-section' }), - bodyFn: () => - createDiv({ - class: 'body h3-section-list', - 'data-js-h3-section-list': '' - }) - }) -} - -/** - * Wraps h3 sections into h3-section. - * Creates and HTML structure like so: - * - * .h3-section - * h3. - * (title) - * .body. - * (body goes here) - * - * @private - */ - -function wrapifyH3(root) { - return groupify(root, { - tag: 'h3', - wrapperFn: () => createDiv({ class: 'h3-section' }), - bodyFn: () => createDiv({ class: 'body' }) - }) -} - -/** - * Groups all headings (a `tag` selector) under wrappers like `.h2-section` - * (build by `wrapperFn()`). - * @private - */ - -export function groupify(el, { tag, wrapperFn, bodyFn }) { - const first = el.children[0] - let result = [] - - // Handle the markup before the first h2 - if (first && !matches(first, tag)) { - const sibs = nextUntil(first, tag) - result.push(wrap(first, null, [first, ...sibs])) - } - - // Find all h3's inside it - const children = findChildren(el, tag) - - children.forEach((child) => { - const sibs = nextUntil(child, tag) - result.push(wrap(child, child, sibs)) - }) - - return result - - function wrap(pivot, first, sibs) { - const wrap = wrapperFn() - - const pivotClass = pivot.className - if (pivotClass) addClass(wrap, pivotClass) - before(pivot, wrap) - - const body = bodyFn() - if (pivotClass) addClass(body, pivotClass) - appendMany(body, sibs) - - if (first) wrap.appendChild(first) - wrap.appendChild(body) - - return wrap - } -} diff --git a/_sass/.gitignore b/_sass/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/_sass/2015/base/normalize.scss b/_sass/2015/base/normalize.scss deleted file mode 100644 index 458eea1ea..000000000 --- a/_sass/2015/base/normalize.scss +++ /dev/null @@ -1,427 +0,0 @@ -/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS text size adjust after orientation change, without disabling - * user zoom. - */ - -html { - font-family: sans-serif; /* 1 */ - -ms-text-size-adjust: 100%; /* 2 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* HTML5 display definitions - ========================================================================== */ - -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} - -/** - * 1. Correct `inline-block` display not defined in IE 8/9. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ - -audio, -canvas, -progress, -video { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ -} - -/** - * Prevent modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* Links - ========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * Improve readability when focused and also mouse hovered in all browsers. - */ - -a:active, -a:hover { - outline: 0; -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -/** - * Address styling not present in Safari and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/** - * Address styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove border when inside `a` element in IE 8/9/10. - */ - -img { - border: 0; -} - -/** - * Correct overflow not hidden in IE 9/10/11. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* Grouping content - ========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari. - */ - -figure { - margin: 1em 40px; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} - -/** - * Contain overflow in all browsers. - */ - -pre { - overflow: auto; -} - -/** - * Address odd `em`-unit font size rendering in all browsers. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} - -/* Forms - ========================================================================== */ - -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ - -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - */ - -button, -input, -optgroup, -select, -textarea { - color: inherit; /* 1 */ - font: inherit; /* 2 */ - margin: 0; /* 3 */ -} - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ - -button { - overflow: visible; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -input { - line-height: normal; -} - -/** - * It's recommended that you don't attempt to style these elements. - * Firefox's implementation doesn't respect box-sizing, padding, or width. - * - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome - * (include `-moz` to future-proof). - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; /* 2 */ - box-sizing: content-box; -} - -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ - -textarea { - overflow: auto; -} - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ - -optgroup { - font-weight: bold; -} - -/* Tables - ========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -td, -th { - padding: 0; -} diff --git a/_sass/2015/base/typography.sass b/_sass/2015/base/typography.sass deleted file mode 100644 index baf91b06b..000000000 --- a/_sass/2015/base/typography.sass +++ /dev/null @@ -1,58 +0,0 @@ -@import url('//brick.a.ssl.fastly.net/Roboto:400,400i,700') -@import url('//fonts.googleapis.com/css?family=Raleway:800') -@import url('//fonts.googleapis.com/css?family=Fira+Mono:400,400i') -@import url('//brick.a.ssl.fastly.net/EB+Garamond:400i') - -$body-font-size: 17px -$body-line-height: 1.7 - -@mixin font-size($multiplier, $lhmultiplier, $size, $line-height) - font-size: $size * $multiplier - @if $line-height != none - line-height: $line-height * $lhmultiplier - -@mixin body-font - font-family: 'Roboto', sans-serif - font-weight: 400 - -@mixin italic-font - font-family: 'eb garamond', serif - font-weight: 400 - font-style: italic - +kernliga - -@mixin headline-font - font-family: 'eb garamond', serif - font-weight: 400 - font-style: italic - +kernliga - -@mixin caps-font - text-transform: uppercase - letter-spacing: 2px - -@mixin mono-font - font-family: 'fira mono', monospace - font-weight: 400 - letter-spacing: -0.5px - +no-antialias - -@mixin bold-font - font-family: 'raleway', sans-serif - font-weight: 800 - -/* - * sizes - */ - -@mixin italic-font-size($size, $line-height: none) - +font-size(1.0, 1.0, $size, $line-height) - -@mixin headline-font-size($size, $line-height: none) - +font-size(1.0, 1.0, $size, $line-height) - -@mixin bold-font-size($size, $line-height: none) - +font-size(1.0, 1.0, $size, $line-height) - -@mixin mono-font-size($size, $line-height: none) - +font-size(1.0, 1.0, $size, $line-height) diff --git a/_sass/2015/base/utils.sass b/_sass/2015/base/utils.sass deleted file mode 100644 index b1df4309b..000000000 --- a/_sass/2015/base/utils.sass +++ /dev/null @@ -1,41 +0,0 @@ -@mixin kernliga - font-size-adjust: none - // don't display digraphs in languages that don't support it - -webkit-font-language-override: normal - font-language-override: normal - - // use font-defined kerning info - -webkit-font-kerning: auto - font-kerning: auto - - // opentype options: kerning, ligatures, horiz ligatures, discretionary ligatures, contextual swash - // https://en.wikipedia.org/wiki/List_of_typographic_features - -webkit-font-feature-settings: "kern", "liga", "dlig", "hlig", "cswh" - font-feature-settings: "kern", "liga", "dlig", "hlig", "cswh" - - // allow browser to auto-infer missing glyphs - font-synthesis: weight style - - // swashes on first letters - // &:first-letter - // font-feature-settings: "kern", "swsh" - // -webkit-font-feature-settings: "kern", "swsh" - -@mixin antialias - text-rendering: optimizeLegibility - -webkit-font-smoothing: antialiased - -moz-osx-font-smoothing: grayscale - -@mixin no-antialias - text-rendering: auto - -webkit-font-smoothing: subpixel-antialiased - -moz-osx-font-smoothing: auto - -@mixin clearfix - &:after - display: table - content: '' - clear: both - height: 0 - zoom: 1 - diff --git a/_sass/2015/components/about-the-site.sass b/_sass/2015/components/about-the-site.sass deleted file mode 100644 index a30747444..000000000 --- a/_sass/2015/components/about-the-site.sass +++ /dev/null @@ -1,105 +0,0 @@ -/* - * .about-the-site - */ - -.about-the-site - & - position: relative - - .container - text-align: center - padding: 3em 80px - margin: 0 auto - +clearfix - - @media (max-width: 768px) - padding-left: 40px - padding-right: 40px - - &:before - content: '' - position: absolute - display: block - left: 20px - right: 20px - top: 0 - border-top: solid 1px $hairline - - & - +body-font - font-size: 0.85em - color: lighten($gray, 20%) - - a, a:visited - color: lighten($gray, 10%) - box-shadow: inset 0 -1px rgba(black, 0.05) - padding-bottom: 2px - - a:hover, a:focus - color: $black - box-shadow: inset 0 -2px $accent - - strong - +bold-font - - strong a, strong a:visited - color: $black - box-shadow: none - - strong a:hover, strong a:focus - color: $black - box-shadow: inset 0 -2px $accent - - .identity - margin: 0 - margin-top: 0.2em - float: right - +italic-font - +italic-font-size(2.5em) - - .identity a, - .identity a:visited - color: $black - box-shadow: none - - .identity a:hover, - .identity a:focus - color: $accent - - .blurb - margin: 0 - max-width: 500px - text-align: left - float: left - line-height: 1.55 - - .back - float: right - margin-top: 0.4em - margin-right: 2em - - .fleuron:before - content: '\f492' - font-family: Ionicons - font-size: 16px - font-weight: normal - font-style: normal - display: inline-block - vertical-align: middle - color: $black - margin: 0 7px - - @media (max-width: 768px) - display: none - - @media (max-width: 768px) - .identity - float: left - clear: both - .blurb - float: none - margin-bottom: 1em - width: auto - .back - float: right - margin-right: 0 diff --git a/_sass/2015/components/big-button.sass b/_sass/2015/components/big-button.sass deleted file mode 100644 index 33f61e0cb..000000000 --- a/_sass/2015/components/big-button.sass +++ /dev/null @@ -1,66 +0,0 @@ -.big-button, -a.big-button - display: inline-block - - width: 180px - height: 50px - line-height: 50px - 2px - padding: 0 - border-radius: 30px - font-size: 0.85em - box-shadow: none - background: transparent - - @media (max-width: 768px) - width: 140px - height: 40px - line-height: 40px - 2px - - &, &:visited - border: solid 2px $accent - color: $accent - - &.-back, - &.-back:visited - border: solid 1px rgba($gray, 0.2) - color: $gray - - &.-back:before, - &.-next:after - font-family: Ionicons - font-size: 20px - display: inline-block - vertical-align: middle - position: relative - top: -1px - - &.-back:before - content: '\f38f' - - &.-next:after - content: '\f3d1' - margin-left: 16px - top: 0 - - &.-slim - width: 60px - border-width: 2px - height: 60px - line-height: 60px - border-radius: 50% - - @media (max-width: 768px) - width: 40px - height: 40px - line-height: 40px - - &:hover, &:focus - background: $accent - border-color: transparent - color: white - box-shadow: none - - &.-back:hover, - &.-back:focus - background: $accent - color: white diff --git a/_sass/2015/components/brief-intro.sass b/_sass/2015/components/brief-intro.sass deleted file mode 100644 index ac4ce72fb..000000000 --- a/_sass/2015/components/brief-intro.sass +++ /dev/null @@ -1,8 +0,0 @@ -/* - * .brief-intro -- Brief introduction - */ - -.brief-intro - font-size: 1.1em - color: $gray - diff --git a/_sass/2015/components/full-image.sass b/_sass/2015/components/full-image.sass deleted file mode 100644 index 0234709b1..000000000 --- a/_sass/2015/components/full-image.sass +++ /dev/null @@ -1,38 +0,0 @@ -/* - * .full-image -- full width image containers - */ - -.full-image - & - overflow: hidden - text-align: center - position: relative - - img - background: #fcfcfc - - &.cropped img, - &.cropped img:first-child:last-child - margin-bottom: -50px - display: block - background: transparent - - &.cropped:after - content: '' - display: block - position: absolute - bottom: 0 - left: 20px - right: 20px - border-bottom: solid 1px $lightgray - - &.stretched img - width: 100% - - @media (max-width: 768px) - margin-left: -20px - margin-right: -20px - - @media (min-width: 769px) - width: 100vw - margin-left: calc(-50vw + #{$page-width} / 2) diff --git a/_sass/2015/components/hint.sass b/_sass/2015/components/hint.sass deleted file mode 100644 index 7d3c25258..000000000 --- a/_sass/2015/components/hint.sass +++ /dev/null @@ -1,14 +0,0 @@ -.hint--top, .hint--bottom - &:before - margin-top: -14px - margin-left: -8px - border-radius: 2px - - &:before, &:after - transition-duration: 10ms - - &:after - box-shadow: none - border-radius: 2px - text-shadow: none - margin-left: -55px diff --git a/_sass/2015/components/hljs.sass b/_sass/2015/components/hljs.sass deleted file mode 100644 index b9cfc8930..000000000 --- a/_sass/2015/components/hljs.sass +++ /dev/null @@ -1,78 +0,0 @@ -.hljs-literal, -.hljs-number, -.hljs-string, -.hljs-symbol, -.hljs-value - color: $accent - -.hljs-key, -.hljs-attribute - color: darken($accent, 20%) - -.hljs-keyword, -.hljs-constant - color: $black - -.hljs-comment - color: $gray - font-style: italic - -// -// Prism -// - -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata - color: $gray - font-style: italic - -.token.punctuation - color: #999 - -.token.property, -.token.tag, -.token.boolean, -.token.number, -.token.constant, -.token.symbol, -.token.deleted - color: #905 - -.token.selector, -.token.attr-name, -.token.string, -.token.char, -.token.builtin, -.token.inserted - color: $accent - -.token.operator, -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string - color: #a67f59 - -.token.atrule, -.token.attr-value, -.token.keyword - color: #07a - -.token.function - color: #DD4A68 - -.token.regex, -.token.important, -.token.variable - color: #e90 - -.token.important, -.token.bold - font-weight: bold -.token.italic - font-style: italic - -.token.entity - cursor: help diff --git a/_sass/2015/components/next-article.sass b/_sass/2015/components/next-article.sass deleted file mode 100644 index 485114ad9..000000000 --- a/_sass/2015/components/next-article.sass +++ /dev/null @@ -1,142 +0,0 @@ -/* - * .next-article -- lead into the next article - */ - -.next-article - $bg: darken(#8e44ad, 15%) - $textcolor: saturate(mix(white, $bg, 85%), 90%) - - & - display: block - padding: 0 - margin-left: 40px - margin-right: 40px - position: relative - - - &, &:hover, &:focus - box-shadow: none - - &:after - content: '' - display: block - position: absolute - left: -20px - right: -20px - bottom: 0 - border-bottom: solid 1px $hairline - - // suppress its hairline - & + .about-the-site:before - display: none - - @media (max-width: 768px) - margin-left: 0 - margin-right: 0 - - // remove horizontal line - & + .about-the-site:before - display: none - - .container - display: block - text-align: center - padding: 10em 20px - - @media (min-width: 769px) - margin-top: 8em - padding: 8em 20px - - .h3 - display: block - margin: 0 auto auto - padding: 0 - font-size: 2.2em - line-height: 1.3em - +bold-font - color: white - transition: all 250ms linear - - // &:hover > span - // box-shadow: inset 0 -2px $accent - // text-shadow: 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg - - @media (max-width: 768px) - font-size: 1.5em - - .h3, .excerpt - max-width: $page-width * 0.9 - - .h3 + .excerpt - margin-top: 0.5em - - .excerpt - display: block - margin-left: auto - margin-right: auto - font-size: 1em - line-height: 1.6em - - .big-button - margin-top: 2em - - h3 a:hover, - h3 a:focus - color: $accent - - .heading - display: block - +caps-font - font-size: 0.7em - margin-bottom: 1em - - .heading:before - font-family: Ionicons - content: '\f4a8' - margin-right: 15px - font-size: 16px - display: inline-block - vertical-align: middle - color: $accent - - .big-button, - a.big-button - background: transparent - - &, &:visited - border-color: $accent - color: white - - &:hover, &:focus - background: $accent - border-color: transparent - -@mixin recolor-article($bg, $bg2, $url: '', $a: 0.9, $angle: 177deg) - $w: 1500 - $h: 10 - $textcolor: mix(white, $bg, 75%) - $notch: "data:image/svg+xml;utf8," - - & - background: url($notch) -50px top / 110% auto no-repeat, linear-gradient(to right, rgba(adjust-color($bg, $lightness: 0%), $a), rgba(adjust-color($bg2, $lightness: 0%), $a)), linear-gradient($angle, rgba($bg, 0.0), rgba($bg, 0.9)), url($url) center center / cover, $bg - &:hover, &:focus - background: url($notch) -50px top / 110% auto no-repeat, linear-gradient(to right, rgba(adjust-color($bg, $lightness: 1%), $a), rgba(adjust-color($bg2, $lightness: 1%), $a)), linear-gradient($angle, rgba($bg, 0.0), rgba($bg, 0.9)), url($url) center center / cover, $bg - .excerpt, .heading - color: $textcolor - -.next-article - & - +recolor-article(#612e76, #5867cc) - &.-v2 - text-shadow: 0 1px 1px rgba(black, 0.5) - +recolor-article(#027d65, #00536b, "bg/pebbles.jpg", 0.7, $angle: 35deg) - &.-v3 - text-shadow: 0 1px 1px rgba(black, 0.5) - +recolor-article(#1d2434, #202a3e, "bg/roughwall.jpg", 0.9, $angle: 1deg) - &.-v4 - text-shadow: 0 1px 1px rgba(black, 0.5) - +recolor-article(#902014, #c77e0a, "bg/woodfloor.jpg", 0.45, $angle: 1deg) - &.-v5 - text-shadow: 0 1px 1px rgba(black, 0.5) - +recolor-article(#17283a, #25295e, "bg/stairs.jpg", 0.85, $angle: 1deg) - // &.next-article diff --git a/_sass/2015/components/post-headline.sass b/_sass/2015/components/post-headline.sass deleted file mode 100644 index 7cda2050f..000000000 --- a/_sass/2015/components/post-headline.sass +++ /dev/null @@ -1,64 +0,0 @@ -/* - * .post-headline -- H1's of posts - */ - -.post-headline - & - margin: 1.5em auto 3em auto - text-align: center - - .post-icon - margin-bottom: 2px - - h1 - text-align: center - margin-bottom: 0 - +headline-font - +headline-font-size(2.8em, 1.2) - width: 80% - margin-left: auto - margin-right: auto - - @media (max-width: 768px) - +headline-font-size(2em) - - .meta - display: block - text-align: center - margin: 0 - margin-top: 1em - font-weight: normal - +caps-font - font-size: 0.8em - - .meta .author, - .meta .date - margin: 0 5px - padding-bottom: 2px - - .meta a, - .meta a:visited - color: $gray - - .meta a:hover, - .meta a:focus - &, span - color: $gray - - time - color: $black - box-shadow: inset 0 -2px $accent - - a, a:visited, a:focus, a:hover - color: $black - text-decoration: none - box-shadow: none - - .pubbox - margin-top: 32px - font-size: 16px - line-height: 1.5 - - .carbon-img - margin-top: 4px - diff --git a/_sass/2015/components/post-icon.sass b/_sass/2015/components/post-icon.sass deleted file mode 100644 index 1bf376f1c..000000000 --- a/_sass/2015/components/post-icon.sass +++ /dev/null @@ -1,58 +0,0 @@ -/* - * .post-icon -- category icons - */ - -$icon-size: 56px - -@mixin iconify($color, $text) - & - background: $color - color: lighten($color, 50%) - box-shadow: -2px 2px #e67e22, 2px -2px #f1c40f, 1px -2px rgba($color, 0.2), 1px 3px rgba($color, 0.3) - - span:after - content: $text - -.post-icon, -abbr.post-icon - border: 0 - margin: 0 - display: inline-block - width: $icon-size - height: $icon-size - line-height: $icon-size + 2px - text-align: center - border-radius: 50% - color: #aaa - background: #eee - - +body-font - font-size: 16px - letter-spacing: 1px - - span:after - content: attr(data-label) - font-size: 0.9em - position: relative - top: -1px - - @media (max-width: 480px) - transform: scale(0.75) - - &.-icon-css - +iconify(#3498db, 'CSS') - font-size: 14px - line-height: $icon-size + 2px - &.-icon-development - +iconify(#34495e, 'DEV') - font-size: 14px - line-height: $icon-size + 2px - &.-icon-ruby - +iconify(#e74c3c, 'RB') - text-indent: 2px - &.-icon-javascript - +iconify(#2ecc71, 'JS') - text-indent: 1px - &.-icon-productivity - +iconify(#2ecc71, 'PROD') - text-indent: 1px diff --git a/_sass/2015/components/post-index.sass b/_sass/2015/components/post-index.sass deleted file mode 100644 index 87586d057..000000000 --- a/_sass/2015/components/post-index.sass +++ /dev/null @@ -1,73 +0,0 @@ -/* - * .post-index (et al) -- utility classes - */ - -.post-index - & - margin: 0 auto 4em auto - position: relative - padding-top: 4em - font-size: 0.9em - - .container - overflow: hidden - max-width: $page-width - margin: 0 auto - - h3 - +caps-font - color: $gray - font-size: 1em - -.post-index-item - display: block - overflow: hidden - padding: 6px 20px - border-top: solid 1px $hairline - - &, &:hover, &:focus - box-shadow: none - - &:hover, &:focus - .article - transition: none - - .date - display: block - - .date - width: 100px - font-size: 0.8em - color: $gray - - @media (min-width: 768px) - padding-left: 0 - padding-right: 0 - - .date, .tag - margin-top: 0.2em - - .date, article - float: left - - .tag - float: right - - .article - color: $text - margin-right: 3px - transition: all 100ms linear - - &:hover .article - color: $accent - - &:nth-of-type(1) .article, - &:nth-of-type(2) .article, - &:nth-of-type(3) .article, - &:nth-of-type(4) .article - +bold-font - - .tag - color: $gray - font-weight: normal - font-size: 0.8em diff --git a/_sass/2015/components/post-list.sass b/_sass/2015/components/post-list.sass deleted file mode 100644 index ed0f9ed63..000000000 --- a/_sass/2015/components/post-list.sass +++ /dev/null @@ -1,23 +0,0 @@ -.post-item - max-width: $page-width - margin: 0 auto - -.post-list - margin: 40px auto - padding: 20px - - @media (max-width: 768px) - margin: 0 auto - -.post-list > .post-item:not(:first-child) - &:before - content: '' - display: block - width: 150px - height: 1px - background: $hairline - margin: 7em auto - - @media (max-width: 768px) - margin: 4em auto - diff --git a/_sass/2015/components/site-header.sass b/_sass/2015/components/site-header.sass deleted file mode 100644 index a5c34b84e..000000000 --- a/_sass/2015/components/site-header.sass +++ /dev/null @@ -1,17 +0,0 @@ - -.site-header - text-align: center - padding: 0 20px - - .container - padding: 15px 20px - font-size: 0.9em - color: rgba($gray, 0.6) - border-bottom: solid 1px $hairline - - em - +italic-font - +italic-font-size(1.1em) - font-size: 1.1em - color: $text - diff --git a/_sass/2015/components/social-list.sass b/_sass/2015/components/social-list.sass deleted file mode 100644 index c6ddbe737..000000000 --- a/_sass/2015/components/social-list.sass +++ /dev/null @@ -1,73 +0,0 @@ -/* - * .social-list -- social share icons - */ - -.social-list - &, li - margin: 0 - padding: 0 - - & - display: block - text-align: center - width: 100% - margin-top: 2em - - @media (min-width: 768px) - margin-top: 4em - - &.-top - margin-top: -2em - - @media (min-width: 768px) - margin-top: -1em - - li - display: inline-block - - a - display: inline-block - padding: 6px - text-align: center - box-shadow: none - - a:before, a:after - transition: all 100ms linear - - .text - display: none - - a:before - font-family: 'Ionicons' - font-weight: normal - font-style: normal - font-size: 18px - width: 40px - height: 40px - line-height: 40px - display: inline-block - text-align: center - border: solid 2px transparent - border-radius: 50% - - @mixin socialiconify($color, $content, $filled) - & - color: darken($lightgray, 10%) - - &:hover, - &:focus - color: $color - &:before - content: $filled - &:hover:before, - &:focus:before - border-color: $color - content: $filled - - .facebook a - +socialiconify(#4c66a4, '\f230', '\f231') - .twitter a - +socialiconify(dodgerblue, '\f242', '\f243') - .googleplus a - +socialiconify(#f53, '\f234', '\f235') - diff --git a/_sass/2015/elements/body.sass b/_sass/2015/elements/body.sass deleted file mode 100644 index bd074d32b..000000000 --- a/_sass/2015/elements/body.sass +++ /dev/null @@ -1,157 +0,0 @@ -/* - * html base (html, body) - */ - -* - +antialias - -html - font-size: $body-font-size - line-height: $body-line-height - background: $bg - color: $text - - @media (max-width: 768px) - font-size: floor($body-font-size * 14/17) - -html - transition: opacity 200ms linear - opacity: 1 - -html, input, textarea, td, th - +body-font - -html, body - overflow-x: hidden - -/* - * fouc prevention - */ - -body - transition: opacity 100ms linear - -html.no-js * - opacity: 0 - -/* - * basic styles (a, p, img...) - */ - -a, a:visited - color: $text - text-decoration: none - box-shadow: inset 0 -1px rgba(#888, 0.3) - transition: all 100ms linear - -a:focus, a:hover - box-shadow: inset 0 -2px $accent - color: $black - -strong, b - &, a, a:visited - color: $black - -h3, p, ul, ol - margin: 1.5em 0 - -/* - * iframes - */ - -p > iframe - margin: 0 auto - display: block - -/* - * lists - */ - -ul, ol - padding-left: 1.5em - -ul - & - list-style: none - - > li - position: relative - - > li:before - content: '' - display: block - position: absolute - left: -1.4em - top: 0 - margin-top: 0.7em - width: 4px - height: 4px - border-radius: 50% - border: solid 2px $lightgray - - @media (max-width: 768px) - width: 3px - height: 3px - -/* - * headings - */ - -h2 - &, a, a:visited - color: $black - -h2 - text-align: center - +headline-font - +headline-font-size(2em, 1.4) - margin: 2em auto 0 auto - @media (max-width: 768px) - +headline-font-size(1.6em) - -@media (min-width: 769px) - h2:before, - h2:after - content: '' - display: inline-block - vertical-align: middle - width: 46px - height: 1px - background: $lightgray - margin: 0 30px - -h3 - +bold-font - +bold-font-size(1.1em) - margin-top: 2em - - &, a, a:visited - color: $black - - @media (max-width: 768px) - margin-top: 1.5em - -h3 + p - margin-top: -1.7em - -/* - * images - */ - -p > img:first-child:last-child - display: block - margin: 0 auto - max-width: 100% - -code - +mono-font - +mono-font-size(0.9em) - -hr - width: 200px - height: 1px - border: 0 - background: $lightgray - margin: 3em auto - display: block - diff --git a/_sass/2015/elements/code.sass b/_sass/2015/elements/code.sass deleted file mode 100644 index ed80ba786..000000000 --- a/_sass/2015/elements/code.sass +++ /dev/null @@ -1,119 +0,0 @@ -$term-border: mix($accent, white, 50%) - -/* - * pre > code -- code blocks - */ - -pre > code - +mono-font - +mono-font-size(0.82em) - color: $text - padding-right: 20px - // box-shadow: inset 1px 1px rgba(black, 0.06) - -pre - padding: 20px 50px - border-radius: 4px - background: $wash - margin: 2.2em -50px - line-height: 1.2em - - @media (min-width: 768px) - border-top: solid 1px #eef3fa - border-bottom: solid 1px #c7d7ee - border-radius: 4px - - @media (max-width: 768px) - padding: 20px - margin: 2em -20px - background: darken($wash, 3%) - - @media (max-width: 660px) - border-radius: 0 - -pre + pre - margin-top: -1.5em - -pre.medium - > code - font-size: 1em - @media (min-width: 768px) - padding-top: 30px - padding-bottom: 30px - -pre.large - > code - font-size: 1.1em - line-height: 1.4em - @media (min-width: 768px) - padding-top: 30px - padding-bottom: 30px - -pre.terminal, -pre.light - & - background: white - border: solid 1px $term-border - position: relative - -pre.light - background: #fdfdff - -pre.terminal - & - padding-top: 56px - - &.large - padding-top: 65px - - &:before - content: '' - display: block - height: 34px - line-height: 34px - background: white - border-bottom: solid 1px $term-border - border-top-left-radius: 3px - border-top-right-radius: 3px - position: absolute - top: 0 - left: 0 - right: 0 - +bold-font - - &:after - content: '' - position: absolute - display: block - width: 4px - height: 4px - border-radius: 50% - left: 15px - top: 15px - font-size: 20px - background-color: $term-border - box-shadow: 20px 0 $term-border, 40px 0 $term-border - - @media (max-width: 768px) - margin-left: 0 - margin-right: 0 - -pre + pre - margin-top: -1.7em - -@media (min-width: 769px) - pre.cursor > code > :last-child:after - content: '' - display: inline-block - width: 3px - height: 1em - transform: scaleY(1.5) translateY(0.1em) - margin-left: 0.4em - background-color: $accent - -webkit-animation: blink 700ms steps(2,end) infinite - -moz-animation: blink 700ms steps(2,end) infinite - animation: blink 700ms steps(2,end) infinite - -h3 + pre, -h3 + table - margin-top: -1em diff --git a/_sass/2015/elements/table.sass b/_sass/2015/elements/table.sass deleted file mode 100644 index 680346463..000000000 --- a/_sass/2015/elements/table.sass +++ /dev/null @@ -1,73 +0,0 @@ -/* - * table - */ - -table - min-width: 100% - margin-top: 2em - margin-bottom: 2em - font-size: 0.9em - border-bottom: solid 1px $gray - -thead > tr:first-child > th, -thead > tr:first-child > td, -tbody > tr:first-child > th, -tbody > tr:first-child > td - border-top: solid 1px $gray - -td, th - text-align: left - border-top: solid 1px $hairline - padding: 8px 10px - -th - +bold-font - color: $black - -td:first-child, -th:first-child - text-align: left - padding-left: 0 - -td:last-child, -th:last-child - padding-right: 0 - -table.no-head - thead - display: none - -table.shortcuts - & - table-layout: fixed - - thead - display: none - - th:nth-child(1), td:nth-child(1) - width: 25% - - th:nth-child(2), td:nth-child(2) - width: 75% - - td:first-child > code - background: #fcfcfc - padding: 5px 10px - border-radius: 2px - -table.lite-headings - & - border-bottom: solid 1px mix($gray, $lightgray, 50%) - - th - color: mix($gray, $lightgray, 50%) - font-size: 0.9em - - thead > tr:first-child > td, - thead > tr:first-child > th - border-top: solid 1px mix($gray, $lightgray, 50%) - - tbody > tr:first-child > td, - tbody > tr:first-child > th - border-top: solid 1px $hairline - diff --git a/_sass/2015/helpers/blink.sass b/_sass/2015/helpers/blink.sass deleted file mode 100644 index b123b3ad1..000000000 --- a/_sass/2015/helpers/blink.sass +++ /dev/null @@ -1,11 +0,0 @@ -@keyframes blink - 0% - opacity: 0 - 100% - opacity: 1 - -@-webkit-keyframes blink - 0% - opacity: 0 - 100% - opacity: 1 diff --git a/_sass/2015/helpers/general.sass b/_sass/2015/helpers/general.sass deleted file mode 100644 index 18ea7100e..000000000 --- a/_sass/2015/helpers/general.sass +++ /dev/null @@ -1,27 +0,0 @@ -/* - * .center (et al) -- utility classes - */ - -.center - text-align: center - -.spaced - @media (min-width: 769px) - margin-top: 4em - margin-bottom: 4em - -.spaced-more - @media (min-width: 769px) - margin-top: 6em - margin-bottom: 6em - -.spaced-less - @media (min-width: 769px) - margin-top: 2em - margin-bottom: 2em - -.wide - @media (min-width: 920px) - width: 140% - margin-left: -25% - diff --git a/_sass/2015/helpers/margins.sass b/_sass/2015/helpers/margins.sass deleted file mode 100644 index 7504c1999..000000000 --- a/_sass/2015/helpers/margins.sass +++ /dev/null @@ -1,43 +0,0 @@ -/* - * .top/.bottom -- margin helpers - */ - -.top-collapse-0 - margin-top: 0 -.top-collapse-1 - margin-top: -1em -.top-collapse-2 - margin-top: -2em -.top-collapse-4 - margin-top: -4em - -.top-space-0 - margin-top: 0 -.top-space-1 - margin-top: 1em -.top-space-2 - margin-top: 2em -.top-space-4 - margin-top: 2em - @media (min-width: 769px) - margin-top: 4em - -.bottom-collapse-0 - margin-bottom: 0 -.bottom-collapse-1 - margin-bottom: -1em -.bottom-collapse-2 - margin-bottom: -2em -.bottom-collapse-4 - margin-bottom: -4em - -.bottom-space-0 - margin-bottom: 0 -.bottom-space-1 - margin-bottom: 1em -.bottom-space-2 - margin-bottom: 2em -.bottom-space-4 - margin-bottom: 2em - @media (min-width: 769px) - margin-bottom: 4em diff --git a/_sass/2015/style.sass b/_sass/2015/style.sass deleted file mode 100644 index 2e737f078..000000000 --- a/_sass/2015/style.sass +++ /dev/null @@ -1,57 +0,0 @@ -// base colors -$text: #555 -$black: #151515 -$bg: #fff -$wash: #f4f6f8 - -// grays -$gray: #939aa1 -$lightgray: #c0d3da -$hairline: #eef3fa - -// accents -$accent: #1ea3ff -$accent2: #f53 - -// metrics -$page-width: 620px - -@import url('//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css') -@import url('//cdn.jsdelivr.net/hint.css/1.3.2/hint.min.css') - -@import 'base/utils' -@import 'base/typography' -@import 'base/normalize' - -@import 'elements/body' -@import 'elements/table' -@import 'elements/code' - -@import 'components/about-the-site' -@import 'components/big-button' -@import 'components/brief-intro' -@import 'components/full-image' -@import 'components/hint' -@import 'components/hljs' -@import 'components/next-article' -@import 'components/post-headline' -@import 'components/post-icon' -@import 'components/post-index' -@import 'components/post-list' -@import 'components/site-header' -@import 'components/social-list' - -@import 'helpers/general' -@import 'helpers/margins' -@import 'helpers/blink' - -// Shim for headline-pub -$base-mute: #678 -$base-b: #333 -$base-b3: #678 -$base-text: #333 -$shadow3: 0 6px 8px rgba($base-mute, 0.03), 0 1px 2px rgba($base-mute, 0.30) -$shadow6: 0 6px 8px rgba($base-mute, 0.03), 0 1px 2px rgba($base-mute, 0.30), 0 8px 12px rgba($base-b3, 0.1) -$gray-text: $base-mute - -@import '../2017/components/headline-pub.scss' diff --git a/_sass/2017/base/fade.scss b/_sass/2017/base/fade.scss deleted file mode 100644 index 0d0d2c1ad..000000000 --- a/_sass/2017/base/fade.scss +++ /dev/null @@ -1,30 +0,0 @@ -$bounce: cubic-bezier(0.75, -0.5, 0, 1.75); - -/* -/* "Preloader": - * This makes the content semi-transparent before the page ad loads. - */ - -.post-content { - html.WithJs & { - opacity: 0; - } -} - -/* - * Defer "loading" until page's onload event fires. - * (The page actually already loaded, we just pretend like it hasn't) - */ - -.pages-list, -.post-content.-wrapified, -.intro-content { - html.WithJs & { - opacity: 0.98; - } - - html.WithJs.LoadDone & { - opacity: 1; - transition: opacity 100ms linear 100ms; - } -} diff --git a/_sass/2017/components/push-button.scss b/_sass/2017/components/push-button.scss deleted file mode 100644 index 52c941f6b..000000000 --- a/_sass/2017/components/push-button.scss +++ /dev/null @@ -1,3 +0,0 @@ -.push-button { - @extend %push-button; -} diff --git a/_sass/2017/style.scss b/_sass/2017/style.scss deleted file mode 100644 index 59be6fa9c..000000000 --- a/_sass/2017/style.scss +++ /dev/null @@ -1,51 +0,0 @@ -@import './variables'; -@import '../vendor/modularscale/modularscale'; -@import '../vendor/ionicons-inline/ionicons'; -@import './utils/font-size'; -@import './utils/gutter'; -@import './utils/heading-style'; -@import './utils/section-gutter'; -@import './utils/section-with-container'; -@import './placeholders/push-button'; -@import './base/base'; -@import './base/fade'; -@import './markdown/a-em'; -@import './markdown/code'; -@import './markdown/headings'; -@import './markdown/local-anchor'; -@import './markdown/p'; -@import './markdown/table'; -@import './markdown/ul'; -@import './components/attribute-peg'; -@import './components/announcements-item'; -@import './components/announcements-list'; -@import './components/back-button'; -@import './components/body-area'; -@import './components/comments-area'; -@import './components/comments-details'; -@import './components/comments-section'; -@import './components/h2-section'; -@import './components/h3-section'; -@import './components/h3-section-list'; -@import './components/headline-pub'; -@import './components/hint-mark'; -@import './components/home-button'; -@import './components/intro-content'; -@import './components/main-heading'; -@import './components/missing-message'; -@import './components/notice-box'; -@import './components/page-actions'; -@import './components/pages-list'; -@import './components/pre-footer'; -@import './components/push-button'; -@import './components/related-posts-area'; -@import './components/related-posts-callout'; -@import './components/related-posts-group'; -@import './components/related-posts-section'; -@import './components/related-post-list'; -@import './components/related-post-item'; -@import './components/search-box'; -@import './components/search-footer'; -@import './components/site-header'; -@import './components/top-nav'; -@import './components/top-sheet'; diff --git a/_support/cf-prime.sh b/_support/cf-prime.sh deleted file mode 100755 index 74614e2ea..000000000 --- a/_support/cf-prime.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -( - echo https://devhints.io/ - ( - git ls-files \ - | grep -E '\.md$' \ - | grep -v -E 'CONTRIBUTING|README|Readme' \ - | grep -v -E '^_' \ - | sort \ - | uniq \ - | sed 's/\.md$//g' - ) \ - | sed 's#^#https://devhints.io/#g' -) \ - | xargs curl >/dev/null diff --git a/_support/cf-purge.sh b/_support/cf-purge.sh deleted file mode 100755 index d214443f0..000000000 --- a/_support/cf-purge.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# Helper to copy the latest cheatsheets to the clipboard for CloudFlare -# purging. This ensures visitors will see new versions. - -( - git log "master@{3 days ago}..HEAD" --pretty="" --name-only \ - | grep -E '\.md$' \ - | grep -v -E 'CONTRIBUTING|README|Readme' \ - | grep -v -E '^_' \ - | sort \ - | uniq \ - | sed 's/\.md$//g' -) \ - | sed 's#^#https://devhints.io/#g' \ - | xargs echo https://devhints.io/ \ - | pbcopy - -echo "Copied to clipboard." -echo "Purge it here:" -echo "" -echo " https://www.cloudflare.com/a/caching/devhints.io" -echo "" -echo "Then click 'Purge Individual Files'" diff --git a/_support/smoke_test.sh b/_support/smoke_test.sh deleted file mode 100644 index 2b59f02fc..000000000 --- a/_support/smoke_test.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -set -eou pipefail - -exit_failure() { - echo 'Failed :(' - echo '' - echo ' If your build failed at this point, it means' - echo ' the site failed to generate. Check the project' - echo ' out locally and try to find out why.' -} - -trap exit_failure ERR - - -files=( - _site/vim.html - _site/react.html - _site/index.html -) - -for fn in "${files[@]}"; do - echo '' - echo -n "→ Checking: $fn... " - test -f "$fn" - grep -q ' diff --git a/src/analytics/GoogleAnalytics.astro b/src/analytics/GoogleAnalytics.astro new file mode 100644 index 000000000..6f1dda63a --- /dev/null +++ b/src/analytics/GoogleAnalytics.astro @@ -0,0 +1,25 @@ +--- +type Props = { measurementId: string } +const props = Astro.props as Props +const measurementId = props.measurementId +--- + + +{/* prettier-ignore */} + diff --git a/src/components/BaseLayout.astro b/src/components/BaseLayout.astro new file mode 100644 index 000000000..c8a3795d7 --- /dev/null +++ b/src/components/BaseLayout.astro @@ -0,0 +1,42 @@ +--- +import '../sass/full.scss' +import '@fontsource/cousine/400.css' +import '@fontsource/cousine/700.css' +import GoogleAnalytics from '~/analytics/GoogleAnalytics.astro' +import CloudflareAnalytics from '~/analytics/CloudflareAnalytics.astro' +import { cloudflareAnalytics, googleAnalytics } from '~/config' + +export type Props = { + title?: string + bodyClass?: string +} + +const props = Astro.props as Props +const analyticsEnabled = import.meta.env.PROD || true +--- + + + + + + + + {/* Title */} + {props.title ? {props.title} : null} + {/* Google tag */} + { + analyticsEnabled && googleAnalytics.measurementId ? ( + + ) : null + } + { + analyticsEnabled && cloudflareAnalytics.token ? ( + + ) : null + } + + + + + + diff --git a/src/components/SEO/SEO.astro b/src/components/SEO/SEO.astro new file mode 100644 index 000000000..aaa9d07e5 --- /dev/null +++ b/src/components/SEO/SEO.astro @@ -0,0 +1,46 @@ +--- +/* + * Simplified replacement for astro-seo. Is less opinionated + */ + +export type Props = { + title?: string + meta?: Record + metaProperties?: Record + links?: Record +} + +const props = Astro.props as Props + +function toArray(input: string | string[]): string[] { + return (Array.isArray(input) ? input : [input]).filter(Boolean) +} +--- + +{props.title ? {props.title} : null} + +{ + props.meta + ? Object.entries(props.meta).flatMap(([name, contents]) => + toArray(contents).map((content) => ( + + )) + ) + : null +} +{ + props.metaProperties + ? Object.entries(props.metaProperties).flatMap(([property, contents]) => + toArray(contents).map((content) => ( + + )) + ) + : null +} +{ + props.links + ? Object.entries(props.links).map(([rel, href]) => ( + + )) + : null +} diff --git a/src/components/SocialList.astro b/src/components/SocialList.astro new file mode 100644 index 000000000..5ff3948cd --- /dev/null +++ b/src/components/SocialList.astro @@ -0,0 +1,52 @@ +--- +import { getUrlFromPage } from '~/lib/links' +import type { SheetPage } from '~/lib/page' + +export type Props = { + class?: string + page?: SheetPage +} +const props = Astro.props as Props +const page = props.page +const url = getUrlFromPage(page, Astro.site) + +const t = { + facebookShare: 'Share on Facebook', + twitterShare: 'Share on Twitter', + sheetDescription: 'The ultimate cheatsheet for {title}', + defaultDescription: 'Ridiculous collection of web development cheatsheets' +} + +const title = page?.frontmatter?.title + +const description = title + ? t.sheetDescription.replace('{title}', title) + : t.defaultDescription + +const tweet = `${description} ${url}` + +// prettier-ignore +const facebookURL = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(url)}` +// prettier-ignore +const twitterURL = `https://twitter.com/intent/tweet?text=${encodeURIComponent(tweet)}` +--- + +
      + + {' '} + +
    diff --git a/src/components/TopNav.astro b/src/components/TopNav.astro new file mode 100644 index 000000000..6898d4dba --- /dev/null +++ b/src/components/TopNav.astro @@ -0,0 +1,67 @@ +--- +import type { SheetPage } from '~/lib/page' +import SocialList from './SocialList.astro' +import { getEditLink } from '~/lib/links' + +export type Props = { + noBack?: boolean + noShare?: boolean + noEdit?: boolean + page?: SheetPage +} +const props = Astro.props as Props + +const t = { + title: 'Devhints.io', + editOnGitHub: 'Edit on GitHub', + edit: 'Edit', + backToHome: 'Back to home' +} + +const editLink = getEditLink(props.page) +--- + + + + diff --git a/src/components/V2017/CarbonBox.astro b/src/components/V2017/CarbonBox.astro new file mode 100644 index 000000000..3b91064c1 --- /dev/null +++ b/src/components/V2017/CarbonBox.astro @@ -0,0 +1,17 @@ +--- +import { carbon } from '~/config' +const useCarbon = import.meta.env.PROD +--- + +