From 8dad1d1bd0bc7206f16323d220fdce73c400f470 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Tue, 18 Aug 2020 15:18:25 +0300 Subject: Squashed 'website/themes/hugo-clarity/' content from commit 4969d5a git-subtree-dir: website/themes/hugo-clarity git-subtree-split: 4969d5a1fb2c358c00e2d7f6fc1e39024d7d2355 --- .github/ISSUE_TEMPLATE/bug_report.md | 22 + .gitignore | 1 + LICENSE.md | 28 ++ README.md | 384 +++++++++++++++ archetypes/post.md | 22 + assets/js/code.js | 255 ++++++++++ assets/js/custom.js | 1 + assets/js/functions.js | 200 ++++++++ assets/js/highlight.js | 2 + assets/js/index.js | 471 ++++++++++++++++++ assets/sass/_base.sass | 151 ++++++ assets/sass/_components.sass | 536 +++++++++++++++++++++ assets/sass/_custom.sass | 1 + assets/sass/_fonts.sass | 55 +++ assets/sass/_mobile.sass | 78 +++ assets/sass/_syntax.sass | 236 +++++++++ assets/sass/_utils.sass | 64 +++ assets/sass/_variables.sass | 118 +++++ assets/sass/main.sass | 8 + exampleSite/LICENSE | 21 + exampleSite/README.md | 23 + exampleSite/archetypes/post.md | 22 + exampleSite/config.toml | 59 +++ exampleSite/configTaxo.toml | 28 ++ exampleSite/content/_index.md | 3 + exampleSite/content/about.md | 25 + exampleSite/content/archives.md | 5 + exampleSite/content/homepage/about.md | 7 + exampleSite/content/homepage/index.md | 3 + exampleSite/content/homepage/work.md | 7 + exampleSite/content/post/_index.md | 6 + exampleSite/content/post/emoji-support.md | 46 ++ exampleSite/content/post/markdown-syntax.md | 153 ++++++ exampleSite/content/post/math-typesetting.md | 49 ++ exampleSite/content/post/placeholder-text.md | 45 ++ exampleSite/content/post/rich-content.md | 44 ++ exampleSite/data/menu.yaml | 14 + exampleSite/data/social.yaml | 9 + exampleSite/layouts/.gitkeep | 0 ...n.sass_d2bdc985df0e3369a538eb4e858e857f.content | 3 + ...main.sass_d2bdc985df0e3369a538eb4e858e857f.json | 1 + exampleSite/static/.gitignore | 0 exampleSite/static/images/building.png | Bin 0 -> 2593 bytes exampleSite/static/images/dollar.png | Bin 0 -> 3352 bytes exampleSite/static/logos/logo.png | Bin 0 -> 6926 bytes images/article-toc.png | Bin 0 -> 21261 bytes images/image-figure.png | Bin 0 -> 9015 bytes images/image-inline.png | Bin 0 -> 12789 bytes images/screenshot-darkmode.png | Bin 0 -> 129635 bytes images/screenshot-mobile-darkmode.png | Bin 0 -> 49649 bytes images/screenshot-mobile.png | Bin 0 -> 49305 bytes images/screenshot.png | Bin 0 -> 124394 bytes images/syntax-block.gif | Bin 0 -> 1588159 bytes images/tags.png | Bin 0 -> 10080 bytes images/tn-darkmode.png | Bin 0 -> 98695 bytes images/tn.png | Bin 0 -> 100835 bytes layouts/404.html | 8 + layouts/_default/baseof.html | 76 +++ layouts/_default/list.html | 3 + layouts/_default/single.html | 26 + layouts/index.html | 3 + layouts/partials/analytics.html | 9 + layouts/partials/archive.html | 15 + layouts/partials/excerpt.html | 25 + layouts/partials/favicon.html | 7 + layouts/partials/follow.html | 15 + layouts/partials/footer.html | 7 + layouts/partials/head.html | 14 + layouts/partials/icons.html | 62 +++ layouts/partials/mode.html | 4 + layouts/partials/nav.html | 43 ++ layouts/partials/opengraph.html | 71 +++ layouts/partials/pager.html | 19 + layouts/partials/post-meta.html | 16 + layouts/partials/share.html | 29 ++ layouts/partials/sidebar.html | 67 +++ layouts/partials/top.html | 6 + layouts/shortcodes/video.html | 4 + static/fonts/Metropolis-Black.woff | Bin 0 -> 26596 bytes static/fonts/Metropolis-Black.woff2 | Bin 0 -> 23960 bytes static/fonts/Metropolis-BlackItalic.woff | Bin 0 -> 27732 bytes static/fonts/Metropolis-BlackItalic.woff2 | Bin 0 -> 25252 bytes static/fonts/Metropolis-Bold.woff | Bin 0 -> 29916 bytes static/fonts/Metropolis-Bold.woff2 | Bin 0 -> 26428 bytes static/fonts/Metropolis-BoldItalic.woff | Bin 0 -> 31208 bytes static/fonts/Metropolis-BoldItalic.woff2 | Bin 0 -> 27792 bytes static/fonts/Metropolis-ExtraBold.woff | Bin 0 -> 29780 bytes static/fonts/Metropolis-ExtraBold.woff2 | Bin 0 -> 26372 bytes static/fonts/Metropolis-ExtraBoldItalic.woff | Bin 0 -> 31228 bytes static/fonts/Metropolis-ExtraBoldItalic.woff2 | Bin 0 -> 27500 bytes static/fonts/Metropolis-ExtraLight.woff | Bin 0 -> 29344 bytes static/fonts/Metropolis-ExtraLight.woff2 | Bin 0 -> 26000 bytes static/fonts/Metropolis-ExtraLightItalic.woff | Bin 0 -> 31512 bytes static/fonts/Metropolis-ExtraLightItalic.woff2 | Bin 0 -> 27872 bytes static/fonts/Metropolis-Light.woff | Bin 0 -> 29320 bytes static/fonts/Metropolis-Light.woff2 | Bin 0 -> 25912 bytes static/fonts/Metropolis-LightItalic.woff | Bin 0 -> 31340 bytes static/fonts/Metropolis-LightItalic.woff2 | Bin 0 -> 27692 bytes static/fonts/Metropolis-Medium.woff | Bin 0 -> 29652 bytes static/fonts/Metropolis-Medium.woff2 | Bin 0 -> 26360 bytes static/fonts/Metropolis-MediumItalic.woff | Bin 0 -> 31340 bytes static/fonts/Metropolis-MediumItalic.woff2 | Bin 0 -> 28100 bytes static/fonts/Metropolis-Regular.woff | Bin 0 -> 26876 bytes static/fonts/Metropolis-Regular.woff2 | Bin 0 -> 24152 bytes static/fonts/Metropolis-RegularItalic.woff | Bin 0 -> 28440 bytes static/fonts/Metropolis-RegularItalic.woff2 | Bin 0 -> 25616 bytes static/fonts/Metropolis-SemiBold.woff | Bin 0 -> 29824 bytes static/fonts/Metropolis-SemiBold.woff2 | Bin 0 -> 26564 bytes static/fonts/Metropolis-SemiBoldItalic.woff | Bin 0 -> 31268 bytes static/fonts/Metropolis-SemiBoldItalic.woff2 | Bin 0 -> 27772 bytes static/fonts/Metropolis-Thin.woff | Bin 0 -> 26720 bytes static/fonts/Metropolis-Thin.woff2 | Bin 0 -> 23852 bytes static/fonts/Metropolis-ThinItalic.woff | Bin 0 -> 28444 bytes static/fonts/Metropolis-ThinItalic.woff2 | Bin 0 -> 25380 bytes static/icons/android-chrome-192x192.png | Bin 0 -> 16219 bytes static/icons/android-chrome-256x256.png | Bin 0 -> 24482 bytes static/icons/apple-touch-icon.png | Bin 0 -> 14756 bytes static/icons/bar.svg | 1 + static/icons/browserconfig.xml | 9 + static/icons/cancel.svg | 42 ++ static/icons/caret-icon.svg | 1 + static/icons/carly.svg | 1 + static/icons/close.svg | 1 + static/icons/copy.svg | 66 +++ static/icons/expand.svg | 1 + static/icons/favicon-16x16.png | Bin 0 -> 1126 bytes static/icons/favicon-32x32.png | Bin 0 -> 2057 bytes static/icons/favicon.ico | Bin 0 -> 15086 bytes static/icons/link.svg | 1 + static/icons/mstile-150x150.png | Bin 0 -> 8139 bytes static/icons/order.svg | 66 +++ static/icons/site.webmanifest | 19 + static/images/night-moon.jpg | Bin 0 -> 19666 bytes static/images/sun.svg | 70 +++ static/images/thumbnail.png | Bin 0 -> 22745 bytes theme.toml | 14 + 136 files changed, 4027 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 archetypes/post.md create mode 100644 assets/js/code.js create mode 100644 assets/js/custom.js create mode 100644 assets/js/functions.js create mode 100644 assets/js/highlight.js create mode 100644 assets/js/index.js create mode 100644 assets/sass/_base.sass create mode 100644 assets/sass/_components.sass create mode 100644 assets/sass/_custom.sass create mode 100644 assets/sass/_fonts.sass create mode 100644 assets/sass/_mobile.sass create mode 100644 assets/sass/_syntax.sass create mode 100644 assets/sass/_utils.sass create mode 100644 assets/sass/_variables.sass create mode 100644 assets/sass/main.sass create mode 100644 exampleSite/LICENSE create mode 100644 exampleSite/README.md create mode 100644 exampleSite/archetypes/post.md create mode 100644 exampleSite/config.toml create mode 100644 exampleSite/configTaxo.toml create mode 100644 exampleSite/content/_index.md create mode 100644 exampleSite/content/about.md create mode 100644 exampleSite/content/archives.md create mode 100644 exampleSite/content/homepage/about.md create mode 100644 exampleSite/content/homepage/index.md create mode 100644 exampleSite/content/homepage/work.md create mode 100644 exampleSite/content/post/_index.md create mode 100644 exampleSite/content/post/emoji-support.md create mode 100644 exampleSite/content/post/markdown-syntax.md create mode 100644 exampleSite/content/post/math-typesetting.md create mode 100644 exampleSite/content/post/placeholder-text.md create mode 100644 exampleSite/content/post/rich-content.md create mode 100644 exampleSite/data/menu.yaml create mode 100644 exampleSite/data/social.yaml create mode 100644 exampleSite/layouts/.gitkeep create mode 100644 exampleSite/resources/_gen/assets/sass/sass/main.sass_d2bdc985df0e3369a538eb4e858e857f.content create mode 100644 exampleSite/resources/_gen/assets/sass/sass/main.sass_d2bdc985df0e3369a538eb4e858e857f.json create mode 100644 exampleSite/static/.gitignore create mode 100644 exampleSite/static/images/building.png create mode 100644 exampleSite/static/images/dollar.png create mode 100644 exampleSite/static/logos/logo.png create mode 100644 images/article-toc.png create mode 100644 images/image-figure.png create mode 100644 images/image-inline.png create mode 100644 images/screenshot-darkmode.png create mode 100644 images/screenshot-mobile-darkmode.png create mode 100644 images/screenshot-mobile.png create mode 100644 images/screenshot.png create mode 100644 images/syntax-block.gif create mode 100644 images/tags.png create mode 100644 images/tn-darkmode.png create mode 100644 images/tn.png create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/analytics.html create mode 100644 layouts/partials/archive.html create mode 100644 layouts/partials/excerpt.html create mode 100644 layouts/partials/favicon.html create mode 100644 layouts/partials/follow.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/icons.html create mode 100644 layouts/partials/mode.html create mode 100644 layouts/partials/nav.html create mode 100644 layouts/partials/opengraph.html create mode 100644 layouts/partials/pager.html create mode 100644 layouts/partials/post-meta.html create mode 100644 layouts/partials/share.html create mode 100644 layouts/partials/sidebar.html create mode 100644 layouts/partials/top.html create mode 100644 layouts/shortcodes/video.html create mode 100644 static/fonts/Metropolis-Black.woff create mode 100644 static/fonts/Metropolis-Black.woff2 create mode 100644 static/fonts/Metropolis-BlackItalic.woff create mode 100644 static/fonts/Metropolis-BlackItalic.woff2 create mode 100644 static/fonts/Metropolis-Bold.woff create mode 100644 static/fonts/Metropolis-Bold.woff2 create mode 100644 static/fonts/Metropolis-BoldItalic.woff create mode 100644 static/fonts/Metropolis-BoldItalic.woff2 create mode 100644 static/fonts/Metropolis-ExtraBold.woff create mode 100644 static/fonts/Metropolis-ExtraBold.woff2 create mode 100644 static/fonts/Metropolis-ExtraBoldItalic.woff create mode 100644 static/fonts/Metropolis-ExtraBoldItalic.woff2 create mode 100644 static/fonts/Metropolis-ExtraLight.woff create mode 100644 static/fonts/Metropolis-ExtraLight.woff2 create mode 100644 static/fonts/Metropolis-ExtraLightItalic.woff create mode 100644 static/fonts/Metropolis-ExtraLightItalic.woff2 create mode 100644 static/fonts/Metropolis-Light.woff create mode 100644 static/fonts/Metropolis-Light.woff2 create mode 100644 static/fonts/Metropolis-LightItalic.woff create mode 100644 static/fonts/Metropolis-LightItalic.woff2 create mode 100644 static/fonts/Metropolis-Medium.woff create mode 100644 static/fonts/Metropolis-Medium.woff2 create mode 100644 static/fonts/Metropolis-MediumItalic.woff create mode 100644 static/fonts/Metropolis-MediumItalic.woff2 create mode 100644 static/fonts/Metropolis-Regular.woff create mode 100644 static/fonts/Metropolis-Regular.woff2 create mode 100644 static/fonts/Metropolis-RegularItalic.woff create mode 100644 static/fonts/Metropolis-RegularItalic.woff2 create mode 100644 static/fonts/Metropolis-SemiBold.woff create mode 100644 static/fonts/Metropolis-SemiBold.woff2 create mode 100644 static/fonts/Metropolis-SemiBoldItalic.woff create mode 100644 static/fonts/Metropolis-SemiBoldItalic.woff2 create mode 100644 static/fonts/Metropolis-Thin.woff create mode 100644 static/fonts/Metropolis-Thin.woff2 create mode 100644 static/fonts/Metropolis-ThinItalic.woff create mode 100644 static/fonts/Metropolis-ThinItalic.woff2 create mode 100644 static/icons/android-chrome-192x192.png create mode 100644 static/icons/android-chrome-256x256.png create mode 100644 static/icons/apple-touch-icon.png create mode 100644 static/icons/bar.svg create mode 100644 static/icons/browserconfig.xml create mode 100644 static/icons/cancel.svg create mode 100644 static/icons/caret-icon.svg create mode 100644 static/icons/carly.svg create mode 100644 static/icons/close.svg create mode 100644 static/icons/copy.svg create mode 100644 static/icons/expand.svg create mode 100644 static/icons/favicon-16x16.png create mode 100644 static/icons/favicon-32x32.png create mode 100644 static/icons/favicon.ico create mode 100644 static/icons/link.svg create mode 100644 static/icons/mstile-150x150.png create mode 100644 static/icons/order.svg create mode 100644 static/icons/site.webmanifest create mode 100644 static/images/night-moon.jpg create mode 100644 static/images/sun.svg create mode 100644 static/images/thumbnail.png create mode 100644 theme.toml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..fb72f68 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,22 @@ +--- +name: Bug report +about: Report an issue to help us improve the theme +title: '' +labels: '' +assignees: '' + +--- + +**I have checked all the prerequisites below and I'm yet experiencing a problem** + +- [ ] Read the README.md +- [ ] Have the extended version of Hugo installed +- [ ] Used the exampleSite's config.toml as a reference + +**Describe the bug** + +A clear and concise description of what the bug is. [REPLACE] + +**Desktop (please complete the following information):** + - OS: [e.g. iOS 14, Windows 10] + - Browser [e.g. chrome 76, safari 13] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..6333e52 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,28 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +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. + +Staticman's reCAPTCHA support +================================================================================= + +The MIT License (MIT) + +Original work Copyright (c) 2019 Praveen Lobo and Munif Tanjim diff --git a/README.md b/README.md new file mode 100644 index 0000000..2aaefab --- /dev/null +++ b/README.md @@ -0,0 +1,384 @@ +# Hugo Clarity + +A technology-minded theme for Hugo based on VMware's open-source [Clarity Design System](https://clarity.design/) featuring rich code support, dark/light mode, mobile support, and much more. See [a live demo at __neonmirrors.net__](https://neonmirrors.net/). Test. + +![Clarity Hugo Theme](https://github.com/chipzoller/hugo-clarity/blob/master/images/screenshot.png) + +## Preview on Desktop + +| Light Mode | Dark Mode | +|---| --- | +| ![Clarity Hugo Theme desktop light](https://github.com/chipzoller/hugo-clarity/blob/master/images/screenshot.png) | ![Clarity Hugo Theme desktop dark](https://github.com/chipzoller/hugo-clarity/blob/master/images/screenshot-darkmode.png) | + +## Preview on Mobile + +| Light Mode | Dark Mode | +|---| --- | +| ![Clarity Hugo Theme mobile light](https://github.com/chipzoller/hugo-clarity/blob/master/images/screenshot-mobile.png) | ![Clarity Hugo Theme mobile dark](https://github.com/chipzoller/hugo-clarity/blob/master/images/screenshot-mobile-darkmode.png) | + +## Table of Contents + +* [Features](#features) +* [Prerequisites](#prerequisites) +* [Getting up and running](#getting-up-and-running) +* [Configuration](#configuration) + * [Global Parameters](#global-parameters) + * [Page Parameters](#page-parameters) + * [Modify links](#modify-links-menu) + * [Social media](#social-media) + * [Search Engine](#search-engine) + * [Blog directory](#blog-directory) + * [Mobile menu positioning](#mobile-menu-positioning) + * [Tags and taxonomies](#tags-and-taxonomies) + * [Images](#images) + * [Code](#code) + * [Table of contents](#table-of-contents) + * [Custom CSS and JS](#custom-css-and-js) + +## Features + +* Blog with tagging and category options +* Deeplinks +* Native Image Lazy Loading +* Customizable (see config) +* Dark Mode (with UI controls for user preference setting) +* Toggleable table of contents +* Flexible image configuration +* Logo alignment +* Mobile support with configurable menu alignment +* Syntax Highlighting +* Rich code block functions including: + 1. Copy to clipboard + 2. Toggle line wrap (dynamic) + 3. Toggle line numbers + 4. Language label + 5. Toggle block expansion/contraction (dynamic) + + To put it all in context, here is a preview showing all functionality. + + ![code block functions](https://github.com/chipzoller/hugo-clarity/blob/master/images/syntax-block.gif) + +## Prerequisites + +Firstly, __ensure you have installed the [extended version of Hugo](https://github.com/gohugoio/hugo/releases)__. See installation steps from [Hugo's official docs](https://gohugo.io/getting-started/installing/). + +## Getting up and running + +There are at least two ways of quickly getting started with Hugo and the VMware Clarity theme: + +### Option 1 (recommended) + +Generate a new Hugo site and add this theme as a Git submodule inside your themes folder: + +```bash +hugo new site yourSiteName +cd yourSiteName +git init +git submodule add https://github.com/chipzoller/hugo-clarity themes/hugo-clarity +cp -a themes/hugo-clarity/exampleSite/ . +``` + +Then run + +```bash +hugo server +``` + +Hurray! + +### Option 2 (Great for testing quickly) + +You can run your site directly from the `exampleSite`. To do so, use the following commands: + +```bash +git clone https://github.com/chipzoller/hugo-clarity +cd hugo-clarity/exampleSite/ +hugo server --themesDir ../.. +``` + +> Although, option 2 is great for quick testing, it is somewhat problematic when you want to update your theme. You would need to be careful not to overwrite your changes. + +Once set, jump over to the `config.toml` file and start [configuring](#configuration) your site. + +## Configuration + +This section will mainly cover settings that are unique to this theme. If something is not covered here (or elsewhere in this file), there's a good chance it is covered in [this Hugo docs page](https://gohugo.io/getting-started/configuration/#configuration-file). + +### Global Parameters + +These options set global values that some pages or all pages in the site use by default. + +| Parameter | Value Type | Overidable on Page | +|:---- | ---- | ---- | +| author | string | no | +| twitter | string | no | +| largeTwitterCard | boolean | no | +| ga_analytics | string | no | +| introDescription | string | no | +| numberOfTagsShown | integer | no | +| fallBackOgImage | file path (string) | no | +| codeMaxLines | integer | yes | +| codeLineNumbers | boolean | yes | +| mainSections | array/string | no | +| centerLogo | boolean | no | +| logo | file path (string) | no | +| mobileNavigation | string | no | +| figurePositionShow | boolean | yes | +| figurePositionLabel | string | no | +| customCSS | array of file path (string) | no | +| customJS | array of file path (string) | no | + +### Page Parameters + +These options can be set from a page [frontmatter](https://gohugo.io/content-management/front-matter#readout) or via [archetypes](https://gohugo.io/content-management/archetypes/#readout). + +| Parameter | Value Type | Overrides Global | +|:---- | ---- | ---- | +| title | string | N/A | +| date | date | N/A | +| description | string | N/A | +| draft | boolean | N/A | +| featured | boolean | N/A | +| tags | array/string | N/A | +| categories | array/string | N/A | +| toc | boolean | N/A | +| thumbnail | file path (string) | N/A | +| featureImage | file path (string) | N/A | +| shareImage | file path (string) | N/A | +| codeMaxLines | integer | yes | +| codeLineNumbers | boolean | yes | +| figurePositionShow | boolean | yes | +| figurePositionLabel | string | no | + +### Modify links menu + +To add, remove, or reorganize top menu items, [edit this YAML file](https://github.com/chipzoller/hugo-clarity/blob/master/exampleSite/data/menu.yaml). These menu items also display any categories (taxonomies) that might be configured for articles. + +### Social media + +To edit your social media profile links, [edit this YAML file](https://github.com/chipzoller/hugo-clarity/blob/master/exampleSite/data/social.yaml). + +If you wish to globally use a [large Twitter summary card](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image) when sharing posts, set the global parameter `largeTwitterCard` to `true`. + +### Search engine + +If using Google Analytics, configure the `ga_analytics` global parameter in your site with your ID. + +### Blog directory + +Edit the `config.toml` file and change the `mainSections` key. Values will be directories where the blogs reside. + +```yaml +[params] +... +mainSections = ["posts", "docs", "blogs"] +... +``` + +For more info, see the [Hugo docs](https://gohugo.io/functions/where/#mainsections). + +### Mobile menu positioning + +The navigation menu when mobile browsing can be configured in `config.toml` to open right or left depending on preference. The "hamburger" menu icon will always display in the upper right hand corner regardless. + +```yaml +[params] +... +mobileNavigation = "left" # Mobile nav menu will open to the left of the screen. +... +``` + +### Tags and Taxonomies + +#### Show number of tags + +The number of tags and taxonomies (including categories) that should be shown can be configured so that any more than this value will only be accessible when clicking the All Tags button. This is to ensure a large number of tags or categories can be easily managed without consuming excess screen real estate. Edit the `numberOfTagsShown` parameter and set accordingly. + +```yaml +[params] +... +numberOfTagsShownPerArticle = 4 # Applies for categories & custom taxonomies. e.g brands +... +``` + +#### Number of tags example + +![Tags](https://github.com/chipzoller/hugo-clarity/blob/master/images/tags.png) + +### Images + +#### Image figure captions + +You have the option of adding captions to images in blog posts and automatically prepending a desired string such as "Figure N" to the alt text. This is controlled via two global settings. + +`figurePositionLabel` is a string which will be prepended to any alt text of an article image. By default, this is set to "Figure." And `figurePositionShow` controls, globally, whether to show this label. It does not affect whether to show the image alt text, only the prefix figure caption. For more granular control, `figurePositionShow` can be overridden at the article level if desired. + +The number will be automatically calculated and assigned after the `figurePositionLabel` text starting from the top of the article and counting down. Featured images will be excluded from this figuration. + +#### Image figure captions example + +In this example, `figurePositionLabel` is set to "Figure" in `config.toml` and this is the first image in a given article. + +```markdown +![Antrea Kubernetes nodes prepared](./images/image-figure.png) +``` + +![Here is my alt text for this image.](https://github.com/chipzoller/hugo-clarity/blob/master/images/image-figure.png) + +#### Inline images + +To make a blog image inline, append `:inline` to its alt text. Typically, inline images will have no alt text associated with them. + +#### Inline images example + +```markdown + +![:inline](someImageUrl) + + + +![some alt text:inline](someOtherImageUrl) +``` + +![Inline image example](https://github.com/chipzoller/hugo-clarity/blob/master/images/image-inline.png) + +#### Float images to the left + +To align a blog image to the left, append `:left` to its alt text. Article text will then flow to the right of the image. + +#### Float images left example + +```markdown + +![:left](someImageUrl) + + + +![some alt text:left](someOtherImageUrl) +``` + +#### Add classes to images + +To add a class image to the left, append `::` to its alt text. You can also add multiple classes to an image separated by space. `:: `. + +#### Image class example + +```markdown + +![::img-medium](someImageUrl) + + + +![some alt text::img-large img-shadow](someOtherImageUrl) +``` + + +#### Article thumbnail image + +Blog articles can specify a thumbnail image which will be displayed to the left of the card on the home page. Thumbnails should be square (height:width ratio of `1:1`) and a suggested dimension of 150 x 150 pixels. They will be specified using a frontmatter variable as follows: + +```yaml +... +thumbnail: "images/2020-04/capv-overview/thumbnail.jpg" +... +``` + +The thumbnail image will take precedence on opengraph share tags if the [shareImage](#share-image) parameter is not specified. + +#### Article featured image + +Each article can specify an image that appears at the top of the content. When sharing the blog article on social media, if a thumnail is not specified, the featured image will be used as a fallback on opengraph share tags. + +```yaml +... +featureImage: "images/2020-04/capv-overview/featured.jpg" +... +``` + +#### Share Image + +Sometimes, you want to explicitly set the image that will be used in the preview when you share an article on social media. You can do so in the front matter. + +```yaml +... +shareImage = "images/theImageToBeUsedOnShare.png" +... +``` + +Note that if a share image is not specified, the order of precedence that will be used to determine which image applies is `thumbnail` => `featureImage` => `fallbackOgImage`. When sharing a link to the home page address of the site (as opposed to a specific article), the `fallbackOgImage` will be used. + +#### Align logo + +You can left align or center your site's logo. + +```yaml +... +centerLogo = true # Change to false to align left +... +``` + +If no logo is specified, the title of the site will appear in its place. + +### Code + +#### Display line numbers + +Choose whether to display line numbers within a code block globally with the parameter `codeLineNumbers` setting to `true` or `false`. + +```yaml +[params] +... +codeLineNumbers = true # Shows line numbers for all code blocks globally. +... +``` + +#### Limit code block height + +You can globally control the number of lines which are displayed by default for your code blocks. Code which has the number of lines exceed this value will dynamically cause two code block expansion buttons to appear, allowing the user to expand to full length and contract. This is useful when sharing code or scripts with tens or hundreds of lines where you wish to control how many are displayed. Under params in `config.toml` file, add a value as follows: + +```yaml +[params] +... +codeMaxLines = 10 # Maximum number of lines to be shown by default across all articles. +... +``` + +> If the value already exists, change it to the desired number. This will apply globally. + +If you need more granular control, this parameter can be overridden at the blog article level. Add the same value to your article frontmatter as follows: + +```yaml +... +codeMaxLines = 15 # Maximum number of lines to be shown in code blocks in this blog post. +... +``` + +If `codeMaxLines` is specified both in `config.toml` and in the article frontmatter, the value specified in the article frontmatter will apply to the given article. In the above example, the global default is `10` and yet the article value is `15` so code blocks in this article will auto-collapse after 15 lines. + +If `codeMaxLines` is not specified anywhere, an internal default value of `100` will be assumed. + +### Table of contents + +Each article can optionally have a table of contents (TOC) generated for it based on top-level links. By configuring the `toc` parameter in the article frontmatter and setting it to `true`, a TOC will be generated only for that article. The TOC will then render under the featured image. + +### Table of contents (TOC) example + +![Article table of contents](https://github.com/chipzoller/hugo-clarity/blob/master/images/article-toc.png) + +### Custom CSS and JS + +To minimize http requests per page, we would recommend loading css styles and javasript helpers in single bundles. That's one css file, and one javascript file. Using hugo minify functions, these files will be minified to optimize the size. + +Going by the above 👆🏻 reason, we recommend adding custom css and js via [this custom sass file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_custom.sass) and [custom javascript file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/js/custom.js). + +However, sometimes you may need to load additional style or script files. In such cases, you can add custom `.css` and `.js` files by listing them in the `config.toml` file (see the snippet below). Similar to images, these paths should be relative to `static` directory. + +```yaml +[params] +... +customCSS = ["css/custom.css"] # Include custom CSS files +customJS = ["js/custom.js"] # Include custom JS files +... +``` + +> __Pro Tip__: You can change the theme colors via the [this variables' sass file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_variables.sass) diff --git a/archetypes/post.md b/archetypes/post.md new file mode 100644 index 0000000..a616cd9 --- /dev/null +++ b/archetypes/post.md @@ -0,0 +1,22 @@ +--- +title: "{{ replace .Name "-" " " | title }}" # Title of the blog post. +date: {{ .Date }} # Date of post creation. +description: "Article description." # Description used for search engine. +featured: true # Sets if post is a featured post, making it appear on the sidebar. A featured post won't be listed on the sidebar if it's the current page +draft: true # Sets whether to render this page. Draft of true will not be rendered. +toc: false # Controls if a table of contents should be generated for first-level links automatically. +# menu: main +featureImage: "/images/path/file.jpg" # Sets featured image on blog post. +thumbnail: "/images/path/thumbnail.png" # Sets thumbnail image appearing inside card on homepage. +shareImage: "/images/path/share.png" # Designate a separate image for social media sharing. +codeMaxLines: 10 # Override global value for how many lines within a code block before auto-collapsing. +codeLineNumbers: false # Override global value for showing of line numbers within code block. +figurePositionShow: true # Override global value for showing the figure label. +categories: + - Technology +tags: + - Tag_name1 + - Tag_name2 +--- + +**Insert Lead paragraph here.** \ No newline at end of file diff --git a/assets/js/code.js b/assets/js/code.js new file mode 100644 index 0000000..afa546e --- /dev/null +++ b/assets/js/code.js @@ -0,0 +1,255 @@ +const codeActionButtons = [ + { + icon: 'copy', + id: 'copy', + title: 'Copy Code', + show: true + }, + { + icon: 'order', + id: 'lines', + title: 'Toggle Line Numbers', + show: true + }, + { + icon: 'carly', + id: 'wrap', + title: 'Toggle Line Wrap', + show: false + }, + { + icon: 'expand', + id: 'expand', + title: 'Toggle code block expand', + show: false + } +]; + +const body = elem('body'); +const maxLines = parseInt(body.dataset.code); +const copyId = 'panel_copy'; +const wrapId = 'panel_wrap'; +const linesId = 'panel_lines'; +const panelExpand = 'panel_expand'; +const panelExpanded = 'panel_expanded'; +const panelHide = 'panel_hide'; +const panelFrom = 'panel_from'; +const panelBox = 'panel_box'; +const fullHeight = 'initial'; +const highlightWrap = 'highlight_wrap' + +function codeBlocks() { + const markedCodeBlocks = elems('code'); + const blocks = Array.from(markedCodeBlocks).filter(function(block){ + return hasClasses(block) && !Array.from(block.classList).includes('noClass'); + }).map(function(block){ + return block + }); + return blocks; +} + +function codeBlockFits(block) { + // return false if codeblock overflows + const blockWidth = block.offsetWidth; + const highlightBlockWidth = block.parentNode.parentNode.offsetWidth; + return blockWidth <= highlightBlockWidth ? true : false; +} + +function maxHeightIsSet(elem) { + let maxHeight = elem.style.maxHeight; + return maxHeight.includes('px') +} + +function restrainCodeBlockHeight(lines) { + const lastLine = lines[maxLines-1]; + let maxCodeBlockHeight = fullHeight; + if(lastLine) { + const lastLinePos = lastLine.offsetTop; + if(lastLinePos !== 0) { + maxCodeBlockHeight = `${lastLinePos}px`; + const codeBlock = lines[0].parentNode; + const outerBlock = codeBlock.closest('.highlight'); + const isExpanded = containsClass(outerBlock, panelExpanded); + if(!isExpanded) { + codeBlock.dataset.height = maxCodeBlockHeight; + codeBlock.style.maxHeight = maxCodeBlockHeight; + } + } + } +} + +const blocks = codeBlocks(); + +function collapseCodeBlock(block) { + const lines = elems('.ln', block); + const codeLines = lines.length; + if (codeLines > maxLines) { + const expandDot = createEl() + pushClass(expandDot, panelExpand); + pushClass(expandDot, panelFrom); + expandDot.title = "Toggle code block expand"; + expandDot.textContent = "..."; + const outerBlock = block.closest('.highlight'); + window.setTimeout(function(){ + const expandIcon = outerBlock.nextElementSibling.lastElementChild; + deleteClass(expandIcon, panelHide); + }, 150) + + restrainCodeBlockHeight(lines); + const highlightElement = block.parentNode.parentNode; + highlightElement.appendChild(expandDot); + } +} + +blocks.forEach(function(block){ + collapseCodeBlock(block); +}) + +function actionPanel() { + const panel = createEl(); + panel.className = panelBox; + + codeActionButtons.forEach(function(button) { + // create button + const btn = createEl('a'); + btn.href = '#'; + btn.title = button.title; + btn.className = `icon panel_icon panel_${button.id}`; + button.show ? false : pushClass(btn, panelHide); + // load icon inside button + loadSvg(button.icon, btn); + // append button on panel + panel.appendChild(btn); + }); + + return panel; +} + +function toggleLineNumbers(elems) { + elems.forEach(function (elem, index) { + // mark the code element when there are no lines + modifyClass(elem, 'pre_nolines') + }); + restrainCodeBlockHeight(elems); +} + +function toggleLineWrap(elem) { + modifyClass(elem, 'pre_wrap'); + // retain max number of code lines on line wrap + const lines = elems('.ln', elem); + restrainCodeBlockHeight(lines); +} + +function copyCode(codeElement) { + lineNumbers = elems('.ln', codeElement); + // remove line numbers before copying + if(lineNumbers.length) { + lineNumbers.forEach(function(line){ + line.remove(); + }); + } + + const codeToCopy = codeElement.textContent; + // copy code + copyToClipboard(codeToCopy); +} + +function disableCodeLineNumbers(block){ + const lines = elems('.ln', block) + toggleLineNumbers(lines); +} + +(function codeActions(){ + const blocks = codeBlocks(); + + const highlightWrapId = highlightWrap; + blocks.forEach(function(block){ + // disable line numbers if disabled globally + const showLines = elem('body').dataset.lines; + parseBoolean(showLines) === false ? disableCodeLineNumbers(block) : false; + + const highlightElement = block.parentNode.parentNode; + // wrap code block in a div + const highlightWrapper = createEl(); + highlightWrapper.className = highlightWrapId; + wrapEl(highlightElement, highlightWrapper); + + const panel = actionPanel(); + // show wrap icon only if the code block needs wrapping + const wrapIcon = elem(`.${wrapId}`, panel); + codeBlockFits(block) ? false : deleteClass(wrapIcon, panelHide); + + // append buttons + highlightWrapper.appendChild(panel); + }); + + function isItem(target, id) { + // if is item or within item + return target.matches(`.${id}`) || target.closest(`.${id}`); + } + + function showActive(target, targetClass,activeClass = 'active') { + const active = activeClass; + const targetElement = target.matches(`.${targetClass}`) ? target : target.closest(`.${targetClass}`); + + deleteClass(targetElement, active); + setTimeout(function() { + modifyClass(targetElement, active) + }, 50) + } + + doc.addEventListener('click', function(event){ + // copy code block + const target = event.target; + const isCopyIcon = isItem(target, copyId); + const isWrapIcon = isItem(target, wrapId); + const isLinesIcon = isItem(target, linesId); + const isExpandIcon = isItem(target, panelExpand); + const isActionable = isCopyIcon || isWrapIcon || isLinesIcon || isExpandIcon; + + if(isActionable) { + event.preventDefault(); + showActive(target, 'icon'); + const codeElement = target.closest(`.${highlightWrapId}`).firstElementChild.firstElementChild; + let lineNumbers = elems('.ln', codeElement); + + isWrapIcon ? toggleLineWrap(codeElement) : false; + + isLinesIcon ? toggleLineNumbers(lineNumbers) : false; + + if (isExpandIcon) { + let thisCodeBlock = codeElement.firstElementChild; + const outerBlock = thisCodeBlock.closest('.highlight'); + if(maxHeightIsSet(thisCodeBlock)) { + thisCodeBlock.style.maxHeight = fullHeight; + // mark code block as expanded + pushClass(outerBlock, panelExpanded) + } else { + thisCodeBlock.style.maxHeight = thisCodeBlock.dataset.height; + // unmark code block as expanded + deleteClass(outerBlock, panelExpanded) + } + } + + if(isCopyIcon) { + // clone code element + const codeElementClone = codeElement.cloneNode(true); + copyCode(codeElementClone); + } + } + }); + + (function addLangLabel() { + const blocks = codeBlocks(); + blocks.forEach(function(block){ + let label = block.dataset.lang; + label = label === 'sh' ? 'bash' : label; + if(label !== "fallback") { + const labelEl = createEl(); + labelEl.textContent = label; + pushClass(labelEl, 'lang'); + block.closest(`.${highlightWrap}`).appendChild(labelEl); + } + }); + })(); +})(); diff --git a/assets/js/custom.js b/assets/js/custom.js new file mode 100644 index 0000000..11b1d82 --- /dev/null +++ b/assets/js/custom.js @@ -0,0 +1 @@ +// add custom js in this file \ No newline at end of file diff --git a/assets/js/functions.js b/assets/js/functions.js new file mode 100644 index 0000000..1b26e21 --- /dev/null +++ b/assets/js/functions.js @@ -0,0 +1,200 @@ +// global variables +const doc = document.documentElement; +const inline = ":inline"; +// variables read from your hugo configuration +const parentURL = '{{ absURL "" }}'; +let showImagePosition = "{{ .Site.Params.figurePositionShow }}"; + +const showImagePositionLabel = '{{ .Site.Params.figurePositionLabel }}'; + +function isObj(obj) { + return (obj && typeof obj === 'object' && obj !== null) ? true : false; +} + +function createEl(element = 'div') { + return document.createElement(element); +} + +function elem(selector, parent = document){ + let elem = parent.querySelector(selector); + return elem != false ? elem : false; +} + +function elems(selector, parent = document) { + let elems = parent.querySelectorAll(selector); + return elems.length ? elems : false; +} + +function pushClass(el, targetClass) { + if (isObj(el) && targetClass) { + elClass = el.classList; + elClass.contains(targetClass) ? false : elClass.add(targetClass); + } +} + +function hasClasses(el) { + if(isObj(el)) { + const classes = el.classList; + return classes.length + } +} + +(function markInlineCodeTags(){ + const codeBlocks = elems('code'); + if(codeBlocks) { + codeBlocks.forEach(function(codeBlock){ + hasClasses(codeBlock) ? false: pushClass(codeBlock, 'noClass'); + }); + } +})(); + +function deleteClass(el, targetClass) { + if (isObj(el) && targetClass) { + elClass = el.classList; + elClass.contains(targetClass) ? elClass.remove(targetClass) : false; + } +} + +function modifyClass(el, targetClass) { + if (isObj(el) && targetClass) { + elClass = el.classList; + elClass.contains(targetClass) ? elClass.remove(targetClass) : elClass.add(targetClass); + } +} + +function containsClass(el, targetClass) { + if (isObj(el) && targetClass && el !== document ) { + return el.classList.contains(targetClass) ? true : false; + } +} + +function elemAttribute(elem, attr, value = null) { + if (value) { + elem.setAttribute(attr, value); + } else { + value = elem.getAttribute(attr); + return value ? value : false; + } +} + +function wrapEl(el, wrapper) { + el.parentNode.insertBefore(wrapper, el); + wrapper.appendChild(el); +} + +function deleteChars(str, subs) { + let newStr = str; + if (Array.isArray(subs)) { + for (let i = 0; i < subs.length; i++) { + newStr = newStr.replace(subs[i], ''); + } + } else { + newStr = newStr.replace(subs, ''); + } + return newStr; +} + +function isBlank(str) { + return (!str || str.trim().length === 0); +} + +function isMatch(element, selectors) { + if(isObj(element)) { + if(selectors.isArray) { + let matching = selectors.map(function(selector){ + return element.matches(selector) + }) + return matching.includes(true); + } + return element.matches(selectors) + } +} + +function copyToClipboard(str) { + let copy, selection, selected; + copy = createEl('textarea'); + copy.value = str; + copy.setAttribute('readonly', ''); + copy.style.position = 'absolute'; + copy.style.left = '-9999px'; + selection = document.getSelection(); + doc.appendChild(copy); + // check if there is any selected content + selected = selection.rangeCount > 0 ? selection.getRangeAt(0) : false; + copy.select(); + document.execCommand('copy'); + doc.removeChild(copy); + if (selected) { // if a selection existed before copying + selection.removeAllRanges(); // unselect existing selection + selection.addRange(selected); // restore the original selection + } +} + +function loadSvg(file, parent, path = 'icons/') { + const link = `${parentURL}${path}${file}.svg`; + fetch(link) + .then((response) => { + return response.text(); + }) + .then((data) => { + parent.innerHTML = data; + }); +} + +function getMobileOperatingSystem() { + let userAgent = navigator.userAgent || navigator.vendor || window.opera; + + if (/android/i.test(userAgent)) { + return "Android"; + } + + if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { + return "iOS"; + } + + return "unknown"; +} + +function horizontalSwipe(element, func, direction) { + // call func if result of swipeDirection() 👇🏻 is equal to direction + + let touchstartX = 0; + let touchendX = 0; + let swipeDirection = null; + + function handleGesure() { + return (touchendX + 50 < touchstartX) ? 'left' : (touchendX < touchstartX + 50) ? 'right' : false; + } + + element.addEventListener('touchstart', e => { + touchstartX = e.changedTouches[0].screenX + }); + + element.addEventListener('touchend', e => { + touchendX = e.changedTouches[0].screenX + swipeDirection = handleGesure() + swipeDirection === direction ? func() : false; + }); + +} + +function parseBoolean(string) { + let bool; + string = string.trim().toLowerCase(); + switch (string) { + case 'true': + return true; + case 'false': + return false; + default: + return undefined; + } +}; + +(function() { + const bodyElement = elem('body'); + const platform = navigator.platform.toLowerCase(); + if(platform.includes("win")) { + pushClass(bodyElement, 'windows'); + } +})(); \ No newline at end of file diff --git a/assets/js/highlight.js b/assets/js/highlight.js new file mode 100644 index 0000000..8273682 --- /dev/null +++ b/assets/js/highlight.js @@ -0,0 +1,2 @@ +/*! highlight.js v9.17.1 | BSD3 License | git.io/hljslicense */ +!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"==typeof exports||exports.nodeType?n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs})):e(exports)}(function(a){var f=[],o=Object.keys,N={},g={},_=!0,n=/^(no-?highlight|plain|text)$/i,E=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,r={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},C="",m="Could not find the language '{}', did you forget to load/include a language module?",O={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},c="of and for in not or if then".split(" ");function B(e){return e.replace(/&/g,"&").replace(//g,">")}function d(e){return e.nodeName.toLowerCase()}function R(e){return n.test(e)}function i(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function p(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:"start",offset:t,node:r}),t=e(r,t),d(r).match(/br|hr|img|input/)||a.push({event:"stop",offset:t,node:r}));return t}(e,0),a}function v(e,n,t){var r=0,a="",i=[];function o(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function l(e){a+=""}function u(e){("start"===e.event?c:l)(e.node)}for(;e.length||n.length;){var s=o();if(a+=B(t.substring(r,s[0].offset)),r=s[0].offset,s===e){for(i.reverse().forEach(l);u(s.splice(0,1)[0]),(s=o())===e&&s.length&&s[0].offset===r;);i.reverse().forEach(c)}else"start"===s[0].event?i.push(s[0].node):i.pop(),u(s.splice(0,1)[0])}return a+B(t.substr(r))}function l(n){return n.v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return i(n,{v:null},e)})),n.cached_variants?n.cached_variants:function e(n){return!!n&&(n.eW||e(n.starts))}(n)?[i(n,{starts:n.starts?i(n.starts):null})]:Object.isFrozen(n)?[i(n)]:[n]}function u(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(u)}}function M(n,t){var i={};return"string"==typeof n?r("keyword",n):o(n).forEach(function(e){r(e,n[e])}),i;function r(a,e){t&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n,t,r=e.split("|");i[r[0]]=[a,(n=r[0],(t=r[1])?Number(t):function(e){return-1!=c.indexOf(e.toLowerCase())}(n)?0:1)]})}}function x(r){function s(e){return e&&e.source||e}function f(e,n){return new RegExp(s(e),"m"+(r.cI?"i":"")+(n?"g":""))}function a(a){var i,e,o={},c=[],l={},t=1;function n(e,n){o[t]=e,c.push([e,n]),t+=new RegExp(n.toString()+"|").exec("").length-1+1}for(var r=0;r')+n+(t?"":C)}function o(){R+=null!=E.sL?function(){var e="string"==typeof E.sL;if(e&&!N[E.sL])return B(p);var n=e?S(E.sL,p,!0,d[E.sL]):T(p,E.sL.length?E.sL:void 0);return 0")+'"');if("end"===n.type){var r=s(n);if(null!=r)return r}return p+=t,t.length}var g=D(n);if(!g)throw console.error(m.replace("{}",n)),new Error('Unknown language: "'+n+'"');x(g);var r,E=e||g,d={},R="";for(r=E;r!==g;r=r.parent)r.cN&&(R=c(r.cN,"",!0)+R);var p="",v=0;try{for(var M,b,h=0;E.t.lastIndex=h,M=E.t.exec(i);)b=t(i.substring(h,M.index),M),h=M.index+b;for(t(i.substr(h)),r=E;r.parent;r=r.parent)r.cN&&(R+=C);return{relevance:v,value:R,i:!1,language:n,top:E}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{i:!0,relevance:0,value:B(i)};if(_)return{relevance:0,value:B(i),language:n,top:E,errorRaised:e};throw e}}function T(t,e){e=e||O.languages||o(N);var r={relevance:0,value:B(t)},a=r;return e.filter(D).filter(L).forEach(function(e){var n=S(e,t,!1);n.language=e,n.relevance>a.relevance&&(a=n),n.relevance>r.relevance&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function b(e){return O.tabReplace||O.useBR?e.replace(t,function(e,n){return O.useBR&&"\n"===e?"
":O.tabReplace?n.replace(/\t/g,O.tabReplace):""}):e}function s(e){var n,t,r,a,i,o,c,l,u,s,f=function(e){var n,t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=E.exec(i)){var o=D(t[1]);return o||(console.warn(m.replace("{}",t[1])),console.warn("Falling back to no-highlight mode for this block.",e)),o?t[1]:"no-highlight"}for(n=0,r=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,r=f?S(f,i,!0):T(i),(t=p(n)).length&&((a=document.createElement("div")).innerHTML=r.value,r.value=v(t,p(a),i)),r.value=b(r.value),e.innerHTML=r.value,e.className=(o=e.className,c=f,l=r.language,u=c?g[c]:l,s=[o.trim()],o.match(/\bhljs\b/)||s.push("hljs"),-1===o.indexOf(u)&&s.push(u),s.join(" ").trim()),e.result={language:r.language,re:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance}))}function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll("pre code");f.forEach.call(e,s)}}var w={disableAutodetect:!0};function D(e){return e=(e||"").toLowerCase(),N[e]||N[g[e]]}function L(e){var n=D(e);return n&&!n.disableAutodetect}return a.highlight=S,a.highlightAuto=T,a.fixMarkup=b,a.highlightBlock=s,a.configure=function(e){O=i(O,e)},a.initHighlighting=h,a.initHighlightingOnLoad=function(){window.addEventListener("DOMContentLoaded",h,!1),window.addEventListener("load",h,!1)},a.registerLanguage=function(n,e){var t;try{t=e(a)}catch(e){if(console.error("Language definition for '{}' could not be registered.".replace("{}",n)),!_)throw e;console.error(e),t=w}u(N[n]=t),t.rawDefinition=e.bind(null,a),t.aliases&&t.aliases.forEach(function(e){g[e]=n})},a.listLanguages=function(){return o(N)},a.getLanguage=D,a.requireLanguage=function(e){var n=D(e);if(n)return n;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},a.autoDetection=L,a.inherit=i,a.debugMode=function(){_=!1},a.IR=a.IDENT_RE="[a-zA-Z]\\w*",a.UIR=a.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",a.NR=a.NUMBER_RE="\\b\\d+(\\.\\d+)?",a.CNR=a.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a.BNR=a.BINARY_NUMBER_RE="\\b(0b[01]+)",a.RSR=a.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a.BE=a.BACKSLASH_ESCAPE={b:"\\\\[\\s\\S]",relevance:0},a.ASM=a.APOS_STRING_MODE={cN:"string",b:"'",e:"'",i:"\\n",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:"comment",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C("//","$"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C("/\\*","\\*/"),a.HCM=a.HASH_COMMENT_MODE=a.C("#","$"),a.NM=a.NUMBER_MODE={cN:"number",b:a.NR,relevance:0},a.CNM=a.C_NUMBER_MODE={cN:"number",b:a.CNR,relevance:0},a.BNM=a.BINARY_NUMBER_MODE={cN:"number",b:a.BNR,relevance:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:"number",b:a.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},a.RM=a.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[a.BE,{b:/\[/,e:/\]/,relevance:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:"title",b:a.IR,relevance:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:"title",b:a.UIR,relevance:0},a.METHOD_GUARD={b:"\\.\\s*"+a.UIR,relevance:0},[a.BE,a.ASM,a.QSM,a.PWM,a.C,a.CLCM,a.CBCM,a.HCM,a.NM,a.CNM,a.BNM,a.CSSNM,a.RM,a.TM,a.UTM,a.METHOD_GUARD].forEach(function(e){!function n(t){Object.freeze(t);var r="function"==typeof t;Object.getOwnPropertyNames(t).forEach(function(e){!t.hasOwnProperty(e)||null===t[e]||"object"!=typeof t[e]&&"function"!=typeof t[e]||r&&("caller"===e||"callee"===e||"arguments"===e)||Object.isFrozen(t[e])||n(t[e])});return t}(e)}),a});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},a={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,relevance:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],relevance:0},e.HCM,a,{cN:"",b:/\\"/},{cN:"string",b:/'/,e:/'/},t]}});hljs.registerLanguage("shell",function(s){return{aliases:["console"],c:[{cN:"meta",b:"^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]",starts:{e:"$",sL:"bash"}}]}});hljs.registerLanguage("ruby",function(e){var c="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",b={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},r={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},n=[e.C("#","$",{c:[r]}),e.C("^\\=begin","^\\=end",{c:[r],relevance:10}),e.C("^__END__","\\n$")],s={cN:"subst",b:"#\\{",e:"}",k:b},t={cN:"string",c:[e.BE,s],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<[-~]?'?(\w+)(?:.|\n)*?\n\s*\1\b/,rB:!0,c:[{b:/<<[-~]?'?/},{b:/\w+/,endSameAsBegin:!0,c:[e.BE,s]}]}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:b},l=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(n)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:c}),i].concat(n)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",relevance:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:c}],relevance:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:b},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[a,{cN:"regexp",c:[e.BE,s],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(n),relevance:0}].concat(n);s.c=l;var d=[{b:/^\s*=>/,starts:{e:"$",c:i.c=l}},{cN:"meta",b:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{e:"$",c:l}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:b,i:/\/\*/,c:n.concat(d).concat(l)}});hljs.registerLanguage("yaml",function(e){var b="true false yes no null",a={cN:"string",relevance:0,v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/\S+/}],c:[e.BE,{cN:"template-variable",v:[{b:"{{",e:"}}"},{b:"%{",e:"}"}]}]};return{cI:!0,aliases:["yml","YAML","yaml"],c:[{cN:"attr",v:[{b:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{b:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{b:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{cN:"meta",b:"^---s*$",relevance:10},{cN:"string",b:"[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*"},{b:"<%[%=-]?",e:"[%-]?%>",sL:"ruby",eB:!0,eE:!0,relevance:0},{cN:"type",b:"!"+e.UIR},{cN:"type",b:"!!"+e.UIR},{cN:"meta",b:"&"+e.UIR+"$"},{cN:"meta",b:"\\*"+e.UIR+"$"},{cN:"bullet",b:"\\-(?=[ ]|$)",relevance:0},e.HCM,{bK:b,k:{literal:b}},{cN:"number",b:e.CNR+"\\b"},a]}}); diff --git a/assets/js/index.js b/assets/js/index.js new file mode 100644 index 0000000..16e12f8 --- /dev/null +++ b/assets/js/index.js @@ -0,0 +1,471 @@ +(function toggleColorModes(){ + const light = 'lit'; + const dark = 'dim'; + const storageKey = 'colorMode'; + const key = '--color-mode'; + const data = 'data-mode'; + const bank = window.localStorage; + + function currentMode() { + let acceptableChars = light + dark; + acceptableChars = [...acceptableChars]; + let mode = getComputedStyle(doc).getPropertyValue(key).replace(/\"/g, '').trim(); + + mode = [...mode].filter(function(letter){ + return acceptableChars.includes(letter); + }); + + return mode.join(''); + } + + function changeMode(isDarkMode) { + if(isDarkMode) { + bank.setItem(storageKey, light) + elemAttribute(doc, data, light); + } else { + bank.setItem(storageKey, dark); + elemAttribute(doc, data, dark); + } + } + + function setUserColorMode(mode = false) { + const isDarkMode = currentMode() == dark; + const storedMode = bank.getItem(storageKey); + if(storedMode) { + if(mode) { + changeMode(isDarkMode); + } else { + elemAttribute(doc, data, storedMode); + } + } else { + if(mode === true) { + changeMode(isDarkMode) + } + } + } + + setUserColorMode(); + + doc.addEventListener('click', function(event) { + let target = event.target; + let modeClass = 'color_choice'; + let animateClass = 'color_animate'; + let isModeToggle = containsClass(target, modeClass); + if(isModeToggle) { + pushClass(target, animateClass); + setUserColorMode(true); + } + }); +})(); + +function fileClosure(){ + // everything in this file should be declared within this closure (function). + + (function updateDate() { + var date = new Date(); + var year = date.getFullYear(); + elem('.year').innerHTML = year; + })(); + + (function makeExternalLinks(){ + let links = elems('a'); + if(links) { + Array.from(links).forEach(function(link){ + let target, rel, blank, noopener, attr1, attr2, url, isExternal; + url = elemAttribute(link, 'href'); + isExternal = (url && typeof url == 'string' && url.startsWith('http')) && !url.startsWith(parentURL) ? true : false; + if(isExternal) { + target = 'target'; + rel = 'rel'; + blank = '_blank'; + noopener = 'noopener'; + attr1 = elemAttribute(link, target); + attr2 = elemAttribute(link, noopener); + + attr1 ? false : elemAttribute(link, target, blank); + attr2 ? false : elemAttribute(link, rel, noopener); + } + }); + } + })(); + + let headingNodes = [], results, link, icon, current, id, + tags = ['h2', 'h3', 'h4', 'h5', 'h6']; + + current = document.URL; + + tags.forEach(function(tag){ + const article = elem('.post_content'); + if (article) { + results = article.getElementsByTagName(tag); + Array.prototype.push.apply(headingNodes, results); + } + }); + + headingNodes.forEach(function(node){ + link = createEl('a'); + loadSvg('link', link); + link.className = 'link icon'; + id = node.getAttribute('id'); + if(id) { + link.href = `${current}#${id}`; + node.appendChild(link); + pushClass(node, 'link_owner'); + } + }); + + let inlineListItems = elems('ol li'); + if(inlineListItems) { + inlineListItems.forEach(function(listItem){ + let firstChild = listItem.children[0] + let containsHeading = isMatch(firstChild, tags); + containsHeading ? pushClass(listItem, 'align') : false; + }) + } + + function copyFeedback(parent) { + const copyText = document.createElement('div'); + const yanked = 'link_yanked'; + copyText.classList.add(yanked); + copyText.innerText = 'Link Copied'; + if(!elem(`.${yanked}`, parent)) { + parent.appendChild(copyText); + setTimeout(function() { + parent.removeChild(copyText) + }, 3000); + } + } + + (function copyHeadingLink() { + let deeplink, deeplinks, newLink, parent, target; + deeplink = 'link'; + deeplinks = elems(`.${deeplink}`); + if(deeplinks) { + document.addEventListener('click', function(event) + { + target = event.target; + parent = target.parentNode; + if (target && containsClass(target, deeplink) || containsClass(parent, deeplink)) { + event.preventDefault(); + newLink = target.href != undefined ? target.href : target.parentNode.href; + copyToClipboard(newLink); + target.href != undefined ? copyFeedback(target) : copyFeedback(target.parentNode); + } + }); + } + })(); + + (function copyLinkToShare() { + let copy, copied, excerpt, isCopyIcon, isInExcerpt, link, postCopy, postLink, target; + copy = 'copy'; + copied = 'copy_done'; + excerpt = 'excerpt'; + postCopy = 'post_copy'; + postLink = 'post_card'; + + doc.addEventListener('click', function(event) { + target = event.target; + isCopyIcon = containsClass(target, copy); + let isWithinCopyIcon = target.closest(`.${copy}`); + if (isCopyIcon || isWithinCopyIcon) { + let icon = isCopyIcon ? isCopyIcon : isWithinCopyIcon; + isInExcerpt = containsClass(icon, postCopy); + if (isInExcerpt) { + link = target.closest(`.${excerpt}`).previousElementSibling; + link = containsClass(link, postLink)? elemAttribute(link, 'href') : false; + } else { + link = window.location.href; + } + if(link) { + copyToClipboard(link); + pushClass(icon, copied); + } + } + const yankLink = '.link_yank'; + const isCopyLink = target.matches(yankLink); + const isCopyLinkIcon = target.closest(yankLink); + + if(isCopyLink || isCopyLinkIcon) { + event.preventDefault(); + const yankContent = isCopyLinkIcon ? elemAttribute(target.closest(yankLink), 'href') : elemAttribute(target, 'href'); + copyToClipboard(yankContent); + isCopyLink ? copyFeedback(target) : copyFeedback(target.parentNode); + } + + }); + })(); + + (function hideAside(){ + let aside, title, posts; + aside = elem('.aside'); + title = aside ? aside.previousElementSibling : null; + if(aside && title.nodeName.toLowerCase() === 'h3') { + posts = Array.from(aside.children); + posts.length < 1 ? title.remove() : false; + } + })(); + + (function goBack() { + let backBtn = elem('.btn_back'); + let history = window.history; + if (backBtn) { + backBtn.addEventListener('click', function(){ + history.back(); + }); + } + })(); + + function showingImagePosition(){ + // whether or not to track image position for non-linear images within the article body element. + const thisPage = document.documentElement; + let showImagePositionOnPage = thisPage.dataset.figures; + + if(showImagePositionOnPage) { + showImagePosition = showImagePositionOnPage; + } + return showImagePosition === "true" ? true : false; + } + + function populateAlt(images) { + let imagePosition = 0; + + images.forEach((image) => { + let alt = image.alt; + image.loading = "lazy"; + const modifiers = [':left', ':right']; + const altArr = alt.split('::').map(x => x.trim()) + + altArr[1]?.split(' ').filter(Boolean).forEach(cls =>{ + pushClass(image, cls); + alt = altArr[0] + }) + + modifiers.forEach(function(modifier){ + const canModify = alt.includes(modifier); + if(canModify) { + pushClass(image, `float_${modifier.replace(":", "")}`); + + alt = alt.replace(modifier, ""); + } + }); + + const isInline = alt.includes(inline); + alt = alt.replace(inline, ""); + + // wait for position to load and a caption if the image is not online and has an alt attribute + if (alt.length > 0 && !containsClass(image, 'alt' && !isInline)) { + imagePosition += 1; + image.dataset.pos = imagePosition; + image.addEventListener('load', function() { + const showImagePosition = showingImagePosition(); + + let desc = document.createElement('p'); + desc.classList.add('img_alt'); + let imageAlt = alt; + + const thisImgPos = image.dataset.pos; + // modify image caption is necessary + imageAlt = showImagePosition ? `${showImagePositionLabel} ${thisImgPos}: ${imageAlt}` : imageAlt; + desc.textContent = imageAlt; + image.insertAdjacentHTML('afterend', desc.outerHTML); + }) + } + + if(isInline) { + modifyClass(image, 'inline'); + } + + }); + + hljs.initHighlightingOnLoad(); + } + + function largeImages(baseParent, images = []) { + if(images) { + images.forEach(function(image) { + + image.addEventListener('load', function(){ + + let actualWidth = image.naturalWidth; + + let parentWidth = baseParent.offsetWidth; + + let actionableRatio = actualWidth / parentWidth; + + if (actionableRatio > 1) { + pushClass(image, "image-scalable"); + image.dataset.scale = actionableRatio; + let figure = createEl('figure'); + + wrapEl(image, figure) + } + + }); + }) + } + } + + (function AltImage() { + let post = elem('.post_content'); + let images = post ? post.querySelectorAll('img') : false; + images ? populateAlt(images) : false; + largeImages(post, images); + })(); + + + doc.addEventListener('click', function(event) { + let target = event.target; + isClickableImage = target.matches('.image-scalable'); + + let isFigure = target.matches('figure'); + + if(isFigure) { + let hasClickableImage = containsClass(target.children[0], 'image-scalable'); + if(hasClickableImage) { + modifyClass(target, 'image-scale'); + } + } + + if(isClickableImage) { + let figure = target.parentNode; + modifyClass(figure, 'image-scale'); + } + + }); + + const tables = elems('table'); + if (tables) { + const scrollable = 'scrollable'; + tables.forEach(function(table) { + const wrapper = createEl(); + wrapper.className = scrollable; + wrapEl(table, wrapper); + }); + } + + // track if there's an expanded tags' widget + let tagWidgetOpen = false; + + function toggleTags(target = null) { + const tagsButtonClass = 'post_tags_toggle'; + const tagsButtonClass2 = 'tags_hide'; + const tagsShowClass = 'jswidgetopen'; + const postTagsWrapper = elem(`.${tagsShowClass}`); + target = target === null ? postTagsWrapper : target; + const showingAllTags = target.matches(`.${tagsShowClass}`); + const isExandButton = target.matches(`.${tagsButtonClass}`); + const isCloseButton = target.matches(`.${tagsButtonClass2}`) || target.closest(`.${tagsButtonClass2}`); + const isButton = isExandButton || isCloseButton; + const isActionable = isButton || showingAllTags; + + if(isActionable) { + if(isButton) { + if(isExandButton) { + let allTagsWrapper = target.nextElementSibling + pushClass(allTagsWrapper, tagsShowClass); + } else { + deleteClass(postTagsWrapper, tagsShowClass); + } + } else { + isActionable ? deleteClass(target, tagsShowClass) : false; + } + } + } + + (function showAllPostTags(){ + doc.addEventListener('click', function(event){ + const target = event.target; + toggleTags(target) + }); + + horizontalSwipe(doc, toggleTags, 'left'); + })(); + + (function navToggle() { + doc.addEventListener('click', function(event){ + const target = event.target; + const open = 'jsopen'; + const navCloseIconClass = '.nav_close'; + const navClose = elem(navCloseIconClass); + const isNavToggle = target.matches(navCloseIconClass) || target.closest(navCloseIconClass); + const harmburgerIcon = navClose.firstElementChild; + if(isNavToggle) { + event.preventDefault(); + modifyClass(doc, open); + modifyClass(harmburgerIcon, 'isopen'); + } + + if(!target.closest('.nav') && elem(`.${open}`)) { + modifyClass(doc, open); + let navIsOpen = containsClass(doc, open); + !navIsOpen ? modifyClass(harmburgerIcon, 'isopen') : false; + } + + const navItem = 'nav_item'; + const navSub = 'nav_sub'; + const showSub = 'nav_open'; + const isNavItem = target.matches(`.${navItem}`); + const isNavItemIcon = target.closest(`.${navItem}`) + + if(isNavItem || isNavItemIcon) { + const thisItem = isNavItem ? target : isNavItemIcon; + const hasNext = thisItem.nextElementSibling + const hasSubNav = hasNext ? hasNext.matches(`.${navSub}`) : null; + if (hasSubNav) { + event.preventDefault(); + modifyClass(thisItem, showSub); + } + } + + }); + })(); + + function isMobileDevice() { + const agent = navigator.userAgent.toLowerCase(); + const isMobile = agent.includes('android') || agent.includes('iphone'); + return isMobile; + }; + + (function ifiOS(){ + // modify backto top button + const backToTopButton = elem('.to_top'); + const thisOS = getMobileOperatingSystem(); + const ios = 'ios'; + if(backToTopButton && thisOS === 'iOS') { + pushClass(backToTopButton, ios); + } + // precisely position back to top button on large screens + const buttonParentWidth = backToTopButton.parentNode.offsetWidth; + const docWidth = doc.offsetWidth; + let leftOffset = (docWidth - buttonParentWidth) / 2; + const buttonWidth = backToTopButton.offsetWidth; + leftOffset = leftOffset + buttonParentWidth - buttonWidth; + if(!isMobileDevice()){ + backToTopButton.style.left = `${leftOffset}px`; + } + })(); + + (function sortTags() { + doc.addEventListener('click', function(event){ + const active = 'active'; + const target = event.target; + const isSortButton = target.matches('.tags_sort') || target.matches('.tags_sort span'); + if(isSortButton) { + const tagsList = target.closest('.tags_list'); + const sortButton = elem('.tags_sort', tagsList); + modifyClass(sortButton, 'sorted'); + const tags = elems('.post_tag', tagsList); + Array.from(tags).forEach(function(tag){ + const order = tag.dataset.position; + const reverseSorting = containsClass(tag, active); + tag.style.order = reverseSorting ? 0 : -order; + modifyClass(tag, active); + }) + } + }) + })(); + + // add new code above this line +} + +window.addEventListener('load', fileClosure()); diff --git a/assets/sass/_base.sass b/assets/sass/_base.sass new file mode 100644 index 0000000..2763337 --- /dev/null +++ b/assets/sass/_base.sass @@ -0,0 +1,151 @@ +* + box-sizing: border-box + -webkit-appearance: none + margin: 0 + padding: 0 + +body, html + scroll-behavior: smooth + font-kerning: normal + -webkit-font-feature-settings: "kern" 1 + text-rendering: optimizeLegibility + text-rendering: geometricPrecision + -webkit-text-size-adjust: 100% + font-size: 100% + &::-webkit-scrollbar-corner + background-color: transparent +body + font-family: var(--font) + background: var(--choice-bg) + color: var(--text) + font-size: 1.1rem + line-height: 1.5 + max-width: 1920px + margin: 0 auto + position: relative + font-kerning: normal + display: flex + flex-direction: column + justify-content: space-between + min-height: 100vh + -webkit-font-smoothing: antialiased + -moz-osx-font-smoothing: grayscale +a + text-decoration: none + color: inherit + &:focus, &:focus-within + outline: none !important + +h1,h2,h3,h4,h5 + font-family: inherit + font-weight: 300 + padding: 5px 0 + margin: 15px 0 + color: var(--header-text) + line-height: 1.35 + &:hover .link + opacity: 1 + +h1 + font-size: 200% + font-weight: 400 +h2 + font-size: 175% +h3 + font-size: 150% +h4 + font-size: 125% +h5 + font-size: 120% +h6 + font-size: 100% + +img, svg + max-width: 100% + vertical-align: middle +img + height: auto + margin: 1rem auto + padding: 0 + &:focus, &:focus-within + outline: none !important + border: none !important + +main + flex: 1 + +ul + list-style: none + -webkit-padding-start: 0 + -moz-padding-start: 0 + +b, strong, em + font-weight: 500 + +hr + border: none + padding: 1px + background: darken($haze, 7.5%) + opacity: 0.5 + margin: 1rem 0 + @media (prefers-color-scheme: dark) + background: var(--theme) + +aside + h3 + position: relative + margin: 0 !important + ul + list-style: initial + padding-left: 1rem + li + padding: 0.25rem 0 + +table + width: 100% + border-collapse: collapse + background: var(--table-haze) + // border-style: hidden + margin-bottom: 1.5rem + &:not(.ln-table) t + background: var(--table-bg) + +th + text-align: left + +td, th + padding: 0.5rem 1rem + border: 1px solid var(--table-border) + +td, +th + padding: 0.5rem 1rem + text-align: left + font-weight: 400 + &:not(:first-child) + padding-left: 1.5rem + +th + font-weight: 700 + +tbody + padding: 0 + tr + &:nth-child(even) + background-color: var(--table-haze) + &:nth-child(odd) + background-color: var(--table-bg) + +blockquote + margin: 25px auto + padding: 1.5rem + color: #555555 + padding: 1rem 1.5rem + border-left: 0.2rem solid $theme + position: relative + background: var(--haze) +p + padding: 0.8rem 0 + + + diff --git a/assets/sass/_components.sass b/assets/sass/_components.sass new file mode 100644 index 0000000..507e65f --- /dev/null +++ b/assets/sass/_components.sass @@ -0,0 +1,536 @@ +.nav + color: $haze + display: flex + justify-content: space-between + @include content + &_active + background-color: rgba($light, 0.05) + &, &_body + &_icon + width: 0.7rem + margin-left: 0.33rem + transition: transform 0.3s var(--ease) + transform-origin: 50% 50% + &_body + display: flex + flex: 1 + &_header + background-color: $bg + padding: 0 1.5rem + position: fixed + width: 100% + z-index: 99 + left: 0 + &_item + padding: 0.5rem 1rem + display: inline-flex + align-items: center + + &_sub + position: absolute + z-index: 20 + border-radius: 0 0 0.5rem 0.5rem + top: 3rem + transition: height 0.3s ease-in-out + height: 0 + overflow: hidden + padding: 0.96rem 0 0 + background: transparent + + &_parent + position: relative + display: flex + align-items: center + margin: 0.25rem 0 + border-radius: 0.5rem + + &_open + &_sub + height: initial + z-index: 999 + @media screen and (min-width: 769px) + background-color: $bg + min-width: 20.5rem + box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.17) + &_open &_icon + transform: rotate(180deg) + + &_sub &_item + position: relative + z-index: 5 + display: block + padding-top: 0.75rem + padding-bottom: 0.75rem + transition: background 0.3s ease-out + margin: 0 + + &_brand + img + max-width: 15rem + margin: 0 + @media screen and (min-width: 769px) + padding-left: 0 + // margin-left: -16rem + // transform: translateX(50rem) + img + background: transparent !important + + &_center + display: none + @media screen and (min-width: 769px) + display: flex + flex: 1 + align-items: center + justify-content: center + + .follow + flex: initial + + &_hide + @media screen and (min-width: 769px) + display: none + &_close + display: none + +.content, .footer + padding: 1.5rem + @media screen and (min-width: 1441px) + padding: 1.5rem 0 + +.content + padding-top: 5rem + @include content + +.footer + // border-top: 1px solid $xhaze + background: var(--footer-bg) + margin-top: 2rem + font-size: 0.9rem + &_inner + @include content + display: grid + grid-template-columns: 4rem 1fr + align-items: center + position: relative + +.button + background-color: $theme + color: $light + display: inline-flex + padding: 0.5rem 1.5rem + text-transform: uppercase + border: 1px solid $theme + border-radius: 1.5rem + font-size: 0.9rem + align-items: center + user-select: none + &:hover, &:focus + background-color: darken($theme, 20%) + color: $light + border: 1px solid darken($theme, 20%) + + &_translucent + background-color: rgba($theme, 0.15) + color: $theme + border: 1px solid transparent + &_tally + padding: 0 0.75rem + border-radius: 0.5rem + background-color: $theme + display: inline-flex + justify-content: center + align-items: center + color: $light + margin: 0.1rem 0 0.1rem 0.2rem + font-size: 0.7rem + + +.post + &_link, &_title + margin-bottom: 0 + &s + margin-top: 2rem + &_header + height: 50vh + max-height: 35rem + background-color: $bg + // background-image: url(/images/island.jpg) + background-size: cover + background-position: center + margin-top: 4.2rem + @media screen and (max-width: 992px) + height: 40vh + margin-top: 3rem + @media screen and (max-width: 667px) + height: 30vh + & + .content + padding-top: 0 + &_item + // box-shadow: 0 2.25rem 1.25rem -1.25rem var(--shadow) + margin-bottom: 3rem + border-radius: 0.5rem + background: var(--post-bg) + &_tag + padding: 0.2rem 0.8rem + font-size: 0.8rem + &s + display: none + &.jswidgetopen + display: initial + position: fixed + top: 0 + left: 0 + height: 100vh + overflow-y: auto + width: 100vw + padding: 5rem 1.5rem + background: var(--translucent-light) + cursor: pointer + z-index: 999 + overflow-y: auto + &_toggle + margin-top: 0.5rem + margin-left: 0.5rem + cursor: pointer + &_tag, &_share + margin: 0.5rem + &_share + display: inline-flex + &_meta + display: inline-flex + flex-flow: row wrap + align-items: center + .button + margin-bottom: 0 + &_date + margin-right: 0.5rem + margin-left: 0.25rem + &_content + a + color: $theme + ul, ol + list-style: initial + padding: 0.5rem 1.25rem + li + padding-top: 0.25rem + ol + list-style: decimal + +.scrollable + display: grid + width: 100% + max-width: 100% + overflow-x: auto + +.to-top + position: fixed + bottom: 2rem + @media screen and (max-width: 667px) + bottom: 2.25rem + right: 1.5rem + height: 2.25rem + width: 2.25rem + background-color: $theme + display: flex + align-items: center + justify-content: center + border: none + -webkit-appearance: none + border-radius: 50% + color: $light !important + text-decoration: none !important + font-size: 1.25rem + cursor: pointer + &, &:focus + outline: none + +.mb-0 + margin-bottom: 0 !important + +.tag + &s + &_list + cursor: initial + background: var(--choice-bg) + padding: 4.5rem 1.5rem 1.5rem 1.5rem + border-radius: 1rem + max-width: 720px + margin: 0 auto + box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.12) + position: relative + display: flex + flex-flow: row wrap + &_nav + position: relative + &_hide + position: absolute + top: 1rem + right: 1.5rem + padding: 0.5rem + border-radius: 50% + cursor: pointer + @media screen and (min-width: 992px) + display: none + &_sort + font-size: 1rem + color: var(--light) + background: var(--theme) + position: absolute + top: 1.5rem + left: 1.5rem + border-radius: 1.5rem + padding: 0.1rem + &, span + user-select: none + span + display: inline-flex + justify-content: center + align-items: center + height: 2rem + position: relative + z-index: 5 + cursor: pointer + width: 5rem + font-weight: 500 + &::before + content: "" + position: absolute + width: 4.5rem + top: 0.25rem + bottom: 0.25rem + left: 0.25rem + z-index: 3 + background: var(--bg) + opacity: 0.5 + border-radius: 1.5rem + transition: 0.25s transform var(--ease) + &.sorted + &::before + transform: translateX(5rem) + &-title + border-bottom: none !important + display: inline-block !important + position: relative + font-size: 2rem + margin-bottom: -1rem + &::after + content: attr(data-count) + margin-left: 1.5rem + background-color: #eee + padding: 0.25rem 1rem + border-radius: 15% + font-size: 1.5rem + +.icon + display: inline-flex + justify-content: center + align-items: center + margin: 0 0.5rem + &, img, svg + width: 1.1rem + height: 1.1rem + &_2 + width: 2.2rem + height: 2.2rem +.link + opacity: 0 + position: relative + &_yank + opacity: 1 + &ed + position: absolute + right: -1rem + top: -2rem + background-color: $theme + color: $light + width: 7rem + padding: 0.25rem 0.5rem + font-size: 0.9rem + border-radius: 1rem + text-align: center + &::after + position: absolute + top: 1rem + content: "" + border-color: $theme transparent + border-style: solid + border-width: 1rem 1rem 0 1rem + height: 0 + width: 0 + transform-origin: 50% 50% + transform: rotate(145deg) + right: 0.45rem + +.excerpt + &_header, &_footer + padding: 1rem + &_footer + padding: 0 1rem 2.25rem 1rem + &_thumbnail + min-height: 10rem + display: none + @media screen and (min-width: 769px) + display: block + border-radius: 0.5rem + &_footer + &.partition + display: grid + @media screen and (min-width: 769px) + grid-template-columns: 2fr 7fr + grid-gap: 1rem +.sidebar + &_inner + position: relative + &::before + content: "" + padding: 0.5px + top: 0 + bottom: 0 + // background: var(--light) + background: linear-gradient(to bottom, var(--haze), var(--light), var(--haze)) + position: absolute + left: -2rem + // display: none + +.pagination + display: flex + +.page + &-item + padding: 0.2rem + &.disabled + opacity: 0.7 + &:first-child, &:last-child + display: none + &.active a + background-color: darken($theme, 20%) + &-link + padding: 0.25rem 0.75rem + background-color: $theme + color: $light + border-radius: 1rem + + +.float + &_left + float: left + margin-right: 1rem + + p + padding-top: 0 + &_right + float: right + margin-left: 1rem + &_left, &_right + &::after + clear: both + +.follow + display: flex + align-items: center + flex: 1 + justify-content: flex-end + svg + fill: $haze + margin-left: 0.75rem + +.img + &_alt + font-style: italic + padding-top: 0rem + opacity: 0.67 + font-size: 0.9rem + +.to + &_top + background-color: $theme + width: 2.75rem + height: 2.75rem + display: flex + justify-content: center + align-items: center + cursor: pointer + border-radius: 50% + position: fixed + bottom: 1.5rem + right: 1.5rem + z-index: 99 + &.ios + position: absolute + bottom: 0.75rem + right: 0 + &:hover + background-color: $theme + svg + fill: $light + opacity: 0.5 + transition: 0.3s opacity var(--ease) + + &:hover svg + opacity: 1 + +.color + &_mode + // width: 3rem + height: 1.5rem + display: grid + align-items: center + margin: 0 0.5rem + @media screen and (min-width: 769px) + margin: 0 1.5rem + grid-template-columns: 1fr + + &_choice + width: 3rem + background-color: var(--translucent-light) + border-radius: 1rem + height: 1.5rem + outline: none + border: none + -webkit-appearance: none + cursor: pointer + position: relative + position: relative + overflow: hidden + box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.15) + &::after + content: "" + position: absolute + top: 0.1rem + left: 0.1rem + width: 1.3rem + height: 1.3rem + background-image: url("#{$images}sun.svg") + background-position: center + background-size: cover + border-radius: 50% + z-index: 2 + &_animate + transition: transform 0.5s cubic-bezier(0.075, 0.82, 0.165, 1) + &::after + transition: transform 0.5s cubic-bezier(.19,1,.22,1) + will-change: transform + + +.taxonomy + text-transform: capitalize + +.image + &-scale + position: fixed + z-index: 999999 + left: 0 + right: 0 + height: 100vh + top: 0 + padding: 1.5rem + background-color: var(--bg) + display: grid + align-items: center + overflow: auto + &-scale &-scalable + background-color: var(--text) + &-scalable + cursor: pointer + transition: transform 0.3s var(--ease) + &_featured + display: block + margin-left: auto !important + margin-right: auto !important \ No newline at end of file diff --git a/assets/sass/_custom.sass b/assets/sass/_custom.sass new file mode 100644 index 0000000..6055fc5 --- /dev/null +++ b/assets/sass/_custom.sass @@ -0,0 +1 @@ +// add custom sass in this file \ No newline at end of file diff --git a/assets/sass/_fonts.sass b/assets/sass/_fonts.sass new file mode 100644 index 0000000..3d3351b --- /dev/null +++ b/assets/sass/_fonts.sass @@ -0,0 +1,55 @@ +@font-face + font-family: 'Metropolis' + font-style: normal + font-weight: 200 + src: local('Metropolis Extra Light'), local('Metropolis-Light'), url('#{$font-path}/Metropolis-ExtraLight.woff2') format('woff2'), url('#{$font-path}/Metropolis-ExtraLight.woff') format('woff') + font-display: swap + +@font-face + font-family: 'Metropolis' + font-style: italic + font-weight: 200 + src: local('Metropolis Extra Light Italic'), local('Metropolis-ExtraLightItalic'), url('#{$font-path}/Metropolis-ExtraLightItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-ExtraLightItalic.woff') format('woff') + font-display: swap + +@font-face + font-family: 'Metropolis' + font-style: normal + font-weight: 300 + src: local('Metropolis Light'), local('Metropolis-Light'), url('#{$font-path}/Metropolis-Light.woff2') format('woff2'), url('#{$font-path}/Metropolis-Light.woff') format('woff') + font-display: swap + +@font-face + font-family: 'Metropolis' + font-style: italic + font-weight: 300 + src: local('Metropolis Light Italic'), local('Metropolis-LightItalic'), url('#{$font-path}/Metropolis-LightItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-LightItalic.woff') format('woff') + font-display: swap + +@font-face + font-family: 'Metropolis' + font-style: normal + font-weight: 400 + src: local('Metropolis Regular'), local('Metropolis-Regular'), url('#{$font-path}/Metropolis-Regular.woff2') format('woff2'), url('#{$font-path}/Metropolis-Regular.woff') format('woff') + font-display: swap + +@font-face + font-family: 'Metropolis' + font-style: italic + font-weight: 400 + src: local('Metropolis Regular Italic'), local('Metropolis-RegularItalic'), url('#{$font-path}/Metropolis-RegularItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-RegularItalic.woff') format('woff') + font-display: swap + +@font-face + font-family: 'Metropolis' + font-style: normal + font-weight: 500 + src: local('Metropolis Medium'), local('Metropolis-Medium'), url('#{$font-path}/Metropolis-Medium.woff2') format('woff2'), url('#{$font-path}/Metropolis-Medium.woff') format('woff') + font-display: swap + +@font-face + font-family: 'Metropolis' + font-style: italic + font-weight: 500 + src: local('Metropolis Medium Italic'), local('Metropolis-MediumItalic'), url('#{$font-path}/Metropolis-MediumItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-MediumItalic.woff') format('woff') + font-display: swap diff --git a/assets/sass/_mobile.sass b/assets/sass/_mobile.sass new file mode 100644 index 0000000..51e2dd3 --- /dev/null +++ b/assets/sass/_mobile.sass @@ -0,0 +1,78 @@ +@media screen and (max-width: 769px) + .nav + // padding-bottom: 2rem + &, &_body + flex-direction: column + &_body + position: fixed + width: 90% + max-width: 16.5rem + top: 0 + bottom: 0 + background-color: $bg + transition: transform 0.3s var(--easing) + &_right + transform: translateX(100vw) + right: 0 + &_left + transform: translateX(-100vw) + left: 0 + + &_close + width: 3rem + position: absolute + right: -4rem + top: 0 + bottom: 0 + cursor: pointer + z-index: 1000 + display: grid + place-items: center + svg + width: 1.25rem + fill: var(--light) + height: 1.25rem + display: none + &:first-child + display: initial + &.isopen + display: none + + svg + display: initial + + &_brand + position: relative + z-index: 999 + width: calc(100% - 3rem) + padding-left: 0 + + &_parent + display: grid + &_sub + position: relative + top: initial + padding-top: 0 + + .jsopen + &::after + content: "" + position: fixed + z-index: 2 + background-color: rgba(0,0,0,0.3) + top: 0 + left: 0 + right: 0 + bottom: 0 + .nav + &_body + transform: translateX(0) + padding-left: 1.5rem + padding-right: 1.5rem + &_parent + &:first-child + margin-top: 4.4rem + + .follow + justify-content: flex-start + flex: initial + margin-top: 0.75rem diff --git a/assets/sass/_syntax.sass b/assets/sass/_syntax.sass new file mode 100644 index 0000000..90a604e --- /dev/null +++ b/assets/sass/_syntax.sass @@ -0,0 +1,236 @@ +@keyframes pulse + 0% + opacity: 1 + 75% + opacity: 0.1 + 100% + opacity: 1 + +code + font-size: 15px + font-weight: 400 + overflow-y: hidden + display: block + font-family: 'Monaco', monospace + word-break: break-all + &.noClass + --inlineColor: rgb(194, 29, 0) + color: var(--inlineColor) + display: inline + line-break: anywhere +.windows .highlight + overflow-x: hidden + &:hover + overflow-x: auto + +.highlight + display: grid + width: 100% + border-radius: 0 0.2rem 0.2rem 0 + overflow-x: auto + // @media screen and (min-width: 1240px) + // overflow-x: hidden + // &:hover + // overflow-x: auto + position: relative + &_wrap + background: var(--code-bg) !important + border-radius: 0.5rem + position: relative + padding: 0 1rem + margin: 1.5rem auto 1rem auto + &:hover > div + opacity: 1 + .lang + position: absolute + // background-color: var(--bg) + top: 0 + right: 0 + text-align: right + width: 7.5rem + padding: 0.5rem 1rem + font-style: italic + text-transform: uppercase + font-size: 67% + opacity: 0.5 + color: var(--light) + &:hover .lang + opacity: 0.1 + & & + margin: 0 + pre + color: var(--light) !important + border-radius: 4px + font-family: 'Monaco', monospace + padding-top: 1.5rem + padding-bottom: 2rem + + table + display: grid + max-width: 100% + margin-bottom: 0 + background: transparent + td, th + padding: 0 + + .lntd + width: 100% + border: none + &:first-child + &, pre + width: 2.5rem !important + padding-left: 0 + padding-right: 0 + color: rgba(255,255,255,0.5) + user-select: none + + pre + width: 100% + display: flex + align-items: center + flex-direction: column + +.err + color: #a61717 + background-color: #e3d2d2 +.hl + width: 100% + background-color: rgba(255,255,255,0.25) +.ln, .lnt + margin-right: 0.75rem + padding: 0 + transition: opacity 0.3s var(--ease) + &, span + color: #666 + +.k, .kc, .kd, .kn, .kp, .kr, .kt, .nt + color: #6ab825 + font-weight: 500 + +.kn, .kp + font-weight: 400 + +.nb, .no, .nv + color: #24909d + +.nc, .nf, .nn + color: #447fcf + +.s, .sa, .sb, .sc, .dl, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss + color: #ed9d13 + +.m, .mb, .mf, .mh, .mi, .il, .mo + color: #3677a9 + +.ow + color: #6ab825 + font-weight: 500 + +.c, .ch, .cm, .c1 + color: #999 + font-style: italic + +.cs + color: #e50808 + background-color: #520000 + font-weight: 500 + +.cp, .cpf + color: #cd2828 + font-weight: 500 + +.gd, .gr + color: #d22323 + +.ge + font-style: italic + +.gh, .gu, .nd, .na, .ne + color: #ffa500 + font-weight: 500 + +.gi + color: #589819 + +.go + color: #ccc + +.gp + color: #aaa + +.gs + font-weight: 500 + +.gt + color: #d22323 +.w + color: #666 + +.hljs + &-string + color: #6ab825 + + &-attr + color: #ed9d13 + + .p &-attr + color: var(--light) + +.pre + &_wrap + white-space: pre-wrap + white-space: -moz-pre-wrap + white-space: -pre-wrap + white-space: -o-pre-wrap + word-wrap: break-word + + &_nolines.ln + display: none + +// crayon-like widget styles +.panel + &_box + display: inline-flex + // grid-template-columns: repeat(3, 1fr) + // max-width: 10rem + perspective: 300px + grid-gap: 0.5rem + transition: opacity 0.3s var(--easing) + background: var(--code-bg) + padding: 0.5rem 1.5rem + border-radius: 2rem + align-items: center + position: absolute + right: 0rem + top: -2.1rem + opacity: 0 + &_icon + display: inline-flex + align-items: center + justify-content: center + cursor: pointer + // transition: opacity 0.3s var(--easing) + padding: 0.1rem + transform-origin: 50% 50% + // opacity: 0.7 + &.active + animation: pulse 0.1s linear + svg + fill: var(--light) + width: 1.5rem + height: 1.5rem + &_hide + // hide icon if not needed + display: none + &_from + position: absolute + color: var(--theme) + bottom: 0 + font-size: 1.5rem + font-weight: 500 + padding: 0.5rem 0 + cursor: pointer + letter-spacing: 0.1px + z-index: 19 + &_expanded &_from + display: none diff --git a/assets/sass/_utils.sass b/assets/sass/_utils.sass new file mode 100644 index 0000000..001e980 --- /dev/null +++ b/assets/sass/_utils.sass @@ -0,0 +1,64 @@ +@for $i from 1 through 2 + $size: $i * 1.5rem + $x-size: $size * 0.5 + .pt-#{$i} + padding-top: $size + + .pb-#{$i} + padding-bottom: $size + + .mt-#{$i} + margin-top: $size + + .mb-#{$i} + margin-bottom: $size + +.flex + display: flex + flex-direction: column + align-items: center + +.shadow + box-shadow: 0 0 60px rgba(0, 0, 0, 0.17) + + +@media screen and (min-width: 42rem) + %grid + display: grid + grid-template-columns: 1fr + + [class*='grid-'] + grid-gap: 2rem + + .grid-2, .grid-3, .grid-4, .grid-auto, .grid-inverse + @extend %grid + .grid-inverse + grid-template-columns: 70% 1fr + grid-column-gap: 4rem + .grid-2 + grid-template-columns: 1fr 1fr + .grid-3 + grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)) + .grid-4 + grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)) + +$sites: ("facebook": #325c94, "twitter": #00abdc,"linkedin": #007bb6) + +@each $item, $color in $sites + .#{$item} + svg + fill: $color + +// 404 page +.never + height: 75vh + display: flex + justify-content: center + align-items: center + flex-direction: column + padding: 1.5rem + text-align: center + +.inline + display: inline + margin: 0 diff --git a/assets/sass/_variables.sass b/assets/sass/_variables.sass new file mode 100644 index 0000000..d9646fe --- /dev/null +++ b/assets/sass/_variables.sass @@ -0,0 +1,118 @@ +$font-path: '../fonts' +$icons: '../icons/' +$images: '../images/' + +$light: #fff +$haze: #fafafa +$xhaze: darken($haze, 11%) +$bg: #002538 +$theme: #0077b8 + +@mixin content() + --maxWidth: 1440px + max-width: var(--maxWidth) + margin-left: auto + margin-right: auto + +@mixin viewport($width: 1024px, $margin: 25px) + max-width: $width + margin: $margin auto + @content + +@mixin shadow($opacity: 0.17) + box-shadow: 0 0 3rem rgba(0,0,0,$opacity) + &:hover + box-shadow: 0 0 5rem rgba(0,0,0, (1.5 * $opacity)) + +html + --color-mode: 'lit' + --light: #fff + --dark: #000 + --bg: #002538 + --haze: #f2f2f2 + --gray: #020202 + --accent: var(--gray) + --text: #575757 + --header-text: var(--dark) + --font: 'Metropolis', sans-serif + --theme: #0077b8 + --ease: cubic-bezier(.19,1,.22,1) + --code-bg: var(--bg) + --table-bg: var(--light) + --table-haze: var(--haze) + --table-border: #dedede + --footer-bg: var(--haze) + --shadow: rgba(0,0,0,0.12) + --translucent: rgba(0,0,0,0.05) + --translucent-light: rgba(255,255,255,0.05) + --post-bg: var(--light) + --choice-bg: var(--haze) + --ease: cubic-bezier(0.39, 0.575, 0.565, 1) + --easing: cubic-bezier(.19,1,.22,1) + &.page + --choice-bg: var(--light) + @mixin darkmode + --color-mode: 'dim' + --text: var(--light) + --accent: var(--bubble) + --choice-bg: var(--bg) + --code-bg: var(--translucent-light) + --header-text: var(--light) + --table-bg: var(--code-bg) + --table-haze: rgba(255,255,255,0.1) + --table-border: var(--code-bg) + --footer-bg: var(--bg) + --post-bg: var(--translucent-light) + * + box-shadow: none !important + + + &[data-mode="dim"] + @include darkmode + blockquote + background: var(--translucent-light) + color: #dedede + svg.icon + fill: var(--light) + img:not(.nav_icon):not(.transparent) + // background: var(--light) + .icon + img + background: none + svg + fill: #fafafa + .sidebar + &_inner + &::before + display: none + .color + &_choice + &::after + background-image: url("#{$images}night-moon.jpg") + transform: translateX(1.4rem) + + @media (prefers-color-scheme: dark) + + &:not([data-mode="lit"]) + @include darkmode + blockquote + background: var(--translucent-light) + color: #dedede + svg.icon + fill: var(--light) + img:not(.nav_icon):not(.transparent) + // background: var(--light) + .icon + img + background: none + svg + fill: #fafafa + .sidebar + &_inner + &::before + display: none + .color + &_choice + &::after + background-image: url("#{$images}night-moon.jpg") + transform: translateX(1.4rem) diff --git a/assets/sass/main.sass b/assets/sass/main.sass new file mode 100644 index 0000000..50f7bbe --- /dev/null +++ b/assets/sass/main.sass @@ -0,0 +1,8 @@ +@import 'variables' +@import 'fonts' +@import 'base' +@import 'components' +@import 'utils' +@import 'mobile' +@import 'syntax' +@import 'custom' diff --git a/exampleSite/LICENSE b/exampleSite/LICENSE new file mode 100644 index 0000000..4527efb --- /dev/null +++ b/exampleSite/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +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. \ No newline at end of file diff --git a/exampleSite/README.md b/exampleSite/README.md new file mode 100644 index 0000000..712626b --- /dev/null +++ b/exampleSite/README.md @@ -0,0 +1,23 @@ +# hugoBasicExample + +This repository offers an example site for [Hugo](https://gohugo.io/) and also it provides the default content for demos hosted on the [Hugo Themes Showcase](https://themes.gohugo.io/). + +# Using + +1. [Install Hugo](https://gohugo.io/overview/installing/) +2. Clone this repository +```bash +git clone https://github.com/gohugoio/hugoBasicExample.git +cd hugoBasicExample +``` +3. Clone the repository you want to test. If you want to test all Hugo Themes then follow the instructions provided [here](https://github.com/gohugoio/hugoThemes#installing-all-themes) +4. Run Hugo and select the theme of your choosing +```bash +hugo server -t YOURTHEME +``` +5. Under `/content/` this repository contains the following: +- A section called `/post/` with sample markdown content +- A headless bundle called `homepage` that you may want to use for single page applications. You can find instructions about headless bundles over [here](https://gohugo.io/content-management/page-bundles/#headless-bundle) +- An `about.md` that is intended to provide the `/about/` page for a theme demo +6. If you intend to build a theme that does not fit in the content structure provided in this repository, then you are still more than welcome to submit it for review at the [Hugo Themes](https://github.com/gohugoio/hugoThemes/issues) respository + diff --git a/exampleSite/archetypes/post.md b/exampleSite/archetypes/post.md new file mode 100644 index 0000000..05b05d7 --- /dev/null +++ b/exampleSite/archetypes/post.md @@ -0,0 +1,22 @@ +--- +title: "{{ replace .Name "-" " " | title }}" # Title of the blog post. +date: {{ .Date }} # Date of post creation. +description: "Article description." # Description used for search engine. +featured: true # Sets if post is a featured post, making appear on the home page side bar. +draft: true # Sets whether to render this page. Draft of true will not be rendered. +toc: false # Controls if a table of contents should be generated for first-level links automatically. +# menu: main +featureImage: "/images/path/file.jpg" # Sets featured image on blog post. +thumbnail: "/images/path/thumbnail.png" # Sets thumbnail image appearing inside card on homepage. +shareImage: "/images/path/share.png" # Designate a separate image for social media sharing. +codeMaxLines: 10 # Override global value for how many lines within a code block before auto-collapsing. +codeLineNumbers: false # Override global value for showing of line numbers within code block. +figurePositionShow: true # Override global value for showing the figure label. +categories: + - Technology +tags: + - Tag_name1 + - Tag_name2 +--- + +**Insert Lead paragraph here.** \ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml new file mode 100644 index 0000000..4f58560 --- /dev/null +++ b/exampleSite/config.toml @@ -0,0 +1,59 @@ +# set `baseurl` to your root domain +# if you set it to "/" share icons won't work properly on production +baseurl = "https://example.com/" # Include trailing slash +title = "Clarity" +author = "Jane Doe" +copyright = "Copyright © 2008–2018, Steve Francia and the Hugo Authors; all rights reserved." +# canonifyurls = true +paginate = 10 +theme = "hugo-clarity" + +[markup] + [markup.highlight] + codeFences = true + guessSyntax = true + hl_Lines = "--" + lineNoStart = 1 + lineNos = true # always set to true # else line numbers won't show at all! even when you toggle them on in the UI + lineNumbersInTable = false + noClasses = false + # style = "monokai" + tabWidth = 2 + +[params] +author = "Jane Doe" +twitter = "@janedoe" +largeTwitterCard = false # set to true if you want to show a large twitter card image. The default is a small twitter card image +introDescription = "Technologist, perpetual student, teacher, continual incremental improvement." + +# Google analytics Id +ga_analytics = "XXXXXXXXXX" + +# limit the number of taxonomies links shown on the sidebar of each page by default. +numberOfTagsShown = 14 # Applies for all other default & custom taxonomies. e.g categories, brands see https://gohugo.io/content-management/taxonomies#what-is-a-taxonomy + +# will be used on share >> twitter, facebook, linkedin +fallBackOgImage = "images/thumbnail.png" + +# sets the maximum number of lines per codeblock. The codeblock will however be scrollable and expandable. +codeMaxLines = 7 + +# disable showing line numbers by default. Switch to `true` if you'd rather have them on. +codeLineNumbers = false + + +# directory(s) where your articles are located +mainSections = ["post"] # see config details here https://gohugo.io/functions/where/#mainsections + +# center logo on navbar +centerLogo = false # Set to "true" for centering or "false" for left aligned. + +logo = "logos/logo.png" + +# Label Non inline images on an article body +figurePositionShow = false # toggle on or off globally +# you can toggle this behaviour on or off on per page using the same variable inside your articles frontmatter +figurePositionLabel = "Figure" # the text before image number e.g Figure 1.0 + +# Set the collapsed mobile navigation to either appear from the left or the right +mobileNavigation = "left" # if you prefer right change to 'right' diff --git a/exampleSite/configTaxo.toml b/exampleSite/configTaxo.toml new file mode 100644 index 0000000..a6acc92 --- /dev/null +++ b/exampleSite/configTaxo.toml @@ -0,0 +1,28 @@ +timeout = 30000 +enableInlineShortcodes = true +footnoteReturnLinkContents = "^" + +[taxonomies] +category = "categories" +tag = "tags" +series = "series" + +[privacy] + +[privacy.vimeo] +disabled = false +simple = true + +[privacy.twitter] +disabled = false +enableDNT = true +simple = true +disableInlineCSS = true + +[privacy.instagram] +disabled = false +simple = true + +[privacy.youtube] +disabled = false +privacyEnhanced = true \ No newline at end of file diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md new file mode 100644 index 0000000..ed6494b --- /dev/null +++ b/exampleSite/content/_index.md @@ -0,0 +1,3 @@ ++++ +author = "Hugo Authors" ++++ diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md new file mode 100644 index 0000000..f49aec5 --- /dev/null +++ b/exampleSite/content/about.md @@ -0,0 +1,25 @@ ++++ +title = "About" +description = "Hugo, the world's fastest framework for building websites" +date = "2019-02-28" +aliases = ["about-us", "about-hugo", "contact"] +author = "Hugo Authors" ++++ + +Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. + +Hugo makes use of a variety of open source projects including: + +* https://github.com/yuin/goldmark +* https://github.com/alecthomas/chroma +* https://github.com/muesli/smartcrop +* https://github.com/spf13/cobra +* https://github.com/spf13/viper + +Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. + +Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. + +Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. + +Learn more and contribute on [GitHub](https://github.com/gohugoio). diff --git a/exampleSite/content/archives.md b/exampleSite/content/archives.md new file mode 100644 index 0000000..db16eed --- /dev/null +++ b/exampleSite/content/archives.md @@ -0,0 +1,5 @@ +--- +date: 2019-05-28 +type: section +layout: "archives" +--- diff --git a/exampleSite/content/homepage/about.md b/exampleSite/content/homepage/about.md new file mode 100644 index 0000000..b5d6981 --- /dev/null +++ b/exampleSite/content/homepage/about.md @@ -0,0 +1,7 @@ +--- +title: 'Our Difference' +button: 'About us' +weight: 2 +--- + +Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. Ipsum dolor sit amet, et essent mediocritatem quo. diff --git a/exampleSite/content/homepage/index.md b/exampleSite/content/homepage/index.md new file mode 100644 index 0000000..ca03031 --- /dev/null +++ b/exampleSite/content/homepage/index.md @@ -0,0 +1,3 @@ +--- +headless: true +--- diff --git a/exampleSite/content/homepage/work.md b/exampleSite/content/homepage/work.md new file mode 100644 index 0000000..f99bc99 --- /dev/null +++ b/exampleSite/content/homepage/work.md @@ -0,0 +1,7 @@ +--- +title: 'We Help Business Grow' +button: 'Our Work' +weight: 1 +--- + +Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. Numquam dolores mel eu, mea docendi omittantur et, mea ea duis erat. Elit melius cu ius. Per ex novum tantas putant, ei his nullam aliquam apeirian. Aeterno quaestio constituto sea an, no eum intellegat assueverit. diff --git a/exampleSite/content/post/_index.md b/exampleSite/content/post/_index.md new file mode 100644 index 0000000..8a084d9 --- /dev/null +++ b/exampleSite/content/post/_index.md @@ -0,0 +1,6 @@ ++++ +aliases = ["posts", "articles", "blog", "showcase", "docs"] +title = "Posts" +author = "Hugo Authors" +tags = ["index"] ++++ diff --git a/exampleSite/content/post/emoji-support.md b/exampleSite/content/post/emoji-support.md new file mode 100644 index 0000000..dc3589a --- /dev/null +++ b/exampleSite/content/post/emoji-support.md @@ -0,0 +1,46 @@ ++++ +author = "Hugo Authors" +title = "Emoji Support" +date = "2019-03-05" +description = "Guide to emoji usage in Hugo" +tags = [ + "emoji", +] ++++ + +Emoji can be enabled in a Hugo project in a number of ways. + +The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). + +To enable emoji globally, set `enableEmoji` to `true` in your site's [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. + +

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

