diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..3e6cf7e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,50 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + + + +**Describe the bug** + + + - Device/Os: [e.g. Android 10] + - Type: [e.g. Desktop/Mobile] + - Browser and version [e.g. Chrome 86.0]: + - Hugo Version [ >=0.83.0 expected]: + - Theme Version [e.g. v4.0, master, or commit-id ]: + +**Steps to reproduce the behavior:** + + +**Expected behavior**: + + +**Repo/Source where this issue can be reproduced**: + + +**Screenshots** + + +**Additional context** + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..1a4dd9b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: PaperMod Discussions + url: https://github.com/adityatelange/hugo-PaperMod/discussions + about: Please ask and answer questions/doubts here, do not open an issue for questions. diff --git a/.github/ISSUE_TEMPLATE/new-blank-issue.md b/.github/ISSUE_TEMPLATE/new-blank-issue.md new file mode 100644 index 0000000..dbc48f1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new-blank-issue.md @@ -0,0 +1,7 @@ +--- +name: New Blank Issue +about: Anything other than bug report +title: "" +labels: "" +assignees: "" +--- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..00b856c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,44 @@ + + + +**What does this PR change? What problem does it solve?** + + + + +**Was the change discussed in an issue or in the Discussions before?** + + + + +## PR Checklist + +- [ ] This change adds/updates translations and I have used the [template present here](https://github.com/adityatelange/hugo-PaperMod/wiki/Translations#want-to-add-your-language-). +- [ ] I have enabled [maintainer edits for this PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork). +- [ ] I have verified that the code works as described/as intended. +- [ ] This change adds a Social Icon which has a permissive license to use it. +- [ ] This change **does not** include any CDN resources/links. +- [ ] This change **does not** include any unrelated scripts such as bash and python scripts. +- [ ] This change updates the overridden internal templates from HUGO's repository. diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 31ad733..305a6de 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,42 +1,80 @@ -name: Build GH-Pages +name: Deploy Hugo PaperMod Demo to Pages on: push: paths-ignore: - - 'images/**' - - 'LICENSE' - - 'README.md' + - "images/**" + - "LICENSE" + - "README.md" branches: - master - exampleSite workflow_dispatch: # manual run + inputs: + hugoVersion: + description: "Hugo Version" + required: false + default: "0.83.0" + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +# Default to bash +defaults: + run: + shell: bash + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write jobs: - deploy: + # Build job + build: runs-on: ubuntu-latest + env: + HUGO_VERSION: "0.83.0" steps: - - name: Git checkout - uses: actions/checkout@v2 + - name: Check version + if: ${{ github.event.inputs.hugoVersion }} + run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}" + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Checkout + uses: actions/checkout@v3 with: ref: exampleSite - + - name: Setup Pages + id: pages + uses: actions/configure-pages@v1 - name: Get Theme run: git submodule update --init --recursive - - name: Update theme to Latest commit run: git submodule update --remote --merge - - - name: Setup hugo - uses: peaceiris/actions-hugo@v2 + - name: Build with Hugo + run: | + hugo \ + --buildDrafts --gc --verbose \ + --baseURL ${{ steps.pages.outputs.base_url }} + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - hugo-version: 'latest' - - - name: Build - run: hugo --buildDrafts --gc --verbose --minify - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.TOKEN }} - publish_dir: ./public + path: ./public + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/LICENSE b/LICENSE index 0dc94d5..1580f7f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License -Copyright (c) 2020 nanxiaobei, adityatelange +Copyright (c) 2020 nanxiaobei and adityatelange +Copyright (c) 2021-2022 adityatelange Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 0bb53b5..286617a --- a/README.md +++ b/README.md @@ -1,85 +1,96 @@ -![Build GH-Pages](https://github.com/adityatelange/hugo-PaperMod/workflows/Build%20GH-Pages/badge.svg) -![GitHub](https://img.shields.io/github/license/adityatelange/hugo-PaperMod) -[![hugo-papermod](https://img.shields.io/badge/Hugo--Themes-@PaperMod-blue)](https://themes.gohugo.io/hugo-papermod/) +

Hugo PaperMod | Demo

+ +

☄️ Fast | ☁️ Fluent | 🌙 Smooth | 📱 Responsive

