diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0b008c9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.py] +indent_style = space +indent_size = 4 diff --git a/.gitignore b/.gitignore index 2ca8682..46d6e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,43 @@ -_site/ -.sass-cache/ -.jekyll-cache/ -.jekyll-metadata +# Ignore docs files +_gh_pages +_site +.ruby-version +.jekyll-cache + +# Numerous always-ignore extensions +*.diff +*.err +*.orig +*.log +*.rej +*.swo +*.swp +*.zip +*.vi +*~ + +# OS or Editor folders +.DS_Store +._* +Thumbs.db +.cache +.project +.settings +.tmproj +*.esproj +nbproject +*.sublime-project +*.sublime-workspace +.idea + +# Komodo +*.komodoproject +.komodotools + +# grunt-html-validation +validation-status.json +validation-report.json + +# Folders to ignore +node_modules +bower_components diff --git a/404.html b/404.html new file mode 100644 index 0000000..4bf3f7d --- /dev/null +++ b/404.html @@ -0,0 +1,10 @@ +--- +layout: default +title: "404: Page not found" +permalink: 404.html +--- + +
Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.
+`, +// or to a parent if there are multiple elements to show. + +.message { + padding: var(--spacer); + margin-bottom: var(--spacer); + color: var(--gray-900); + background-color: var(--yellow-100); + border-radius: var(--border-radius); +} diff --git a/_sass/_pagination.scss b/_sass/_pagination.scss new file mode 100644 index 0000000..6ef79b3 --- /dev/null +++ b/_sass/_pagination.scss @@ -0,0 +1,52 @@ +// Pagination +// +// Super lightweight (HTML-wise) blog pagination. `span`s are provide for when +// there are no more previous or next posts to show. + +.pagination { + display: flex; + margin: 0 -1.5rem var(--spacer); + color: var(--gray-500); + text-align: center; +} + +// Pagination items can be `span`s or `a`s +.pagination-item { + display: block; + padding: var(--spacer); + text-decoration: none; + border: solid var(--border-color); + border-width: 1px 0; + + &:first-child { + margin-bottom: -1px; + } +} + +// Only provide a hover state for linked pagination items +a.pagination-item:hover { + background-color: var(--border-color); +} + +@media (min-width: 30em) { + .pagination { + margin: var(--spacer-3) 0; + } + + .pagination-item { + float: left; + width: 50%; + border-width: 1px; + + &:first-child { + margin-bottom: 0; + border-top-left-radius: var(--border-radius); + border-bottom-left-radius: var(--border-radius); + } + &:last-child { + margin-left: -1px; + border-top-right-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); + } + } +} diff --git a/_sass/_posts.scss b/_sass/_posts.scss new file mode 100644 index 0000000..1ef5201 --- /dev/null +++ b/_sass/_posts.scss @@ -0,0 +1,67 @@ +// Posts and pages +// +// Each post is wrapped in `.post` and is used on default and post layouts. Each +// page is wrapped in `.page` and is only used on the page layout. + +.page, +.post { + margin-bottom: 4em; + + li + li { + margin-top: .25rem; + } +} + +// Blog post or page title +.page-title, +.post-title { + color: var(--heading-color); +} +.page-title, +.post-title { + margin-top: 0; +} +.post-title a { + color: inherit; + text-decoration: none; + + &:hover, + &:focus { + text-decoration: underline; + } +} + +// Meta data line below post title +.post-date { + display: block; + margin-top: -.5rem; + margin-bottom: var(--spacer); + color: var(--gray-600); +} + + +// Related posts +.related { + padding-top: var(--spacer-2); + padding-bottom: var(--spacer-2); + margin-bottom: var(--spacer-2); + border-top: 1px solid var(--border-color); + border-bottom: 1px solid var(--border-color); +} + +.related-posts { + padding-left: 0; + list-style: none; + + h3 { + margin-top: 0; + } + + a { + text-decoration: none; + + small { + color: var(--gray-600); + } + } +} diff --git a/_sass/_syntax.scss b/_sass/_syntax.scss new file mode 100644 index 0000000..15ad797 --- /dev/null +++ b/_sass/_syntax.scss @@ -0,0 +1,65 @@ +.highlight .hll { background-color: #ffc; } +.highlight .c { color: #999; } /* Comment */ +.highlight .err { color: #a00; background-color: #faa } /* Error */ +.highlight .k { color: #069; } /* Keyword */ +.highlight .o { color: #555 } /* Operator */ +.highlight .cm { color: #09f; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #099 } /* Comment.Preproc */ +.highlight .c1 { color: #999; } /* Comment.Single */ +.highlight .cs { color: #999; } /* Comment.Special */ +.highlight .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #f00 } /* Generic.Error */ +.highlight .gh { color: #030; } /* Generic.Heading */ +.highlight .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */ +.highlight .go { color: #aaa } /* Generic.Output */ +.highlight .gp { color: #009; } /* Generic.Prompt */ +.highlight .gs { } /* Generic.Strong */ +.highlight .gu { color: #030; } /* Generic.Subheading */ +.highlight .gt { color: #9c6 } /* Generic.Traceback */ +.highlight .kc { color: #069; } /* Keyword.Constant */ +.highlight .kd { color: #069; } /* Keyword.Declaration */ +.highlight .kn { color: #069; } /* Keyword.Namespace */ +.highlight .kp { color: #069 } /* Keyword.Pseudo */ +.highlight .kr { color: #069; } /* Keyword.Reserved */ +.highlight .kt { color: #078; } /* Keyword.Type */ +.highlight .m { color: #f60 } /* Literal.Number */ +.highlight .s { color: #d44950 } /* Literal.String */ +.highlight .na { color: #4f9fcf } /* Name.Attribute */ +.highlight .nb { color: #366 } /* Name.Builtin */ +.highlight .nc { color: #0a8; } /* Name.Class */ +.highlight .no { color: #360 } /* Name.Constant */ +.highlight .nd { color: #99f } /* Name.Decorator */ +.highlight .ni { color: #999; } /* Name.Entity */ +.highlight .ne { color: #c00; } /* Name.Exception */ +.highlight .nf { color: #c0f } /* Name.Function */ +.highlight .nl { color: #99f } /* Name.Label */ +.highlight .nn { color: #0cf; } /* Name.Namespace */ +.highlight .nt { color: #2f6f9f; } /* Name.Tag */ +.highlight .nv { color: #033 } /* Name.Variable */ +.highlight .ow { color: #000; } /* Operator.Word */ +.highlight .w { color: #bbb } /* Text.Whitespace */ +.highlight .mf { color: #f60 } /* Literal.Number.Float */ +.highlight .mh { color: #f60 } /* Literal.Number.Hex */ +.highlight .mi { color: #f60 } /* Literal.Number.Integer */ +.highlight .mo { color: #f60 } /* Literal.Number.Oct */ +.highlight .sb { color: #c30 } /* Literal.String.Backtick */ +.highlight .sc { color: #c30 } /* Literal.String.Char */ +.highlight .sd { color: #c30; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #c30 } /* Literal.String.Double */ +.highlight .se { color: #c30; } /* Literal.String.Escape */ +.highlight .sh { color: #c30 } /* Literal.String.Heredoc */ +.highlight .si { color: #a00 } /* Literal.String.Interpol */ +.highlight .sx { color: #c30 } /* Literal.String.Other */ +.highlight .sr { color: #3aa } /* Literal.String.Regex */ +.highlight .s1 { color: #c30 } /* Literal.String.Single */ +.highlight .ss { color: #fc3 } /* Literal.String.Symbol */ +.highlight .bp { color: #366 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #033 } /* Name.Variable.Class */ +.highlight .vg { color: #033 } /* Name.Variable.Global */ +.highlight .vi { color: #033 } /* Name.Variable.Instance */ +.highlight .il { color: #f60 } /* Literal.Number.Integer.Long */ + +.css .o, +.css .o + .nt, +.css .nt + .nt { color: #999; } diff --git a/_sass/_toc.scss b/_sass/_toc.scss new file mode 100644 index 0000000..f004db7 --- /dev/null +++ b/_sass/_toc.scss @@ -0,0 +1,16 @@ +// Table of Contents + +#markdown-toc { + padding: var(--spacer-2) var(--spacer-3); + margin-bottom: var(--spacer-2); + border: solid var(--border-color); + border-width: 1px 0; + + &::before { + display: block; + margin-left: calc(var(--spacer-3) * -1); + content: "Contents"; + font-size: 85%; + font-weight: 500; + } +} diff --git a/_sass/_type.scss b/_sass/_type.scss new file mode 100644 index 0000000..a26964f --- /dev/null +++ b/_sass/_type.scss @@ -0,0 +1,115 @@ +// Typography +// +// Headings, body text, lists, and other misc typographic elements. + +h1, h2, h3, h4, h5, h6 { + margin-bottom: .5rem; + font-weight: 600; + line-height: 1.25; + color: var(--heading-color); +} + +h1 { + font-size: 2rem; +} + +h2 { + margin-top: 1rem; + font-size: 1.5rem; +} + +h3 { + margin-top: 1.5rem; + font-size: 1.25rem; +} + +h4, h5, h6 { + margin-top: 1rem; + font-size: 1rem; +} + +p { + margin-top: 0; + margin-bottom: 1rem; +} + +ul, ol, dl { + margin-top: 0; + margin-bottom: 1rem; +} + +dt { + font-weight: bold; +} + +dd { + margin-bottom: .5rem; +} + +hr { + position: relative; + margin: var(--spacer-2) 0; + border: 0; + border-top: 1px solid var(--border-color); +} + +abbr { + font-size: 85%; + font-weight: bold; + color: var(--gray-600); + text-transform: uppercase; + + &[title] { + cursor: help; + border-bottom: 1px dotted var(--border-color); + } +} + +blockquote { + padding: .5rem 1rem; + margin: .8rem 0; + color: var(--gray-500); + border-left: .25rem solid var(--border-color); + + p:last-child { + margin-bottom: 0; + } + + @media (min-width: 30em) { + padding-right: 5rem; + padding-left: 1.25rem; + } +} + +figure { + margin: 0; +} + + +// Markdown footnotes +// +// See the example content post for an example. + +// Footnote number within body text +a[href^="#fn:"], +// Back to footnote link +a[href^="#fnref:"] { + display: inline-block; + margin-left: .1rem; + font-weight: bold; +} + +// List of footnotes +.footnotes { + margin-top: 2rem; + font-size: 85%; +} + +// Custom type +// +// Extend paragraphs with `.lead` for larger introductory text. + +.lead { + font-size: 1.25rem; + font-weight: 300; +} diff --git a/_sass/_variables.scss b/_sass/_variables.scss new file mode 100644 index 0000000..4fa181f --- /dev/null +++ b/_sass/_variables.scss @@ -0,0 +1,66 @@ +:root { + --gray-000: #f8f9fa; + --gray-100: #f1f3f5; + --gray-200: #e9ecef; + --gray-300: #dee2e6; + --gray-400: #ced4da; + --gray-500: #adb5bd; + --gray-600: #868e96; + --gray-700: #495057; + --gray-800: #343a40; + --gray-900: #212529; + + --red: #fa5252; + --pink: #e64980; + --grape: #be4bdb; + --purple: #7950f2; + --indigo: #4c6ef5; + --blue: #228be6; + --cyan: #15aabf; + --teal: #12b886; + --green: #40c057; + --yellow: #fab005; + --orange: #fd7e14; + + --blue-300: #74c0fc; + --blue-400: #4dabf7; + --yellow-100: #fff3bf; + + --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --body-font-size: 16px; + --body-line-height: 1.5; + --body-color: var(--gray-700); + --body-bg: #fff; + + --link-color: var(--blue); + --link-hover-color: #1c7ed6; + + --heading-color: var(--gray-900); + + --border-color: var(--gray-300); + --border-radius: .25rem; + + --code-font: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + --code-color: var(--grape); + --code-bg: var(--gray-000); + + --spacer: 1rem; + --spacer-2: calc(var(--spacer) * 1.5); + --spacer-3: calc(var(--spacer) * 3); +} + +@media (prefers-color-scheme: dark) { + :root { + --body-color: var(--gray-300); + --body-bg: var(--gray-800); + + --heading-color: #fff; + + --link-color: var(--blue-300); + --link-hover-color: var(--blue-400); + + --border-color: rgba(255,255,255,.15); + + --code-bg: var(--gray-900); + } +} diff --git a/about.md b/about.md new file mode 100644 index 0000000..91f6292 --- /dev/null +++ b/about.md @@ -0,0 +1,19 @@ +--- +layout: page +title: About +--- + +I'm a software developer working in Bangalore. When I'm not working, I might be doing any one of the following activities in addition to blogging. + +* Eat +* Sleep +* Play Chess +* Read a book +* Play my keyboard +* Play video games + +# Connect + +* [Email](mailto:n.suryap@gmail.com) +* [Github](https://github.com/cool-mist) +* [Steam](https://www.dotabuff.com/players/137192269) diff --git a/archive.md b/archive.md new file mode 100644 index 0000000..78bb3be --- /dev/null +++ b/archive.md @@ -0,0 +1,16 @@ +--- +layout: page +title: Archive +--- + +Browse all posts by month and year. + +{% assign postsByYearMonth = site.posts | group_by_exp: "post", "post.date | date: '%B %Y'" %} +{% for yearMonth in postsByYearMonth %} +
`, + * or to a parent if there are multiple elements to show. + */ + +.message { + margin-bottom: 1rem; + padding: 1rem; + color: #717171; + background-color: #f9f9f9; +} + + +/* + * Container + * + * Center the page content. + */ + +.container { + max-width: 38rem; + padding-left: 1rem; + padding-right: 1rem; + margin-left: auto; + margin-right: auto; +} + + +/* + * Masthead + * + * Super small header above the content for site name and short description. + */ + +.masthead { + padding-top: 1rem; + padding-bottom: 1rem; + margin-bottom: 3rem; +} +.masthead-title { + margin-top: 0; + margin-bottom: 0; + color: #505050; +} +.masthead-title a { + color: #505050; +} +.masthead-title small { + font-size: 75%; + font-weight: 400; + color: #c0c0c0; + letter-spacing: 0; +} + + +/* + * Posts and pages + * + * Each post is wrapped in `.post` and is used on default and post layouts. Each + * page is wrapped in `.page` and is only used on the page layout. + */ + +.page, +.post { + margin-bottom: 4em; +} + +/* Blog post or page title */ +.page-title, +.post-title, +.post-title a { + color: #303030; +} +.page-title, +.post-title { + margin-top: 0; +} + +/* Meta data line below post title */ +.post-date { + display: block; + margin-top: -.5rem; + margin-bottom: 1rem; + color: #9a9a9a; +} + +/* Related posts */ +.related { + padding-top: 2rem; + padding-bottom: 2rem; + border-top: 1px solid #eee; +} +.related-posts { + padding-left: 0; + list-style: none; +} +.related-posts h3 { + margin-top: 0; +} +.related-posts li small { + font-size: 75%; + color: #999; +} +.related-posts li a:hover { + color: #268bd2; + text-decoration: none; +} +.related-posts li a:hover small { + color: inherit; +} + + +/* + * Pagination + * + * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when + * there are no more previous or next posts to show. + */ + +.pagination { + overflow: hidden; /* clearfix */ + margin-left: -1rem; + margin-right: -1rem; + font-family: "PT Sans", Helvetica, Arial, sans-serif; + color: #ccc; + text-align: center; +} + +/* Pagination items can be `span`s or `a`s */ +.pagination-item { + display: block; + padding: 1rem; + border: 1px solid #eee; +} +.pagination-item:first-child { + margin-bottom: -1px; +} + +/* Only provide a hover state for linked pagination items */ +a.pagination-item:hover { + background-color: #f5f5f5; +} + +@media (min-width: 30em) { + .pagination { + margin: 3rem 0; + } + .pagination-item { + float: left; + width: 50%; + } + .pagination-item:first-child { + margin-bottom: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + } + .pagination-item:last-child { + margin-left: -1px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + } +} diff --git a/public/css/syntax.css b/public/css/syntax.css new file mode 100644 index 0000000..15ad797 --- /dev/null +++ b/public/css/syntax.css @@ -0,0 +1,65 @@ +.highlight .hll { background-color: #ffc; } +.highlight .c { color: #999; } /* Comment */ +.highlight .err { color: #a00; background-color: #faa } /* Error */ +.highlight .k { color: #069; } /* Keyword */ +.highlight .o { color: #555 } /* Operator */ +.highlight .cm { color: #09f; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #099 } /* Comment.Preproc */ +.highlight .c1 { color: #999; } /* Comment.Single */ +.highlight .cs { color: #999; } /* Comment.Special */ +.highlight .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #f00 } /* Generic.Error */ +.highlight .gh { color: #030; } /* Generic.Heading */ +.highlight .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */ +.highlight .go { color: #aaa } /* Generic.Output */ +.highlight .gp { color: #009; } /* Generic.Prompt */ +.highlight .gs { } /* Generic.Strong */ +.highlight .gu { color: #030; } /* Generic.Subheading */ +.highlight .gt { color: #9c6 } /* Generic.Traceback */ +.highlight .kc { color: #069; } /* Keyword.Constant */ +.highlight .kd { color: #069; } /* Keyword.Declaration */ +.highlight .kn { color: #069; } /* Keyword.Namespace */ +.highlight .kp { color: #069 } /* Keyword.Pseudo */ +.highlight .kr { color: #069; } /* Keyword.Reserved */ +.highlight .kt { color: #078; } /* Keyword.Type */ +.highlight .m { color: #f60 } /* Literal.Number */ +.highlight .s { color: #d44950 } /* Literal.String */ +.highlight .na { color: #4f9fcf } /* Name.Attribute */ +.highlight .nb { color: #366 } /* Name.Builtin */ +.highlight .nc { color: #0a8; } /* Name.Class */ +.highlight .no { color: #360 } /* Name.Constant */ +.highlight .nd { color: #99f } /* Name.Decorator */ +.highlight .ni { color: #999; } /* Name.Entity */ +.highlight .ne { color: #c00; } /* Name.Exception */ +.highlight .nf { color: #c0f } /* Name.Function */ +.highlight .nl { color: #99f } /* Name.Label */ +.highlight .nn { color: #0cf; } /* Name.Namespace */ +.highlight .nt { color: #2f6f9f; } /* Name.Tag */ +.highlight .nv { color: #033 } /* Name.Variable */ +.highlight .ow { color: #000; } /* Operator.Word */ +.highlight .w { color: #bbb } /* Text.Whitespace */ +.highlight .mf { color: #f60 } /* Literal.Number.Float */ +.highlight .mh { color: #f60 } /* Literal.Number.Hex */ +.highlight .mi { color: #f60 } /* Literal.Number.Integer */ +.highlight .mo { color: #f60 } /* Literal.Number.Oct */ +.highlight .sb { color: #c30 } /* Literal.String.Backtick */ +.highlight .sc { color: #c30 } /* Literal.String.Char */ +.highlight .sd { color: #c30; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #c30 } /* Literal.String.Double */ +.highlight .se { color: #c30; } /* Literal.String.Escape */ +.highlight .sh { color: #c30 } /* Literal.String.Heredoc */ +.highlight .si { color: #a00 } /* Literal.String.Interpol */ +.highlight .sx { color: #c30 } /* Literal.String.Other */ +.highlight .sr { color: #3aa } /* Literal.String.Regex */ +.highlight .s1 { color: #c30 } /* Literal.String.Single */ +.highlight .ss { color: #fc3 } /* Literal.String.Symbol */ +.highlight .bp { color: #366 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #033 } /* Name.Variable.Class */ +.highlight .vg { color: #033 } /* Name.Variable.Global */ +.highlight .vi { color: #033 } /* Name.Variable.Instance */ +.highlight .il { color: #f60 } /* Literal.Number.Integer.Long */ + +.css .o, +.css .o + .nt, +.css .nt + .nt { color: #999; } diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000..08c0cfd Binary files /dev/null and b/public/favicon.png differ diff --git a/public/js/script.js b/public/js/script.js new file mode 100644 index 0000000..b47910a --- /dev/null +++ b/public/js/script.js @@ -0,0 +1,15 @@ +(function(document) { + var toggle = document.querySelector('.sidebar-toggle'); + var sidebar = document.querySelector('#sidebar'); + var checkbox = document.querySelector('#sidebar-checkbox'); + + document.addEventListener('click', function(e) { + var target = e.target; + + if(!checkbox.checked || + sidebar.contains(target) || + (target === checkbox || target === toggle)) return; + + checkbox.checked = false; + }, false); +})(document); diff --git a/styles.scss b/styles.scss new file mode 100644 index 0000000..e02d902 --- /dev/null +++ b/styles.scss @@ -0,0 +1,47 @@ +--- +# Use a comment to ensure Jekyll reads the file to be transformed into CSS later +# only main files contain this front matter, not partials. +--- + +// +// ___ +// /\_ \ +// _____ ___ ___\//\ \ __ +// /\ '__`\ / __`\ / __`\\ \ \ /'__`\ +// \ \ \_\ \/\ \_\ \/\ \_\ \\_\ \_/\ __/ +// \ \ ,__/\ \____/\ \____//\____\ \____\ +// \ \ \/ \/___/ \/___/ \/____/\/____/ +// \ \_\ +// \/_/ +// +// Designed, built, and released under MIT license by @mdo. Learn more at +// https://github.com/poole/poole. + +@import "variables"; +@import "base"; +@import "type"; +@import "syntax"; +@import "code"; +@import "layout"; +@import "masthead"; +@import "posts"; +@import "pagination"; +@import "message"; +@import "toc"; + +// Sass for creating the swatches +.colors { + display: grid; + grid-template-columns: max-content 1fr; + + dt { + width: 3rem; + height: 3rem; + border-radius: var(--border-radius); + box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); + } + + dd { + margin-left: var(--spacer); + } +}