+
+ +The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. + +*** + +**N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. + +{{< highlight html >}} +.emoji { + font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols; +} +{{< /highlight >}} + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/exampleSite/content/post/markdown-syntax.md b/exampleSite/content/post/markdown-syntax.md new file mode 100644 index 0000000..e100f02 --- /dev/null +++ b/exampleSite/content/post/markdown-syntax.md @@ -0,0 +1,153 @@ ++++ +author = "Hugo Authors" +title = "Markdown Syntax Guide" +date = "2019-03-11" +description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." +featured = true +tags = [ + "markdown", + "css", + "html", + "themes", + "featured" +] +categories = [ + "themes", + "syntax", +] +series = ["Themes Guide"] +aliases = ["migrate-from-jekyl"] +thumbnail = "images/building.png" ++++ + +This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. + + +## Headings + +The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. + +# H1 +## H2 +### H3 +#### H4 +##### H5 +###### H6 + +## Paragraph + +Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. + +Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. + +## Blockquotes + +The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. + +#### Blockquote without attribution + +> Tiam, ad mint andaepu dandae nostion secatur sequo quae. +> **Note** that you can use *Markdown syntax* within a blockquote. + +#### Blockquote with attribution + +> Don't communicate by sharing memory, share memory by communicating.
+> — Rob Pike[^1] + +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. + +## Tables + +Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. + + Name | Age +--------|------ + Bob | 27 + Alice | 23 + +#### Inline Markdown within tables + +| Italics | Bold | Code | +| -------- | -------- | ------ | +| *italics* | **bold** | `code` | + +## Code Blocks + +#### Code block with backticks + +```html + + + + + Example HTML5 Document + + +