+
+ +> Hugo PaperMod is a theme based on [hugo-paper](https://github.com/nanxiaobei/hugo-paper). +> The goal of this project is to add more features and customization to the og theme. + +The [demo](https://adityatelange.github.io/hugo-PaperMod/) includes a lot of documentation about Installation, Features with a few more stuff. Make sure you visit it, to get an awesome hands-on experience and get to know about the features ... + +**ExampleSite** can be found here: [exampleSite](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite). Demo is built up with [exampleSite](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite) as source. + +[![Minimum Hugo Version](https://img.shields.io/static/v1?label=min-HUGO-version&message=0.83.0&color=blue&logo=hugo)](https://github.com/gohugoio/hugo/releases/tag/v0.83.0) +[![Build GH-Pages](https://github.com/adityatelange/hugo-PaperMod/workflows/Build%20GH-Pages/badge.svg)](https://github.com/adityatelange/hugo-PaperMod/deployments/activity_log?environment=github-pages) +[![GitHub](https://img.shields.io/github/license/adityatelange/hugo-PaperMod)](https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE) +[![hugo-papermod](https://img.shields.io/badge/Hugo--Themes-@PaperMod-blue)](https://themes.gohugo.io/themes/hugo-papermod/) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=adityatelange_hugo-PaperMod&metric=alert_status)](https://sonarcloud.io/dashboard?id=adityatelange_hugo-PaperMod) ![code-size](https://img.shields.io/github/languages/code-size/adityatelange/hugo-PaperMod) - -# hugo-PaperMod | [Demo](https://adityatelange.github.io/hugo-PaperMod/) - -☄️ Fast | ☁️ Fluent | 🌙 Smooth | 📱 Responsive - -Hugo PaperMod is a theme based on [hugo-paper](https://github.com/nanxiaobei/hugo-paper). -The goal of this project is add more Features and customization to the og theme. - -The [demo site](https://adityatelange.github.io/hugo-PaperMod/) includes a lot of documentation about Installation, Features with few more stuff. Make sure you visit it, to get the awesome hands-on experience and get known about the features ... - -ExampleSite can be found here: [exampleSite](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite). Demo is built up with exampleSite as source. +[![Discord](https://img.shields.io/discord/971046860317921340?label=Discord)](https://discord.gg/ahpmTvhVmp) ---

- HomeInfo - HomeInfo + Mockup image

--- -## Install/Update - -Read this post For More Details => [hugo-PaperMod - Installation](https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-installation/) - ---- - -## Features/Mods +## Features/Mods 💥 - Uses Hugo's asset generator with pipelining, fingerprinting, bundling and minification by default. - 3 Modes: - - Regular Mode. - - [Home-Info Mode.](https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-features/#home-info-mode) - - [Profile Mode.](https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-features/#profile-mode) + - [Regular Mode.](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#regular-mode-default-mode) + - [Home-Info Mode.](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#home-info-mode) + - [Profile Mode.](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#profile-mode) - Table of Content Generation (newer implementation). - Archive of posts. - Social Icons (home-info and profile-mode) -- Social-Media Share buttons on post. +- Social-Media Share buttons on posts. - Menu location indicator. - Multilingual support. (with language selector) - Taxonomies - Cover image for each post (with Responsive image support). - Light/Dark theme (automatic theme switch a/c to browser theme and theme-switch button). - SEO Friendly. -- Muliple Author support. -- No webpack, nodejs and other depedencies required to edit the theme :) +- Multiple Author support. +- Search Page with Fuse.js +- Other Posts suggestion below a post +- Breadcrumb Navigation +- Code Block Copy buttons +- No webpack, nodejs and other dependencies are required to edit the theme. -Read this post For More Details => [hugo-PaperMod - Features](https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-features/) - -Release ChangeLog has info about stuff added: [Releases](https://github.com/adityatelange/hugo-PaperMod/releases) - -Huge thanks to contributors for making this theme better :) +Read Wiki For More Details => **[PaperMod - Features](https://github.com/adityatelange/hugo-PaperMod/wiki/Features)** --- -## Social-Icons/Share-Icons +## Install/Update 📥 -Read this post For More Details => [Social-Icons](https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-icons/) +Read Wiki For More Details => **[PaperMod - Installation](https://github.com/adityatelange/hugo-PaperMod/wiki/Installation)** --- -## FAQs / How To's +## Social-Icons/Share-Icons 🖼️ -Read this post For More Details => [How To's Guide](https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-how-to/) +Read Wiki For More Details => **[PaperMod-Icons](https://github.com/adityatelange/hugo-PaperMod/wiki/Icons)** --- -## [LightHouse Report (100% ?)](https://lighthouse-dot-webdotdevsite.appspot.com//lh/html?url=https%3A%2F%2Fadityatelange.github.io%2Fhugo-PaperMod%2F) +## FAQs / How To's Guide 🙋 + +Read Wiki For More Details => **[PaperMod-FAQs](https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs)** --- -## Found a bug? +## Release Changelog 📃 -If you spot any bugs, please use [Issue Tracker](https://github.com/adityatelange/hugo-PaperMod/issues) and/or -create a new [Pull Request](https://github.com/adityatelange/hugo-PaperMod/pulls) to fix the issue. +Release ChangeLog has info about stuff added: **[Releases](https://github.com/adityatelange/hugo-PaperMod/releases)** + +--- + +## [Pagespeed Insights (100% ?)](https://pagespeed.web.dev/report?url=https://adityatelange.github.io/hugo-PaperMod/) 👀 + +--- + +## Special Thanks 🌟 + +- [**Highlight.js**](https://github.com/highlightjs/highlight.js) +- [**Fuse.js**](https://github.com/krisk/fuse) +- [**Feather Icons**](https://github.com/feathericons/feather) +- [**Simple Icons**](https://github.com/simple-icons/simple-icons) +- **All Contributors and Supporters** + +## Stargazers over time 📈 + +[![Stargazers over time](https://starchart.cc/adityatelange/hugo-PaperMod.svg)](https://starchart.cc/adityatelange/hugo-PaperMod) -[![GitHub issues](https://img.shields.io/github/issues-raw/adityatelange/hugo-papermod)](https://github.com/adityatelange/hugo-PaperMod/issues?q=is%3Aopen) -[![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/adityatelange/hugo-PaperMod)](https://github.com/adityatelange/hugo-PaperMod/issues?q=is%3Aissue+is%3Aclosed) -[![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/adityatelange/hugo-papermod)](https://github.com/adityatelange/hugo-PaperMod/pulls?q=is%3Aopen+is%3Apr) -[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/adityatelange/hugo-papermod)](https://github.com/adityatelange/hugo-PaperMod/pulls?q=is%3Apr+is%3Aclosed) diff --git a/assets/css/404.css b/assets/css/common/404.css similarity index 89% rename from assets/css/404.css rename to assets/css/common/404.css index 41b2409..8a23430 100644 --- a/assets/css/404.css +++ b/assets/css/common/404.css @@ -7,5 +7,5 @@ justify-content: center; height: 80%; font-size: 160px; - font-weight: 700 + font-weight: 700; } diff --git a/assets/css/archive.css b/assets/css/common/archive.css similarity index 53% rename from assets/css/archive.css rename to assets/css/common/archive.css index 51d6282..7e7e245 100644 --- a/assets/css/archive.css +++ b/assets/css/common/archive.css @@ -1,54 +1,44 @@ .archive-posts { width: 100%; - font-size: 16px + font-size: 16px; } .archive-year { - margin-top: 40px + margin-top: 40px; } .archive-year:not(:last-of-type) { - border-bottom: 2px solid var(--border) + border-bottom: 2px solid var(--border); } .archive-month { display: flex; align-items: flex-start; - padding: 10px 0 + padding: 10px 0; } .archive-month-header { margin: 25px 0; - width: 200px + width: 200px; } .archive-month:not(:last-of-type) { - border-bottom: 1px solid var(--border) + border-bottom: 1px solid var(--border); } .archive-entry { position: relative; padding: 5px; - margin: 10px 0 + margin: 10px 0; } .archive-entry-title { margin: 5px 0; - font-weight: 400 + font-weight: 400; } .archive-count, .archive-meta { color: var(--secondary); - font-size: 14px -} - -@media (max-width:800px) { - .archive-month { - flex-direction: column - } - - .archive-year { - margin-top: 20px - } + font-size: 14px; } diff --git a/assets/css/footer.css b/assets/css/common/footer.css similarity index 50% rename from assets/css/footer.css rename to assets/css/common/footer.css index f0a1ffc..5addb1e 100644 --- a/assets/css/footer.css +++ b/assets/css/common/footer.css @@ -1,34 +1,37 @@ .footer, .top-link { font-size: 12px; - color: var(--secondary) + color: var(--secondary); } .footer { max-width: calc(var(--main-width) + var(--gap) * 2); margin: auto; - padding: calc((var(--footer-height) - (var(--gap)) - 10px) / 2) var(--gap); + padding: calc((var(--footer-height) - var(--gap)) / 2) var(--gap); text-align: center; - line-height: 24px + line-height: 24px; } .footer span { margin-inline-start: 1px; - margin-inline-end: 1px + margin-inline-end: 1px; +} + +.footer span:last-child { + white-space: nowrap; } .footer a { color: inherit; - border-bottom: 1px solid var(--secondary) + border-bottom: 1px solid var(--secondary); } .footer a:hover { - border-bottom: 1px solid var(--primary) + border-bottom: 1px solid var(--primary); } .top-link { visibility: hidden; - opacity: 0; position: fixed; bottom: 60px; right: 30px; @@ -38,16 +41,20 @@ height: 42px; padding: 12px; border-radius: 64px; - fill: currentColor; - fill-opacity: 80%; - transition: visibility .5s, opacity .8s linear + transition: visibility 0.5s, opacity 0.8s linear; +} + +.top-link, +.top-link svg { + filter: drop-shadow(0px 0px 0px var(--theme)); } .footer a:hover, .top-link:hover { - color: var(--primary) + color: var(--primary); } -.top-link:focus { - outline: 0 +.top-link:focus, +#theme-toggle:focus { + outline: 0; } diff --git a/assets/css/header.css b/assets/css/common/header.css similarity index 56% rename from assets/css/header.css rename to assets/css/common/header.css index e4ec64e..64894da 100644 --- a/assets/css/header.css +++ b/assets/css/common/header.css @@ -5,82 +5,89 @@ max-width: calc(var(--nav-width) + var(--gap) * 2); margin-inline-start: auto; margin-inline-end: auto; - line-height: var(--header-height) + line-height: var(--header-height); } .nav a { - display: block + display: block; } .logo, -.menu { +#menu { display: flex; margin: auto var(--gap); - flex-wrap: inherit +} + +.logo { + flex-wrap: inherit; } .logo a { font-size: 24px; font-weight: 700; - margin-inline-end: 10px } -.logo a img { +.logo a img, .logo a svg { display: inline; vertical-align: middle; pointer-events: none; transform: translate(0, -10%); border-radius: 6px; - margin-inline-end: 8px + margin-inline-end: 8px; } -.theme-toggle svg { - height: 18px; - user-select: none; - cursor: pointer +button#theme-toggle { + font-size: 26px; + margin: auto 4px; } body.dark #moon { vertical-align: middle; - display: none + display: none; } body:not(.dark) #sun { - display: none + display: none; } -.menu { +#menu { list-style: none; word-break: keep-all; overflow-x: auto; - white-space: nowrap + white-space: nowrap; } -.menu li+li { - margin-inline-start: var(--gap) +#menu li + li { + margin-inline-start: var(--gap); } -.menu a { - font-size: 16px +#menu a { + font-size: 16px; } -.menu .active { +#menu .active { font-weight: 500; - border-bottom: 2px solid currentColor + border-bottom: 2px solid currentColor; } .lang-switch li, .lang-switch ul, .logo-switches { - display: inline-flex + display: inline-flex; + margin: auto 4px; +} + +.lang-switch { + display: flex; + flex-wrap: inherit; } .lang-switch a { + margin: auto 3px; font-size: 16px; font-weight: 500; - margin: 0 8px } .logo-switches { - flex-wrap: inherit + flex-wrap: inherit; } diff --git a/assets/css/common/main.css b/assets/css/common/main.css new file mode 100644 index 0000000..50022ac --- /dev/null +++ b/assets/css/common/main.css @@ -0,0 +1,68 @@ +.main { + position: relative; + min-height: calc(100vh - var(--header-height) - var(--footer-height)); + max-width: calc(var(--main-width) + var(--gap) * 2); + margin: auto; + padding: var(--gap); +} + +.page-header h1 { + font-size: 40px; +} + +.pagination { + display: flex; +} + +.pagination a { + color: var(--theme); + font-size: 13px; + line-height: 36px; + background: var(--primary); + border-radius: calc(36px / 2); + padding: 0 16px; +} + +.pagination .next { + margin-inline-start: auto; +} + +.social-icons { + padding: 12px 0; +} + +.social-icons a:not(:last-of-type) { + margin-inline-end: 12px; +} + +.social-icons a svg { + height: 26px; + width: 26px; +} + +code { + direction: ltr; +} + +div.highlight, +pre { + position: relative; +} + +.copy-code { + display: none; + position: absolute; + top: 4px; + right: 4px; + color: rgba(255, 255, 255, 0.8); + background: rgba(78, 78, 78, 0.8); + border-radius: var(--radius); + padding: 0 5px; + font-size: 14px; + user-select: none; +} + +div.highlight:hover .copy-code, +pre:hover .copy-code { + display: block; +} diff --git a/assets/css/post-entry.css b/assets/css/common/post-entry.css similarity index 66% rename from assets/css/post-entry.css rename to assets/css/common/post-entry.css index 722b597..885aa2a 100644 --- a/assets/css/post-entry.css +++ b/assets/css/common/post-entry.css @@ -4,38 +4,33 @@ flex-direction: column; justify-content: center; min-height: 320px; - margin: var(--gap) 0 calc(var(--gap) * 2) 0 -} - -@media screen and (max-width:600px) { - .first-entry { - min-height: 260px - } + margin: var(--gap) 0 calc(var(--gap) * 2) 0; } .first-entry .entry-header { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; - -webkit-line-clamp: 3 + -webkit-line-clamp: 3; } -.first-entry .entry-header h2 { - font-size: 34px +.first-entry .entry-header h1 { + font-size: 34px; + line-height: 1.3; } .first-entry .entry-content { margin: 14px 0; font-size: 16px; - -webkit-line-clamp: 3 + -webkit-line-clamp: 3; } .first-entry .entry-footer { - font-size: 14px + font-size: 14px; } .home-info .entry-content { - -webkit-line-clamp: unset + -webkit-line-clamp: unset; } .post-entry { @@ -44,19 +39,21 @@ padding: var(--gap); background: var(--entry); border-radius: var(--radius); - transition: transform .1s + transition: transform 0.1s; + border: 1px solid var(--border); } .post-entry:active { - transform: scale(.96) + transform: scale(0.96); } .tag-entry .entry-cover { - display: none + display: none; } .entry-header h2 { - font-size: 24px + font-size: 24px; + line-height: 1.3; } .entry-content { @@ -67,12 +64,12 @@ overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; - -webkit-line-clamp: 2 + -webkit-line-clamp: 2; } .entry-footer { color: var(--secondary); - font-size: 13px + font-size: 13px; } .entry-link { @@ -80,31 +77,28 @@ left: 0; right: 0; top: 0; - bottom: 0 + bottom: 0; } .entry-cover, .entry-isdraft { font-size: 14px; - color: var(--secondary) -} - -.entry-isdraft { - display: inline + color: var(--secondary); } .entry-cover { margin-bottom: var(--gap); - text-align: center + text-align: center; } .entry-cover img { border-radius: var(--radius); pointer-events: none; - width: 100% + width: 100%; + height: auto; } .entry-cover a { color: var(--secondary); - box-shadow: 0 1px 0 var(--primary) + box-shadow: 0 1px 0 var(--primary); } diff --git a/assets/css/common/post-single.css b/assets/css/common/post-single.css new file mode 100644 index 0000000..ba6e5a2 --- /dev/null +++ b/assets/css/common/post-single.css @@ -0,0 +1,403 @@ +.page-header, +.post-header { + margin: 24px auto var(--content-gap) auto; +} + +.post-title { + margin-bottom: 2px; + font-size: 40px; +} + +.post-description { + margin-top: 10px; + margin-bottom: 5px; +} + +.post-meta, +.breadcrumbs { + color: var(--secondary); + font-size: 14px; + display: flex; + flex-wrap: wrap; +} + +.post-meta .i18n_list li { + display: inline-flex; + list-style: none; + margin: auto 3px; + box-shadow: 0 1px 0 var(--secondary); +} + +.breadcrumbs a { + font-size: 16px; +} + +.post-content { + color: var(--content); +} + +.post-content h3, +.post-content h4, +.post-content h5, +.post-content h6 { + margin: 24px 0 16px; +} + +.post-content h1 { + margin: 40px auto 32px; + font-size: 40px; +} + +.post-content h2 { + margin: 32px auto 24px; + font-size: 32px; +} + +.post-content h3 { + font-size: 24px; +} + +.post-content h4 { + font-size: 16px; +} + +.post-content h5 { + font-size: 14px; +} + +.post-content h6 { + font-size: 12px; +} + +.post-content a, +.toc a:hover { + box-shadow: 0 1px 0; + box-decoration-break: clone; + -webkit-box-decoration-break: clone; +} + +.post-content a code { + margin: auto 0; + border-radius: 0; + box-shadow: 0 -1px 0 var(--primary) inset; +} + +.post-content del { + text-decoration: none; + background: linear-gradient(to right, var(--primary) 100%, transparent 0) 0 50%/1px 1px repeat-x; +} + +.post-content dl, +.post-content ol, +.post-content p, +.post-content figure, +.post-content ul { + margin-bottom: var(--content-gap); +} + +.post-content ol, +.post-content ul { + padding-inline-start: 20px; +} + +.post-content li { + margin-top: 5px; +} + +.post-content li p { + margin-bottom: 0; +} + +.post-content dl { + display: flex; + flex-wrap: wrap; + margin: 0; +} + +.post-content dt { + width: 25%; + font-weight: 700; +} + +.post-content dd { + width: 75%; + margin-inline-start: 0; + padding-inline-start: 10px; +} + +.post-content dd ~ dd, +.post-content dt ~ dt { + margin-top: 10px; +} + +.post-content table { + margin-bottom: 32px; +} + +.post-content table th, +.post-content table:not(.highlighttable, .highlight table, .gist .highlight) td { + min-width: 80px; + padding: 12px 8px; + line-height: 1.5; + border-bottom: 1px solid var(--border); +} + +.post-content table th { + font-size: 14px; + text-align: start; +} + +.post-content table:not(.highlighttable) td code:only-child { + margin: auto 0; +} + +.post-content .highlight table { + border-radius: var(--radius); +} + +.post-content .highlight:not(table) { + margin: 10px auto; + background: var(--hljs-bg) !important; + border-radius: var(--radius); + direction: ltr; +} + +.post-content li > .highlight { + margin-inline-end: 0; +} + +.post-content ul pre { + margin-inline-start: calc(var(--gap) * -2); +} + +.post-content .highlight pre { + margin: 0; +} + +.post-content .highlighttable { + table-layout: fixed; +} + +.post-content .highlighttable td:first-child { + width: 40px; +} + +.post-content .highlighttable td .linenodiv { + padding-inline-end: 0 !important; +} + +.post-content .highlighttable td .highlight, +.post-content .highlighttable td .linenodiv pre { + margin-bottom: 0; +} + +.post-content code { + margin: auto 4px; + padding: 4px 6px; + font-size: 0.78em; + line-height: 1.5; + background: var(--code-bg); + border-radius: 2px; +} + +.post-content pre code { + display: block; + margin: auto 0; + padding: 10px; + color: rgb(213, 213, 214); + background: var(--hljs-bg) !important; + border-radius: var(--radius); + overflow-x: auto; + word-break: break-all; +} + +.post-content blockquote { + margin: 20px 0; + padding: 0 14px; + border-inline-start: 3px solid var(--primary); +} + +.post-content hr { + margin: 30px 0; + height: 2px; + background: var(--tertiary); + border: 0; +} + +.post-content iframe { + max-width: 100%; +} + +.post-content img { + border-radius: 4px; + margin: 1rem 0; +} + +.post-content img[src*="#center"] { + margin: 1rem auto; +} + +.post-content figure.align-center { + text-align: center; +} + +.post-content figure > figcaption { + color: var(--primary); + font-size: 16px; + font-weight: bold; + margin: 8px 0 16px; +} + +.post-content figure > figcaption > p { + color: var(--secondary); + font-size: 14px; + font-weight: normal; +} + +.toc { + margin: 0 2px 40px 2px; + border: 1px solid var(--border); + background: var(--code-bg); + border-radius: var(--radius); + padding: 0.4em; +} + +.dark .toc { + background: var(--entry); +} + +.toc details summary { + cursor: zoom-in; + margin-inline-start: 20px; +} + +.toc details[open] summary { + cursor: zoom-out; +} + +.toc .details { + display: inline; + font-weight: 500; +} + +.toc .inner { + margin: 0 20px; + padding: 10px 20px; +} + +.toc li ul { + margin-inline-start: var(--gap); +} + +.toc summary:focus { + outline: 0; +} + +.post-footer { + margin-top: 56px; +} + +.post-tags li { + display: inline-block; + margin-inline-end: 3px; + margin-bottom: 5px; +} + +.post-tags a, +.share-buttons, +.paginav { + border-radius: var(--radius); + background: var(--code-bg); + border: 1px solid var(--border); +} + +.post-tags a { + display: block; + padding-inline-start: 14px; + padding-inline-end: 14px; + color: var(--secondary); + font-size: 14px; + line-height: 34px; + background: var(--code-bg); +} + +.post-tags a:hover, +.paginav a:hover { + background: var(--border); +} + +.share-buttons { + margin: 14px 0; + padding-inline-start: var(--radius); + display: flex; + justify-content: center; + overflow-x: auto; +} + +.share-buttons a { + margin-top: 10px; +} + +.share-buttons a:not(:last-of-type) { + margin-inline-end: 12px; +} + +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-flex; + color: var(--secondary); + margin-inline-start: 8px; + font-weight: 500; + user-select: none; +} + +.paginav { + margin: 10px 0; + display: flex; + line-height: 30px; + border-radius: var(--radius); +} + +.paginav a { + padding-inline-start: 14px; + padding-inline-end: 14px; + border-radius: var(--radius); +} + +.paginav .title { + letter-spacing: 1px; + text-transform: uppercase; + font-size: small; + color: var(--secondary); +} + +.paginav .prev, +.paginav .next { + width: 50%; +} + +.paginav span:hover:not(.title) { + box-shadow: 0 1px 0; +} + +.paginav .next { + margin-inline-start: auto; + text-align: right; +} + +[dir="rtl"] .paginav .next { + text-align: left; +} + +h1>a>svg { + display: inline; +} + +img.in-text { + display: inline; + margin: auto; +} \ No newline at end of file diff --git a/assets/css/common/profile-mode.css b/assets/css/common/profile-mode.css new file mode 100644 index 0000000..58f2819 --- /dev/null +++ b/assets/css/common/profile-mode.css @@ -0,0 +1,42 @@ +.buttons, +.main .profile { + display: flex; + justify-content: center; +} + +.main .profile { + align-items: center; + min-height: calc(100vh - var(--header-height) - var(--footer-height) - (var(--gap) * 2)); + text-align: center; +} + +.profile .profile_inner h1 { + padding: 12px 0; +} + +.profile img { + display: inline-table; + border-radius: 50%; +} + +.buttons { + flex-wrap: wrap; + max-width: 400px; + margin: 0 auto; +} + +.button { + background: var(--tertiary); + border-radius: var(--radius); + margin: 8px; + padding: 6px; + transition: transform 0.1s; +} + +.button-inner { + padding: 0 8px; +} + +.button:active { + transform: scale(0.96); +} diff --git a/assets/css/common/search.css b/assets/css/common/search.css new file mode 100644 index 0000000..38d5b6b --- /dev/null +++ b/assets/css/common/search.css @@ -0,0 +1,45 @@ +#searchbox input { + padding: 4px 10px; + width: 100%; + color: var(--primary); + font-weight: bold; + border: 2px solid var(--tertiary); + border-radius: var(--radius); +} + +#searchbox input:focus { + border-color: var(--secondary); +} + +#searchResults li { + list-style: none; + border-radius: var(--radius); + padding: 10px; + margin: 10px 0; + position: relative; + font-weight: 500; +} + +#searchResults { + margin: 10px 0; + width: 100%; +} + +#searchResults li:active { + transition: transform 0.1s; + transform: scale(0.98); +} + +#searchResults a { + position: absolute; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + outline: none; +} + +#searchResults .focus { + transform: scale(0.98); + border: 2px solid var(--tertiary); +} diff --git a/assets/css/terms.css b/assets/css/common/terms.css similarity index 67% rename from assets/css/terms.css rename to assets/css/common/terms.css index 82db445..244614b 100644 --- a/assets/css/terms.css +++ b/assets/css/common/terms.css @@ -1,7 +1,7 @@ .terms-tags li { display: inline-block; margin: 10px; - font-weight: 500 + font-weight: 500; } .terms-tags a { @@ -9,10 +9,10 @@ padding: 3px 10px; background: var(--tertiary); border-radius: 6px; - transition: transform .1s + transition: transform 0.1s; } -.terms-tags a:hover { +.terms-tags a:active { background: var(--tertiary); - transform: scale(.96) + transform: scale(0.96); } diff --git a/assets/css/core/license.css b/assets/css/core/license.css new file mode 100644 index 0000000..8e81d22 --- /dev/null +++ b/assets/css/core/license.css @@ -0,0 +1,6 @@ +/* + PaperMod v6 + License: MIT https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE + Copyright (c) 2020 nanxiaobei and adityatelange + Copyright (c) 2021-2022 adityatelange +*/ diff --git a/assets/css/core/reset.css b/assets/css/core/reset.css new file mode 100644 index 0000000..f509cf6 --- /dev/null +++ b/assets/css/core/reset.css @@ -0,0 +1,116 @@ +*, +::after, +::before { + box-sizing: border-box; +} + +html { + -webkit-tap-highlight-color: transparent; + overflow-y: scroll; +} + +a, +button, +body, +h1, +h2, +h3, +h4, +h5, +h6 { + color: var(--primary); +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-size: 18px; + line-height: 1.6; + word-break: break-word; + background: var(--theme); +} + +article, +aside, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +table { + display: block; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.2; +} + +h1, +h2, +h3, +h4, +h5, +h6, +p { + margin-top: 0; + margin-bottom: 0; +} + +ul { + padding: 0; +} + +a { + text-decoration: none; +} + +body, +figure, +ul { + margin: 0; +} + +table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow-x: auto; + word-break: keep-all; +} + +button, +input, +textarea { + padding: 0; + font: inherit; + background: 0 0; + border: 0; +} + +input, +textarea { + outline: 0; +} + +button, +input[type=button], +input[type=submit] { + cursor: pointer; +} + +input:-webkit-autofill, +textarea:-webkit-autofill { + box-shadow: 0 0 0 50px var(--theme) inset; +} + +img { + display: block; + max-width: 100%; +} diff --git a/assets/css/core/theme-vars.css b/assets/css/core/theme-vars.css new file mode 100644 index 0000000..fd0c5ee --- /dev/null +++ b/assets/css/core/theme-vars.css @@ -0,0 +1,38 @@ +:root { + --gap: 24px; + --content-gap: 20px; + --nav-width: 1024px; + --main-width: 720px; + --header-height: 60px; + --footer-height: 60px; + --radius: 8px; + --theme: rgb(255, 255, 255); + --entry: rgb(255, 255, 255); + --primary: rgb(30, 30, 30); + --secondary: rgb(108, 108, 108); + --tertiary: rgb(214, 214, 214); + --content: rgb(31, 31, 31); + --hljs-bg: rgb(28, 29, 33); + --code-bg: rgb(245, 245, 245); + --border: rgb(238, 238, 238); +} + +.dark { + --theme: rgb(29, 30, 32); + --entry: rgb(46, 46, 51); + --primary: rgb(218, 218, 219); + --secondary: rgb(155, 156, 157); + --tertiary: rgb(65, 66, 68); + --content: rgb(196, 196, 197); + --hljs-bg: rgb(46, 46, 51); + --code-bg: rgb(55, 56, 62); + --border: rgb(51, 51, 51); +} + +.list { + background: var(--code-bg); +} + +.dark.list { + background: var(--theme); +} diff --git a/assets/css/core/zmedia.css b/assets/css/core/zmedia.css new file mode 100644 index 0000000..210d486 --- /dev/null +++ b/assets/css/core/zmedia.css @@ -0,0 +1,49 @@ +@media screen and (max-width: 768px) { + /* theme-vars */ + :root { + --gap: 14px; + } + + /* profile-mode */ + .profile img { + transform: scale(0.85); + } + + /* post-entry */ + .first-entry { + min-height: 260px; + } + + /* archive */ + .archive-month { + flex-direction: column; + } + + .archive-year { + margin-top: 20px; + } + + /* footer */ + .footer { + padding: calc((var(--footer-height) - var(--gap) - 10px) / 2) var(--gap); + } +} + +/* footer */ +@media screen and (max-width: 900px) { + .list .top-link { + transform: translateY(-5rem); + } +} + +@media (prefers-reduced-motion) { + /* terms; profile-mode; post-single; post-entry; post-entry; search; search */ + .terms-tags a:active, + .button:active, + .post-entry:active, + .top-link, + #searchResults .focus, + #searchResults li:active { + transform: none; + } +} diff --git a/assets/css/extended/blank.css b/assets/css/extended/blank.css new file mode 100644 index 0000000..a577295 --- /dev/null +++ b/assets/css/extended/blank.css @@ -0,0 +1,5 @@ +/* +This is just a placeholder blank stylesheet so as to support adding custom styles budled with theme's default styles + +Read https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#bundling-custom-css-with-themes-assets for more info +*/ diff --git a/assets/css/an-old-hope.min.css b/assets/css/hljs/an-old-hope.min.css similarity index 73% rename from assets/css/an-old-hope.min.css rename to assets/css/hljs/an-old-hope.min.css index acf5824..b5dabdf 100644 --- a/assets/css/an-old-hope.min.css +++ b/assets/css/hljs/an-old-hope.min.css @@ -1,6 +1,6 @@ .hljs-comment, .hljs-quote { - color: #b6b18b + color: #b6b18b; } .hljs-deletion, @@ -11,7 +11,7 @@ .hljs-tag, .hljs-template-variable, .hljs-variable { - color: #eb3c54 + color: #eb3c54; } .hljs-built_in, @@ -22,28 +22,28 @@ .hljs-number, .hljs-params, .hljs-type { - color: #e7ce56 + color: #e7ce56; } .hljs-attribute { - color: #ee7c2b + color: #ee7c2b; } .hljs-addition, .hljs-bullet, .hljs-string, .hljs-symbol { - color: #4fb4d7 + color: #4fb4d7; } .hljs-section, .hljs-title { - color: #78bb65 + color: #78bb65; } .hljs-keyword, .hljs-selector-tag { - color: #b45ea4 + color: #b45ea4; } .hljs { @@ -51,13 +51,13 @@ overflow-x: auto; background: #1c1d21; color: #c0c5ce; - padding: .5em + padding: .5em; } .hljs-emphasis { - font-style: italic + font-style: italic; } .hljs-strong { - font-weight: 700 -} \ No newline at end of file + font-weight: 700; +} diff --git a/assets/css/includes/scroll-bar.css b/assets/css/includes/scroll-bar.css new file mode 100644 index 0000000..47405de --- /dev/null +++ b/assets/css/includes/scroll-bar.css @@ -0,0 +1,63 @@ +/* from reset */ +::-webkit-scrollbar-track { + background: 0 0; +} + +.list:not(.dark)::-webkit-scrollbar-track { + background: var(--code-bg); +} + +::-webkit-scrollbar-thumb { + background: var(--tertiary); + border: 5px solid var(--theme); + border-radius: var(--radius); +} + +.list:not(.dark)::-webkit-scrollbar-thumb { + border: 5px solid var(--code-bg); +} + +::-webkit-scrollbar-thumb:hover { + background: var(--secondary); +} + +::-webkit-scrollbar:not(.highlighttable, .highlight table, .gist .highlight) { + background: var(--theme); +} + +/* from post-single */ +.post-content .highlighttable td .highlight pre code::-webkit-scrollbar { + display: none; +} + +.post-content :not(table) ::-webkit-scrollbar-thumb { + border: 2px solid var(--hljs-bg); + background: rgb(113, 113, 117); +} + +.post-content :not(table) ::-webkit-scrollbar-thumb:hover { + background: rgb(163, 163, 165); +} + +.gist table::-webkit-scrollbar-thumb { + border: 2px solid rgb(255, 255, 255); + background: rgb(173, 173, 173); +} + +.gist table::-webkit-scrollbar-thumb:hover { + background: rgb(112, 112, 112); +} + +.post-content table::-webkit-scrollbar-thumb { + border-width: 2px; +} + +/* from zmedia */ +@media screen and (min-width: 768px) { + + /* reset */ + ::-webkit-scrollbar { + width: 19px; + height: 11px; + } +} \ No newline at end of file diff --git a/assets/css/main.css b/assets/css/main.css deleted file mode 100644 index b9dbe41..0000000 --- a/assets/css/main.css +++ /dev/null @@ -1,49 +0,0 @@ -.main { - position: relative; - min-height: calc(100vh - var(--header-height) - var(--footer-height)); - max-width: calc(var(--main-width) + var(--gap) * 2); - margin: auto; - padding: var(--gap) -} - -.page-header { - margin-bottom: 24px -} - -.page-header h1 { - font-size: 40px -} - -.pagination { - display: flex -} - -.pagination a { - color: var(--theme); - font-size: 13px; - line-height: 36px; - background: var(--primary); - border-radius: calc(36px / 2); - padding: 0 16px -} - -.pagination .next { - margin-inline-start: auto -} - -.social-icons { - padding: 12px 0 -} - -.social-icons a:not(:last-of-type) { - margin-inline-end: 12px -} - -.social-icons a svg { - height: 26px; - width: 26px -} - -code { - direction: ltr -} diff --git a/assets/css/post-single.css b/assets/css/post-single.css deleted file mode 100644 index 084ffad..0000000 --- a/assets/css/post-single.css +++ /dev/null @@ -1,335 +0,0 @@ -.post-header { - margin: 24px auto var(--content-gap) auto -} - -.post-title { - margin-bottom: 2px; - font-size: 40px; - transform: translateX(-2px) -} - -.post-meta { - color: var(--secondary); - font-size: 14px; - display: flex; - flex-wrap: wrap -} - -.post-meta .i18n_list li { - display: inline-flex; - list-style: none; - margin: auto 3px; - box-shadow: 0 1px 0 var(--secondary) -} - -.post-content { - color: var(--content) -} - -.post-content h3, -.post-content h4, -.post-content h5, -.post-content h6 { - margin: 24px 0 16px -} - -.post-content h1 { - margin: 40px auto 32px; - font-size: 40px -} - -.post-content h2 { - margin: 32px auto 24px; - font-size: 32px -} - -.post-content h3 { - font-size: 24px -} - -.post-content h4 { - font-size: 16px -} - -.post-content h5 { - font-size: 14px -} - -.post-content h6 { - font-size: 12px -} - -.post-content a, -.toc a:hover { - box-shadow: 0 1px 0 var(--primary) -} - -.post-content a code { - margin: auto 0; - border-radius: 0; - box-shadow: 0 -1px 0 var(--primary) inset -} - -.post-content del { - text-decoration: none; - background: linear-gradient(to right, var(--primary) 100%, transparent 0) 0 50%/1px 1px repeat-x -} - -.post-content dl, -.post-content ol, -.post-content p, -.post-content ul { - margin-bottom: var(--content-gap) -} - -.post-content ol, -.post-content ul { - padding-inline-start: 20px -} - -.post-content li { - margin-top: 5px -} - -.post-content li p { - margin-bottom: 0 -} - -.post-content dl { - display: flex; - flex-wrap: wrap; - margin: 0 -} - -.post-content dt { - width: 25%; - font-weight: 700 -} - -.post-content dd { - width: 75%; - margin-inline-start: 0; - padding-inline-start: 10px -} - -.post-content dd~dd, -.post-content dt~dt { - margin-top: 10px -} - -.post-content table { - margin-bottom: 32px -} - -.post-content table th, -.post-content table:not(.highlighttable) td { - min-width: 80px; - padding: 12px 8px; - line-height: 1.5; - border-bottom: 1px solid var(--border) -} - -.post-content table th { - font-size: 14px; - text-align: start -} - -.post-content table:not(.highlighttable) td code:only-child { - margin: auto 0 -} - -.post-content .highlight, -.post-content pre { - margin: auto calc(var(--gap) * -1) 32px; - background: var(--hljs-bg) !important; - border-radius: var(--radius) -} - -.post-content li>.highlight { - margin-inline-end: 0 -} - -.post-content ul pre { - margin-inline-start: calc(var(--gap) * -2) -} - -.post-content .highlight pre { - margin: 0 -} - -.post-content .highlighttable { - table-layout: fixed -} - -.post-content .highlighttable td:first-child { - width: 40px -} - -.post-content .highlighttable td .linenodiv { - padding-inline-end: 0 !important -} - -.post-content .highlighttable td .highlight, -.post-content .highlighttable td .linenodiv pre { - margin-bottom: 0 -} - -.post-content .highlighttable td .highlight pre code::-webkit-scrollbar { - display: none -} - -.post-content .highlight span { - background: 0 0 !important -} - -.post-content code { - margin: auto 4px; - padding: 4px 6px; - font-family: Menlo, Monaco, 'Courier New', Courier, monospace; - font-size: .78em; - line-height: 1.5; - background: var(--code-bg); - border-radius: 2px -} - -.post-content pre code { - display: block; - margin: auto 0; - padding: 10px; - color: rgba(255, 255, 255, .8); - background: 0 0; - border-radius: 0; - overflow-x: auto -} - -.post-content blockquote { - margin: 0 calc(var(--gap) * -1); - padding: 0 32px; - border-inline-start: 2px solid var(--primary) -} - -.post-content hr { - margin: 30px calc(var(--gap) * -1); - height: 2px; - background: var(--tertiary); - border-top: 0; - border-bottom: 0 -} - -.post-content iframe { - max-width: 100% -} - -.post-content img { - border-radius: 4px -} - -.toc { - margin-bottom: 40px; - border: 1px solid var(--border); - border-radius: var(--radius); - padding: .5em -} - -.toc details summary { - cursor: zoom-in; - margin-inline-start: 20px -} - -.toc details[open] summary { - cursor: zoom-out -} - -.toc .details { - display: inline; - font-weight: 500 -} - -.toc blockquote { - margin: 0 20px; - padding: 10px 20px -} - -.toc li ul { - margin-inline-start: var(--gap) -} - -.toc summary:focus { - outline: 0 -} - -.post-footer { - margin-top: 56px -} - -.post-tags li { - display: inline-block; - margin-inline-end: 3px; - margin-bottom: 5px -} - -.post-tags a, -.share-buttons { - border: 1px solid var(--tertiary) -} - -.post-tags a { - display: block; - padding-inline-start: 14px; - padding-inline-end: 14px; - color: var(--secondary); - font-size: 14px; - line-height: 34px; - background: var(--code-bg); - border-radius: 4px -} - -.post-tags a:hover { - background: var(--border) -} - -.share-buttons { - margin-top: var(--gap); - padding-inline-start: var(--radius); - border-radius: var(--radius); - display: flex; - overflow-x: auto -} - -.share-buttons a { - margin-top: 10px -} - -.share-buttons a:not(:last-of-type) { - margin-inline-end: 12px -} - -.share-buttons a svg { - height: 30px; - width: 30px; - fill: currentColor; - transition: transform .1s -} - -.share-buttons svg:hover { - transform: scale(.96) -} - -h1:hover .anchor, -h2:hover .anchor, -h3:hover .anchor, -h4:hover .anchor, -h5:hover .anchor, -h6:hover .anchor { - display: inline-flex; - color: var(--secondary); - margin-inline-start: 8px; - font-weight: 500 -} - -@media screen and (max-width:600px) { - .post-content blockquote { - margin: 0 calc(var(--gap) * -1); - padding: 0 21px - } -} diff --git a/assets/css/profile-mode.css b/assets/css/profile-mode.css deleted file mode 100644 index d59f736..0000000 --- a/assets/css/profile-mode.css +++ /dev/null @@ -1,57 +0,0 @@ -.buttons, -.main .profile { - display: flex; - justify-content: center -} - -.main .profile { - position: absolute; - left: 0; - right: 0; - align-items: center; - height: 80%; - text-align: center -} - -.profile .profile_inner h1 { - padding: 12px 0 -} - -.profile .profile_inner span { - padding: 10px 0; - font-size: 18px -} - -.profile img { - display: inline-table; - border-radius: 50%; - pointer-events: none -} - -@media screen and (max-width:600px) { - .profile img { - transform: scale(.85) - } -} - -.buttons { - flex-wrap: wrap; - max-width: 400px; - margin: 0 auto -} - -.button { - background: var(--tertiary); - border-radius: var(--radius); - margin: 8px; - padding: 6px; - transition: transform .1s -} - -.button-inner { - padding: 0 8px -} - -.button:active { - transform: scale(.96) -} diff --git a/assets/css/reset.css b/assets/css/reset.css deleted file mode 100644 index 9640924..0000000 --- a/assets/css/reset.css +++ /dev/null @@ -1,144 +0,0 @@ -*, -::after, -::before { - box-sizing: border-box -} - -html { - -webkit-tap-highlight-color: transparent -} - -a, -body, -h1, -h2, -h3, -h4, -h5, -h6 { - color: var(--primary) -} - -body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - font-size: 18px; - line-height: 1.6; - word-break: break-word; - background: var(--theme) -} - -article, -aside, -figcaption, -figure, -footer, -header, -hgroup, -main, -nav, -section, -table { - display: block -} - -h1, -h2, -h3, -h4, -h5, -h6 { - line-height: 1.2 -} - -h1, -h2, -h3, -h4, -h5, -h6, -p { - margin-top: 0; - margin-bottom: 0 -} - -ul { - padding: 0 -} - -a { - text-decoration: none -} - -body, -figure, -ul { - margin: 0 -} - -table { - width: 100%; - border-collapse: collapse; - border-spacing: 0; - overflow-x: scroll; - word-break: keep-all -} - -button, -input, -textarea { - padding: 0; - font: inherit; - background: 0 0; - border: 0; - -webkit-appearance: none -} - -input, -textarea { - outline: 0 -} - -button, -input[type=button], -input[type=submit] { - cursor: pointer -} - -input:-webkit-autofill, -textarea:-webkit-autofill { - box-shadow: 0 0 0 50px var(--theme) inset -} - -img { - display: block; - max-width: 100% -} - -::-webkit-scrollbar { - width: 10px; - height: 6px -} - -::-webkit-scrollbar-track { - background: var(--theme) -} - -.list:not(.dark)::-webkit-scrollbar-track { - background: var(--code-bg) -} - -::-webkit-scrollbar-thumb { - background: var(--tertiary); - border-radius: var(--radius) -} - -::-webkit-scrollbar-thumb:hover { - background: var(--secondary) -} - -@media screen and (max-width:800px) { - ::-webkit-scrollbar { - width: 8px; - height: 2px - } -} diff --git a/assets/css/theme-vars.css b/assets/css/theme-vars.css deleted file mode 100644 index 47c061c..0000000 --- a/assets/css/theme-vars.css +++ /dev/null @@ -1,44 +0,0 @@ -:root { - --gap: 24px; - --content-gap: 20px; - --nav-width: 1024px; - --main-width: 720px; - --header-height: 60px; - --footer-height: 60px; - --radius: 8px; - --theme: #fff; - --entry: #fff; - --primary: rgba(0, 0, 0, 0.88); - --secondary: rgba(0, 0, 0, 0.56); - --tertiary: rgba(0, 0, 0, 0.16); - --content: rgba(0, 0, 0, 0.88); - --hljs-bg: #1c1d21; - --code-bg: #f5f5f5; - --border: #eee -} - -@media screen and (max-width:600px) { - :root { - --gap: 14px - } -} - -.dark { - --theme: #1d1e20; - --entry: #2e2e33; - --primary: rgba(255, 255, 255, 0.84); - --secondary: rgba(255, 255, 255, 0.56); - --tertiary: rgba(255, 255, 255, 0.16); - --content: rgba(255, 255, 255, 0.64); - --hljs-bg: #2e2e33; - --code-bg: #37383e; - --border: #5b5d67 -} - -.list { - background: var(--code-bg) -} - -.dark.list { - background: var(--theme) -} diff --git a/assets/js/fastsearch.js b/assets/js/fastsearch.js new file mode 100644 index 0000000..06ebcfb --- /dev/null +++ b/assets/js/fastsearch.js @@ -0,0 +1,147 @@ +import * as params from '@params'; + +let fuse; // holds our search engine +let resList = document.getElementById('searchResults'); +let sInput = document.getElementById('searchInput'); +let first, last, current_elem = null +let resultsAvailable = false; + +// load our search index +window.onload = function () { + let xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + if (xhr.status === 200) { + let data = JSON.parse(xhr.responseText); + if (data) { + // fuse.js options; check fuse.js website for details + let options = { + distance: 100, + threshold: 0.4, + ignoreLocation: true, + keys: [ + 'title', + 'permalink', + 'summary', + 'content' + ] + }; + if (params.fuseOpts) { + options = { + isCaseSensitive: params.fuseOpts.iscasesensitive ?? false, + includeScore: params.fuseOpts.includescore ?? false, + includeMatches: params.fuseOpts.includematches ?? false, + minMatchCharLength: params.fuseOpts.minmatchcharlength ?? 1, + shouldSort: params.fuseOpts.shouldsort ?? true, + findAllMatches: params.fuseOpts.findallmatches ?? false, + keys: params.fuseOpts.keys ?? ['title', 'permalink', 'summary', 'content'], + location: params.fuseOpts.location ?? 0, + threshold: params.fuseOpts.threshold ?? 0.4, + distance: params.fuseOpts.distance ?? 100, + ignoreLocation: params.fuseOpts.ignorelocation ?? true + } + } + fuse = new Fuse(data, options); // build the index from the json file + } + } else { + console.log(xhr.responseText); + } + } + }; + xhr.open('GET', "../index.json"); + xhr.send(); +} + +function activeToggle(ae) { + document.querySelectorAll('.focus').forEach(function (element) { + // rm focus class + element.classList.remove("focus") + }); + if (ae) { + ae.focus() + document.activeElement = current_elem = ae; + ae.parentElement.classList.add("focus") + } else { + document.activeElement.parentElement.classList.add("focus") + } +} + +function reset() { + resultsAvailable = false; + resList.innerHTML = sInput.value = ''; // clear inputbox and searchResults + sInput.focus(); // shift focus to input box +} + +// execute search as each character is typed +sInput.onkeyup = function (e) { + // run a search query (for "term") every time a letter is typed + // in the search box + if (fuse) { + const results = fuse.search(this.value.trim()); // the actual query being run using fuse.js + if (results.length !== 0) { + // build our html if result exists + let resultSet = ''; // our results bucket + + for (let item in results) { + resultSet += `
  • ${results[item].item.title} »
    ` + + `
  • ` + } + + resList.innerHTML = resultSet; + resultsAvailable = true; + first = resList.firstChild; + last = resList.lastChild; + } else { + resultsAvailable = false; + resList.innerHTML = ''; + } + } +} + +sInput.addEventListener('search', function (e) { + // clicked on x + if (!this.value) reset() +}) + +// kb bindings +document.onkeydown = function (e) { + let key = e.key; + let ae = document.activeElement; + + let inbox = document.getElementById("searchbox").contains(ae) + + if (ae === sInput) { + let elements = document.getElementsByClassName('focus'); + while (elements.length > 0) { + elements[0].classList.remove('focus'); + } + } else if (current_elem) ae = current_elem; + + if (key === "Escape") { + reset() + } else if (!resultsAvailable || !inbox) { + return + } else if (key === "ArrowDown") { + e.preventDefault(); + if (ae == sInput) { + // if the currently focused element is the search input, focus the of first
  • + activeToggle(resList.firstChild.lastChild); + } else if (ae.parentElement != last) { + // if the currently focused element's parent is last, do nothing + // otherwise select the next search result + activeToggle(ae.parentElement.nextSibling.lastChild); + } + } else if (key === "ArrowUp") { + e.preventDefault(); + if (ae.parentElement == first) { + // if the currently focused element is first item, go to input box + activeToggle(sInput); + } else if (ae != sInput) { + // if the currently focused element is input box, do nothing + // otherwise select the previous search result + activeToggle(ae.parentElement.previousSibling.lastChild); + } + } else if (key === "ArrowRight") { + ae.click(); // click on active link + } +} diff --git a/assets/js/fuse.basic.min.js b/assets/js/fuse.basic.min.js new file mode 100644 index 0000000..89477c6 --- /dev/null +++ b/assets/js/fuse.basic.min.js @@ -0,0 +1,9 @@ +/** + * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) + * + * Copyright (c) 2022 Kiro Risk (http://kiro.me) + * All Rights Reserved. Apache Software License 2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ +var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(_).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),a=parseFloat(Math.round(o*r)/r);return n.set(i,a),a},clear:function(){n.clear()}}}var O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?L.getFn:n,o=t.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o;r(this,e),this.norm=S(a,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,u(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();u(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?L.getFn:r,o=n.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o,c=new O({getFn:i,fieldNormWeight:a});return c.setKeys(e.map(k)),c.setSources(t),c.create(),c}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,c=void 0===a?0:a,s=t.distance,h=void 0===s?L.distance:s,u=t.ignoreLocation,l=void 0===u?L.ignoreLocation:u,d=r/e.length;if(l)return d;var f=Math.abs(c-o);return h?d+f/h:f?1:d}function E(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var I=32;function F(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?L.location:o,c=i.threshold,s=void 0===c?L.threshold:c,h=i.distance,u=void 0===h?L.distance:h,l=i.includeMatches,d=void 0===l?L.includeMatches:l,f=i.findAllMatches,v=void 0===f?L.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?L.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?L.isCaseSensitive:p,b=i.ignoreLocation,k=void 0===b?L.ignoreLocation:b;if(r(this,e),this.options={location:a,threshold:s,distance:u,includeMatches:d,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:k},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var M=function(e,t){n.chunks.push({pattern:e,alphabet:F(e),startIndex:t})},w=this.pattern.length;if(w>I){for(var x=0,_=w%I,S=w-_;x3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?L.location:i,a=r.distance,c=void 0===a?L.distance:a,s=r.threshold,h=void 0===s?L.threshold:s,u=r.findAllMatches,l=void 0===u?L.findAllMatches:u,d=r.minMatchCharLength,f=void 0===d?L.minMatchCharLength:d,v=r.includeMatches,g=void 0===v?L.includeMatches:v,y=r.ignoreLocation,m=void 0===y?L.ignoreLocation:y;if(t.length>I)throw new Error(p(I));for(var b,k=t.length,M=e.length,w=Math.max(0,Math.min(o,M)),x=h,_=w,S=f>1||g,O=S?Array(M):[];(b=e.indexOf(t,_))>-1;){var A=j(t,{currentLocation:b,expectedLocation:w,distance:c,ignoreLocation:m});if(x=Math.min(A,x),_=b+k,S)for(var F=0;F=T;R-=1){var U=R-1,B=n[e.charAt(U)];if(S&&(O[U]=+!!B),J[R]=(J[R+1]<<1|1)&B,$&&(J[R]|=(C[R+1]|C[R])<<1|1|C[R+1]),J[R]&W&&(N=j(t,{errors:$,currentLocation:U,expectedLocation:w,distance:c,ignoreLocation:m}))<=x){if(x=N,(_=U)<=w)break;T=Math.max(1,2*w-_)}}if(j(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:c,ignoreLocation:m})>x)break;C=J}var V={isMatch:_>=0,score:Math.max(.001,N)};if(S){var q=E(O,f);q.length?g&&(V.indices=q):V.isMatch=!1}return V}(e,n,i,{location:a+o,distance:s,threshold:h,findAllMatches:u,minMatchCharLength:l,includeMatches:r,ignoreLocation:d}),m=y.isMatch,b=y.score,k=y.indices;m&&(g=!0),v+=b,m&&k&&(f=[].concat(c(f),c(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=f),y}}]),e}(),N=[];function P(e,t){for(var n=0,r=N.length;n-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function D(e,t){t.score=e.score}function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?L.includeMatches:r,o=n.includeScore,a=void 0===o?L.includeScore:o,c=[];return i&&c.push($),a&&c.push(D),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}var T=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(r(this,e),this.options=t(t({},L),i),this.options.useExtendedSearch)throw new Error(y);this._keyStore=new b(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof O))throw new Error("Incorrect 'index' type");this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){f(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,a=i.includeScore,c=i.shouldSort,s=i.sortFn,h=i.ignoreFieldNorm,d=u(e)?u(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return W(d,{ignoreFieldNorm:h}),c&&d.sort(s),l(r)&&r>-1&&(d=d.slice(0,r)),K(d,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=P(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(f(n)){var a=t.searchIn(n),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=P(e,this.options),r=this._myIndex,i=r.keys,o=r.records,a=[];return o.forEach((function(e){var r=e.$,o=e.i;if(f(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,c(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&a.push({idx:o,item:r,matches:s})}})),a}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!f(n))return[];var i=[];if(h(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(f(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),s=c.isMatch,u=c.score,l=c.indices;s&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),e}();return T.version="6.6.2",T.createIndex=A,T.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?L.getFn:n,i=t.fieldNormWeight,o=void 0===i?L.fieldNormWeight:i,a=e.keys,c=e.records,s=new O({getFn:r,fieldNormWeight:o});return s.setKeys(a),s.setIndexRecords(c),s},T.config=L,T},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); \ No newline at end of file diff --git a/assets/js/license.js b/assets/js/license.js new file mode 100644 index 0000000..8e81d22 --- /dev/null +++ b/assets/js/license.js @@ -0,0 +1,6 @@ +/* + PaperMod v6 + License: MIT https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE + Copyright (c) 2020 nanxiaobei and adityatelange + Copyright (c) 2021-2022 adityatelange +*/ diff --git a/i18n/ar.yaml b/i18n/ar.yaml new file mode 100644 index 0000000..11f50a2 --- /dev/null +++ b/i18n/ar.yaml @@ -0,0 +1,22 @@ +- id: prev_page + translation: "الصفحة السابقة" + +- id: next_page + translation: "الصفحة التالية" + +- id: read_time + translation: + one: "دقيقة واحدة" + two: "دقيقتان" + few: "بضع ثوان" + zero: "الآن" + other: "دقائق {{ .Count }}" + +- id: toc + translation: "فهرس المحتوى" + +- id: translations + translation: "ترجمات أخرى" + +- id: home + translation: "الصفحة الرئيسية" diff --git a/i18n/bn.yaml b/i18n/bn.yaml new file mode 100644 index 0000000..f42780f --- /dev/null +++ b/i18n/bn.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "পূর্ববর্তী" + +- id: next_page + translation: "পরবর্তী" + +- id: read_time + translation: + one : "১ মিনিট" + other: "{{ .Count }} মিনিট" + +- id: words + translation: + one : "১ টি শব্দ" + other: "{{ .Count }} টি শব্দ" + +- id: toc + translation: "সূচিপত্র" + +- id: translations + translation: "অনুবাদসমূহ" + +- id: home + translation: "হোম" + +- id: edit_post + translation: "সম্পাদনা করুন" + +- id: code_copy + translation: "কপি করুন" + +- id: code_copied + translation: "কপি হয়েছে!" diff --git a/i18n/ca.yaml b/i18n/ca.yaml new file mode 100644 index 0000000..15713e1 --- /dev/null +++ b/i18n/ca.yaml @@ -0,0 +1,19 @@ +- id: prev_page + translation: "Pàgina anterior" + +- id: next_page + translation: "Pàgina següent" + +- id: read_time + translation: + one : "1 min" + other: "{{ .Count }} min" + +- id: toc + translation: "Taula de Continguts" + +- id: translations + translation: "Traduccions" + +- id: home + translation: "Inici" diff --git a/i18n/ckb.yaml b/i18n/ckb.yaml new file mode 100644 index 0000000..25789d1 --- /dev/null +++ b/i18n/ckb.yaml @@ -0,0 +1,25 @@ +- id: prev_page + translation: "پەڕەی پێشتر" + +- id: next_page + translation: "پەڕەی دواتر" + +- id: read_time + translation: + one : "1 خولەک" + other: "{{ .Count }} خولەک" + +- id: toc + translation: "پێڕست" + +- id: translations + translation: "وەرگێڕانەکان" + +- id: home + translation: "ماڵەوە" + +- id: code_copy + translation: "لەبەری بگرەوە" + +- id: code_copied + translation: "لەبەر گیرایەوە!" diff --git a/i18n/da.yaml b/i18n/da.yaml new file mode 100644 index 0000000..03b0abe --- /dev/null +++ b/i18n/da.yaml @@ -0,0 +1,28 @@ +- id: prev_page + translation: "Forrige Side" + +- id: next_page + translation: "Næste Side" + +- id: read_time + translation: + one: "1 min" + other: "{{ .Count }} min" + +- id: toc + translation: "Indholdsfortegnelse" + +- id: translations + translation: "Oversættelser" + +- id: home + translation: "Start" + +- id: edit_post + translation: "Rediger" + +- id: code_copy + translation: "kopier" + +- id: code_copied + translation: "kopieret!" diff --git a/i18n/de.yaml b/i18n/de.yaml index e7feaac..f64aad9 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -1,5 +1,33 @@ - id: prev_page - translation: "Vorherige Seite" + translation: "Vorherige" - id: next_page - translation: "Nächste Seite" + translation: "Nächste" + +- id: read_time + translation: + one: "1 Minute" + other: "{{ .Count }} Minuten" + +- id: words + translation: + one : "Wort" + other: "{{ .Count }} Wörter" + +- id: toc + translation: "Inhaltsverzeichnis" + +- id: translations + translation: "Übersetzungen" + +- id: home + translation: "Home" + +- id: edit_post + translation: "Bearbeiten" + +- id: code_copy + translation: "Kopieren" + +- id: code_copied + translation: "Kopiert!" diff --git a/i18n/en.yaml b/i18n/en.yaml index 14b37b5..3a1e215 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1,16 +1,33 @@ - id: prev_page - translation: "Prev Page" + translation: "Prev" - id: next_page - translation: "Next Page" + translation: "Next" - id: read_time translation: one : "1 min" other: "{{ .Count }} min" +- id: words + translation: + one : "word" + other: "{{ .Count }} words" + - id: toc translation: "Table of Contents" - id: translations translation: "Translations" + +- id: home + translation: "Home" + +- id: edit_post + translation: "Edit" + +- id: code_copy + translation: "copy" + +- id: code_copied + translation: "copied!" diff --git a/i18n/eo.yaml b/i18n/eo.yaml new file mode 100644 index 0000000..de5d744 --- /dev/null +++ b/i18n/eo.yaml @@ -0,0 +1,25 @@ +- id: prev_page + translation: "antaŭa paĝo" + +- id: next_page + translation: "sekva paĝo" + +- id: read_time + translation: + one : "1 min" + other: "{{ .Count }} min" + +- id: toc + translation: "Enhavo" + +- id: translations + translation: "tradukoj" + +- id: home + translation: "ĉefpaĝo" + +- id: code_copy + translation: "kopii" + +- id: code_copied + translation: "kopiite!" diff --git a/i18n/es.yaml b/i18n/es.yaml index 38d2239..52a559c 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -1,16 +1,33 @@ - id: prev_page - translation: "Página anterior" + translation: "Anterior" - id: next_page - translation: "Página siguiente" + translation: "Siguiente" - id: read_time translation: one : "1 min" other: "{{ .Count }} min" +- id: words + translation: + one : "palabra" + other: "{{ .Count }} palabras" + - id: toc translation: "Tabla de Contenidos" - id: translations translation: "Traducciones" + +- id: home + translation: "Inicio" + +- id: edit_post + translation: "Editar" + +- id: code_copy + translation: "copiar" + +- id: code_copied + translation: "¡copiado!" diff --git a/i18n/fa.yaml b/i18n/fa.yaml index 3cdd047..3fd5927 100644 --- a/i18n/fa.yaml +++ b/i18n/fa.yaml @@ -1,16 +1,28 @@ - id: prev_page - translation: "صفحهٔ قبل" + translation: "صفحه قبلی" - id: next_page - translation: "صفحهٔ بعد" + translation: "صفحه بعدی" - id: read_time translation: - one : "1 دقیقه" + one: "۱ دقیقه" other: "{{ .Count }} دقیقه" - id: toc translation: "فهرست مطالب" - id: translations - translation: "ترجمه‌ها" + translation: "ترجمه ها" + +- id: home + translation: "خانه" + +- id: edit_post + translation: "ویرایش" + +- id: code_copy + translation: "کپی" + +- id: code_copied + translation: "کپی شد!" \ No newline at end of file diff --git a/i18n/fr.yaml b/i18n/fr.yaml index a26a876..b074c10 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -1,5 +1,33 @@ - id: prev_page - translation: "Page Précédente" + translation: "Page précédente" - id: next_page - translation: "Page Suivante" + translation: "Page suivante" + +- id: read_time + translation: + one : "1 min" + other: "{{ .Count }} min" + +- id: words + translation: + one : "mot" + other: "{{ .Count }} mots" + +- id: toc + translation: "Table des matières" + +- id: translations + translation: "Traductions" + +- id: home + translation: "Accueil" + +- id: edit_post + translation: "Modifier" + +- id: code_copy + translation: "Copier" + +- id: code_copied + translation: "Copié !" diff --git a/i18n/he.yaml b/i18n/he.yaml new file mode 100644 index 0000000..3912fb8 --- /dev/null +++ b/i18n/he.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "קודם" + +- id: next_page + translation: "הבא" + +- id: read_time + translation: + one : "דקה אחת" + other: "דקות {{ .Count }}" + +- id: words + translation: + one : "word" + other: "מילים {{ .Count }} " + +- id: toc + translation: "תוכן העניינים" + +- id: translations + translation: "תרגומים" + +- id: home + translation: "בית" + +- id: edit_post + translation: "ערוך" + +- id: code_copy + translation: "העתק" + +- id: code_copied + translation: "!הועתק" diff --git a/i18n/hi.yaml b/i18n/hi.yaml index 24e8fc6..681efdc 100644 --- a/i18n/hi.yaml +++ b/i18n/hi.yaml @@ -1,14 +1,17 @@ - id: prev_page - translation: "पिछला पृष्ठ" + translation: "पिछला" - id: next_page - translation: "अगला पृष्ठ" + translation: "अगला" - id: read_time translation: one : "एक मिनट" other: "{{ .Count }} मिनट" +- id: edit_post + translation: "सुधारें" + - id: toc translation: "विषय - सूची" diff --git a/i18n/hr.yaml b/i18n/hr.yaml new file mode 100644 index 0000000..2f2d228 --- /dev/null +++ b/i18n/hr.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "Prethodna stranica" + +- id: next_page + translation: "Sljedeća stranica" + +- id: read_time + translation: + one : "1 minuta" + other: "{{ .Count }} minute" + +- id: words + translation: + one : "riječ" + other: "{{ .Count }} riječi" + +- id: toc + translation: "Tablica Sadržaja" + +- id: translations + translation: "Prijevodi" + +- id: home + translation: "Početna stranica" + +- id: edit_post + translation: "Promjeni" + +- id: code_copy + translation: "kopiraj" + +- id: code_copied + translation: "kopirano!" diff --git a/i18n/hu.yaml b/i18n/hu.yaml new file mode 100644 index 0000000..a039dda --- /dev/null +++ b/i18n/hu.yaml @@ -0,0 +1,16 @@ +- id: prev_page + translation: "Előző oldal" + +- id: next_page + translation: "Következő oldal" + +- id: read_time + translation: + one: "1 perc" + other: "{{ .Count }} perc" + +- id: toc + translation: "Tartalomjegyzék" + +- id: translations + translation: "Fordítások" diff --git a/i18n/id.yaml b/i18n/id.yaml new file mode 100644 index 0000000..93d34f5 --- /dev/null +++ b/i18n/id.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "Sebelumnya" + +- id: next_page + translation: "Selanjutnya" + +- id: read_time + translation: + one : "1 menit" + other: "{{ .Count }} menit" + +- id: words + translation: + one : "kata" + other: "{{ .Count }} kata" + +- id: toc + translation: "Daftar isi" + +- id: translations + translation: "Terjemahan" + +- id: home + translation: "Beranda" + +- id: edit_post + translation: "Sunting" + +- id: code_copy + translation: "salin" + +- id: code_copied + translation: "disalin!" \ No newline at end of file diff --git a/i18n/it.yaml b/i18n/it.yaml new file mode 100644 index 0000000..ef41db4 --- /dev/null +++ b/i18n/it.yaml @@ -0,0 +1,27 @@ +- id: prev_page + translation: "Pag Prec" + +- id: next_page + translation: "Pag Succ" + +- id: read_time + translation: + one: "1 minuto" + other: "{{ .Count }} minuti" + +- id: words + translation: + one : "parola" + other: "{{ .Count }} parole" + +- id: toc + translation: "Tabella dei Contenuti" + +- id: translations + translation: "Traduzioni" + +- id: code_copy + translation: "copia" + +- id: code_copied + translation: "copiato!" diff --git a/i18n/ja.yaml b/i18n/ja.yaml index 30b412d..bc7bf37 100644 --- a/i18n/ja.yaml +++ b/i18n/ja.yaml @@ -3,3 +3,31 @@ - id: next_page translation: "次のページ" + +- id: read_time + translation: + one : "1 分" + other: "{{ .Count }} 分" + +- id: words + translation: + one: "文字" + other: "{{ .Count }} 文字" + +- id: toc + translation: "目次" + +- id: translations + translation: "言語" + +- id: home + translation: "ホーム" + +- id: edit_post + translation: "編集" + +- id: code_copy + translation: "コピー" + +- id: code_copied + translation: "コピーされました!" diff --git a/i18n/ko.yaml b/i18n/ko.yaml index 129ad73..777dd93 100644 --- a/i18n/ko.yaml +++ b/i18n/ko.yaml @@ -3,3 +3,31 @@ - id: next_page translation: "다음 페이지" + +- id: read_time + translation: + one : "1 분" + other: "{{ .Count }} 분" + +- id: words + translation: + one : "단어" + other: "{{ .Count }} 단어" + +- id: toc + translation: "목차" + +- id: translations + translation: "번역" + +- id: home + translation: "홈" + +- id: edit_post + translation: "편집" + +- id: code_copy + translation: "복사" + +- id: code_copied + translation: "복사 완료!" diff --git a/i18n/ku.yaml b/i18n/ku.yaml new file mode 100644 index 0000000..d1d30a5 --- /dev/null +++ b/i18n/ku.yaml @@ -0,0 +1,25 @@ +- id: prev_page + translation: "Rûpela Paş" + +- id: next_page + translation: "Rûpela Pêş" + +- id: read_time + translation: + one : "1 xulek" + other: "{{ .Count }} xulek" + +- id: toc + translation: "Pêrist" + +- id: translations + translation: "Wergeran" + +- id: home + translation: "Xanî" + +- id: code_copy + translation: "Jê bigire" + +- id: code_copied + translation: "Hat jêgirtin!" diff --git a/i18n/mn.yaml b/i18n/mn.yaml new file mode 100644 index 0000000..dbce2ce --- /dev/null +++ b/i18n/mn.yaml @@ -0,0 +1,25 @@ +- id: prev_page + translation: "Ѳмнѳх" + +- id: next_page + translation: "Дараах" + +- id: read_time + translation: + one : "1 МИН" + other: "{{ .Count }} МИН" + +- id: toc + translation: "Агуулга" + +- id: translations + translation: "Орчуулга" + +- id: home + translation: "Нүүр" + +- id: code_copy + translation: "хуулах" + +- id: code_copied + translation: "хуулсан!" diff --git a/i18n/ms.yaml b/i18n/ms.yaml new file mode 100644 index 0000000..d8a9eff --- /dev/null +++ b/i18n/ms.yaml @@ -0,0 +1,28 @@ +- id: prev_page + translation: "Halaman Sebelumnya" + +- id: next_page + translation: "Halaman Seterusnya" + +- id: read_time + translation: + one: "1 minit" + other: "{{ .Count }} minit" + +- id: toc + translation: "Isi Kandungan" + +- id: translations + translation: "Terjemahan" + +- id: home + translation: "Home" + +- id: edit_post + translation: "Sunting" + +- id: code_copy + translation: "Salin" + +- id: code_copied + translation: "Disalin!" diff --git a/i18n/nl.yaml b/i18n/nl.yaml new file mode 100644 index 0000000..e9d06fa --- /dev/null +++ b/i18n/nl.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "Vorige" + +- id: next_page + translation: "Volgende" + +- id: read_time + translation: + one: "1 min" + other: "{{ .Count }} min" + +- id: words + translation: + one : "woord" + other: "{{ .Count }} woorden" + +- id: toc + translation: "Inhoudsopgave" + +- id: translations + translation: "Vertalingen" + +- id: home + translation: "Startpagina" + +- id: edit_post + translation: "Bewerk" + +- id: code_copy + translation: "kopieer" + +- id: code_copied + translation: "gekopieerd!" diff --git a/i18n/pl.yaml b/i18n/pl.yaml new file mode 100644 index 0000000..fdf6b0c --- /dev/null +++ b/i18n/pl.yaml @@ -0,0 +1,28 @@ +- id: prev_page + translation: "Poprzednia strona" + +- id: next_page + translation: "Następna strona" + +- id: read_time + translation: + one: "1 min" + other: "{{ .Count }} min" + +- id: toc + translation: "Spis treści" + +- id: translations + translation: "Tłumaczenia" + +- id: home + translation: "Strona Główna" + +- id: edit_post + translation: "Edytuj" + +- id: code_copy + translation: "Kopiuj" + +- id: code_copied + translation: "Skopiowano!" diff --git a/i18n/pt.yaml b/i18n/pt.yaml new file mode 100644 index 0000000..f449de9 --- /dev/null +++ b/i18n/pt.yaml @@ -0,0 +1,21 @@ +- id: prev_page + translation: "Página Anterior" + +- id: next_page + translation: "Próxima Página" + +- id: read_time + translation: + one: "1 minuto" + other: "{{ .Count }} minutos" + +- id: words + translation: + one : "palavra" + other: "{{ .Count }} palavras" + +- id: toc + translation: "Conteúdo" + +- id: translations + translation: "Traduções" diff --git a/i18n/ru.yaml b/i18n/ru.yaml index 3d4ed0f..634138b 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -1,17 +1,45 @@ - id: prev_page - translation: 'Предыдущая' + translation: "Предыдущая" - id: next_page - translation: 'Следующая' + translation: "Следующая" - id: read_time translation: +<<<<<<< HEAD one: "Время чтения: 1 мин" few: "Время чтения: {{ .Count }} мин" other: "Время чтения: {{ .Count }} мин" +======= + zero: "0 минут" + one: "1 минута" + few: "{{ .Count }} минуты" + many: "{{ .Count }} минут" + other: "{{ .Count }} минута" + +- id: words + translation: + zero: "0 слов" + one: "1 слово" + few: "{{ .Count }} слова" + many: "{{ .Count }} слов" + other: "{{ .Count }} слово" +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 - id: toc - translation: 'Оглавление' + translation: "Оглавление" - id: translations - translation: 'Переводы' + translation: "Переводы" + +- id: home + translation: "Главная" + +- id: edit_post + translation: "Редактировать" + +- id: code_copy + translation: "копировать" + +- id: code_copied + translation: "скопировано!" \ No newline at end of file diff --git a/i18n/ru.yaml.orig b/i18n/ru.yaml.orig new file mode 100644 index 0000000..634138b --- /dev/null +++ b/i18n/ru.yaml.orig @@ -0,0 +1,45 @@ +- id: prev_page + translation: "Предыдущая" + +- id: next_page + translation: "Следующая" + +- id: read_time + translation: +<<<<<<< HEAD + one: "Время чтения: 1 мин" + few: "Время чтения: {{ .Count }} мин" + other: "Время чтения: {{ .Count }} мин" +======= + zero: "0 минут" + one: "1 минута" + few: "{{ .Count }} минуты" + many: "{{ .Count }} минут" + other: "{{ .Count }} минута" + +- id: words + translation: + zero: "0 слов" + one: "1 слово" + few: "{{ .Count }} слова" + many: "{{ .Count }} слов" + other: "{{ .Count }} слово" +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 + +- id: toc + translation: "Оглавление" + +- id: translations + translation: "Переводы" + +- id: home + translation: "Главная" + +- id: edit_post + translation: "Редактировать" + +- id: code_copy + translation: "копировать" + +- id: code_copied + translation: "скопировано!" \ No newline at end of file diff --git a/i18n/sv.yaml b/i18n/sv.yaml new file mode 100644 index 0000000..65ce422 --- /dev/null +++ b/i18n/sv.yaml @@ -0,0 +1,28 @@ +- id: prev_page + translation: "Förra Sidan" + +- id: next_page + translation: "Nästa Sida" + +- id: read_time + translation: + one: "1 min" + other: "{{ .Count }} min" + +- id: toc + translation: "Innehållsförteckning" + +- id: translations + translation: "Översättningar" + +- id: home + translation: "Hem" + +- id: edit_post + translation: "Redigera" + +- id: code_copy + translation: "kopiera" + +- id: code_copied + translation: "kopierad!" diff --git a/i18n/tr.yaml b/i18n/tr.yaml new file mode 100644 index 0000000..d11ef21 --- /dev/null +++ b/i18n/tr.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "Önceki" + +- id: next_page + translation: "Sonraki" + +- id: read_time + translation: + one : "1 dk" + other: "{{ .Count }} dk" + +- id: words + translation: + one : "kelime" + other: "{{ .Count }} kelime" + +- id: toc + translation: "İçindekiler" + +- id: translations + translation: "Çeviriler" + +- id: home + translation: "Anasayfa" + +- id: edit_post + translation: "Düzenle" + +- id: code_copy + translation: "Kopyala" + +- id: code_copied + translation: "Kopyalandı!" diff --git a/i18n/uk.yaml b/i18n/uk.yaml new file mode 100644 index 0000000..41be964 --- /dev/null +++ b/i18n/uk.yaml @@ -0,0 +1,25 @@ +- id: prev_page + translation: "Попередня" + +- id: next_page + translation: "Наступна" + +- id: read_time + translation: + one : "1 хвилина" + other: "{{ .Count }} хвилин" + +- id: toc + translation: "Зміст" + +- id: translations + translation: "Переклади" + +- id: home + translation: "Головна" + +- id: code_copy + translation: "копіювати" + +- id: code_copied + translation: "скопійовано!" \ No newline at end of file diff --git a/i18n/uz.yaml b/i18n/uz.yaml new file mode 100644 index 0000000..c9f2375 --- /dev/null +++ b/i18n/uz.yaml @@ -0,0 +1,20 @@ +- id: prev_page + translation: "Oldingi sahifa" + +- id: next_page + translation: "Keyingi sahifa" + +- id: read_time + translation: + one : "Bir daqiqa" + other: "{{ .Count }} daqiqa" + +- id: toc + translation: "Mundarija" + +- id: translations + translation: "Tarjimalar" + +- id: home + translation: "Bosh sahifa" + diff --git a/i18n/vi.yaml b/i18n/vi.yaml new file mode 100644 index 0000000..a3832ed --- /dev/null +++ b/i18n/vi.yaml @@ -0,0 +1,25 @@ +- id: prev_page + translation: "Trang trước" + +- id: next_page + translation: "Trang tiếp theo" + +- id: read_time + translation: + one : "1 phút" + other: "{{ .Count }} phút" + +- id: toc + translation: "Mục lục" + +- id: translations + translation: "Bản dịch" + +- id: home + translation: "Trang chủ" + +- id: code_copy + translation: "Sao chép" + +- id: code_copied + translation: "Đã sao chép!" diff --git a/i18n/zh-tw.yaml b/i18n/zh-tw.yaml new file mode 100644 index 0000000..48b84d2 --- /dev/null +++ b/i18n/zh-tw.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "上一頁" + +- id: next_page + translation: "下一頁" + +- id: read_time + translation: + one : "1 分鐘" + other: "{{ .Count }} 分鐘" + +- id: words + translation: + one: "字" + other: "{{ .Count }} 字" + +- id: toc + translation: "目錄" + +- id: translations + translation: "語言" + +- id: home + translation: "首頁" + +- id: edit_post + translation: "編輯" + +- id: code_copy + translation: "複製" + +- id: code_copied + translation: "已複製!" diff --git a/i18n/zh.yaml b/i18n/zh.yaml index cb84ce9..0280425 100644 --- a/i18n/zh.yaml +++ b/i18n/zh.yaml @@ -9,8 +9,25 @@ one : "1 分钟" other: "{{ .Count }} 分钟" +- id: words + translation: + one: "字" + other: "{{ .Count }} 字" + - id: toc translation: "目录" - id: translations translation: "语言" + +- id: home + translation: "主页" + +- id: edit_post + translation: "编辑" + +- id: code_copy + translation: "复制" + +- id: code_copied + translation: "已复制!" diff --git a/layouts/404.html b/layouts/404.html index 6f6f3a1..a405573 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,3 +1,3 @@ -{{ define "main" }} +{{- define "main" }}
    404
    -{{ end }}{{/* end main */}} \ No newline at end of file +{{- end }}{{/* end main */ -}} diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..1acb87d --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1 @@ +{{ .Text }} diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index 68b8ae0..e61f908 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -2,9 +2,19 @@ {{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} + +{{- if site.Params.ShowAllPagesInArchive }} +{{- $pages = site.RegularPages }} +{{- end }} + {{- range $pages.GroupByPublishDate "2006" }} {{- if ne .Key "0001" }}
    @@ -15,11 +25,12 @@

    {{- .Key }}  {{ len .Pages }}

    - {{- range .Pages }} + {{- range .Pages }} {{- if eq .Kind "page" }}

    {{- .Title | markdownify }} + {{- if .Draft }}  [draft]{{- end }}

    {{- partial "post_meta.html" . -}} @@ -35,4 +46,4 @@ {{- end }} {{- end }} -{{- end }}{{/* end main */}} +{{- end }}{{/* end main */}} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6036e19..3d13f07 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,24 +1,23 @@ - + {{- partial "head.html" . }} - {{- partialCached "header.html" . .Page}} + {{- partialCached "header.html" . .Page -}}
    - {{- block "main" . }} - {{- end }} + {{- block "main" . }}{{ end }}
    - {{- partialCached "footer.html" . .Type }} + {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} diff --git a/layouts/_default/index.json b/layouts/_default/index.json new file mode 100644 index 0000000..feeb437 --- /dev/null +++ b/layouts/_default/index.json @@ -0,0 +1,7 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range site.RegularPages -}} + {{- if and (not .Params.searchHidden) (ne .Layout `archives`) (ne .Layout `search`) }} + {{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}} + {{- end }} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9d88391..b82e1bb 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,52 +1,90 @@ {{- define "main" }} -{{- if (and .Site.Params.profileMode.enabled .IsHome) }} +{{- if (and site.Params.profileMode.enabled .IsHome) }} {{- partial "index_profile.html" . }} {{- else }} {{/* if not profileMode */}} {{- if not .IsHome | and .Title }}
    {{- end }} +{{- if .Content }} +
    + {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} +
    +{{- end }} + {{- $pages := union .RegularPages .Sections }} {{- if .IsHome }} {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} -{{- end}} +{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }} +{{- end }} -{{ $paginator := .Paginate $pages }} -{{ $term := .Data.Term}} +{{- $paginator := .Paginate $pages }} + +{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} +{{- partial "home_info.html" . }} +{{- end }} + +{{- $term := .Data.Term }} {{- range $index, $page := $paginator.Pages }} {{- $class := "post-entry" }} -{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0)) }} -{{- if .Site.Params.homeInfoParams | or .Site.Params.disableSpecial1stPost}} -{{- partial "home_info.html" . }} -{{- else}} + +{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }} +{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} {{- $class = "first-entry" }} -{{- end }} {{- else if $term }} {{- $class = "post-entry tag-entry" }} {{- end }} +
    - {{- partial "cover.html" (dict "cxt" . "IsHome" true) }} + {{- $isHidden := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }} + {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}

    - {{ .Title }} - {{- if .Draft }}
      [draft]
    {{- end }} + {{- .Title }} + {{- if .Draft }}  [draft]{{- end }}

    - {{- if (ne .Site.Params.hideSummary true)}} -
    -

    {{ .Summary | plainify | htmlUnescape }}...

    -
    + {{- if (ne (.Param "hideSummary") true) }} +
    +

    {{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}

    +
    {{- end }} + {{- if not (.Param "hideMeta") }}
    {{- partial "post_meta.html" . -}}
    +<<<<<<< HEAD
    +======= + {{- end }} + +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8
    {{- end }} @@ -54,13 +92,25 @@ {{- end }} -{{end}}{{/* end profileMode */}} -{{- end }}{{- /* end main */ -}} + +{{- end }}{{/* end profileMode */}} + +{{- end }}{{- /* end main */ -}} diff --git a/layouts/_default/list.html.orig b/layouts/_default/list.html.orig new file mode 100644 index 0000000..b82e1bb --- /dev/null +++ b/layouts/_default/list.html.orig @@ -0,0 +1,116 @@ +{{- define "main" }} + +{{- if (and site.Params.profileMode.enabled .IsHome) }} +{{- partial "index_profile.html" . }} +{{- else }} {{/* if not profileMode */}} + +{{- if not .IsHome | and .Title }} + +{{- end }} + +{{- if .Content }} +
    + {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} +
    +{{- end }} + +{{- $pages := union .RegularPages .Sections }} + +{{- if .IsHome }} +{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} +{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }} +{{- end }} + +{{- $paginator := .Paginate $pages }} + +{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} +{{- partial "home_info.html" . }} +{{- end }} + +{{- $term := .Data.Term }} +{{- range $index, $page := $paginator.Pages }} + +{{- $class := "post-entry" }} + +{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }} +{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} +{{- $class = "first-entry" }} +{{- else if $term }} +{{- $class = "post-entry tag-entry" }} +{{- end }} + +
    + {{- $isHidden := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }} + {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} +
    +

    + {{- .Title }} + {{- if .Draft }}  [draft]{{- end }} +

    +
    + {{- if (ne (.Param "hideSummary") true) }} +
    +

    {{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}

    +
    + {{- end }} + {{- if not (.Param "hideMeta") }} +
    + {{- partial "post_meta.html" . -}} +
    +<<<<<<< HEAD + +======= + {{- end }} + +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 +
    +{{- end }} + +{{- if gt $paginator.TotalPages 1 }} + +{{- end }} + +{{- end }}{{/* end profileMode */}} + +{{- end }}{{- /* end main */ -}} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..134d50d --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,50 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + + {{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ site.Title }} + {{- with site.Params.images }} + + {{ index . 0 | absURL }} + {{ index . 0 | absURL }} + + {{- end }} + Hugo -- gohugo.io{{ with site.LanguageCode }} + {{.}}{{end}}{{ with site.Author.email }} + {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with site.Author.email }} + {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with site.Author.email }}{{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}} + {{- if site.Params.ShowFullTextinRSS }} + {{ (printf "" .Content) | safeHTML }} + {{- end }} + + {{- end }} + {{ end }} + + diff --git a/layouts/_default/search.html b/layouts/_default/search.html new file mode 100644 index 0000000..2349587 --- /dev/null +++ b/layouts/_default/search.html @@ -0,0 +1,29 @@ +{{- define "main" }} + + + + + +{{- end }}{{/* end main */}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index dfa87e3..b807f27 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,13 +2,20 @@
    + {{ partial "breadcrumbs.html" . }}

    {{ .Title }} - {{- if .Draft }}
      [draft]
    {{- end }} + {{- if .Draft }}  [draft]{{- end }}

    - {{- if .Params.hideMeta }}{{ else }} + {{- if .Description }} +
    + {{ .Description }} +
    + {{- end }} + {{- if not (.Param "hideMeta") }} - {{- end}} + {{- end }}
    - {{- partial "cover.html" (dict "cxt" . "IsHome" false) }} - {{- if .Params.ShowToc }} -
    -
    - -
    {{- i18n "toc" | default "Table of Contents" }}
    -
    -
    - {{- partial "toc.html" . }} -
    -
    + {{- $isHidden := .Params.cover.hidden | default site.Params.cover.hiddenInSingle | default site.Params.cover.hidden }} + {{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }} + {{- if (.Param "ShowToc") }} + {{- partial "toc.html" . }} + {{- end }} + + {{- if .Content }} +
    + {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }}
    {{- end }} -
    - {{- partial "anchored_headings.html" .Content -}} -
    + - {{- if and ($.Site.Params.comments) (ne .Params.comments false) }} + {{- if (.Param "comments") }} {{- partial "comments.html" . }} {{- end }}
    -{{- end }}{{/* end main */}} +{{- end }}{{/* end main */}} diff --git a/layouts/_default/single.html.orig b/layouts/_default/single.html.orig new file mode 100644 index 0000000..b807f27 --- /dev/null +++ b/layouts/_default/single.html.orig @@ -0,0 +1,90 @@ +{{- define "main" }} + +
    +
    + {{ partial "breadcrumbs.html" . }} +

    + {{ .Title }} + {{- if .Draft }}  [draft]{{- end }} +

    + {{- if .Description }} +
    + {{ .Description }} +
    + {{- end }} + {{- if not (.Param "hideMeta") }} + + {{- end }} +
    + {{- $isHidden := .Params.cover.hidden | default site.Params.cover.hiddenInSingle | default site.Params.cover.hidden }} + {{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }} + {{- if (.Param "ShowToc") }} + {{- partial "toc.html" . }} + {{- end }} + + {{- if .Content }} +
    + {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} +
    + {{- end }} + +
    +<<<<<<< HEAD + + {{- if .Params.tags }} +======= + {{- $tags := .Language.Params.Taxonomies.tag | default "tags" }} +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 + + {{- if (.Param "ShowPostNavLinks") }} + {{- partial "post_nav_links.html" . }} + {{- end }} + {{- if (and site.Params.ShowShareButtons (ne .Params.disableShare true)) }} + {{- partial "share_icons.html" . -}} + {{- end }} +
    + + {{- if (.Param "comments") }} + {{- partial "comments.html" . }} + {{- end }} +
    + +{{- end }}{{/* end main */}} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 167efbc..cf51d39 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -1,8 +1,13 @@ -{{ define "main" }} +{{- define "main" }} {{- if .Title }} {{- end }} @@ -11,7 +16,7 @@ {{- range $key, $value := .Data.Terms.Alphabetical }} {{- $name := .Name }} {{- $count := .Count }} - {{- with $.Site.GetPage (printf "/%s/%s" $type $name) }} + {{- with site.GetPage (printf "/%s/%s" $type $name) }}
  • {{ .Name }} {{ $count }}
  • @@ -19,4 +24,4 @@ {{- end }} -{{ end }}{{/* end main */}} \ No newline at end of file +{{- end }}{{/* end main */ -}} diff --git a/layouts/partials/anchored_headings.html b/layouts/partials/anchored_headings.html index 27184fe..377af89 100644 --- a/layouts/partials/anchored_headings.html +++ b/layouts/partials/anchored_headings.html @@ -1,2 +1,2 @@ - +{{- /* formats .Content headings by adding an anchor */ -}} {{ . | replaceRE "()" "${1}${3}" | safeHTML }} diff --git a/layouts/partials/author.html b/layouts/partials/author.html index a1ef62c..8f2758f 100644 --- a/layouts/partials/author.html +++ b/layouts/partials/author.html @@ -1,7 +1,7 @@ -{{- if or .Params.author .Site.Params.author }} -{{- $author := (.Params.author | default .Site.Params.author)}} +{{- if or .Params.author site.Params.author }} +{{- $author := (.Params.author | default site.Params.author) }} {{- $author_type := (printf "%T" $author) }} -{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}") ) }} +{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }} {{- (delimit $author ", " ) }} {{- else }} {{- $author }} diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html new file mode 100644 index 0000000..7e8257b --- /dev/null +++ b/layouts/partials/breadcrumbs.html @@ -0,0 +1,19 @@ +{{- if (.Param "ShowBreadCrumbs") -}} + +{{- end -}} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index d6ff010..918451a 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,5 +1,3 @@ - - - \ No newline at end of file +{{- /* Comments area start */ -}} +{{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}} +{{- /* Comments area end */ -}} diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html index 4c87971..08311dc 100644 --- a/layouts/partials/cover.html +++ b/layouts/partials/cover.html @@ -1,29 +1,39 @@ {{- with .cxt}} {{/* Apply proper context from dict */}} -{{- if .Params.cover.image }} +{{- if (and .Params.cover.image (not $.isHidden)) }} {{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }}
    - {{- $addLink := (and .Site.Params.cover.linkFullImages (not $.IsHome)) }} - {{- $cover := (.Page.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} + {{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }} + {{- $addLink := (and site.Params.cover.linkFullImages (not $.IsHome)) }} + {{- $cover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} {{- if $cover -}}{{/* i.e it is present in page bundle */}} {{- if $addLink }}{{ end -}} {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} - {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") }} - {{- $prod := (eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production")) }} - {{- if (and (in $processableFormats $cover.MediaType.SubType) (ne .Site.Params.cover.responsiveImages false) (eq $prod true)) }} - {{ $alt }} +======= + {{- end -}}{{$cover.Permalink }} {{printf "%dw" ($cover.Width)}}" + sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}" alt="{{ $alt }}" + width="{{ $cover.Width }}" height="{{ $cover.Height }}"> +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 {{- else }}{{/* Unprocessable image or responsive images disabled */}} - {{ $alt }} + {{ $alt }} {{- end }} {{- else }}{{/* For absolute urls and external links, no img processing here */}} {{- if $addLink }}{{ end -}} - {{ $alt }} + {{ $alt }} {{- end }} {{- if $addLink }}{{ end -}} {{/* Display Caption */}} @@ -32,4 +42,4 @@ {{- end }}
    {{- end }}{{/* End image */}} -{{- end -}}{{/* End context */}} +{{- end -}}{{/* End context */ -}} diff --git a/layouts/partials/cover.html.orig b/layouts/partials/cover.html.orig new file mode 100644 index 0000000..08311dc --- /dev/null +++ b/layouts/partials/cover.html.orig @@ -0,0 +1,45 @@ +{{- with .cxt}} {{/* Apply proper context from dict */}} +{{- if (and .Params.cover.image (not $.isHidden)) }} +{{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }} +
    + {{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }} + {{- $addLink := (and site.Params.cover.linkFullImages (not $.IsHome)) }} + {{- $cover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} + {{- if $cover -}}{{/* i.e it is present in page bundle */}} + {{- if $addLink }}{{ end -}} + {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} + {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} + {{- if hugo.IsExtended -}} + {{- $processableFormats = $processableFormats | append "webp" -}} + {{- end -}} + {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} + {{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }} + {{ $alt }} +======= + {{- end -}}{{$cover.Permalink }} {{printf "%dw" ($cover.Width)}}" + sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}" alt="{{ $alt }}" + width="{{ $cover.Width }}" height="{{ $cover.Height }}"> +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 + {{- else }}{{/* Unprocessable image or responsive images disabled */}} + {{ $alt }} + {{- end }} + {{- else }}{{/* For absolute urls and external links, no img processing here */}} + {{- if $addLink }}{{ end -}} + {{ $alt }} + {{- end }} + {{- if $addLink }}{{ end -}} + {{/* Display Caption */}} + {{- if not $.IsHome }} + {{ with .Params.cover.caption }}

    {{ . | markdownify }}

    {{- end }} + {{- end }} +
    +{{- end }}{{/* End image */}} +{{- end -}}{{/* End context */ -}} diff --git a/layouts/partials/edit_post.html b/layouts/partials/edit_post.html new file mode 100644 index 0000000..efa4c70 --- /dev/null +++ b/layouts/partials/edit_post.html @@ -0,0 +1,8 @@ +{{- if or .Params.editPost.URL site.Params.editPost.URL -}} +{{- $fileUrlPath := path.Join .File.Path }} + +{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}} + + {{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}} + +{{- end }} diff --git a/layouts/partials/extend_footer.html b/layouts/partials/extend_footer.html index 52714e8..0519748 100644 --- a/layouts/partials/extend_footer.html +++ b/layouts/partials/extend_footer.html @@ -1,5 +1,3 @@ - - - +{{- /* Footer custom content area start */ -}} +{{- /* Insert any custom code web-analytics, resources, etc. here */ -}} +{{- /* Footer custom content area end */ -}} diff --git a/layouts/partials/extend_head.html b/layouts/partials/extend_head.html index d372acc..150cbef 100644 --- a/layouts/partials/extend_head.html +++ b/layouts/partials/extend_head.html @@ -1,5 +1,4 @@ - - - \ No newline at end of file +{{- /* Head custom content area start */ -}} +{{- /* Insert any custom code (web-analytics, resources, etc.) - it will appear in the section of every page. */ -}} +{{- /* Can be overwritten by partial with the same name in the global layouts. */ -}} +{{- /* Head custom content area end */ -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 832d7ca..552b0eb 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,41 +1,68 @@ +{{- if not (.Param "hideFooter") }} - - +{{- end }} + +{{- if (not site.Params.disableScrollToTop) }} + + + + +<<<<<<< HEAD {{- partial "extend_footer.html" . -}} {{ if in site.Params.mainSections .Type }} {{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }} +======= +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 {{- end }} + +{{- partial "extend_footer.html" . }} + + +{{- if (not site.Params.disableScrollToTop) }} + -{{- if (not .Site.Params.disableThemeToggle) }} +{{- end }} + +{{- if (not site.Params.disableThemeToggle) }} {{- end }} + +{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }} + +{{- end }} diff --git a/layouts/partials/footer.html.orig b/layouts/partials/footer.html.orig new file mode 100644 index 0000000..552b0eb --- /dev/null +++ b/layouts/partials/footer.html.orig @@ -0,0 +1,143 @@ +{{- if not (.Param "hideFooter") }} + +{{- end }} + +{{- if (not site.Params.disableScrollToTop) }} + + + + + +<<<<<<< HEAD +{{- partial "extend_footer.html" . -}} +{{ if in site.Params.mainSections .Type }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }} + +======= +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 +{{- end }} + +{{- partial "extend_footer.html" . }} + + + +{{- if (not site.Params.disableScrollToTop) }} + +{{- end }} + +{{- if (not site.Params.disableThemeToggle) }} + +{{- end }} + +{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }} + +{{- end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 5943ac2..bb5a1e4 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,21 +1,28 @@ -{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +{{- if hugo.IsProduction | or (eq site.Params.env "production") | and (ne .Params.robotsNoIndex true) }} {{- else }} - -{{- end -}} - -{{ if .IsHome }}{{else}}{{ if .Title }}{{ .Title }} | {{ end }}{{end}}{{ .Site.Title }} - + +{{- end }} + +{{- /* Title */}} +{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ site.Title }} + +{{- /* Meta */}} +{{- if .IsHome }} +{{ with site.Params.keywords -}}{{ end }} +{{- else }} - + {{- range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- end -}}"> +{{- end }} + +<<<<<<< HEAD {{- if .Site.Params.analytics.google.SiteVerificationTag }} @@ -44,12 +51,151 @@ {{- range .Translations -}} {{ end }} +======= + +{{- if site.Params.analytics.google.SiteVerificationTag }} + +{{- end }} +{{- if site.Params.analytics.yandex.SiteVerificationTag }} + +{{- end }} +{{- if site.Params.analytics.bing.SiteVerificationTag }} + +{{- end }} +{{- if site.Params.analytics.naver.SiteVerificationTag }} + +{{- end }} + +{{- /* Styles */}} + +{{- /* includes */}} +{{- $includes := slice }} +{{- $includes = $includes | append (" " | resources.FromString "assets/css/includes-blank.css")}} + +{{- if not (eq site.Params.assets.disableScrollBarStyle true) }} + {{- $ScrollStyle := (resources.Get "css/includes/scroll-bar.css") }} + {{- $includes = (append $ScrollStyle $includes) }} +{{- end }} + +{{- $includes_all := $includes | resources.Concat "assets/css/includes.css" }} + +{{- $theme_vars := (resources.Get "css/core/theme-vars.css") }} +{{- $reset := (resources.Get "css/core/reset.css") }} +{{- $media := (resources.Get "css/core/zmedia.css") }} +{{- $license_css := (resources.Get "css/core/license.css") }} +{{- $common := (resources.Match "css/common/*.css") | resources.Concat "assets/css/common.css" }} + +{{- /* include `an-old-hope` if hljs is on */}} +{{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default false) }} +{{- $hljs := (cond ($isHLJSdisabled) (".chroma { background-color: unset !important;}" | resources.FromString "assets/css/hljs-blank.css") (resources.Get "css/hljs/an-old-hope.min.css")) }} + +{{- /* order is important */}} +{{- $core := (slice $theme_vars $reset $common $hljs $includes_all $media) | resources.Concat "assets/css/core.css" | resources.Minify }} +{{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" | resources.Minify }} + +{{- /* bundle all required css */}} +{{- /* Add extended css after theme style */ -}} +{{- $stylesheet := (slice $license_css $core $extended) | resources.Concat "assets/css/stylesheet.css" }} + +{{- if not site.Params.assets.disableFingerprinting }} +{{- $stylesheet := $stylesheet | fingerprint }} + +{{- else }} + +{{- end }} + +{{- /* Search */}} +{{- if (eq .Layout `search`) -}} + +{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) | resources.Minify }} +{{- $fusejs := resources.Get "js/fuse.basic.min.js" }} +{{- $license_js := resources.Get "js/license.js" }} +{{- if not site.Params.assets.disableFingerprinting }} +{{- $search := (slice $fusejs $license_js $fastsearch ) | resources.Concat "assets/js/search.js" | fingerprint }} + +{{- else }} +{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" }} + +{{- end }} +{{- end -}} + +{{- /* Highlight.js */}} +{{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default .Params.disableHLJS ) }} +{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }} +{{- if not site.Params.assets.disableFingerprinting }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | fingerprint }} + +{{- else }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" }} + +{{- end }} +{{- end }} + +{{- /* Favicons */}} + + + + + + + + +{{- /* RSS */}} +{{ range .AlternativeOutputFormats -}} + +{{ end -}} +{{- range .AllTranslations -}} + +{{ end -}} + + + +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 {{- partial "extend_head.html" . -}} - -{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} -{{- template "_internal/google_analytics_async.html" . }} -{{- template "_internal/google_news.html" . }} + +{{- /* Misc */}} +{{- if hugo.IsProduction | or (eq site.Params.env "production") }} +{{- template "_internal/google_analytics.html" . }} {{- template "partials/templates/opengraph.html" . }} {{- template "partials/templates/twitter_cards.html" . }} {{- template "partials/templates/schema_json.html" . }} -{{- end }} +{{- end -}} diff --git a/layouts/partials/head.html.orig b/layouts/partials/head.html.orig new file mode 100644 index 0000000..bb5a1e4 --- /dev/null +++ b/layouts/partials/head.html.orig @@ -0,0 +1,201 @@ + + + +{{- if hugo.IsProduction | or (eq site.Params.env "production") | and (ne .Params.robotsNoIndex true) }} + +{{- else }} + +{{- end }} + +{{- /* Title */}} +{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ site.Title }} + +{{- /* Meta */}} +{{- if .IsHome }} +{{ with site.Params.keywords -}}{{ end }} +{{- else }} + +{{- end }} + + +<<<<<<< HEAD + +{{- if .Site.Params.analytics.google.SiteVerificationTag }} + +{{- end}} + +{{- $stylesheet := (resources.Match "css/*.css") | resources.Concat "assets/css/stylesheet.css" | minify | fingerprint -}} + + + + + + + + + + +{{- hugo.Generator }} + +{{- range .AlternativeOutputFormats -}} + +{{ end -}} +{{- range .Translations -}} + +{{ end }} +======= + +{{- if site.Params.analytics.google.SiteVerificationTag }} + +{{- end }} +{{- if site.Params.analytics.yandex.SiteVerificationTag }} + +{{- end }} +{{- if site.Params.analytics.bing.SiteVerificationTag }} + +{{- end }} +{{- if site.Params.analytics.naver.SiteVerificationTag }} + +{{- end }} + +{{- /* Styles */}} + +{{- /* includes */}} +{{- $includes := slice }} +{{- $includes = $includes | append (" " | resources.FromString "assets/css/includes-blank.css")}} + +{{- if not (eq site.Params.assets.disableScrollBarStyle true) }} + {{- $ScrollStyle := (resources.Get "css/includes/scroll-bar.css") }} + {{- $includes = (append $ScrollStyle $includes) }} +{{- end }} + +{{- $includes_all := $includes | resources.Concat "assets/css/includes.css" }} + +{{- $theme_vars := (resources.Get "css/core/theme-vars.css") }} +{{- $reset := (resources.Get "css/core/reset.css") }} +{{- $media := (resources.Get "css/core/zmedia.css") }} +{{- $license_css := (resources.Get "css/core/license.css") }} +{{- $common := (resources.Match "css/common/*.css") | resources.Concat "assets/css/common.css" }} + +{{- /* include `an-old-hope` if hljs is on */}} +{{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default false) }} +{{- $hljs := (cond ($isHLJSdisabled) (".chroma { background-color: unset !important;}" | resources.FromString "assets/css/hljs-blank.css") (resources.Get "css/hljs/an-old-hope.min.css")) }} + +{{- /* order is important */}} +{{- $core := (slice $theme_vars $reset $common $hljs $includes_all $media) | resources.Concat "assets/css/core.css" | resources.Minify }} +{{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" | resources.Minify }} + +{{- /* bundle all required css */}} +{{- /* Add extended css after theme style */ -}} +{{- $stylesheet := (slice $license_css $core $extended) | resources.Concat "assets/css/stylesheet.css" }} + +{{- if not site.Params.assets.disableFingerprinting }} +{{- $stylesheet := $stylesheet | fingerprint }} + +{{- else }} + +{{- end }} + +{{- /* Search */}} +{{- if (eq .Layout `search`) -}} + +{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) | resources.Minify }} +{{- $fusejs := resources.Get "js/fuse.basic.min.js" }} +{{- $license_js := resources.Get "js/license.js" }} +{{- if not site.Params.assets.disableFingerprinting }} +{{- $search := (slice $fusejs $license_js $fastsearch ) | resources.Concat "assets/js/search.js" | fingerprint }} + +{{- else }} +{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" }} + +{{- end }} +{{- end -}} + +{{- /* Highlight.js */}} +{{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default .Params.disableHLJS ) }} +{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }} +{{- if not site.Params.assets.disableFingerprinting }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | fingerprint }} + +{{- else }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" }} + +{{- end }} +{{- end }} + +{{- /* Favicons */}} + + + + + + + + +{{- /* RSS */}} +{{ range .AlternativeOutputFormats -}} + +{{ end -}} +{{- range .AllTranslations -}} + +{{ end -}} + + + +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 +{{- partial "extend_head.html" . -}} + +{{- /* Misc */}} +{{- if hugo.IsProduction | or (eq site.Params.env "production") }} +{{- template "_internal/google_analytics.html" . }} +{{- template "partials/templates/opengraph.html" . }} +{{- template "partials/templates/twitter_cards.html" . }} +{{- template "partials/templates/schema_json.html" . }} +{{- end -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 0ed3cac..2f0c273 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,15 +1,15 @@ -{{- /* theme-toggle is enabled */}} -{{- if (not .Site.Params.disableThemeToggle) }} -{{- /* theme is light */}} -{{- if (eq .Site.Params.defaultTheme "light") }} +{{- /* theme-toggle is enabled */}} +{{- if (not site.Params.disableThemeToggle) }} +{{- /* theme is light */}} +{{- if (eq site.Params.defaultTheme "light") }} -{{- /* theme is dark */}} -{{- else if (eq .Site.Params.defaultTheme "dark") }} +{{- /* theme is dark */}} +{{- else if (eq site.Params.defaultTheme "dark") }} {{- else }} -{{- /* theme is auto */}} +{{- /* theme is auto */}} {{- end }} -{{- /* theme-toggle is disabled and theme is auto */}} -{{- else if (and (ne .Site.Params.defaultTheme "light") (ne .Site.Params.defaultTheme "dark"))}} +{{- /* theme-toggle is disabled and theme is auto */}} +{{- else if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark"))}} {{- end }} -
    diff --git a/layouts/partials/header.html.orig b/layouts/partials/header.html.orig new file mode 100644 index 0000000..2f0c273 --- /dev/null +++ b/layouts/partials/header.html.orig @@ -0,0 +1,200 @@ +{{- /* theme-toggle is enabled */}} +{{- if (not site.Params.disableThemeToggle) }} +{{- /* theme is light */}} +{{- if (eq site.Params.defaultTheme "light") }} + +{{- /* theme is dark */}} +{{- else if (eq site.Params.defaultTheme "dark") }} + +{{- else }} +{{- /* theme is auto */}} + +{{- end }} +{{- /* theme-toggle is disabled and theme is auto */}} +{{- else if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark"))}} + +{{- end }} + +
    + +
    diff --git a/layouts/partials/home_info.html b/layouts/partials/home_info.html index ef08615..efae956 100644 --- a/layouts/partials/home_info.html +++ b/layouts/partials/home_info.html @@ -1,13 +1,13 @@ -{{- with $.Site.Params.homeInfoParams }} +{{- with site.Params.homeInfoParams }}
    -

    {{- .Title | markdownify }}

    +

    {{ .Title | markdownify }}

    -
    -

    {{- .Content | markdownify }}

    -
    +
    + {{ .Content | markdownify }} +
    - {{- partial "social_icons.html" $.Site.Params.socialIcons -}} + {{ partial "social_icons.html" site.Params.socialIcons }}
    -{{- end}} +{{- end -}} diff --git a/layouts/partials/index_profile.html b/layouts/partials/index_profile.html index bee94fb..d9ddbda 100644 --- a/layouts/partials/index_profile.html +++ b/layouts/partials/index_profile.html @@ -1,19 +1,56 @@
    - {{- with .Site.Params.profileMode }} + {{- with site.Params.profileMode }}
    - {{- if .imageUrl}}{{ .imageTitle | default {{- end}} -

    {{- .title | default $.Site.Title | markdownify -}}

    - {{- .subtitle | markdownify -}} - {{- partial "social_icons.html" $.Site.Params.socialIcons -}} + {{- if .imageUrl -}} + {{- $img := "" }} + {{- if not (urls.Parse .imageUrl).IsAbs }} + {{- $img = resources.Get .imageUrl }} + {{- end }} + {{- if $img }} + {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} + {{- if hugo.IsExtended -}} + {{- $processableFormats = $processableFormats | append "webp" -}} + {{- end -}} + {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} + {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}} + {{- if (not (and (not .imageHeight) (not .imageWidth))) }} + {{- $img = $img.Resize (printf "%dx%d" .imageWidth .imageHeight) }} + {{- else if .imageHeight }} + {{- $img = $img.Resize (printf "x%d" .imageHeight) }} + {{ else if .imageWidth }} + {{- $img = $img.Resize (printf "%dx" .imageWidth) }} + {{ else }} + {{- $img = $img.Resize "150x150" }} + {{- end }} + {{- end }} + {{ .imageTitle | default + {{- else }} + {{ .imageTitle | default + {{- end }} + {{- end }} +

    {{ .title | default site.Title | markdownify }}

    + {{ .subtitle | markdownify }} + {{- partial "social_icons.html" site.Params.socialIcons -}} {{- with .buttons }} {{- end }}
    diff --git a/layouts/partials/post_canonical.html b/layouts/partials/post_canonical.html new file mode 100644 index 0000000..abfc1e3 --- /dev/null +++ b/layouts/partials/post_canonical.html @@ -0,0 +1,9 @@ +{{ if and (.Params.canonicalURL) (.Params.ShowCanonicalLink ) -}} +{{ $url := urls.Parse .Params.canonicalURL }} + +{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL site.Params.editPost.URL) }} | {{- end -}} + + {{- (site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}} +  {{ $url.Host }} + +{{- end }} diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html index e0dbef4..15b8b1b 100644 --- a/layouts/partials/post_meta.html +++ b/layouts/partials/post_meta.html @@ -1,17 +1,21 @@ -{{- $scratch := newScratch}} +{{- $scratch := newScratch }} {{- if not .Date.IsZero -}} -{{- $scratch.Add "meta" (slice (.Date.Format (default "January 2, 2006" .Site.Params.DateFormat))) }} -{{- end -}} - -{{- if $.Site.Params.ShowReadingTime -}} -{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%s min" .ReadingTime))) }} -{{- end -}} - -{{ with (partial "author.html" . ) }} -{{ $scratch.Add "meta" (slice .)}} -{{end}} - -{{- with ($scratch.Get "meta")}} -{{- delimit . " · "}} +{{- $scratch.Add "meta" (slice (printf "%s" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }} {{- end }} + +{{- if (.Param "ShowReadingTime") -}} +{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} +{{- end }} + +{{- if (.Param "ShowWordCount") -}} +{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} +{{- end }} + +{{- with (partial "author.html" .) }} +{{- $scratch.Add "meta" (slice .) }} +{{- end }} + +{{- with ($scratch.Get "meta") }} +{{- delimit . " · " -}} +{{- end -}} diff --git a/layouts/partials/post_nav_links.html b/layouts/partials/post_nav_links.html new file mode 100644 index 0000000..b988641 --- /dev/null +++ b/layouts/partials/post_nav_links.html @@ -0,0 +1,19 @@ +{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} +{{- if and (gt (len $pages) 1) (in $pages . ) }} + +{{- end }} diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html index 17740d7..73454ea 100644 --- a/layouts/partials/share_icons.html +++ b/layouts/partials/share_icons.html @@ -1,57 +1,85 @@ -{{- $pageurl := .RelPermalink }} +{{- $pageurl := .Permalink }} {{- $title := .Title }} -{{ $.Scratch.Set "tags" ""}} +{{- $.Scratch.Set "tags" ""}} {{- with .Params.Tags }} +<<<<<<< HEAD {{ $hashtags := newScratch}} {{ range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} {{ $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} {{- end }} {{- if .Site.Params.ShareButtons }} +======= +{{- $hashtags := newScratch}} +{{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} +{{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} +{{- end -}} + +{{- $custom := false }} +{{- $ShareButtons := (.Param "ShareButtons")}} +{{- with $ShareButtons }}{{ $custom = true }}{{ end }} + +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 {{- end -}} +======= + {{- end }} +
    +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 diff --git a/layouts/partials/share_icons.html.orig b/layouts/partials/share_icons.html.orig new file mode 100644 index 0000000..23d36c7 --- /dev/null +++ b/layouts/partials/share_icons.html.orig @@ -0,0 +1,85 @@ +{{- $pageurl := .RelPermalink }} +{{- $title := .Title }} + +{{- $.Scratch.Set "tags" ""}} + +{{- with .Params.Tags }} +<<<<<<< HEAD +{{ $hashtags := newScratch}} +{{ range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} +{{ $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} +{{- end }} +{{- if .Site.Params.ShareButtons }} +======= +{{- $hashtags := newScratch}} +{{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} +{{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} +{{- end -}} + +{{- $custom := false }} +{{- $ShareButtons := (.Param "ShareButtons")}} +{{- with $ShareButtons }}{{ $custom = true }}{{ end }} + +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 +
    + {{- if (cond ($custom) (in $ShareButtons "twitter") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "linkedin") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "reddit") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "facebook") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "whatsapp") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "telegram") (true)) }} + + + + + +<<<<<<< HEAD +
    +{{- end -}} + +======= + {{- end }} + +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 diff --git a/layouts/partials/social_icons.html b/layouts/partials/social_icons.html index 7bb9c14..3f8d6a3 100644 --- a/layouts/partials/social_icons.html +++ b/layouts/partials/social_icons.html @@ -1,6 +1,7 @@
    - {{- range . -}} - {{ partial "svg.html" . }} - {{- end -}} + {{- range . }} + + {{ partial "svg.html" . }} + + {{- end }}
    diff --git a/layouts/partials/svg.html b/layouts/partials/svg.html index 0d4d0c0..49f5389 100644 --- a/layouts/partials/svg.html +++ b/layouts/partials/svg.html @@ -1,11 +1,12 @@ -{{ $icon_name := ( trim .name " " | lower )}} +{{- $icon_name := ( trim .name " " | lower )}} {{- if (eq $icon_name "123rf") -}} - + + {{- else if (eq $icon_name "adobestock") -}} @@ -13,6 +14,21 @@ +{{- else if (eq $icon_name "anilist") -}} + + + +{{- else if (eq $icon_name "applemusic") -}} + + + +{{- else if (eq $icon_name "applepodcasts") -}} + + + {{- else if (eq $icon_name "behance") -}} @@ -20,6 +36,19 @@ style="font-variation-settings:normal" d="M1.774 18.063V5.466h5.51c1.978 0 3.116 1.326 3.055 2.806-.043 1.049-.711 2.988-2.643 2.988h-5.93H7.73c1.224 0 3.532 1.13 3.532 3.532 0 2.4-1.873 3.27-3.318 3.27zm12.57-4.459h7.89s.012-4.18-4.167-4.18c-5.237 0-5.277 9.11-.3 9.11 3.06 0 3.935-1.806 3.935-1.806M15.526 5.823h4.987" /> +{{- else if (eq $icon_name "bilibili") -}} + + + + + + + +{{- else if (eq $icon_name "bitcoin") -}} + + + {{- else if (eq $icon_name "buymeacoffee") -}} +{{- else if (eq $icon_name "ctftime") -}} + + + + + + +{{- else if (eq $icon_name "cv") -}} + + + + + + {{- else if (eq $icon_name "dev") -}} +{{- else if (eq $icon_name "deviantart") -}} + + + +{{- else if (eq $icon_name "deezer") -}} + + + {{- else if (eq $icon_name "discogs") -}} + paint-order="stroke fill markers" /> + {{- else if (eq $icon_name "dribbble") -}} @@ -108,9 +170,10 @@ + d="M8.533 3.208s2.888 2.73 5.339 9.235c2.451 6.505 2.344 8.4 2.344 8.4" /> + {{- else if (eq $icon_name "email") -}} - @@ -120,6 +183,11 @@ stroke-linecap="round" stroke-linejoin="round"> +{{- else if (eq $icon_name "flickr") -}} + + + {{- else if (eq $icon_name "freepik") -}} @@ -130,7 +198,13 @@ d="M1.265 12.607c.159-1.98.561-3.898 2.08-5.701m5.148-3.29c2.006-.66 3.968-1.157 6.446-.844m5.202 2.98c1.192 1.275 1.963 2.163 2.594 3.815" style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="round" /> - + + +{{- else if (eq $icon_name "gitea") -}} + + + {{- else if (eq $icon_name "github") -}} @@ -145,6 +219,41 @@ d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"> +{{- else if (eq $icon_name "goodreads") -}} + + + +{{- else if (eq $icon_name "googlepodcasts") -}} + + + +{{- else if (eq $icon_name "googlescholar") -}} + + + +{{- else if (eq $icon_name "gurushots") -}} + + + + + + + + + + + + +{{- else if (eq $icon_name "hackerone") -}} + + + {{- else if (eq $icon_name "hackerrank") -}} @@ -159,10 +268,10 @@ {{- else if (eq $icon_name "hackthebox") -}} + preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" fill="currentColor" stroke="none"> + d="M11.9959.0008a1.1187 1.1187 0 00-.057.002.8993.8993 0 00-.2358.0498.9067.9067 0 00-.1652.079L1.9357 5.675a.889.889 0 00-.4444.7699c0 .006.0004.0128.0006.0192-.0002.007 0 .014 0 .0212V17.556a.889.889 0 00.469.7837l9.5983 5.5416c.018.0102.036.0197.054.0287v.002a.8568.8568 0 00.083.0348c0 .001.01.003.012.004.028.01.056.0177.085.0245.01.001.011.003.016.004.028.006.057.0112.086.0146 0 .0005.01.0009.014.001.03.003.061.005.091.005s.061-.002.091-.005c0-.0005.01-.0009.014-.001a.6831.6831 0 00.086-.0146c.01-.001.011-.002.016-.004a.9404.9404 0 00.085-.0245c0-.001.01-.003.012-.004a.8818.8818 0 00.083-.0347v-.002a1.086 1.086 0 00.054-.0287l9.5986-5.5416a.889.889 0 00.4689-.7837V6.4786c0-.009-.0006-.0172-.0008-.0258h.0003v-.008a.8886.8886 0 00-.3117-.6755c-.01-.008-.019-.0162-.029-.0241 0-.002-.01-.005-.01-.007a.8988.8988 0 00-.1074-.0705L12.4533.1267a.8872.8872 0 00-.4646-.1266zm.01 2.2523c.072 0 .1443.0187.209.056l6.5366 3.774c.2789.161.2789.5633 0 .7243l-6.5367 3.774a.4182.4182 0 01-.4182 0L5.26 6.8074c-.2788-.1609-.2789-.5633 0-.7243l6.5368-3.774a.4193.4193 0 01.209-.056zm-8.0801 6.458a.4145.4145 0 01.215.0565l6.524 3.7666a.417.417 0 01.2086.3612v7.5326c0 .3212-.3477.522-.626.3613l-6.5237-3.7666a.4172.4172 0 01-.2086-.3613V9.1288c0-.2408.1955-.414.4107-.4177zm16.1599 0c.215.004.4107.1768.4107.4177v7.5325c0 .149-.08.2868-.2087.3614l-6.5239 3.7666c-.278.1606-.6258-.0401-.6258-.3614v-7.5325c0-.149.08-.2867.2086-.3613l6.5238-3.7666a.415.415 0 01.2152-.0565z"> @@ -173,16 +282,65 @@ +{{- else if (eq $icon_name "itchio") -}} + + + +{{- else if (eq $icon_name "kaggle") -}} + + + +{{- else if (eq $icon_name "kakaotalk") -}} + + + + + + + {{- else if (eq $icon_name "keybase") -}} +{{- else if (eq $icon_name "kofi") -}} + + + +{{- else if (eq $icon_name "komoot") -}} + + + {{- else if (eq $icon_name "lastfm") -}} +{{- else if (eq $icon_name "letterboxd") -}} + + + +{{- else if (eq $icon_name "liberapay") -}} + + + + + + +{{- else if (eq $icon_name "lichess" ) -}} + + + {{- else if (eq $icon_name "linkedin") -}} @@ -200,6 +358,11 @@ d="M17.832 8.633v5h-1.978V8.78c0-1.023-.43-1.542-1.29-1.542-.95 0-1.427.616-1.427 1.834v2.655H11.17V9.072c0-1.218-.476-1.834-1.427-1.834-.86 0-1.29.52-1.29 1.542v4.852H6.475V8.633c0-1.022.26-1.834.782-2.434.538-.6 1.243-.909 2.118-.909 1.012 0 1.779.39 2.286 1.169l.492.827.493-.827c.507-.78 1.274-1.169 2.286-1.169.875 0 1.58.308 2.118.909.522.6.782 1.412.782 2.434" fill="currentColor" stroke="none" /> +{{- else if (eq $icon_name "matrix") -}} + + + {{- else if (eq $icon_name "medium") -}} @@ -208,17 +371,98 @@ d="M0 380 l0 -380 380 0 380 0 0 380 0 380 -380 0 -380 0 0 -380z m334 85 c30 -63 57 -115 59 -115 2 0 16 30 31 68 15 37 37 88 49 115 l20 47 76 0 76 -1 -27 -20 -28 -21 0 -151 c0 -150 0 -151 27 -179 l27 -28 -109 0 -109 0 27 28 c26 27 27 32 26 143 0 131 3 134 -71 -58 -24 -62 -48 -113 -53 -113 -6 0 -17 16 -24 35 -7 19 -36 83 -64 142 l-52 108 -3 -98 c-3 -97 -2 -99 28 -133 16 -19 30 -39 30 -44 0 -6 -31 -10 -70 -10 -45 0 -70 4 -70 11 0 6 14 27 30 46 30 33 30 35 30 151 0 116 0 118 -31 155 l-30 37 75 0 76 0 54 -115z" /> +{{- else if (eq $icon_name "microblog") -}} + + + + + + {{- else if (eq $icon_name "mixcloud") -}} +{{- else if (eq $icon_name "monero") -}} + + + +{{- else if (eq $icon_name "nuget") -}} + + + + + + + + +{{- else if (eq $icon_name "orcid") -}} + + + +{{- else if (eq $icon_name "osu!") -}} + + + + + + +{{- else if (eq $icon_name "overcast") -}} + + + +{{- else if (eq $icon_name "patreon") -}} + + + {{- else if (eq $icon_name "paypal") -}} + style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="miter" /> + +{{- else if (eq $icon_name "peertube") -}} + + + +{{- else if or (eq $icon_name "pgpkey") (eq $icon_name "key") -}} + + + + +{{- else if (eq $icon_name "phone") -}} + + + + + +{{- else if (eq $icon_name "pocketcasts") -}} + + + +{{- else if (eq $icon_name "polywork") -}} + {{- else if (eq $icon_name "qq") -}} @@ -226,6 +470,17 @@ d="M433.754 420.445c-11.526 1.393-44.86-52.741-44.86-52.741 0 31.345-16.136 72.247-51.051 101.786 16.842 5.192 54.843 19.167 45.803 34.421-7.316 12.343-125.51 7.881-159.632 4.037-34.122 3.844-152.316 8.306-159.632-4.037-9.045-15.25 28.918-29.214 45.783-34.415-34.92-29.539-51.059-70.445-51.059-101.792 0 0-33.334 54.134-44.859 52.741-5.37-.65-12.424-29.644 9.347-99.704 10.261-33.024 21.995-60.478 40.144-105.779C60.683 98.063 108.982.006 224 0c113.737.006 163.156 96.133 160.264 214.963 18.118 45.223 29.912 72.85 40.144 105.778 21.768 70.06 14.716 99.053 9.346 99.704z"> +{{- else if (eq $icon_name "reddit") -}} + + + +{{- else if (eq $icon_name "researchgate") -}} + + + {{- else if (eq $icon_name "rss") -}} @@ -233,6 +488,17 @@ +{{- else if (eq $icon_name "serverfault") -}} + + + +{{- else if (eq $icon_name "sessionmessenger") -}} + + + + {{- else if (eq $icon_name "soundcloud") -}} + stroke-linecap="square" stroke-linejoin="miter" /> + +{{- else if (eq $icon_name "sketchfab") -}} + + + {{- else if (eq $icon_name "slack") -}} @@ -253,27 +524,21 @@ -{{- else if (eq $icon_name "sourcerer") -}} - - - - - - - - - - - +{{- else if (eq $icon_name "snapchat") -}} + + + +{{- else if (eq $icon_name "sourcehut") -}} + + + + +{{- else if (eq $icon_name "spotify") -}} + + {{- else if (eq $icon_name "stackoverflow") -}} + d="M-24.6 20.8c-1.4-.8-2.7-1.5-4.1-2.3-2.4-1.5-3.6-3.6-3.3-6.5.3-3 2.8-5.2 5.8-5.3h11c2.6 0 4.6 2.2 4.7 4.7 0 2.6-2 4.8-4.6 4.9h-2.8v.2c.2.2.5.3.7.5 1.2.7 2.4 1.3 3.6 2 2.5 1.5 3.7 4.5 2.9 7.2-.8 2.7-3.1 4.3-6.1 4.4h-10.6c-2.4 0-4.3-1.9-4.6-4.3-.3-2.3 1.2-4.5 3.5-5.1.6-.1 1.2-.1 1.7-.2h2.1c.1 0 .1-.1.1-.2zm4.3-3.8c-.1.3-.2.3-.2.4v3.9c0 1.1-.1 1.2-1.2 1.2h-5.1c-.4 0-.9 0-1.3.1-1.6.4-2.5 1.9-2.4 3.6.2 1.6 1.6 2.9 3.3 2.9h10.5c2.1 0 3.8-1.2 4.5-3.1.7-1.8.2-4.1-1.5-5.3-2.1-1.3-4.3-2.4-6.6-3.7zm-1.7 3.4v-4c0-1.4.1-1.5 1.4-1.5h5.3c1.5 0 2.7-1 3.1-2.4.6-2.2-1-4.2-3.4-4.3h-10.1c-2.4 0-4.3 1.3-4.9 3.4-.6 2.1.4 4.4 2.5 5.5 1.7 1 3.5 1.9 5.2 2.9.4.2.6.3.9.4z" /> + + + + + + + +{{- else if (eq $icon_name "strava") -}} + + {{- else if (eq $icon_name "telegram") -}} +{{- else if (eq $icon_name "threema") -}} + + + +{{- else if (eq $icon_name "tiktok") -}} + + + {{- else if (eq $icon_name "twitch") -}} @@ -304,6 +597,41 @@ d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"> +{{- else if (eq $icon_name "unsplash") -}} + + + + +{{- else if (eq $icon_name "vimeo") -}} + + + +{{- else if (eq $icon_name "xda") -}} + + + +{{- else if (eq $icon_name "xing") -}} + + + + +{{- else if (eq $icon_name "xmpp") -}} + + + + +{{- else if (eq $icon_name "ycombinator") -}} + + + {{- else if (eq $icon_name "youtube") -}} diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 9945937..16afeec 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -1,5 +1,5 @@ - + {{- if .Params.cover.image -}} @@ -9,57 +9,59 @@ {{- end}} {{- else }} -{{ with $.Params.images }}{{ range first 6 . -}} - -{{ end }}{{ else -}} + +{{- with $.Params.images -}} +{{- range first 6 . }}{{ end -}} +{{- else -}} {{- $images := $.Resources.ByType "image" -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{- with $featured -}} +<<<<<<< HEAD {{ else -}} {{- with $.Site.Params.images -}} {{ end }}{{ end }}{{ end }} +======= + +{{- else -}} +{{- with site.Params.images }}{{ end -}} +{{- end -}} +{{- end -}} +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 {{- end }} -{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} {{- if .IsPage }} -{{- if not .PublishDate.IsZero }} -{{ else if not .Date.IsZero }} -{{ end }} -{{- if not .Lastmod.IsZero }}{{ end }} -{{- else }} -{{- if not .Date.IsZero }} -{{- end }} -{{- end }}{{/* .IsPage */}} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} + +{{ with .PublishDate }}{{ end }} +{{ with .Lastmod }}{{ end }} +{{- end -}} {{- with .Params.audio }}{{ end }} {{- with .Params.locale }}{{ end }} -{{- with .Site.Params.title }}{{ end }} -{{- with .Params.videos }} -{{- range . }} +{{- with site.Params.title }}{{ end }} +{{- with .Params.videos }}{{- range . }} {{ end }}{{ end }} {{- /* If it is part of a series, link to related articles */}} +<<<<<<< HEAD {{- $permalink := .RelPermalink }} {{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }} {{- range $name := . }} {{- $series := index $siteSeries $name }} +======= +{{- $permalink := .Permalink }} +{{- $siteSeries := site.Taxonomies.series }} +{{ with .Params.series }}{{- range $name := . }} + {{- $series := index $siteSeries ($name | urlize) }} +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 {{- range $page := first 6 $series.Pages }} {{- if ne $page.RelPermalink $permalink }}{{ end }} {{- end }} {{ end }}{{ end }} -{{- if .IsPage }} -{{- range .Site.Authors }}{{ with .Social.facebook }} -{{ end }}{{ with .Site.Social.facebook }} -{{ end }} - -{{- with .Params.tags }}{{ range first 6 . }} -{{ end }}{{ end }} -{{- end }}{{ end }} - {{- /* Facebook Page Admin ID for Domain Insights */}} -{{- with .Site.Social.facebook_admin }}{{ end }} +{{- with site.Social.facebook_admin }}{{ end }} diff --git a/layouts/partials/templates/opengraph.html.orig b/layouts/partials/templates/opengraph.html.orig new file mode 100644 index 0000000..16afeec --- /dev/null +++ b/layouts/partials/templates/opengraph.html.orig @@ -0,0 +1,67 @@ + + + + +{{- if .Params.cover.image -}} +{{- if (ne .Params.cover.relative true) }} + +{{- else}} + +{{- end}} +{{- else }} + +{{- with $.Params.images -}} +{{- range first 6 . }}{{ end -}} +{{- else -}} +{{- $images := $.Resources.ByType "image" -}} +{{- $featured := $images.GetMatch "*feature*" -}} +{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- with $featured -}} +<<<<<<< HEAD + +{{ else -}} +{{- with $.Site.Params.images -}} + +{{ end }}{{ end }}{{ end }} +======= + +{{- else -}} +{{- with site.Params.images }}{{ end -}} +{{- end -}} +{{- end -}} +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 +{{- end }} + +{{- if .IsPage }} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} + +{{ with .PublishDate }}{{ end }} +{{ with .Lastmod }}{{ end }} +{{- end -}} + +{{- with .Params.audio }}{{ end }} +{{- with .Params.locale }}{{ end }} +{{- with site.Params.title }}{{ end }} +{{- with .Params.videos }}{{- range . }} + +{{ end }}{{ end }} + +{{- /* If it is part of a series, link to related articles */}} +<<<<<<< HEAD +{{- $permalink := .RelPermalink }} +{{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }} +{{- range $name := . }} + {{- $series := index $siteSeries $name }} +======= +{{- $permalink := .Permalink }} +{{- $siteSeries := site.Taxonomies.series }} +{{ with .Params.series }}{{- range $name := . }} + {{- $series := index $siteSeries ($name | urlize) }} +>>>>>>> d3d90be8a4ea04433d95d02a1dc07b0014c5b8b8 + {{- range $page := first 6 $series.Pages }} + {{- if ne $page.RelPermalink $permalink }}{{ end }} + {{- end }} +{{ end }}{{ end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{- with site.Social.facebook_admin }}{{ end }} diff --git a/layouts/partials/templates/schema_json.html b/layouts/partials/templates/schema_json.html index 891e954..4f66cee 100644 --- a/layouts/partials/templates/schema_json.html +++ b/layouts/partials/templates/schema_json.html @@ -2,28 +2,67 @@ -{{- else if .IsPage }} +{{- else if (or .IsPage .IsSection) }} +{{/* BreadcrumbList */}} +{{- $url := replace .Parent.Permalink ( printf "%s" site.BaseURL) "" }} +{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }} +{{- $bc_list := (split $lang_url "/")}} + +{{- $scratch := newScratch }} + +{{- if .IsPage }} -{{ end }} +{{- end }}{{/* .IsPage end */}} + +{{- end -}} diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index 816fafb..7cf34d7 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -17,7 +17,7 @@ {{- else -}} -{{- with $.Site.Params.images -}} +{{- with site.Params.images -}} {{ else -}} @@ -27,12 +27,7 @@ {{- end }} {{- end }} - -{{ with .Site.Social.twitter -}} + +{{ with site.Social.twitter -}} {{ end -}} -{{ range .Site.Authors }} -{{ with .twitter -}} - -{{ end -}} -{{ end -}} \ No newline at end of file diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index c873bdb..d9b8b23 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -1,84 +1,97 @@ {{- $headers := findRE "(.|\n])+?
    " .Content -}} {{- $has_headers := ge (len $headers) 1 -}} {{- if $has_headers -}} +
    +
    + + {{- i18n "toc" | default "Table of Contents" }} + -{{- $largest := 6 -}} -{{- range $headers -}} -{{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}} -{{- $headerLevel := len (seq $headerLevel) -}} -{{- if lt $headerLevel $largest -}} -{{- $largest = $headerLevel -}} -{{- end -}} -{{- end -}} - -{{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} - -{{- $.Scratch.Set "bareul" slice -}} - - - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} -
  • - {{- $header | safeHTML -}} - {{- else -}} -
  • - {{- $header | safeHTML -}} - {{- end -}} - {{- end -}} - - {{- $firstHeaderLevel := $largest }} - {{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) -}} -
  • - {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}} - {{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) -}} - -{{- else -}} - - -{{- end -}} -{{- end -}} - -{{- end -}} + {{- end -}} + {{- end }} + + {{- end }} +
    + + +{{- end }} diff --git a/layouts/partials/translation_list.html b/layouts/partials/translation_list.html new file mode 100644 index 0000000..0028251 --- /dev/null +++ b/layouts/partials/translation_list.html @@ -0,0 +1,19 @@ +{{- if .IsTranslated -}} +{{- if (ne .Layout "search") }} +{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}} +{{- end }} +{{- i18n "translations" | default "Translations" }}: + +{{- end -}} diff --git a/layouts/robots.txt b/layouts/robots.txt index 35f59d1..f26f508 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,5 +1,5 @@ User-agent: * -{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +{{- if hugo.IsProduction | or (eq site.Params.env "production") }} Disallow: {{- else }} Disallow: / diff --git a/layouts/shortcodes/blockquote.html b/layouts/shortcodes/blockquote.html deleted file mode 100644 index 14bb107..0000000 --- a/layouts/shortcodes/blockquote.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -{{ $.Scratch.Set "bl_author" false }} -{{ $.Scratch.Set "bl_source" false }} -{{ $.Scratch.Set "bl_link" false }} -{{ $.Scratch.Set "bl_title" false }} - -{{ if .IsNamedParams }} - {{ $.Scratch.Set "bl_author" (.Get "author") }} - {{ $.Scratch.Set "bl_source" (.Get "source") }} - {{ $.Scratch.Set "bl_link" (.Get "link") }} - {{ $.Scratch.Set "bl_title" (.Get "title") }} -{{ else }} - -{{ end }} - - - -{{ with $.Scratch.Get "bl_title" }} - -{{ else }} - {{ with $.Scratch.Get "bl_link" }} - {{ range last 1 (split ($.Scratch.Get "bl_link" ) "://") }} - {{ $.Scratch.Set "title_without_protocol" . }} - {{ end }} - {{ range last 1 (split ($.Scratch.Get "title_without_protocol" ) "www.") }} - {{ $.Scratch.Set "title_without_protocol" . }} - {{ end }} - {{ $.Scratch.Set "bl_title" ($.Scratch.Get "title_without_protocol") }} - - - {{ if (gt (len ($.Scratch.Get "title_without_protocol") ) 32) }} - {{ $title := (slicestr ($.Scratch.Get "title_without_protocol") 0 32) }} - {{ $split_by_fw_slash := split $title "/" }} - {{ $count := (sub (len $split_by_fw_slash) 1) }} - - {{ $.Scratch.Set "tempstring" "" }} - {{ range first $count $split_by_fw_slash }} - {{ $.Scratch.Set "tempstring" ( . | printf "%s%s/" ($.Scratch.Get "tempstring") | printf "%s" ) }} - {{ end }} - {{ $.Scratch.Set "bl_title" ( printf "%s..." ($.Scratch.Get "tempstring") | printf "%s" ) }} - {{ end }} - {{ end }} -{{ end }} - -
    -

    {{ .Inner | markdownify }}

    - -
    diff --git a/layouts/shortcodes/collapse.html b/layouts/shortcodes/collapse.html index b92ad01..17d8d3b 100644 --- a/layouts/shortcodes/collapse.html +++ b/layouts/shortcodes/collapse.html @@ -1,12 +1,8 @@ -{{ if .Get "content" }} {{ if .Get "summary" }} {{ else }} {{ warnf "missing value for param 'summary': %s" .Position }} {{ end }} -{{ else }} -{{ errorf "missing value for param 'content': %s" .Position }} -{{ end }}

    {{ .Get "summary" | markdownify }} - {{ .Get "content" | markdownify }} + {{ .Inner | markdownify }}

    diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html new file mode 100644 index 0000000..8c93eff --- /dev/null +++ b/layouts/shortcodes/figure.html @@ -0,0 +1,31 @@ + + {{- if .Get "link" -}} + + {{- end }} + {{ with .Get + {{- if .Get "link" }}{{ end -}} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} +
    + {{ with (.Get "title") -}} + {{ . }} + {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}

    + {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" }} + + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}{{ end }}

    + {{- end }} +
    + {{- end }} + diff --git a/layouts/shortcodes/inTextImg.html b/layouts/shortcodes/inTextImg.html new file mode 100644 index 0000000..0239fd6 --- /dev/null +++ b/layouts/shortcodes/inTextImg.html @@ -0,0 +1,5 @@ +{{- $Img := (.Get "url") }} +{{- $height := (.Get "height") }} +{{- $alt := (.Get "alt") }} + +{{$alt}} diff --git a/layouts/shortcodes/ltr.html b/layouts/shortcodes/ltr.html new file mode 100644 index 0000000..4ad7682 --- /dev/null +++ b/layouts/shortcodes/ltr.html @@ -0,0 +1,15 @@ +{{ $.Scratch.Set "md" false }} + +{{ if .IsNamedParams }} +{{ $.Scratch.Set "md" (.Get "md") }} +{{ else }} +{{ $.Scratch.Set "md" (.Get 0) }} +{{ end }} + +
    + {{ if eq ($.Scratch.Get "md") false }} + {{ .Inner }} + {{ else }} + {{ .Inner | markdownify }} + {{ end }} +
    diff --git a/layouts/shortcodes/rawhtml.html b/layouts/shortcodes/rawhtml.html index 520ec17..9350c13 100644 --- a/layouts/shortcodes/rawhtml.html +++ b/layouts/shortcodes/rawhtml.html @@ -1,2 +1,2 @@ -{{.Inner}} \ No newline at end of file +{{- .Inner -}} \ No newline at end of file diff --git a/layouts/shortcodes/rtl.html b/layouts/shortcodes/rtl.html new file mode 100644 index 0000000..a69b8ce --- /dev/null +++ b/layouts/shortcodes/rtl.html @@ -0,0 +1,15 @@ +{{ $.Scratch.Set "md" false }} + +{{ if .IsNamedParams }} +{{ $.Scratch.Set "md" (.Get "md") }} +{{ else }} +{{ $.Scratch.Set "md" (.Get 0) }} +{{ end }} + +
    + {{ if eq ($.Scratch.Get "md") false }} + {{ .Inner }} + {{ else }} + {{ .Inner | markdownify }} + {{ end }} +
    diff --git a/theme.toml b/theme.toml index 926792e..b49887d 100644 --- a/theme.toml +++ b/theme.toml @@ -5,7 +5,7 @@ name = "PaperMod" license = "MIT" licenselink = "https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE" description = "A fast, clean, responsive Hugo theme" -homepage = "https://github.com/adityatelange/hugo-PaperMod" +homepage = "https://adityatelange.github.io/hugo-PaperMod/" tags = [ "responsive", "simple", @@ -14,7 +14,8 @@ tags = [ "dark", "blog", "minimalist", - "highlight.js" + "highlight.js", + "search" ] features = [ "responsive", @@ -33,9 +34,10 @@ features = [ "minified-assets", "theme-toggle", "menu-location-indicator", - "scroll-to-top" + "scroll-to-top", + "search" ] -min_version = "0.74.0" +min_version = "0.83.0" [author] name = "Aditya Telange"