Test

+ + + +``` + +#### Code block indented with four spaces + + + + + + Example HTML5 Document + + +

Test

+ + + +#### Code block with Hugo's internal highlight shortcode +{{< highlight html >}} + + + + + Example HTML5 Document + + +

Test

+ + +{{< /highlight >}} + +## List Types + +#### Ordered List + +1. First item +2. Second item +3. Third item + +#### Unordered List + +* List item +* Another item +* And another item + +#### Nested list + +* Fruit + * Apple + * Orange + * Banana +* Dairy + * Milk + * Cheese + +## Other Elements — abbr, sub, sup, kbd, mark + +GIF is a bitmap image format. + +H2O + +Xn + Yn = Zn + +Press CTRL+ALT+Delete to end the session. + +Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. diff --git a/exampleSite/content/post/math-typesetting.md b/exampleSite/content/post/math-typesetting.md new file mode 100644 index 0000000..48fdc79 --- /dev/null +++ b/exampleSite/content/post/math-typesetting.md @@ -0,0 +1,49 @@ +--- +author: Hugo Authors +title: Math Typesetting +date: 2019-03-08 +description: A brief guide to setup KaTeX +math: true +--- + +Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. + + +In this example we will be using [KaTeX](https://katex.org/) + +- Create a partial under `/layouts/partials/math.html` +- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. +- Include the partial in your templates like so: + +```bash +{{ if or .Params.math .Site.Params.math }} +{{ partial "math.html" . }} +{{ end }} +``` + +- To enable KaTex globally set the parameter `math` to `true` in a project's configuration +- To enable KaTex on a per page basis include the parameter `math: true` in content files + +**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) + +{{< math.inline >}} +{{ if or .Page.Params.math .Site.Params.math }} + + + + +{{ end }} +{{}} + +### Examples + +{{< math.inline >}} +

+Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) +

+{{}} + +Block math: +$$ + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +$$ diff --git a/exampleSite/content/post/placeholder-text.md b/exampleSite/content/post/placeholder-text.md new file mode 100644 index 0000000..9ed5f69 --- /dev/null +++ b/exampleSite/content/post/placeholder-text.md @@ -0,0 +1,45 @@ ++++ +author = "Hugo Authors" +title = "Placeholder Text" +date = "2019-03-09" +description = "Lorem Ipsum Dolor Si Amet" +tags = [ + "markdown", + "text", +] ++++ + +Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. + +1. Exierant elisi ambit vivere dedere +2. Duce pollice +3. Eris modo +4. Spargitque ferrea quos palude + +Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis. + +1. Comas hunc haec pietate fetum procerum dixit +2. Post torum vates letum Tiresia +3. Flumen querellas +4. Arcanaque montibus omnes +5. Quidem et + +# Vagus elidunt + + + +[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) + +## Mane refeci capiebant unda mulcebat + +Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. + +Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et. + +Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/exampleSite/content/post/rich-content.md b/exampleSite/content/post/rich-content.md new file mode 100644 index 0000000..6c6c60b --- /dev/null +++ b/exampleSite/content/post/rich-content.md @@ -0,0 +1,44 @@ ++++ +author = "Hugo Authors" +title = "Rich Content" +date = "2019-03-10" +description = "A brief description of Hugo Shortcodes" +tags = [ + "shortcodes", + "privacy", +] +thumbnail = "images/dollar.png" + ++++ + +Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. + +--- + +## Instagram Simple Shortcode + +{{< instagram_simple BGvuInzyFAe hidecaption >}} + +
+ +--- + +## YouTube Privacy Enhanced Shortcode + +{{< youtube ZJthWmvUzzc >}} + +
+ +--- + +## Twitter Simple Shortcode + +{{< twitter_simple 1085870671291310081 >}} + +
+ +--- + +## Vimeo Simple Shortcode + +{{< vimeo_simple 48912912 >}} diff --git a/exampleSite/data/menu.yaml b/exampleSite/data/menu.yaml new file mode 100644 index 0000000..7de2c67 --- /dev/null +++ b/exampleSite/data/menu.yaml @@ -0,0 +1,14 @@ +- name: Home + link: / +- name: Archives + link: post/rich-content/ +# - name: Mus +# link: /categories/music/ +- name: Links + submenu: + - name: LinkedIn + link: https://www.linkedin.com/ + - name: Twitter + link: https://twitter.com/ +- name: About + link: about/ diff --git a/exampleSite/data/social.yaml b/exampleSite/data/social.yaml new file mode 100644 index 0000000..331544f --- /dev/null +++ b/exampleSite/data/social.yaml @@ -0,0 +1,9 @@ +- item: "github" + url: "https://github.com/#" +- item: "twitter" + url: "https://twitter.com/#" +- item: "linkedin" + url: "https://www.linkedin.com/in/#" +- item: "rss" + url: "index.xml" + internal: true diff --git a/exampleSite/layouts/.gitkeep b/exampleSite/layouts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/exampleSite/resources/_gen/assets/sass/sass/main.sass_d2bdc985df0e3369a538eb4e858e857f.content b/exampleSite/resources/_gen/assets/sass/sass/main.sass_d2bdc985df0e3369a538eb4e858e857f.content new file mode 100644 index 0000000..62fe4b1 --- /dev/null +++ b/exampleSite/resources/_gen/assets/sass/sass/main.sass_d2bdc985df0e3369a538eb4e858e857f.content @@ -0,0 +1,3 @@ +html{--color-mode: 'lit';--light: #fff;--dark: #000;--bg: #002538;--haze: #f2f2f2;--gray: #020202;--accent: var(--gray);--text: #575757;--header-text: var(--dark);--font: 'Metropolis', sans-serif;--theme: #0077b8;--ease: cubic-bezier(.19,1,.22,1);--code-bg: var(--bg);--table-bg: var(--light);--table-haze: var(--haze);--table-border: #dedede;--footer-bg: var(--haze);--shadow: rgba(0,0,0,0.12);--translucent: rgba(0,0,0,0.05);--translucent-light: rgba(255,255,255,0.05);--post-bg: var(--light);--choice-bg: var(--haze);--ease: cubic-bezier(0.39, 0.575, 0.565, 1);--easing: cubic-bezier(.19,1,.22,1)}html.page{--choice-bg: var(--light)}html[data-mode="dim"]{--color-mode: 'dim';--text: var(--light);--accent: var(--bubble);--choice-bg: var(--bg);--code-bg: var(--translucent-light);--header-text: var(--light);--table-bg: var(--code-bg);--table-haze: rgba(255,255,255,0.1);--table-border: var(--code-bg);--footer-bg: var(--bg);--post-bg: var(--translucent-light)}html[data-mode="dim"] *{box-shadow:none !important}html[data-mode="dim"] blockquote{background:var(--translucent-light);color:#dedede}html[data-mode="dim"] svg.icon{fill:var(--light)}html[data-mode="dim"] .icon img{background:none}html[data-mode="dim"] .icon svg{fill:#fafafa}html[data-mode="dim"] .sidebar_inner::before{display:none}html[data-mode="dim"] .color_choice::after{background-image:url("../images/night-moon.jpg");transform:translateX(1.4rem)}@media (prefers-color-scheme: dark){html:not([data-mode="lit"]){--color-mode: 'dim';--text: var(--light);--accent: var(--bubble);--choice-bg: var(--bg);--code-bg: var(--translucent-light);--header-text: var(--light);--table-bg: var(--code-bg);--table-haze: rgba(255,255,255,0.1);--table-border: var(--code-bg);--footer-bg: var(--bg);--post-bg: var(--translucent-light)}html:not([data-mode="lit"]) *{box-shadow:none !important}html:not([data-mode="lit"]) blockquote{background:var(--translucent-light);color:#dedede}html:not([data-mode="lit"]) svg.icon{fill:var(--light)}html:not([data-mode="lit"]) .icon img{background:none}html:not([data-mode="lit"]) .icon svg{fill:#fafafa}html:not([data-mode="lit"]) .sidebar_inner::before{display:none}html:not([data-mode="lit"]) .color_choice::after{background-image:url("../images/night-moon.jpg");transform:translateX(1.4rem)}}@font-face{font-family:'Metropolis';font-style:normal;font-weight:200;src:local("Metropolis Extra Light"),local("Metropolis-Light"),url("../fonts/Metropolis-ExtraLight.woff2") format("woff2"),url("../fonts/Metropolis-ExtraLight.woff") format("woff");font-display:swap}@font-face{font-family:'Metropolis';font-style:italic;font-weight:200;src:local("Metropolis Extra Light Italic"),local("Metropolis-ExtraLightItalic"),url("../fonts/Metropolis-ExtraLightItalic.woff2") format("woff2"),url("../fonts/Metropolis-ExtraLightItalic.woff") format("woff");font-display:swap}@font-face{font-family:'Metropolis';font-style:normal;font-weight:300;src:local("Metropolis Light"),local("Metropolis-Light"),url("../fonts/Metropolis-Light.woff2") format("woff2"),url("../fonts/Metropolis-Light.woff") format("woff");font-display:swap}@font-face{font-family:'Metropolis';font-style:italic;font-weight:300;src:local("Metropolis Light Italic"),local("Metropolis-LightItalic"),url("../fonts/Metropolis-LightItalic.woff2") format("woff2"),url("../fonts/Metropolis-LightItalic.woff") format("woff");font-display:swap}@font-face{font-family:'Metropolis';font-style:normal;font-weight:400;src:local("Metropolis Regular"),local("Metropolis-Regular"),url("../fonts/Metropolis-Regular.woff2") format("woff2"),url("../fonts/Metropolis-Regular.woff") format("woff");font-display:swap}@font-face{font-family:'Metropolis';font-style:italic;font-weight:400;src:local("Metropolis Regular Italic"),local("Metropolis-RegularItalic"),url("../fonts/Metropolis-RegularItalic.woff2") format("woff2"),url("../fonts/Metropolis-RegularItalic.woff") format("woff");font-display:swap}@font-face{font-family:'Metropolis';font-style:normal;font-weight:500;src:local("Metropolis Medium"),local("Metropolis-Medium"),url("../fonts/Metropolis-Medium.woff2") format("woff2"),url("../fonts/Metropolis-Medium.woff") format("woff");font-display:swap}@font-face{font-family:'Metropolis';font-style:italic;font-weight:500;src:local("Metropolis Medium Italic"),local("Metropolis-MediumItalic"),url("../fonts/Metropolis-MediumItalic.woff2") format("woff2"),url("../fonts/Metropolis-MediumItalic.woff") format("woff");font-display:swap}*{box-sizing:border-box;-webkit-appearance:none;margin:0;padding:0}body,html{scroll-behavior:smooth;font-kerning:normal;-webkit-font-feature-settings:"kern" 1;text-rendering:optimizeLegibility;text-rendering:geometricPrecision;-webkit-text-size-adjust:100%;font-size:100%}body::-webkit-scrollbar-corner,html::-webkit-scrollbar-corner{background-color:transparent}body{font-family:var(--font);background:var(--choice-bg);color:var(--text);font-size:1.1rem;line-height:1.5;max-width:1920px;margin:0 auto;position:relative;font-kerning:normal;display:flex;flex-direction:column;justify-content:space-between;min-height:100vh;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{text-decoration:none;color:inherit}a:focus,a:focus-within{outline:none !important}h1,h2,h3,h4,h5{font-family:inherit;font-weight:300;padding:5px 0;margin:15px 0;color:var(--header-text);line-height:1.35}h1:hover .link,h2:hover .link,h3:hover .link,h4:hover .link,h5:hover .link{opacity:1}h1{font-size:200%;font-weight:400}h2{font-size:175%}h3{font-size:150%}h4{font-size:125%}h5{font-size:120%}h6{font-size:100%}img,svg{max-width:100%;vertical-align:middle}img{height:auto;margin:1rem auto;padding:0}img:focus,img:focus-within{outline:none !important;border:none !important}main{flex:1}ul{list-style:none;-webkit-padding-start:0;-moz-padding-start:0}b,strong,em{font-weight:500}hr{border:none;padding:1px;background:#e7e7e7;opacity:0.5;margin:1rem 0}@media (prefers-color-scheme: dark){hr{background:var(--theme)}}aside h3{position:relative;margin:0 !important}aside ul{list-style:initial;padding-left:1rem}aside li{padding:0.25rem 0}table{width:100%;border-collapse:collapse;background:var(--table-haze);margin-bottom:1.5rem}table:not(.ln-table) t{background:var(--table-bg)}th{text-align:left}td,th{padding:0.5rem 1rem;border:1px solid var(--table-border)}td,th{padding:0.5rem 1rem;text-align:left;font-weight:400}td:not(:first-child),th:not(:first-child){padding-left:1.5rem}th{font-weight:700}tbody{padding:0}tbody tr:nth-child(even){background-color:var(--table-haze)}tbody tr:nth-child(odd){background-color:var(--table-bg)}blockquote{margin:25px auto;padding:1.5rem;color:#555555;padding:1rem 1.5rem;border-left:0.2rem solid #0077b8;position:relative;background:var(--haze)}p{padding:0.8rem 0}.nav{color:#fafafa;display:flex;justify-content:space-between;--maxWidth: 1440px;max-width:var(--maxWidth);margin-left:auto;margin-right:auto}.nav_active{background-color:rgba(255,255,255,0.05)}.nav_icon{width:0.7rem;margin-left:0.33rem;transition:transform 0.3s var(--ease);transform-origin:50% 50%}.nav_body{display:flex;flex:1}.nav_header{background-color:#002538;padding:0 1.5rem;position:fixed;width:100%;z-index:99;left:0}.nav_item{padding:0.5rem 1rem;display:inline-flex;align-items:center}.nav_sub{position:absolute;z-index:20;border-radius:0 0 0.5rem 0.5rem;top:3rem;transition:height 0.3s ease-in-out;height:0;overflow:hidden;padding:0.96rem 0 0;background:transparent}.nav_parent{position:relative;display:flex;align-items:center;margin:0.25rem 0;border-radius:0.5rem}.nav_open+.nav_sub{height:initial;z-index:999}@media screen and (min-width: 769px){.nav_open+.nav_sub{background-color:#002538;min-width:20.5rem;box-shadow:0 0.25rem 0.5rem rgba(0,0,0,0.17)}}.nav_open .nav_icon{transform:rotate(180deg)}.nav_sub .nav_item{position:relative;z-index:5;display:block;padding-top:0.75rem;padding-bottom:0.75rem;transition:background 0.3s ease-out;margin:0}.nav_brand img{max-width:15rem;margin:0}@media screen and (min-width: 769px){.nav_brand{padding-left:0}.nav_brand img{background:transparent !important}}.nav_center{display:none}@media screen and (min-width: 769px){.nav_center{display:flex;flex:1;align-items:center;justify-content:center}.nav_center+.follow{flex:initial}}@media screen and (min-width: 769px){.nav_hide{display:none}}.nav_close{display:none}.content,.footer{padding:1.5rem}@media screen and (min-width: 1441px){.content,.footer{padding:1.5rem 0}}.content{padding-top:5rem;--maxWidth: 1440px;max-width:var(--maxWidth);margin-left:auto;margin-right:auto}.footer{background:var(--footer-bg);margin-top:2rem;font-size:0.9rem}.footer_inner{--maxWidth: 1440px;max-width:var(--maxWidth);margin-left:auto;margin-right:auto;display:grid;grid-template-columns:4rem 1fr;align-items:center;position:relative}.button{background-color:#0077b8;color:#fff;display:inline-flex;padding:0.5rem 1.5rem;text-transform:uppercase;border:1px solid #0077b8;border-radius:1.5rem;font-size:0.9rem;align-items:center;user-select:none}.button:hover,.button:focus{background-color:#003552;color:#fff;border:1px solid #003552}.button_translucent{background-color:rgba(0,119,184,0.15);color:#0077b8;border:1px solid transparent}.button_tally{padding:0 0.75rem;border-radius:0.5rem;background-color:#0077b8;display:inline-flex;justify-content:center;align-items:center;color:#fff;margin:0.1rem 0 0.1rem 0.2rem;font-size:0.7rem}.post_link,.post_title{margin-bottom:0}.posts{margin-top:2rem}.post_header{height:50vh;max-height:35rem;background-color:#002538;background-size:cover;background-position:center;margin-top:4.2rem}@media screen and (max-width: 992px){.post_header{height:40vh;margin-top:3rem}}@media screen and (max-width: 667px){.post_header{height:30vh}}.post_header+.content{padding-top:0}.post_item{margin-bottom:3rem;border-radius:0.5rem;background:var(--post-bg)}.post_tag{padding:0.2rem 0.8rem;font-size:0.8rem}.post_tags{display:none}.post_tags.jswidgetopen{display:initial;position:fixed;top:0;left:0;height:100vh;overflow-y:auto;width:100vw;padding:5rem 1.5rem;background:var(--translucent-light);cursor:pointer;z-index:999;overflow-y:auto}.post_tags_toggle{margin-top:0.5rem;margin-left:0.5rem;cursor:pointer}.post_tag,.post_share{margin:0.5rem}.post_share{display:inline-flex}.post_meta{display:inline-flex;flex-flow:row wrap;align-items:center}.post_meta .button{margin-bottom:0}.post_date{margin-right:0.5rem;margin-left:0.25rem}.post_content a{color:#0077b8}.post_content ul,.post_content ol{list-style:initial;padding:0.5rem 1.25rem}.post_content ul li,.post_content ol li{padding-top:0.25rem}.post_content ol{list-style:decimal}.scrollable{display:grid;width:100%;max-width:100%;overflow-x:auto}.to-top{position:fixed;bottom:2rem;right:1.5rem;height:2.25rem;width:2.25rem;background-color:#0077b8;display:flex;align-items:center;justify-content:center;border:none;-webkit-appearance:none;border-radius:50%;color:#fff !important;text-decoration:none !important;font-size:1.25rem;cursor:pointer}@media screen and (max-width: 667px){.to-top{bottom:2.25rem}}.to-top,.to-top:focus{outline:none}.mb-0{margin-bottom:0 !important}.tags_list{cursor:initial;background:var(--choice-bg);padding:4.5rem 1.5rem 1.5rem 1.5rem;border-radius:1rem;max-width:720px;margin:0 auto;box-shadow:0 0.5rem 1.5rem rgba(0,0,0,0.12);position:relative;display:flex;flex-flow:row wrap}.tags_nav{position:relative}.tags_hide{position:absolute;top:1rem;right:1.5rem;padding:0.5rem;border-radius:50%;cursor:pointer}@media screen and (min-width: 992px){.tags_hide{display:none}}.tags_sort{font-size:1rem;color:var(--light);background:var(--theme);position:absolute;top:1.5rem;left:1.5rem;border-radius:1.5rem;padding:0.1rem}.tags_sort,.tags_sort span{user-select:none}.tags_sort span{display:inline-flex;justify-content:center;align-items:center;height:2rem;position:relative;z-index:5;cursor:pointer;width:5rem;font-weight:500}.tags_sort::before{content:"";position:absolute;width:4.5rem;top:0.25rem;bottom:0.25rem;left:0.25rem;z-index:3;background:var(--bg);opacity:0.5;border-radius:1.5rem;transition:0.25s transform var(--ease)}.tags_sort.sorted::before{transform:translateX(5rem)}.tag-title{border-bottom:none !important;display:inline-block !important;position:relative;font-size:2rem;margin-bottom:-1rem}.tag-title::after{content:attr(data-count);margin-left:1.5rem;background-color:#eee;padding:0.25rem 1rem;border-radius:15%;font-size:1.5rem}.icon{display:inline-flex;justify-content:center;align-items:center;margin:0 0.5rem}.icon,.icon img,.icon svg{width:1.1rem;height:1.1rem}.icon_2{width:2.2rem;height:2.2rem}.link{opacity:0;position:relative}.link_yank{opacity:1}.link_yanked{position:absolute;right:-1rem;top:-2rem;background-color:#0077b8;color:#fff;width:7rem;padding:0.25rem 0.5rem;font-size:0.9rem;border-radius:1rem;text-align:center}.link_yanked::after{position:absolute;top:1rem;content:"";border-color:#0077b8 transparent;border-style:solid;border-width:1rem 1rem 0 1rem;height:0;width:0;transform-origin:50% 50%;transform:rotate(145deg);right:0.45rem}.excerpt_header,.excerpt_footer{padding:1rem}.excerpt_footer{padding:0 1rem 2.25rem 1rem}.excerpt_thumbnail{min-height:10rem;display:none}@media screen and (min-width: 769px){.excerpt_thumbnail{display:block;border-radius:0.5rem}}.excerpt_footer.partition{display:grid}@media screen and (min-width: 769px){.excerpt_footer.partition{grid-template-columns:2fr 7fr;grid-gap:1rem}}.sidebar_inner{position:relative}.sidebar_inner::before{content:"";padding:0.5px;top:0;bottom:0;background:linear-gradient(to bottom, var(--haze), var(--light), var(--haze));position:absolute;left:-2rem}.pagination{display:flex}.page-item{padding:0.2rem}.page-item.disabled{opacity:0.7}.page-item:first-child,.page-item:last-child{display:none}.page-item.active a{background-color:#003552}.page-link{padding:0.25rem 0.75rem;background-color:#0077b8;color:#fff;border-radius:1rem}.float_left{float:left;margin-right:1rem}.float_left+p{padding-top:0}.float_right{float:right;margin-left:1rem}.float_left::after,.float_right::after{clear:both}.follow{display:flex;align-items:center;flex:1;justify-content:flex-end}.follow svg{fill:#fafafa;margin-left:0.75rem}.img_alt{font-style:italic;padding-top:0rem;opacity:0.67;font-size:0.9rem}.to_top{background-color:#0077b8;width:2.75rem;height:2.75rem;display:flex;justify-content:center;align-items:center;cursor:pointer;border-radius:50%;position:fixed;bottom:1.5rem;right:1.5rem;z-index:99}.to_top.ios{position:absolute;bottom:0.75rem;right:0}.to_top:hover{background-color:#0077b8}.to_top svg{fill:#fff;opacity:0.5;transition:0.3s opacity var(--ease)}.to_top:hover svg{opacity:1}.color_mode{height:1.5rem;display:grid;align-items:center;margin:0 0.5rem}@media screen and (min-width: 769px){.color_mode{margin:0 1.5rem;grid-template-columns:1fr}}.color_choice{width:3rem;background-color:var(--translucent-light);border-radius:1rem;height:1.5rem;outline:none;border:none;-webkit-appearance:none;cursor:pointer;position:relative;position:relative;overflow:hidden;box-shadow:0 0.25rem 1rem rgba(0,0,0,0.15)}.color_choice::after{content:"";position:absolute;top:0.1rem;left:0.1rem;width:1.3rem;height:1.3rem;background-image:url("../images/sun.svg");background-position:center;background-size:cover;border-radius:50%;z-index:2}.color_animate{transition:transform 0.5s cubic-bezier(0.075, 0.82, 0.165, 1)}.color_animate::after{transition:transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);will-change:transform}.taxonomy{text-transform:capitalize}.image-scale{position:fixed;z-index:999999;left:0;right:0;height:100vh;top:0;padding:1.5rem;background-color:var(--bg);display:grid;align-items:center;overflow:auto}.image-scale .image-scalable{background-color:var(--text)}.image-scalable{cursor:pointer;transition:transform 0.3s var(--ease)}.image_featured{display:block;margin-left:auto !important;margin-right:auto !important}.pt-1{padding-top:1.5rem}.pb-1{padding-bottom:1.5rem}.mt-1{margin-top:1.5rem}.mb-1{margin-bottom:1.5rem}.pt-2{padding-top:3rem}.pb-2{padding-bottom:3rem}.mt-2{margin-top:3rem}.mb-2{margin-bottom:3rem}.flex{display:flex;flex-direction:column;align-items:center}.shadow{box-shadow:0 0 60px rgba(0,0,0,0.17)}@media screen and (min-width: 42rem){.grid-2,.grid-3,.grid-4,.grid-auto,.grid-inverse{display:grid;grid-template-columns:1fr}[class*='grid-']{grid-gap:2rem}.grid-inverse{grid-template-columns:70% 1fr;grid-column-gap:4rem}.grid-2{grid-template-columns:1fr 1fr}.grid-3{grid-template-columns:repeat(auto-fit, minmax(19rem, 1fr))}.grid-4{grid-template-columns:repeat(auto-fit, minmax(16rem, 1fr))}}.facebook svg{fill:#325c94}.twitter svg{fill:#00abdc}.linkedin svg{fill:#007bb6}.never{height:75vh;display:flex;justify-content:center;align-items:center;flex-direction:column;padding:1.5rem;text-align:center}.inline{display:inline;margin:0}@media screen and (max-width: 769px){.nav,.nav_body{flex-direction:column}.nav_body{position:fixed;width:90%;max-width:16.5rem;top:0;bottom:0;background-color:#002538;transition:transform 0.3s var(--easing)}.nav_body_right{transform:translateX(100vw);right:0}.nav_body_left{transform:translateX(-100vw);left:0}.nav_close{width:3rem;position:absolute;right:-4rem;top:0;bottom:0;cursor:pointer;z-index:1000;display:grid;place-items:center}.nav_close svg{width:1.25rem;fill:var(--light);height:1.25rem;display:none}.nav_close svg:first-child{display:initial}.nav_close svg.isopen{display:none}.nav_close svg.isopen+svg{display:initial}.nav_brand{position:relative;z-index:999;width:calc(100% - 3rem);padding-left:0}.nav_parent{display:grid}.nav_sub{position:relative;top:initial;padding-top:0}.jsopen::after{content:"";position:fixed;z-index:2;background-color:rgba(0,0,0,0.3);top:0;left:0;right:0;bottom:0}.jsopen .nav_body{transform:translateX(0);padding-left:1.5rem;padding-right:1.5rem}.jsopen .nav_parent:first-child{margin-top:4.4rem}.jsopen .nav .follow{justify-content:flex-start;flex:initial;margin-top:0.75rem}}@keyframes pulse{0%{opacity:1}75%{opacity:0.1}100%{opacity:1}}code{font-size:15px;font-weight:400;overflow-y:hidden;display:block;font-family:'Monaco', monospace;word-break:break-all}code.noClass{--inlineColor: rgb(194, 29, 0);color:var(--inlineColor);display:inline;line-break:anywhere}.windows .highlight{overflow-x:hidden}.windows .highlight:hover{overflow-x:auto}.highlight{display:grid;width:100%;border-radius:0 0.2rem 0.2rem 0;overflow-x:auto;position:relative}.highlight_wrap{background:var(--code-bg) !important;border-radius:0.5rem;position:relative;padding:0 1rem;margin:1.5rem auto 1rem auto}.highlight_wrap:hover>div{opacity:1}.highlight_wrap .lang{position:absolute;top:0;right:0;text-align:right;width:7.5rem;padding:0.5rem 1rem;font-style:italic;text-transform:uppercase;font-size:67%;opacity:0.5;color:var(--light)}.highlight_wrap:hover .lang{opacity:0.1}.highlight .highlight{margin:0}.highlight pre{color:var(--light) !important;border-radius:4px;font-family:'Monaco', monospace;padding-top:1.5rem;padding-bottom:2rem}.highlight table{display:grid;max-width:100%;margin-bottom:0;background:transparent}.highlight td,.highlight th{padding:0}.highlight .lntd{width:100%;border:none}.highlight .lntd:first-child,.highlight .lntd:first-child pre{width:2.5rem !important;padding-left:0;padding-right:0;color:rgba(255,255,255,0.5);user-select:none}.highlight .lntd:first-child pre{width:100%;display:flex;align-items:center;flex-direction:column}.err{color:#a61717;background-color:#e3d2d2}.hl{width:100%;background-color:rgba(255,255,255,0.25)}.ln,.lnt{margin-right:0.75rem;padding:0;transition:opacity 0.3s var(--ease)}.ln,.ln span,.lnt,.lnt span{color:#666}.k,.kc,.kd,.kn,.kp,.kr,.kt,.nt{color:#6ab825;font-weight:500}.kn,.kp{font-weight:400}.nb,.no,.nv{color:#24909d}.nc,.nf,.nn{color:#447fcf}.s,.sa,.sb,.sc,.dl,.sd,.s2,.se,.sh,.si,.sx,.sr,.s1,.ss{color:#ed9d13}.m,.mb,.mf,.mh,.mi,.il,.mo{color:#3677a9}.ow{color:#6ab825;font-weight:500}.c,.ch,.cm,.c1{color:#999;font-style:italic}.cs{color:#e50808;background-color:#520000;font-weight:500}.cp,.cpf{color:#cd2828;font-weight:500}.gd,.gr{color:#d22323}.ge{font-style:italic}.gh,.gu,.nd,.na,.ne{color:#ffa500;font-weight:500}.gi{color:#589819}.go{color:#ccc}.gp{color:#aaa}.gs{font-weight:500}.gt{color:#d22323}.w{color:#666}.hljs-string{color:#6ab825}.hljs-attr{color:#ed9d13}.p .hljs-attr{color:var(--light)}.pre_wrap{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.pre_nolines.ln{display:none}.panel_box{display:inline-flex;perspective:300px;grid-gap:0.5rem;transition:opacity 0.3s var(--easing);background:var(--code-bg);padding:0.5rem 1.5rem;border-radius:2rem;align-items:center;position:absolute;right:0rem;top:-2.1rem;opacity:0}.panel_icon{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0.1rem;transform-origin:50% 50%}.panel_icon.active{animation:pulse 0.1s linear}.panel_icon svg{fill:var(--light);width:1.5rem;height:1.5rem}.panel_hide{display:none}.panel_from{position:absolute;color:var(--theme);bottom:0;font-size:1.5rem;font-weight:500;padding:0.5rem 0;cursor:pointer;letter-spacing:0.1px;z-index:19}.panel_expanded .panel_from{display:none} + +/*# sourceMappingURL=styles.css.map */ \ No newline at end of file diff --git a/exampleSite/resources/_gen/assets/sass/sass/main.sass_d2bdc985df0e3369a538eb4e858e857f.json b/exampleSite/resources/_gen/assets/sass/sass/main.sass_d2bdc985df0e3369a538eb4e858e857f.json new file mode 100644 index 0000000..6a96071 --- /dev/null +++ b/exampleSite/resources/_gen/assets/sass/sass/main.sass_d2bdc985df0e3369a538eb4e858e857f.json @@ -0,0 +1 @@ +{"Target":"css/styles.911db35c8e306d717b4098e7a4f14096bbc15388e4c04e8b7e7809a9d1dd2820d178edba6928d1cbfa82083bd2263626853f300038e96a7dc6284ace1dfdcdc9.css","MediaType":"text/css","Data":{"Integrity":"sha512-kR2zXI4wbXF7QJjnpPFAlrvBU4jkwE6LfngJqdHdKCDReO26aSjRy/qCCDvSJjYmhT8wADjpan3GKErOHf3NyQ=="}} \ No newline at end of file diff --git a/exampleSite/static/.gitignore b/exampleSite/static/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/exampleSite/static/images/building.png b/exampleSite/static/images/building.png new file mode 100644 index 0000000..b437490 Binary files /dev/null and b/exampleSite/static/images/building.png differ diff --git a/exampleSite/static/images/dollar.png b/exampleSite/static/images/dollar.png new file mode 100644 index 0000000..da93ff9 Binary files /dev/null and b/exampleSite/static/images/dollar.png differ diff --git a/exampleSite/static/logos/logo.png b/exampleSite/static/logos/logo.png new file mode 100644 index 0000000..4bcb17c Binary files /dev/null and b/exampleSite/static/logos/logo.png differ diff --git a/images/article-toc.png b/images/article-toc.png new file mode 100644 index 0000000..a07f85e Binary files /dev/null and b/images/article-toc.png differ diff --git a/images/image-figure.png b/images/image-figure.png new file mode 100644 index 0000000..67ff2ca Binary files /dev/null and b/images/image-figure.png differ diff --git a/images/image-inline.png b/images/image-inline.png new file mode 100644 index 0000000..93d36f1 Binary files /dev/null and b/images/image-inline.png differ diff --git a/images/screenshot-darkmode.png b/images/screenshot-darkmode.png new file mode 100644 index 0000000..539ed63 Binary files /dev/null and b/images/screenshot-darkmode.png differ diff --git a/images/screenshot-mobile-darkmode.png b/images/screenshot-mobile-darkmode.png new file mode 100644 index 0000000..cf89290 Binary files /dev/null and b/images/screenshot-mobile-darkmode.png differ diff --git a/images/screenshot-mobile.png b/images/screenshot-mobile.png new file mode 100644 index 0000000..962f69e Binary files /dev/null and b/images/screenshot-mobile.png differ diff --git a/images/screenshot.png b/images/screenshot.png new file mode 100644 index 0000000..f08264c Binary files /dev/null and b/images/screenshot.png differ diff --git a/images/syntax-block.gif b/images/syntax-block.gif new file mode 100644 index 0000000..91de114 Binary files /dev/null and b/images/syntax-block.gif differ diff --git a/images/tags.png b/images/tags.png new file mode 100644 index 0000000..8da6c60 Binary files /dev/null and b/images/tags.png differ diff --git a/images/tn-darkmode.png b/images/tn-darkmode.png new file mode 100644 index 0000000..256b5ae Binary files /dev/null and b/images/tn-darkmode.png differ diff --git a/images/tn.png b/images/tn.png new file mode 100644 index 0000000..2b2dcfe Binary files /dev/null and b/images/tn.png differ diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..30115e8 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,8 @@ +{{ define "main" }} +
+

Lost

+

We couldn't find the page you're looking for


+
Go Back
+
+{{ end }} + diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..18f14e6 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,76 @@ + + + + {{- partial "head" . }} + + {{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}} + {{ $mainSassFile := "sass/main.sass" }} + {{- $styles := resources.Get $mainSassFile | resources.ExecuteAsTemplate $mainSassFile . | resources.ToCSS $options | resources.Fingerprint "sha512" }} + + + {{- $highlightPath := "js/highlight.js" }} + {{- $highlight := resources.Get $highlightPath | resources.ExecuteAsTemplate $highlightPath . }} + + {{- $functionsScriptPath := "js/functions.js" }} + {{- $functions := resources.Get $functionsScriptPath | resources.ExecuteAsTemplate $functionsScriptPath . }} + + {{- $codeScriptPath := "js/code.js" }} + {{- $code := resources.Get $codeScriptPath | resources.ExecuteAsTemplate $codeScriptPath . }} + + {{- $customScriptPath := "js/custom.js" }} + {{- $custom := resources.Get $customScriptPath | resources.ExecuteAsTemplate $customScriptPath . }} + + {{- $mainScriptPath := "js/index.js" }} + {{- $main := resources.Get $mainScriptPath | resources.ExecuteAsTemplate $mainScriptPath . }} + + {{- $bundle := slice $highlight $functions $code $main $custom | resources.Concat "js/bundle.js" | resources.Fingerprint "sha512" -}} + + + + + + + + {{- with .Site.Params.customCSS }} + {{- range . -}} + + {{- end }} + {{- end }} + + + {{- $maxCodeLines := 100 }} + {{- $params := .Site.Params }} + {{- with $params.codeMaxLines }} + {{- $maxCodeLines = . }} + {{- end }} + {{- with .Params.codeMaxLines }} + {{- $maxCodeLines = . }} + {{- end }} + {{- $codeLineNumbers := false }} + {{ with $params.codeLineNumbers }} + {{- $codeLineNumbers = . }} + {{ end }} + {{ with .Params.codeLineNumbers }} + {{- $codeLineNumbers = . }} + {{ else }} + {{ if eq .Params.codeLineNumbers false }} + {{- $codeLineNumbers = false }} + {{ end }} + {{ end }} + + {{- partial "nav" . }} +
+ {{- block "main" . }}{{ end }} +
+ {{- partial "icons" }} + {{- partial "footer" . }} + + {{- with .Site.Params.customJS }} + {{- range . -}} + + {{- end }} + {{- end }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..35a8ba8 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,3 @@ +{{ define "main" }} + {{- partial "archive" . }} +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..1749a4e --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,26 @@ +{{- define "main" }} +{{- $scratch := newScratch }} +{{- if isset .Params "image" }} + {{- $scratch.Set "image" .Params.image }} +{{- else }} + {{ $scratch.Set "image" .Site.Params.fallBackOgImage }} +{{- end }} +{{- $image := $scratch.Get "image" }} +{{- $bg := (path.Join "images" $image | absLangURL) }} +
+
+

{{ .Title }}

+ {{- partial "post-meta" . }} + {{ partial "share" . }} + {{ with .Params.featureImage }} + + {{ end }} + {{ if .Params.toc }} +

Overview

+ {{ .TableOfContents }} + {{ end }} + {{- .Content }} +
+ {{- partial "sidebar" . }} +
+{{- end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..35a8ba8 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,3 @@ +{{ define "main" }} + {{- partial "archive" . }} +{{ end }} diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html new file mode 100644 index 0000000..9c2a200 --- /dev/null +++ b/layouts/partials/analytics.html @@ -0,0 +1,9 @@ +{{- with .Site.Params.ga_analytics }} + + +{{- end -}} diff --git a/layouts/partials/archive.html b/layouts/partials/archive.html new file mode 100644 index 0000000..d83d69c --- /dev/null +++ b/layouts/partials/archive.html @@ -0,0 +1,15 @@ +{{ $pages := .Pages }} +{{ if .IsHome }} + {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} +{{ end }} +
+
    + {{- range (.Paginate $pages).Pages }} + {{ partial "excerpt" . }} + {{- end }} +
  • + {{- template "_internal/pagination.html" . }} +
  • +
+ {{- partial "sidebar" . }} +
diff --git a/layouts/partials/excerpt.html b/layouts/partials/excerpt.html new file mode 100644 index 0000000..1f0fcdd --- /dev/null +++ b/layouts/partials/excerpt.html @@ -0,0 +1,25 @@ + +
  • +
    +
    +

    + {{ .Title }} +

    + {{ partial "post-meta.html" . }} +
    + {{- with .Params.thumbnail }} + +
  • + \ No newline at end of file diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html new file mode 100644 index 0000000..2c78928 --- /dev/null +++ b/layouts/partials/favicon.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/layouts/partials/follow.html b/layouts/partials/follow.html new file mode 100644 index 0000000..96c7cc2 --- /dev/null +++ b/layouts/partials/follow.html @@ -0,0 +1,15 @@ +{{- $items := .Site.Data.social }} + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..1b3eccf --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,7 @@ +
    + +
    \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..c2544b8 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,14 @@ + {{ if and .Title (ne (trim (lower .Site.Title) "") (trim (lower .Title) "")) }}{{ .Title }} | {{ end }}{{ .Site.Title }} + + {{ hugo.Generator }} + {{- with .Site.Params.ga_verify }} + + {{- end }} + + + {{- if (ne hugo.Environment "development") }} + {{- partial "analytics.html" . }} + {{- end }} + {{- partial "opengraph.html" . }} + {{- partial "favicon.html" . }} + diff --git a/layouts/partials/icons.html b/layouts/partials/icons.html new file mode 100644 index 0000000..f8b40fd --- /dev/null +++ b/layouts/partials/icons.html @@ -0,0 +1,62 @@ + diff --git a/layouts/partials/mode.html b/layouts/partials/mode.html new file mode 100644 index 0000000..227738b --- /dev/null +++ b/layouts/partials/mode.html @@ -0,0 +1,4 @@ + +
    + +
    diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..e21e054 --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,43 @@ +{{- $params := .Site.Params }} +{{- $centerLogo := $params.centerLogo }} +{{ $logo := $params.logo }} + diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html new file mode 100644 index 0000000..29332fd --- /dev/null +++ b/layouts/partials/opengraph.html @@ -0,0 +1,71 @@ +{{- $summary := .Summary | truncate 160 }} +{{- with .Params.description }} + {{- $summary = (. | truncate 160) }} +{{- end }} +{{- $site := .Site.Title }} +{{- $title := .Title }} +{{- $params := .Site.Params }} +{{- $permalink := .Permalink }} +{{- $logo := absURL $params.logo }} +{{- $author := $params.author }} +{{- with .Params.author }} + {{ $author := . }} +{{- end }} +{{- $image := absURL $params.fallBackOgImage }} +{{- with .Params.featureImage }} + {{- $image = absURL . }} +{{- end }} +{{- with .Params.thumbnail }} + {{- $image = absURL . }} +{{- end }} +{{- with .Params.shareImage }} + {{- $image = absURL . }} +{{- end }} + +{{- if .IsHome }} + +{{- else }} + +{{- end }} + + + + + + + + +{{- if eq .Section $params.blogDir -}} + {{- $date := ( .Date.Format "2006-02-01") -}} + {{- $date := (time .Date) }} + {{- $lastMod := (time .Lastmod) }} + +{{- end }} diff --git a/layouts/partials/pager.html b/layouts/partials/pager.html new file mode 100644 index 0000000..9848fb4 --- /dev/null +++ b/layouts/partials/pager.html @@ -0,0 +1,19 @@ +{{- $imageBase := absURL "images/icons/" }} +{{- $paginator := .Paginator }} +{{- if gt $paginator.TotalPages 1 }} +
    + {{- if $paginator.HasPrev }} + + {{- else }} + + {{- end }} + {{- range first 4 $paginator.Pagers }} + {{ .PageNumber }} + {{- end }} + {{- if $paginator.HasNext -}} + + {{- else -}} + + {{- end }} +
    +{{- end }} diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html new file mode 100644 index 0000000..f39b050 --- /dev/null +++ b/layouts/partials/post-meta.html @@ -0,0 +1,16 @@ + diff --git a/layouts/partials/share.html b/layouts/partials/share.html new file mode 100644 index 0000000..c2c5d83 --- /dev/null +++ b/layouts/partials/share.html @@ -0,0 +1,29 @@ +
    + Share on: + + + + + + + + + + + + + + +
    diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..c54285b --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,67 @@ +{{ $title := .Title }} + diff --git a/layouts/partials/top.html b/layouts/partials/top.html new file mode 100644 index 0000000..54ac4c1 --- /dev/null +++ b/layouts/partials/top.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 0000000..5f29d66 --- /dev/null +++ b/layouts/shortcodes/video.html @@ -0,0 +1,4 @@ +{{ $url := .Get 0 }} +
    + +
    diff --git a/static/fonts/Metropolis-Black.woff b/static/fonts/Metropolis-Black.woff new file mode 100644 index 0000000..0b4022d Binary files /dev/null and b/static/fonts/Metropolis-Black.woff differ diff --git a/static/fonts/Metropolis-Black.woff2 b/static/fonts/Metropolis-Black.woff2 new file mode 100644 index 0000000..9ad74d2 Binary files /dev/null and b/static/fonts/Metropolis-Black.woff2 differ diff --git a/static/fonts/Metropolis-BlackItalic.woff b/static/fonts/Metropolis-BlackItalic.woff new file mode 100644 index 0000000..470b7e6 Binary files /dev/null and b/static/fonts/Metropolis-BlackItalic.woff differ diff --git a/static/fonts/Metropolis-BlackItalic.woff2 b/static/fonts/Metropolis-BlackItalic.woff2 new file mode 100644 index 0000000..a269f3a Binary files /dev/null and b/static/fonts/Metropolis-BlackItalic.woff2 differ diff --git a/static/fonts/Metropolis-Bold.woff b/static/fonts/Metropolis-Bold.woff new file mode 100644 index 0000000..8538378 Binary files /dev/null and b/static/fonts/Metropolis-Bold.woff differ diff --git a/static/fonts/Metropolis-Bold.woff2 b/static/fonts/Metropolis-Bold.woff2 new file mode 100644 index 0000000..9648b0c Binary files /dev/null and b/static/fonts/Metropolis-Bold.woff2 differ diff --git a/static/fonts/Metropolis-BoldItalic.woff b/static/fonts/Metropolis-BoldItalic.woff new file mode 100644 index 0000000..377c991 Binary files /dev/null and b/static/fonts/Metropolis-BoldItalic.woff differ diff --git a/static/fonts/Metropolis-BoldItalic.woff2 b/static/fonts/Metropolis-BoldItalic.woff2 new file mode 100644 index 0000000..84a031b Binary files /dev/null and b/static/fonts/Metropolis-BoldItalic.woff2 differ diff --git a/static/fonts/Metropolis-ExtraBold.woff b/static/fonts/Metropolis-ExtraBold.woff new file mode 100644 index 0000000..fc98683 Binary files /dev/null and b/static/fonts/Metropolis-ExtraBold.woff differ diff --git a/static/fonts/Metropolis-ExtraBold.woff2 b/static/fonts/Metropolis-ExtraBold.woff2 new file mode 100644 index 0000000..8a96ad9 Binary files /dev/null and b/static/fonts/Metropolis-ExtraBold.woff2 differ diff --git a/static/fonts/Metropolis-ExtraBoldItalic.woff b/static/fonts/Metropolis-ExtraBoldItalic.woff new file mode 100644 index 0000000..7039b62 Binary files /dev/null and b/static/fonts/Metropolis-ExtraBoldItalic.woff differ diff --git a/static/fonts/Metropolis-ExtraBoldItalic.woff2 b/static/fonts/Metropolis-ExtraBoldItalic.woff2 new file mode 100644 index 0000000..e080928 Binary files /dev/null and b/static/fonts/Metropolis-ExtraBoldItalic.woff2 differ diff --git a/static/fonts/Metropolis-ExtraLight.woff b/static/fonts/Metropolis-ExtraLight.woff new file mode 100644 index 0000000..7e5c31e Binary files /dev/null and b/static/fonts/Metropolis-ExtraLight.woff differ diff --git a/static/fonts/Metropolis-ExtraLight.woff2 b/static/fonts/Metropolis-ExtraLight.woff2 new file mode 100644 index 0000000..951cfc4 Binary files /dev/null and b/static/fonts/Metropolis-ExtraLight.woff2 differ diff --git a/static/fonts/Metropolis-ExtraLightItalic.woff b/static/fonts/Metropolis-ExtraLightItalic.woff new file mode 100644 index 0000000..da2929c Binary files /dev/null and b/static/fonts/Metropolis-ExtraLightItalic.woff differ diff --git a/static/fonts/Metropolis-ExtraLightItalic.woff2 b/static/fonts/Metropolis-ExtraLightItalic.woff2 new file mode 100644 index 0000000..c6a665c Binary files /dev/null and b/static/fonts/Metropolis-ExtraLightItalic.woff2 differ diff --git a/static/fonts/Metropolis-Light.woff b/static/fonts/Metropolis-Light.woff new file mode 100644 index 0000000..f3a84ef Binary files /dev/null and b/static/fonts/Metropolis-Light.woff differ diff --git a/static/fonts/Metropolis-Light.woff2 b/static/fonts/Metropolis-Light.woff2 new file mode 100644 index 0000000..f0ff6f3 Binary files /dev/null and b/static/fonts/Metropolis-Light.woff2 differ diff --git a/static/fonts/Metropolis-LightItalic.woff b/static/fonts/Metropolis-LightItalic.woff new file mode 100644 index 0000000..ee72f2c Binary files /dev/null and b/static/fonts/Metropolis-LightItalic.woff differ diff --git a/static/fonts/Metropolis-LightItalic.woff2 b/static/fonts/Metropolis-LightItalic.woff2 new file mode 100644 index 0000000..3cbcc34 Binary files /dev/null and b/static/fonts/Metropolis-LightItalic.woff2 differ diff --git a/static/fonts/Metropolis-Medium.woff b/static/fonts/Metropolis-Medium.woff new file mode 100644 index 0000000..cd3c1ab Binary files /dev/null and b/static/fonts/Metropolis-Medium.woff differ diff --git a/static/fonts/Metropolis-Medium.woff2 b/static/fonts/Metropolis-Medium.woff2 new file mode 100644 index 0000000..43578fe Binary files /dev/null and b/static/fonts/Metropolis-Medium.woff2 differ diff --git a/static/fonts/Metropolis-MediumItalic.woff b/static/fonts/Metropolis-MediumItalic.woff new file mode 100644 index 0000000..814a9d5 Binary files /dev/null and b/static/fonts/Metropolis-MediumItalic.woff differ diff --git a/static/fonts/Metropolis-MediumItalic.woff2 b/static/fonts/Metropolis-MediumItalic.woff2 new file mode 100644 index 0000000..83f741c Binary files /dev/null and b/static/fonts/Metropolis-MediumItalic.woff2 differ diff --git a/static/fonts/Metropolis-Regular.woff b/static/fonts/Metropolis-Regular.woff new file mode 100644 index 0000000..6aa4dba Binary files /dev/null and b/static/fonts/Metropolis-Regular.woff differ diff --git a/static/fonts/Metropolis-Regular.woff2 b/static/fonts/Metropolis-Regular.woff2 new file mode 100644 index 0000000..f50bf34 Binary files /dev/null and b/static/fonts/Metropolis-Regular.woff2 differ diff --git a/static/fonts/Metropolis-RegularItalic.woff b/static/fonts/Metropolis-RegularItalic.woff new file mode 100644 index 0000000..019578a Binary files /dev/null and b/static/fonts/Metropolis-RegularItalic.woff differ diff --git a/static/fonts/Metropolis-RegularItalic.woff2 b/static/fonts/Metropolis-RegularItalic.woff2 new file mode 100644 index 0000000..93de258 Binary files /dev/null and b/static/fonts/Metropolis-RegularItalic.woff2 differ diff --git a/static/fonts/Metropolis-SemiBold.woff b/static/fonts/Metropolis-SemiBold.woff new file mode 100644 index 0000000..ca2edb0 Binary files /dev/null and b/static/fonts/Metropolis-SemiBold.woff differ diff --git a/static/fonts/Metropolis-SemiBold.woff2 b/static/fonts/Metropolis-SemiBold.woff2 new file mode 100644 index 0000000..fad6dfd Binary files /dev/null and b/static/fonts/Metropolis-SemiBold.woff2 differ diff --git a/static/fonts/Metropolis-SemiBoldItalic.woff b/static/fonts/Metropolis-SemiBoldItalic.woff new file mode 100644 index 0000000..3c6a03b Binary files /dev/null and b/static/fonts/Metropolis-SemiBoldItalic.woff differ diff --git a/static/fonts/Metropolis-SemiBoldItalic.woff2 b/static/fonts/Metropolis-SemiBoldItalic.woff2 new file mode 100644 index 0000000..ad97ed0 Binary files /dev/null and b/static/fonts/Metropolis-SemiBoldItalic.woff2 differ diff --git a/static/fonts/Metropolis-Thin.woff b/static/fonts/Metropolis-Thin.woff new file mode 100644 index 0000000..40341f4 Binary files /dev/null and b/static/fonts/Metropolis-Thin.woff differ diff --git a/static/fonts/Metropolis-Thin.woff2 b/static/fonts/Metropolis-Thin.woff2 new file mode 100644 index 0000000..9ffe02a Binary files /dev/null and b/static/fonts/Metropolis-Thin.woff2 differ diff --git a/static/fonts/Metropolis-ThinItalic.woff b/static/fonts/Metropolis-ThinItalic.woff new file mode 100644 index 0000000..8943df9 Binary files /dev/null and b/static/fonts/Metropolis-ThinItalic.woff differ diff --git a/static/fonts/Metropolis-ThinItalic.woff2 b/static/fonts/Metropolis-ThinItalic.woff2 new file mode 100644 index 0000000..e4bdf05 Binary files /dev/null and b/static/fonts/Metropolis-ThinItalic.woff2 differ diff --git a/static/icons/android-chrome-192x192.png b/static/icons/android-chrome-192x192.png new file mode 100644 index 0000000..c869c6c Binary files /dev/null and b/static/icons/android-chrome-192x192.png differ diff --git a/static/icons/android-chrome-256x256.png b/static/icons/android-chrome-256x256.png new file mode 100644 index 0000000..8b522f6 Binary files /dev/null and b/static/icons/android-chrome-256x256.png differ diff --git a/static/icons/apple-touch-icon.png b/static/icons/apple-touch-icon.png new file mode 100644 index 0000000..8156ad7 Binary files /dev/null and b/static/icons/apple-touch-icon.png differ diff --git a/static/icons/bar.svg b/static/icons/bar.svg new file mode 100644 index 0000000..0defb0a --- /dev/null +++ b/static/icons/bar.svg @@ -0,0 +1 @@ + diff --git a/static/icons/browserconfig.xml b/static/icons/browserconfig.xml new file mode 100644 index 0000000..b3930d0 --- /dev/null +++ b/static/icons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #da532c + + + diff --git a/static/icons/cancel.svg b/static/icons/cancel.svg new file mode 100644 index 0000000..07ed974 --- /dev/null +++ b/static/icons/cancel.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/icons/caret-icon.svg b/static/icons/caret-icon.svg new file mode 100644 index 0000000..8f9bb98 --- /dev/null +++ b/static/icons/caret-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/icons/carly.svg b/static/icons/carly.svg new file mode 100644 index 0000000..9bab2ec --- /dev/null +++ b/static/icons/carly.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/icons/close.svg b/static/icons/close.svg new file mode 100644 index 0000000..0b43290 --- /dev/null +++ b/static/icons/close.svg @@ -0,0 +1 @@ + diff --git a/static/icons/copy.svg b/static/icons/copy.svg new file mode 100644 index 0000000..13fdc26 --- /dev/null +++ b/static/icons/copy.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/icons/expand.svg b/static/icons/expand.svg new file mode 100644 index 0000000..14d8524 --- /dev/null +++ b/static/icons/expand.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/icons/favicon-16x16.png b/static/icons/favicon-16x16.png new file mode 100644 index 0000000..f15d4ff Binary files /dev/null and b/static/icons/favicon-16x16.png differ diff --git a/static/icons/favicon-32x32.png b/static/icons/favicon-32x32.png new file mode 100644 index 0000000..45bfd44 Binary files /dev/null and b/static/icons/favicon-32x32.png differ diff --git a/static/icons/favicon.ico b/static/icons/favicon.ico new file mode 100644 index 0000000..8f21884 Binary files /dev/null and b/static/icons/favicon.ico differ diff --git a/static/icons/link.svg b/static/icons/link.svg new file mode 100644 index 0000000..01ee4d6 --- /dev/null +++ b/static/icons/link.svg @@ -0,0 +1 @@ + diff --git a/static/icons/mstile-150x150.png b/static/icons/mstile-150x150.png new file mode 100644 index 0000000..ab67c73 Binary files /dev/null and b/static/icons/mstile-150x150.png differ diff --git a/static/icons/order.svg b/static/icons/order.svg new file mode 100644 index 0000000..333747f --- /dev/null +++ b/static/icons/order.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/icons/site.webmanifest b/static/icons/site.webmanifest new file mode 100644 index 0000000..de65106 --- /dev/null +++ b/static/icons/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-256x256.png", + "sizes": "256x256", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/static/images/night-moon.jpg b/static/images/night-moon.jpg new file mode 100644 index 0000000..cfa8bb3 Binary files /dev/null and b/static/images/night-moon.jpg differ diff --git a/static/images/sun.svg b/static/images/sun.svg new file mode 100644 index 0000000..e92f76d --- /dev/null +++ b/static/images/sun.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/thumbnail.png b/static/images/thumbnail.png new file mode 100644 index 0000000..c484f2a Binary files /dev/null and b/static/images/thumbnail.png differ diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..6d504a3 --- /dev/null +++ b/theme.toml @@ -0,0 +1,14 @@ +name = "Clarity" +license = "MIT" +licenselink = "https://github.com/chipzoller/hugo-clarity/blob/master/LICENSE.md" +description = "A theme based on VMware's Clarity Design System for publishing technical blogs with Hugo." +homepage = "https://github.com/chipzoller/hugo-clarity" +tags = ["blog", "technical", "simple", "dark", "syntax highlighting"] +features = ["blog", "technical", "simple", "dark", "syntax highlighting"] +min_version = "0.63.0" + +# If the theme has multiple authors +authors = [ + {name = "Chip Zoller", homepage = "https://neonmirrors.net"}, + {name = "Dan Weru", homepage = "https://github.com/onweru"}, +] -- cgit v1.3.1-23-gd82d