187 Commits
v2.0 ... v4.0

Author SHA1 Message Date
Aditya Telange
0af2e50d89 rm redundant styleing from profile-mode 2021-01-20 21:42:05 +05:30
Aditya Telange
2c9efe204a Update README.md
link refs to wiki instead of demo
2021-01-20 21:30:44 +05:30
Aditya Telange
757a3094b2 add drop-shadow to show go-to-top button
on code-bg in light mode
2021-01-20 19:21:59 +05:30
Aditya Telange
e02df37142 Revert "fix wrong load stylesheet and JS on multihost (multilingual) #126"
Doesn't work with multilingual config with no specific baseurl

This reverts commit ad79fdaf83.
2021-01-20 19:11:21 +05:30
Aditya Telange
ad79fdaf83 fix wrong load stylesheet and JS on multihost (multilingual) #126 2021-01-20 19:06:02 +05:30
skinner12
42280d1170 Add italian (it) translation (#184) 2021-01-20 11:27:30 +05:30
Aditya Telange
e4a6970186 Update FUNDING.yml
keep only ko-fi link

Thanks to everyone who supported on other platforms :)
2021-01-17 13:55:03 +05:30
Aditya Telange
ec2aa47c44 make content in dark more whiter improving redability and contrast in-between 2021-01-17 12:29:35 +05:30
Florian Kohrt
2b3baf94bb Make some page settings also configurable site wide (#182)
Adds **local** and **global** param to following front-matter vars:
- hideMeta
- ShowToc
- TocOpen
- comments

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
2021-01-17 12:25:35 +05:30
Aditya Telange
8222f2bd11 fix search result multiple hightlight on lost focus
also use set vars instead of fetching element again
2021-01-16 13:26:55 +05:30
Aditya Telange
704921ccd1 init media.css
- combine all media queries
- name zmedia to conacat at last
- change some max-width values to group them
2021-01-16 12:54:51 +05:30
Aditya Telange
4c51e9e8be fix code highlight spacing when in a list 2021-01-15 23:27:25 +05:30
Aditya Telange
ad44cdda0f fix highlight.js loading on section pages 2021-01-15 23:21:13 +05:30
Aditya Telange
18ae4e5593 respect prefers-reduced-motion while animating 2021-01-13 23:35:54 +05:30
Aditya Telange
b6a308d331 Do not smooth scrollIntoView
if user has it preferred

https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
2021-01-13 23:19:35 +05:30
Aditya Telange
dd83560010 go-top-top button cleanup 2021-01-11 21:01:50 +05:30
Aditya Telange
7a0e1f369c change animation condition from hover to active for share-buttons and terms-tags 2021-01-11 20:31:03 +05:30
Aditya Telange
89414d00dc add minimal border to post-entry
- increases element speration without being noticed
cc: #169
2021-01-11 20:15:04 +05:30
Aditya Telange
e809aef590 lighten dark's border
#5b5d67 -> #333
2021-01-11 20:01:19 +05:30
Muhammad Hanif
6f397ef591 i18n: Add id Bahasa Indonesia (#173) 2021-01-11 19:13:36 +05:30
Aditya Telange
6a897a9e67 update LICENSE for 2021 2021-01-08 23:37:28 +05:30
Aditya Telange
4fd4bc5e20 Add info to blank.css 2021-01-08 23:36:33 +05:30
Aditya Telange
9d478913ec Update README.md
replace unseen emoji
2021-01-08 23:35:00 +05:30
Aditya Telange
bd4a118afa rm unnecessay color to box-shadow for anchors 2021-01-08 22:53:04 +05:30
Aditya Telange
3b0997fc42 fix margin when hljs was disabled 2021-01-08 22:52:03 +05:30
Aditya Telange
905640ceef increase blockquote thickness inside post 2021-01-08 20:38:00 +05:30
Aditya Telange
09de369d2f update fuse.js to v6.4.6
credits: https://github.com/krisk/Fuse/releases/tag/v6.4.6
2021-01-06 01:52:22 +05:30
Roman Ispaev
3b5c7faaec fix wrong asset links on multihost config (#126)
CORS issue for multidomain setup (#168)
2021-01-06 01:51:43 +05:30
Weichen Liu
946cc1ffe3 single: Add post description (#165)
usage =>
in post params add : 
    description: "Desc Text."
2021-01-02 22:30:20 +05:30
Aditya Telange
5d6de5ecb1 post-single(css): fix scroll-bar in code
hiding background
2020-12-31 17:01:26 +05:30
Tomás Dias Almeida
bfb5019cbc Code block / blockquote / hr should respect the margin layout (#154)
* Code block should respect the margin layout

* Blockquote should respect the margin layout

* align others elements to main width with minors mods

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
2020-12-31 16:11:18 +05:30
Aditya Telange
d53671786c social-icons: add reddit icon #163
credits for svg: https://iconmonstr.com/reddit-1-svg/

LICENSE: https://iconmonstr.com/license/
2020-12-31 11:05:08 +05:30
Aditya Telange
e000675275 social-icons: add nuget icon & refactor code #163
credits for svg: https://commons.wikimedia.org/wiki/File:NuGet_project_logo.svg

This file is licensed under the Creative Commons Attribution 2.0 Generic license.
2020-12-31 11:05:08 +05:30
Aditya Telange
3d88f46f33 Update README.md 2020-12-30 21:37:26 +05:30
Aditya Telange
b825b7f27c post-single: Fix embeded gist colors
fixes: #161
2020-12-29 18:12:15 +05:30
Aditya Telange
2b7d2dd493 reset: scroll-bar: set only on devices > 768px
default style to others
2020-12-29 18:10:18 +05:30
Aditya Telange
0e9ca244dc fotter: fix Links do not have a discernible name for go-to-top btn 2020-12-29 17:03:22 +05:30
Aditya Telange
c9fa6c7915 cover: granular controls for hiding cover image #156
in site config =>
    params:
        cover:
            hidden: true # hide everywhere but not in structured data
            hiddenInList: true # hide on list pages and home
            hiddenInSingle: true # hide on single page

per-page in front-matter =>
   hidden: true # only hide on current single page
2020-12-29 16:44:03 +05:30
Aditya Telange
e252e761f5 footer: allow disabling HLJS #143
usage =>

in site config =>
    params:
        assets:
            disableHLJS: true

per-page in front-matter =>
   disableHLJS: true
2020-12-29 16:39:23 +05:30
Aditya Telange
838e607122 head: rm invalid rel="preload" on search assets 2020-12-27 22:39:03 +05:30
Aditya Telange
4389e03df9 baseof: pass .Layout
for 0f994eee95/layouts/partials/footer.html (L21)
2020-12-27 22:31:14 +05:30
Aditya Telange
0f994eee95 footer: change scroll behaviour as it was before 80954de
fixes #151

anchored-headings: retain anchor link '#' in URL
cc #108

footer: remove '#' with go-to-top

Revert "anchored-headings: retain anchor link '#' in URL"
This reverts commit 80954de8bd.

Revert "footer: rm unused code"
This reverts commit c76233b350.
2020-12-24 13:00:58 +05:30
Aditya Telange
7c53c14c85 Update theme.toml
change homepage to demo website
2020-12-23 16:44:32 +05:30
Aditya Telange
aeaa60d9b6 reset(css): rm -webkit-appearance
fixes: #150
2020-12-23 16:36:19 +05:30
pacientes
a36d045214 post-single(css): add image center align tag (#145)
usage in markdown =>
![name](path/to/image.png#center)

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
2020-12-23 16:34:01 +05:30
Maurice Bauer
8933950217 i18n: Added missing german (de) translation (#147) 2020-12-23 13:09:20 +05:30
Aditya Telange
b4933eadd6 header: use .KeyName for accesskey search
in menu

- .Name doesn't work with emojis
- .URL doesn't work with url such as 'search/'
2020-12-18 22:50:04 +05:30
Aditya Telange
6c83df566c header: add accesskey (Alt + /) for search
in menu

- Alt + /: jumps to search page if in menu
2020-12-18 22:05:02 +05:30
Aditya Telange
bccce36c98 search: use kb nav only inside searchbox
rm 'prevent mouseclick to change active element'
2020-12-18 21:25:34 +05:30
Aditya Telange
a150c3449a Link AccessKeys shortcut in title of elements 2020-12-18 20:02:05 +05:30
Aditya Telange
23aeda369c head: trim whitespace from canonicalURL
- amend to 14c5245
2020-12-18 11:58:16 +05:30
Aditya Telange
b7f8749cdf Search: Keyboard Bindings for easier navigation (#138)
* set up basic actions on keypress
* add actions to perform conditionally
* add simple highlight animation
* prevent mouseclick to change active element
* clear input box on Escape
* click on Arrow Right
* clear results and focus search-input on esc
* refactor
2020-12-18 11:45:10 +05:30
Maciej Sawicki
d6b2282582 templates: Fix series detection in opengraph
When inside front matter you specified series with spaces,
then the opengraph template wouldn't detect other articles,
because in `.Site.Taxonomies.series` they are stored by
urlized key.

Example:

```yaml
series:
    - My Series
```

```gohtml
{{/* in a template */}}
{{- $series := index .Site.Taxonomies.series$name }}

{{/* was resolved to */}}
{{- $series := index {'my-series': ...} "MySeries" }}
```

(cherry picked from commit d2d493ab5d6a054001a8448ea0de2949dac4b30e)
2020-12-16 18:07:59 +05:30
Aditya Telange
f5417ab6d0 Update README.md 2020-12-16 00:01:44 +05:30
Cody Brownstein
2abc278c69 head: Fix user defining canonical URL resulting in multiple canonical URLs (#133)
* Revert "head: add support for Canonical URLs"

This reverts commit 8af7c551ff.

* Allow user to specify single canonical URL
2020-12-15 22:59:04 +05:30
Aditya Telange
77ff1e6b45 search: introduce loading custom fusejs options from site config #134
* refer https://fusejs.io/api/options.html for opts
* keys used can be some, all or none from
   ["title", "permalink", "summary", "content"]

in config.yml, add fuseOpts as shown below =>
  params:
    fuseOpts:
        isCaseSensitive: false
        shouldSort: true
        location: 0
        distance: 1000
        threshold: 0.4
        minMatchCharLength: 0
        keys: ["title", "permalink", "summary", "content"]
2020-12-15 18:57:42 +05:30
Kian Kasad
f9236d92af shortcodes: figure: don't use h4 tag in figure captions (#127)
* avoiding h4 tags in figcaption elements
* picked from https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/shortcodes/figure.html
* figure.html is licensed under Apache License 2.0 and is part of https://github.com/gohugoio/hugo
2020-12-15 17:52:04 +05:30
Aditya Telange
09aba49bf0 header: rm class attributes [WIP]
from hugov0.79.0
2020-12-13 22:29:06 +05:30
Aditya Telange
bf79c208ae layouts: use hugo.IsProduction 2020-12-13 20:19:25 +05:30
Aditya Telange
153740bbac header: add title attribute to menus 2020-12-13 20:17:01 +05:30
Aditya Telange
73de54e4bc update theme meta
- add search
2020-12-13 20:01:54 +05:30
Aditya Telange
14c524539b Remove whitespace around urls wherever applicable
- corrects mistyped urls with leading or trailing whitespaces
2020-12-13 16:56:41 +05:30
Aditya Telange
8af7c551ff head: add support for Canonical URLs
cc:  #104

usage =>
  in site config.yml (used for home page only) =>
     canonical: ["https://www.example.com" , "https://blog.example.com"]
  in per-page vars =>
     canonical: ["https://www.example.com/page1" , "https://blog.example.com/pages/page1"]
2020-12-13 16:36:30 +05:30
Aditya Telange
b7f5dd10f1 language-switch: humanize only Lang code
- displays weird text :/
- amend to ad11fe1
2020-12-11 17:20:50 +05:30
Aditya Telange
d74ad93c18 head: add *.css under assets/css/extended/
to bundle it with stylesheet.css as single resource minified

- added to the end so that default vars are overriden properly
2020-12-11 18:22:21 +05:30
Kian Kasad
5e40132673 single: add support for custom taxonomy URLs (#125)
* fix URLs of tags in tag lists
* use recommended code by hugo for tag list generator
* https://gohugo.io/templates/taxonomy-templates/#example-list-tags-in-a-single-page-template
* closes: #113
2020-12-11 11:28:09 +05:30
Aditya Telange
9c09564590 header: fix trailing slash '/' in menu URL
closes #122
2020-12-11 00:18:08 +05:30
Kian Kasad
7352aedb34 README: make non-executable (#106)
Readme isn't an executable, so the executable permission should be disabled.
2020-12-10 21:09:16 +05:30
pacientes
11c3230214 social-icons: add svg for kakaotalk (#115)
credits for svg: https://www.flaticon.com/free-icon/kakao-talk_2111683
Flaticon License: Free for personal and commercial purpose with attribution.

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
2020-12-08 18:19:07 +05:30
Aditya Telange
db38e156f5 footer: hljs: add check to not load hljs on archive and search 2020-12-08 00:16:11 +05:30
Aditya Telange
08e58f5f77 head: commonize stylesheet resource 2020-12-07 22:59:51 +05:30
Aditya Telange
91bc0acfa9 Update README.md 2020-12-06 22:31:18 +05:30
Aditya Telange
f4b900de72 footer: go-to-top: fix Uncrawlable Link
rm redundant a tag
2020-12-06 19:45:46 +05:30
Aditya Telange
bb2717a3b9 search: fix redundant results after clearing searchbox 2020-12-06 19:44:36 +05:30
Aditya Telange
4a4408573e search: init Search feature (#105)
* based on https://gist.github.com/cmod/5410eae147e4318164258742dd053993
* modified working for PaperMod
* fetches current lang index.json for search
* add fuse.js v6.4.3 LICENSE: Apache License 2.0
* bundled fastsearch and fusejs as search.js

Co-authored-by: Craig Mod <stuff@craigmod.com>
2020-12-06 18:19:50 +05:30
Aditya Telange
c76233b350 footer: rm unused code
CC: #108 #64
2020-12-05 20:45:15 +05:30
Aditya Telange
80954de8bd anchored-headings: retain anchor link '#' in URL
close: #108
2020-12-05 20:17:07 +05:30
Devorange
d4b259cd63 list: use absURL for pagination (#109) 2020-12-05 20:12:55 +05:30
Aditya Telange
28abfba27e home-info: fix title line height
close: #102
2020-12-04 16:29:56 +05:30
Aditya Telange
f2253b2e83 Create FUNDING.yml 2020-12-02 16:04:55 +05:30
Aditya Telange
a9ff9533a0 head, footer: add option to disable fingerprinting #89
in site config =>
    params:
      assets:
        disableFingerprinting: true
2020-12-01 18:52:06 +05:30
Aditya Telange
7a0e742def header: improve menu location indicator
- fix non-highlight on subdirs
- menu url need not have leading or trailing slashes
- fix non-highlight with multilingual config
2020-12-01 13:59:31 +05:30
Aditya Telange
dc743ae5e2 header: fix menu items overflow instead of horizontal scroll #99
- broken by https://git.io/JIfLS
2020-12-01 08:36:08 +05:30
Aditya Telange
29797a7464 social-icons: add kofi icon #29
* thanks to https://iconify.design/icon-sets/simple-icons/kofi.html
  and Simple Icons Collaborators
* License CC0 1.0
* edited to fit dual-tone theme
2020-11-30 20:55:41 +05:30
Aditya Telange
b5f3debebb footer: go-to-top: fix overlap with next_page button
close: #91
2020-11-30 13:25:20 +05:30
Aditya Telange
0d8cb9fd15 cover: responsive cover: rm forced q100
- lets quality attribute in imaging section
- https://gohugo.io/content-management/image-processing/#image-processing-config

close #92
2020-11-29 09:39:57 +05:30
Misha Brukman
e89e7570cd Archive: Close the <sup> tag for month counts (#93) 2020-11-29 09:20:56 +05:30
Aditya Telange
ad11fe16ed language-switch: rm humanize on 'displayFullLangName'
- displays weird text :/
2020-11-28 23:04:32 +05:30
Aditya Telange
e7e5e8ce6d main(css): rm media rule for smaller devices
-has no effect
2020-11-28 23:03:06 +05:30
Aditya Telange
673f7ccc96 baseof: rm unused classes
single, home
2020-11-28 22:33:57 +05:30
Aditya Telange
b301d60f03 theme-switch: Improve theme switch logic (#86)
- removes unnecessary local-storage item removal
- less inline script on build
- assumes `defaultTheme as auto when value is not `dark` or `light`
- should work according to table at docs
2020-11-26 09:10:24 +05:30
Aditya Telange
678b5d82fc update README 2020-11-24 23:16:17 +05:30
Niek Blankers
aa6be95a12 social-icons: add svg for keybase (#79)
From https://github.com/keybase/keybase-issues/issues/973#issuecomment-307547386
SVG reduced to 2.5kB

Co-authored-by: dabura667 <matsuringo667@gmail.com>
2020-11-23 18:25:57 +05:30
Aditya Telange
dbb0e63248 head: change title separator "-" -> "|" 2020-11-23 01:27:09 +05:30
Aditya Telange
20710d34b9 social-icons: Trim whitespace and Lowercase name
- allows name like shown below

    socialIcons:
        - name: "TWitteR"
          url: "https://twitter.com"
        - name: "Codepen"
          url: "https://codepen.com"
2020-11-22 19:20:58 +05:30
Mikhail Zolotukhin
1f608c8fad social-icons: add svg for Mastodon (#82)
from: https://joinmastodon.org/press-kit.zip
LICENSE: AGPLv3

close #81
2020-11-22 19:05:56 +05:30
Aditya Telange
d4967f9ebc hljs: updatev10.2.0 -> v10.2.1
* credits : https://cdnjs.com/libraries/highlight.js
2020-11-19 15:29:02 +05:30
Aditya Telange
4cc4604498 cover: add rel="noopener noreferrer"
to links
2020-11-18 15:45:19 +05:30
Aditya Telange
361362773c social-icons: add svg for discord
- from https://discord.com/branding
close #76
2020-11-18 15:34:21 +05:30
Aditya Telange
c429d81b18 static: rm PaperMod icons from theme 2020-11-17 19:39:24 +05:30
Aditya Telange
a276a5dfd1 head: rm site.webmanifest, not a PWA 2020-11-17 19:38:07 +05:30
Aditya Telange
c9a387ebdb assets(css): fix "calc" operands should be correctly spaced 2020-11-17 15:56:27 +05:30
Aditya Telange
fd06af55fc footer: simpify loading hljs,
defer and beautify
2020-11-17 15:44:16 +05:30
Aditya Telange
3c28b8a8b2 footer: fix scroll for non ASCII anchors
closes #78
2020-11-17 15:25:39 +05:30
Aditya Telange
2a06c26e9f assets(css): optimize using csso
https://css.github.io/csso/csso.html
2020-11-17 12:45:19 +05:30
Aditya Telange
62477e7d1b head: add meta robots
- disable indexing for non-prod sites
2020-11-14 12:55:19 +05:30
Aditya Telange
f4998a1ab8 head: add google_news internal template from hugo 2020-11-14 12:44:56 +05:30
Aditya Telange
66ba0f0ea9 home-info: unset line-clamp for content
- content can be as long as one wants it to be
- was hiding content on mobile devices
- amend to 2c7cffb
2020-11-12 22:20:24 +05:30
Aditya Telange
d2f2fa6cc6 head: add alternate pages
to indicate multiple language/locale versions
for multilungual sites
2020-11-12 11:19:29 +05:30
Aditya Telange
b22520630d toc: highlight underline on hover 2020-11-12 11:09:23 +05:30
Aditya Telange
1775dfccfd scroll-bar(css): fix dark track color on list
pages, due to c960b8a
2020-11-11 10:39:55 +05:30
Aditya Telange
0b07dd2a7d header: fix spacing when logo-text overflows 2020-11-11 10:36:54 +05:30
Aditya Telange
cf4fd27e3d anchored-headings: port to PaperMod
- add corresponding css
- gen anchored headings for h1-h6
- link with single.html
2020-11-10 12:34:22 +05:30
Jake Wiesler
2b0619f684 anchored-headings: init partial
Signed-off-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
2020-11-10 12:08:52 +05:30
Aditya Telange
8574c385cd profile-mode: user set-able image size
- default 150

usage:
      profileMode:
        imageUrl: "/android-chrome-192x192.png"
        imageWidth: 120
        imageHeight: 120
2020-11-09 12:14:45 +05:30
Aditya Telange
c960b8af04 scroll-bar(css): fix white track color on list
pages, due to diff bg
2020-11-09 11:52:57 +05:30
Aditya Telange
64e8532a50 head: load stylesheet resources with a wildcard
- include profile-mode
  (cannot be done before f9fbdc9963)
- reduce request count from 2 to 1
  improves perf :P
  https://web.dev/resource-summary/
2020-11-09 11:18:22 +05:30
Aditya Telange
f9fbdc9963 profile-mode: improvements
- update css logic
- rm redundant code
- reduce image size, it looks big imo
2020-11-09 11:12:52 +05:30
Aditya Telange
b7169d2259 language-switch: enable emojify
- languageName: ":country_emoji:"
 can now be displayed as emoji
2020-11-08 23:07:51 +05:30
Aditya Telange
b5d55aee8d layouts/single: fix Lang Name hidden when LanguageName
was unset
2020-11-08 23:04:24 +05:30
Aditya Telange
77baa3d76e layouts: add robots.txt
used when
enableRobotsTXT: true

https://gohugo.io/templates/robots/
2020-11-08 22:31:27 +05:30
Aditya Telange
5264c7011e toc: add aria-label for accessibility reasons
- fix: Links do not have a discernible name
2020-11-06 10:58:23 +05:30
Aditya Telange
795c06b2cc head: improve favicons presence
- also set theme color to #2e2e33
- use syntax from https://favicon.io
- `site.webmanifest` added, should be present in "static"

Custom links to favicons can be added in site config =>

params:
  assets:
    favicon: "<link / abs url>"
    favicon16x16:  "<link / abs url>"
    favicon32x32:  "<link / abs url>"
    apple_touch_icon:  "<link / abs url>"
    safari_pinned_tab:  "<link / abs url>"
2020-11-05 19:48:30 +05:30
Itay Cohen
3064e8cfc5 theme-switch: Enable theme toggle unless specifically disabled (#69)
Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
2020-11-04 14:04:45 +05:30
Aditya Telange
12b6b132e4 Revert "theme-switch-button: improve logic"
This reverts commit 0eed773e6d.
2020-11-03 20:21:10 +05:30
Aditya Telange
0eed773e6d theme-switch-button: improve logic
- owner can set dark/light/auto default theme
- theme toggle will be enabled on all theme modes unless disbaled
- if disableThemeToggle is true, user won't be able to switch themes,
here auto (a/c to system theme) also works

for #69
2020-11-03 20:07:59 +05:30
Aditya Telange
229df19ec9 header: fix spacing between lang-selector and label
when theme-toggle is disabled
2020-11-03 19:44:19 +05:30
Nick Spreitzer
55107fcfc2 footer: Fix broken anchor link scrolling (#64)
fixes: Footnotes anchor link hrefs such as `#fn:1`
fixes: ToC anchors failing with hrefs having numbers.

based-on: https://stackoverflow.com/a/51396346/300212
2020-10-30 22:39:44 +05:30
Dan van Wijk
0a7a540761 footer: remove hidden chars (#63)
Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
2020-10-30 17:31:52 +05:30
Aditya Telange
b8c29c2e06 reset(css): disable focus only on toc and go-to-top button
revert "css: reset: disbale highlight on focus"

This reverts commit 94b67a5dc9.
2020-10-30 11:42:58 +05:30
Aditya Telange
b239f42f6b Add accesskeys (attribute specifies a shortcut key to activate/focus an element.)
c - ToC Open/Close
g- Go To Top
h - Home (according to current lang)
t - Theme toggle

more: https://www.w3schools.com/tags/att_global_accesskey.asp
2020-10-30 01:15:43 +05:30
Aditya Telange
9acbc2c134 baseof: use dir attribute instead of class
and set default dir to `auto`

main(css): rm unused class
2020-10-30 01:01:48 +05:30
Aditya Telange
0887805caf README: update
link faq post
2020-10-28 22:41:42 +05:30
Aditya Telange
7392edb1d3 README: update
- rm old Lighthouse report
- beautify
- update demo image
2020-10-28 11:11:13 +05:30
Aditya Telange
6c7b8cf2f9 share-icons: fix extra uneven padding 2020-10-28 09:35:21 +05:30
Aditya Telange
b40f30754d header: add cursor type pointer to theme-toggle 2020-10-26 22:49:27 +05:30
Aditya Telange
c33dabf3a2 header: add Language switch (#54)
* language-switch: init
* header: move logo-switches together
2020-10-26 22:19:05 +05:30
Aditya Telange
a97de0f9a4 reset(css): rm bold styling (#55) 2020-10-25 16:08:52 +05:30
Aditya Telange
70a2b06ac1 share-icons: add #hashtag generation from tags
for twitter share
2020-10-25 13:58:17 +05:30
Aditya Telange
1256f353e5 json-schema:fix multiple authors in config displayed incorrectly
* is of type `[]interface {}` and not `[]string`
2020-10-25 13:08:03 +05:30
Aditya Telange
0bd68d242c update README 2020-10-25 13:03:50 +05:30
Aditya Telange
9ac0f391f6 author(partial): fix multiple authors in config displayed incorrectly
* is of type `[]interface {}` and not `[]string`
2020-10-25 13:01:49 +05:30
Aditya Telange
44bc299ca3 json-schema: add support for multiple authors 2020-10-25 12:49:58 +05:30
Aditya Telange
5b9eaac130 layouts: use author partial in head and post_meta 2020-10-25 12:47:09 +05:30
Aditya Telange
bc2b82c370 author(partial): init, with support for multiple authors
* usage:
    author: ["me", "you"]
2020-10-25 12:16:36 +05:30
Aditya Telange
3e84ff0435 post-meta: fix redundant '·'(separator) in end
when author is not present
2020-10-25 11:17:54 +05:30
Dragomir Yordanov
db0e744af3 i18n: improve for 'es' and add 'bg' (#58)
* Translate read_time, toc and translations to spanish

* Add translations in bulgarian
2020-10-25 09:52:26 +05:30
Mehdy Khoshnoody
3e3a7d380e post-single(css): improve RTL support (#57)
* Replace left with start for tables and block-quote
2020-10-24 19:12:24 +05:30
Aditya Telange
4e9d470fec Revert "reset(css): themify text selection"
* looks ugly :p

This reverts commit 3d60370494.
2020-10-23 16:11:55 +05:30
Aditya Telange
413034e43b social-icons: fix duplicate rel tags 2020-10-23 15:56:41 +05:30
Mehdy Khoshnoody
a8123bc688 i18n: Add translations for fa: Farsi (#56) 2020-10-23 15:11:20 +05:30
Aditya Telange
834feb9adc cover: responsive cover: generate responsive images only in "production" env
- will reduce render time in development env
2020-10-23 11:35:30 +05:30
Aditya Telange
51c58ad0d5 social-icons: add rel=me
* rel=me links allow cross-linking of user's identities, improving SEO
2020-10-23 11:26:28 +05:30
Aditya Telange
16213a37e5 post-meta: improvements
- hide zero date (closes #33)
- fix separator
- refactor
2020-10-22 20:40:00 +05:30
Aditya Telange
684cb2160f layouts: post_meta as partial 2020-10-22 16:53:24 +05:30
Aditya Telange
3d60370494 reset(css): themify text selection 2020-10-22 16:52:45 +05:30
Niek Blankers
21241c212e relative-cover: init Responsive cover images (#43)
Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>

- generates images of different sizes
- browser can choose between set of images w.r.t viewport width
- is enabled by default
- supported image formats :
  https://gohugo.io/content-management/image-processing/#target-format

- Customizing site config params:
params:
    cover:
      responsiveImages: false  # if want to disable it
      linkFullImages: true # if link original image on clicking cover
2020-10-22 16:42:26 +05:30
Zhangyuan Nie
3e92b5aa29 chore: add go.mod (#51)
* more about this: https://gohugo.io/hugo-modules/use-modules/
2020-10-21 10:36:44 +05:30
Zhangyuan Nie
ea9aa38573 header: disable user-select for theme-toggle (#52)
* fix: clicking twice on theme switch selects other text on the nav-bar.
2020-10-20 10:38:43 +05:30
Aditya Telange
c0ba1ce20d social-icons: add svg for medium
* icon belong to medium[.]com
* converted to svg with online-convert[.]com
2020-10-19 19:00:01 +05:30
Aditya Telange
ddbd65b937 Update README 2020-10-19 16:02:45 +05:30
Mehdy Khoshnoody
a153a7cc6f Add RTL support for multilingual mode (#47)
Usage: 
in site config:
languages:
  ar:
    languagedirection: rtl
    title: مدونتي
    weight: 2

* ref: https://gohugo.io/content-management/multilingual/#configure-languages
2020-10-19 14:47:23 +05:30
Aditya Telange
a41f09bb99 extended_footer: init
* add placeholder template for extending footer

closes #37
2020-10-18 21:52:22 +05:30
Northerner-coder
b720e4a523 extended_head: init (#44)
* add placeholder template for extending head
2020-10-18 20:21:42 +05:30
Aditya Telange
7db1be3d73 head: update description and keywords logic 2020-10-17 16:00:46 +05:30
Aditya Telange
353146891e home-info, profile-mode: enable markdownify for text elements 2020-10-17 15:02:40 +05:30
Aditya Telange
3826200b7c nav-label: accessibility 2020-10-17 00:05:10 +05:30
Aditya Telange
3edc160c59 nav-label: init
* label can be set differently from title
* label can have an optional icon with preffered size

* in site config =>
params:
  label:
    text: "Home"
    icon: /apple-touch-icon.png
    iconHeight: 35
2020-10-16 23:56:56 +05:30
Northerner-coder
db52aa9942 layouts: Add DateFormat parameter (#39)
* User can change Date Format to be displayed in Front Matter
* Formats supported by Hugo can be found here: https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference
2020-10-16 22:12:32 +05:30
Northerner-coder
a980d10bfc i18n: ru: Add full Russian localization (#40) 2020-10-16 18:26:54 +05:30
Aditya Telange
fb945ba3c1 json-schema: add support for Rich Results: Json schema for structured data (#36)
* json-schema: init

* sameAs can be set through .Site.Params.schema.sameAs
* if it is not specified but social-icons exsists, we use social-icons for sameAs vars
* .Site.Params.schema.sameAs overrides social-icons
* publisherType can be changed via .Site.Params.schema.publisherType
2020-10-15 10:21:33 +05:30
Aditya Telange
95e6bf1e13 list: show nested sections
* shows links to section if _index.md is present
* by this sub-sections can be distinguished properly
* more about this and way to implement: https://gohugo.io/content-management/organization/#index-pages-_indexmd
2020-10-13 18:17:39 +05:30
Aditya Telange
0a0d756671 Merge pull request #34 from adityatelange/cover-image-in-social-meta
Cover image in social meta
2020-10-12 17:33:33 +05:30
Aditya Telange
23636ab326 templates: social-meta: prefer cover image over other images 2020-10-12 17:26:45 +05:30
Aditya Telange
306889f68b head: link custom templates for social meta 2020-10-11 21:08:44 +05:30
Aditya Telange
4a4d0c009c templates: add cover image to be linked into meta
for opengraph, schema and twitter
2020-10-11 21:04:17 +05:30
Aditya Telange
6c4e094c91 templates: Add Twitter Cards, OpenGraph, Schema
This code is licensed under Apache License 2.0
and is part of https://github.com/gohugoio/hugo
2020-10-11 20:07:43 +05:30
Aditya Telange
a8abbd3545 post-cover: relative covers need to be explicitely set
* change in d819914 and #13
* previous impl breks sites not using `/static` dir as their static location
* hugo supports multiple static directories and previous impl checks only for one
* ref : https://gohugo.io/content-management/static-files/

usage change in post-vars =>

cover:
  image: '<relative url>'
  relative: true
2020-10-10 19:52:08 +05:30
Aditya Telange
3ca79f59fe post-cover: fix strange /./ in cover image url 2
#13
2020-10-10 19:41:44 +05:30
Aditya Telange
e04e248ae1 terms: hide cover image in taxonomy list,
show others

* taxonomies are meant to be browsed faster
2020-10-10 19:40:37 +05:30
Aditya Telange
f933372c55 terms: fix unreachable code in taxonomy list 2020-10-10 19:34:13 +05:30
Aditya Telange
46bf0538c9 post-tags(css): highlight tags with a slim border 2020-10-10 19:24:48 +05:30
Aditya Telange
2c7cffb617 home-info: let content show upto 5 lines
* previously 3
2020-10-08 15:50:20 +05:30
Aditya Telange
724e73facb social-icons: add buymeacoffee icon
* icon belongs to buymeacoffee.com
* edited to fit dual-tone theme
2020-10-08 14:27:43 +05:30
Aditya Telange
82e9b29bf4 post-cover: fix strange /./ in cover image url
#13
2020-10-08 09:21:57 +05:30
Aditya Telange
fae1c47611 update theme meta 2020-10-06 15:47:39 +05:30
Aditya Telange
e03bc919bc Add Stale bot 2020-10-06 09:20:21 +05:30
63 changed files with 3803 additions and 593 deletions

12
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: adityatelange
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: #

17
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 7
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 3
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- keep
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@@ -1,6 +1,7 @@
MIT License MIT License
Copyright (c) 2020 nanxiaobei, adityatelange Copyright (c) 2020 nanxiaobei and adityatelange
Copyright (c) 2021 adityatelange
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

89
README.md Executable file → Normal file
View File

@@ -1,76 +1,85 @@
![Build GH-Pages](https://github.com/adityatelange/hugo-PaperMod/workflows/Build%20GH-Pages/badge.svg) # PaperMod | [Demo](https://adityatelange.github.io/hugo-PaperMod/)
![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/)
[![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 ☄️ Fast | ☁️ Fluent | 🌙 Smooth | 📱 Responsive
Hugo PaperMod is a theme based on [hugo-paper](https://github.com/nanxiaobei/hugo-paper). 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 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 ... 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. ExampleSite can be found here: [exampleSite](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite). Demo is built up with exampleSite as source.
![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/)
[![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)
--- ---
<p align="center"> <p align="center">
<kbd><img width=600px src="https://i.ibb.co/GvspqCX/HomeInfo.png" alt="HomeInfo" /></kbd> <kbd><img width=600px src="https://raw.githubusercontent.com/adityatelange/hugo-PaperMod/exampleSite/content/posts/papermod/papermod-features/images/homeinfo.webp" alt="HomeInfo" /></kbd>
<kbd><img width=153px src="https://i.ibb.co/LNgGcrt/mobileview.png" alt="HomeInfo" /></kbd> <kbd><img width=153px src="https://i.ibb.co/LNgGcrt/mobileview.png" alt="HomeInfo" /></kbd>
</p> </p>
--- ---
## Install ## Features/Mods 💥
Read this post For More Details => [hugo-PaperMod - Installation](https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-installation/) - Uses Hugo's asset generator with pipelining, fingerprinting, bundling and minification by default.
- 3 Modes:
- [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.
- 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.
- Search Page with Fuse.js
- No webpack, nodejs and other depedencies required to edit the theme.
Read this post For More Details => **[PaperMod - Features](https://github.com/adityatelange/hugo-PaperMod/wiki/Features)**
--- ---
## Features/Mods ## Install/Update 📥
- Uses Hugo's asset generator with pipelining, fingerprinting, bundling and minification by default. Read Wiki For More Details => **[PaperMod - Installation](https://github.com/adityatelange/hugo-PaperMod/wiki/Installation)**
- 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)
- Table of Content Generation (newer implementation).
- Archive of posts
- Social-Media Share buttons on post.
- Menu location indicator.
- Multilingual support.
- Cover image for each post
- Light/Dark theme ( automatic theme switch a/c to browser theme)
- No webpack, nodejs and other depedencies 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)
--- ---
## Social-Icons ## Social-Icons/Share-Icons 🖼️
Read this post For More Details => [Social-Icons](https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-icons/) Read Wiki For More Details => **[PaperMod-Icons](https://github.com/adityatelange/hugo-PaperMod/wiki/Icons)**
--- ---
## LightHouse Report ## FAQs / How To's Guide 🙋
<kbd><a href="https://lighthouse-dot-webdotdevsite.appspot.com//lh/html?url=https%3A%2F%2Fadityatelange.github.io%2Fhugo-PaperMod%2F"><img src="https://i.ibb.co/y6RwCzb/lighthouse.png" alt="LightHouse" /></a></kbd> 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 Release ChangeLog has info about stuff added: **[Releases](https://github.com/adityatelange/hugo-PaperMod/releases)**
create a new [Pull Request](https://github.com/adityatelange/hugo-PaperMod/pulls) to fix the issue.
![GitHub issues](https://img.shields.io/github/issues-raw/adityatelange/hugo-papermod) ---
![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/adityatelange/hugo-PaperMod)
![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/adityatelange/hugo-papermod) ## [LightHouse Report (100% ?)](https://lighthouse-dot-webdotdevsite.appspot.com//lh/html?url=https%3A%2F%2Fadityatelange.github.io%2Fhugo-PaperMod%2F)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/adityatelange/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)
- **All Contributors and Supporters**

View File

@@ -1,5 +1,3 @@
/* 404
-------------------------------------------------- */
.not-found { .not-found {
position: absolute; position: absolute;
left: 0; left: 0;
@@ -9,5 +7,5 @@
justify-content: center; justify-content: center;
height: 80%; height: 80%;
font-size: 160px; font-size: 160px;
font-weight: 700; font-weight: 700
} }

View File

@@ -1,60 +1,44 @@
/* Archive
-------------------------------------------------- */
.archive-posts { .archive-posts {
width: 100%; width: 100%;
font-size: 16px; font-size: 16px
} }
.archive-year { .archive-year {
margin-top: 40px; margin-top: 40px
} }
.archive-year:not(:last-of-type) { .archive-year:not(:last-of-type) {
border-bottom: 2px solid var(--border); border-bottom: 2px solid var(--border)
} }
.archive-month { .archive-month {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
padding: 10px 0; padding: 10px 0
} }
.archive-month-header { .archive-month-header {
margin: 25px 0; margin: 25px 0;
width: 200px; width: 200px
} }
.archive-month:not(:last-of-type) { .archive-month:not(:last-of-type) {
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border)
} }
.archive-entry { .archive-entry {
position: relative; position: relative;
padding: 5px; padding: 5px;
margin: 10px 0; margin: 10px 0
} }
.archive-entry-title { .archive-entry-title {
margin: 5px 0; margin: 5px 0;
font-weight: 400; font-weight: 400
} }
.archive-count,
.archive-meta { .archive-meta {
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px
}
.archive-count {
color: var(--secondary);
font-size: 14px;
}
@media (max-width: 800px) {
.archive-month {
flex-direction: column;
}
.archive-year {
margin-top: 20px;
}
} }

View File

@@ -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
*/

View File

@@ -1,34 +1,33 @@
/* Footer .footer,
-------------------------------------------------- */ .top-link {
font-size: 12px;
color: var(--secondary)
}
.footer { .footer {
max-width: calc(var(--main-width) + var(--gap) * 2); max-width: calc(var(--main-width) + var(--gap) * 2);
margin: auto; margin: auto;
padding: calc((var(--footer-height) - (var(--gap)) - 10px) / 2) var(--gap); padding: calc((var(--footer-height) - (var(--gap)) - 10px) / 2) var(--gap);
color: var(--secondary);
font-size: 12px;
text-align: center; text-align: center;
line-height: 24px; line-height: 24px
} }
.footer span { .footer span {
margin-left: 1px; margin-inline-start: 1px;
margin-right: 1px; margin-inline-end: 1px
} }
.footer a { .footer a {
color: inherit; color: inherit;
border-bottom: 1px solid var(--secondary); border-bottom: 1px solid var(--secondary)
} }
.footer a:hover { .footer a:hover {
color: var(--primary); border-bottom: 1px solid var(--primary)
border-bottom: 1px solid var(--primary);
} }
.top-link { .top-link {
font-size: 12px;
visibility: hidden; visibility: hidden;
opacity: 0;
position: fixed; position: fixed;
bottom: 60px; bottom: 60px;
right: 30px; right: 30px;
@@ -37,14 +36,20 @@
width: 42px; width: 42px;
height: 42px; height: 42px;
padding: 12px; padding: 12px;
color: var(--secondary);
border-radius: 64px; border-radius: 64px;
fill: currentColor; transition: visibility .5s, opacity .8s linear
fill-opacity: 80%;
transition: visibility 0.5s,
opacity 0.8s linear;
} }
.top-link:hover { .top-link,
color: var(--primary); .top-link svg {
filter: drop-shadow(0px 0px 0px var(--theme));
}
.footer a:hover,
.top-link:hover {
color: var(--primary)
}
.top-link:focus {
outline: 0
} }

View File

@@ -1,17 +1,15 @@
/* Header
-------------------------------------------------- */
.nav { .nav {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
max-width: calc(var(--nav-width) + var(--gap) * 2); max-width: calc(var(--nav-width) + var(--gap) * 2);
margin-left: auto; margin-inline-start: auto;
margin-right: auto; margin-inline-end: auto;
line-height: var(--header-height)
} }
.nav a { .nav a {
display: block; display: block
line-height: var(--header-height);
} }
.logo, .logo,
@@ -20,41 +18,72 @@
margin: auto var(--gap); margin: auto var(--gap);
} }
.logo {
flex-wrap: inherit
}
.logo a { .logo a {
font-size: 24px; font-size: 24px;
font-weight: 700; font-weight: 700;
margin-inline-end: 10px
} }
.theme-toggle svg{ .logo a img {
height: 18px; display: inline;
margin: 0 10px;
}
body.dark #moon{
vertical-align: middle; vertical-align: middle;
display: none; pointer-events: none;
transform: translate(0, -10%);
border-radius: 6px;
margin-inline-end: 8px
}
.theme-toggle svg {
height: 18px;
user-select: none;
cursor: pointer
}
body.dark #moon {
vertical-align: middle;
display: none
} }
body:not(.dark) #sun { body:not(.dark) #sun {
display: none; display: none
} }
.menu { .menu {
list-style: none; list-style: none;
word-break: keep-all; word-break: keep-all;
overflow-x: auto; overflow-x: auto;
white-space: nowrap; white-space: nowrap
} }
.menu li+li { .menu li+li {
margin-left: var(--gap); margin-inline-start: var(--gap)
} }
.menu a { .menu a {
font-size: 16px; font-size: 16px
} }
.menu .active { .menu .active {
font-weight: 500; font-weight: 500;
border-bottom: 2px solid currentColor; border-bottom: 2px solid currentColor
}
.lang-switch li,
.lang-switch ul,
.logo-switches {
display: inline-flex
}
.lang-switch a {
font-size: 16px;
font-weight: 500;
margin: 0 8px
}
.logo-switches {
flex-wrap: inherit
} }

View File

@@ -1,29 +1,21 @@
/* Main
-------------------------------------------------- */
.main { .main {
position: relative; position: relative;
min-height: calc(100vh - var(--header-height) - var(--footer-height)); min-height: calc(100vh - var(--header-height) - var(--footer-height));
max-width: calc(var(--main-width) + var(--gap) * 2); max-width: calc(var(--main-width) + var(--gap) * 2);
margin: auto; margin: auto;
padding: var(--gap); padding: var(--gap)
}
@media screen and (max-width: 400px) {
.main {
min-height: calc(100vh - var(--header-height) - var(--footer-height) - 24px);
}
} }
.page-header { .page-header {
margin-bottom: 24px; margin-bottom: 24px
} }
.page-header h1 { .page-header h1 {
font-size: 40px; font-size: 40px
} }
.pagination { .pagination {
display: flex; display: flex
} }
.pagination a { .pagination a {
@@ -32,22 +24,26 @@
line-height: 36px; line-height: 36px;
background: var(--primary); background: var(--primary);
border-radius: calc(36px / 2); border-radius: calc(36px / 2);
padding: 0 16px; padding: 0 16px
} }
.pagination .next { .pagination .next {
margin-left: auto; margin-inline-start: auto
} }
.social-icons { .social-icons {
padding: 12px 0; padding: 12px 0
} }
.social-icons a:not(:last-of-type) { .social-icons a:not(:last-of-type) {
margin-right: 12px; margin-inline-end: 12px
} }
.social-icons a svg { .social-icons a svg {
height: 26px; height: 26px;
width: 26px; width: 26px
}
code {
direction: ltr
} }

View File

@@ -1,39 +1,36 @@
/* Post entry
-------------------------------------------------- */
.first-entry { .first-entry {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
min-height: 320px; min-height: 320px;
margin: var(--gap) 0 calc(var(--gap) * 2) 0; margin: var(--gap) 0 calc(var(--gap) * 2) 0
}
@media screen and (max-width: 600px) {
.first-entry {
min-height: 260px;
}
} }
.first-entry .entry-header { .first-entry .entry-header {
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 3; -webkit-line-clamp: 3
} }
.first-entry .entry-header h2 { .first-entry .entry-header h2 {
font-size: 34px; font-size: 34px;
line-height: 1.3
} }
.first-entry .entry-content { .first-entry .entry-content {
margin: 14px 0; margin: 14px 0;
font-size: 16px; font-size: 16px;
-webkit-line-clamp: 3; -webkit-line-clamp: 3
} }
.first-entry .entry-footer { .first-entry .entry-footer {
font-size: 14px; font-size: 14px
}
.home-info .entry-content {
-webkit-line-clamp: unset
} }
.post-entry { .post-entry {
@@ -42,20 +39,20 @@
padding: var(--gap); padding: var(--gap);
background: var(--entry); background: var(--entry);
border-radius: var(--radius); border-radius: var(--radius);
transition: transform 0.1s; transition: transform .1s;
border: 1px solid var(--border);
} }
.post-entry:active { .post-entry:active {
transform: scale(0.96); transform: scale(.96)
} }
.tag-entry .entry-content, .tag-entry .entry-cover {
.tag-entry .entry-footer { display: none
display: none;
} }
.entry-header h2 { .entry-header h2 {
font-size: 24px; font-size: 24px
} }
.entry-content { .entry-content {
@@ -66,12 +63,12 @@
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2
} }
.entry-footer { .entry-footer {
color: var(--secondary); color: var(--secondary);
font-size: 13px; font-size: 13px
} }
.entry-link { .entry-link {
@@ -79,29 +76,31 @@
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0
}
.entry-cover,
.entry-isdraft {
font-size: 14px;
color: var(--secondary)
} }
.entry-isdraft { .entry-isdraft {
display: inline; display: inline
color: var(--secondary);
font-size: 14px;
} }
.entry-cover { .entry-cover {
margin-bottom: var(--gap); margin-bottom: var(--gap);
text-align: center; text-align: center
font-size: 14px;
color: var(--secondary);
} }
.entry-cover img { .entry-cover img {
border-radius: var(--radius); border-radius: var(--radius);
pointer-events: none; pointer-events: none;
width: 100%; width: 100%
} }
.entry-cover a { .entry-cover a {
color: var(--secondary); color: var(--secondary);
box-shadow: 0 1px 0 var(--primary); box-shadow: 0 1px 0 var(--primary)
} }

View File

@@ -1,5 +1,3 @@
/* Post single
-------------------------------------------------- */
.post-header { .post-header {
margin: 24px auto var(--content-gap) auto margin: 24px auto var(--content-gap) auto
} }
@@ -7,312 +5,352 @@
.post-title { .post-title {
margin-bottom: 2px; margin-bottom: 2px;
font-size: 40px; font-size: 40px;
transform: translateX(-2px); transform: translateX(-2px)
}
.post-description {
margin-top: 10px;
margin-bottom: 5px;
} }
.post-meta { .post-meta {
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap
} }
.post-meta .i18n_list li { .post-meta .i18n_list li {
display: inline-flex; display: inline-flex;
list-style: none; list-style: none;
margin: auto 3px; margin: auto 3px;
box-shadow: 0 1px 0 var(--secondary); box-shadow: 0 1px 0 var(--secondary)
} }
.post-content { .post-content {
color: var(--content); color: var(--content)
} }
.post-content h3, .post-content h3,
.post-content h4, .post-content h4,
.post-content h5, .post-content h5,
.post-content h6 { .post-content h6 {
margin: 24px 0 16px 0; margin: 24px 0 16px
} }
.post-content h1 { .post-content h1 {
margin: 40px auto 32px auto; margin: 40px auto 32px;
font-size: 40px; font-size: 40px
} }
.post-content h2 { .post-content h2 {
margin: 32px auto 24px auto; margin: 32px auto 24px;
font-size: 32px; font-size: 32px
} }
.post-content h3 { .post-content h3 {
font-size: 24px; font-size: 24px
} }
.post-content h4 { .post-content h4 {
font-size: 16px; font-size: 16px
} }
.post-content h5 { .post-content h5 {
font-size: 14px; font-size: 14px
} }
.post-content h6 { .post-content h6 {
font-size: 12px; font-size: 12px
} }
.post-content a { .post-content a,
box-shadow: 0 1px 0 var(--primary); .toc a:hover {
box-shadow: 0 1px 0
} }
.post-content a code { .post-content a code {
margin: auto 0; margin: auto 0;
border-radius: 0; border-radius: 0;
box-shadow: 0 -1px 0 var(--primary) inset; box-shadow: 0 -1px 0 var(--primary) inset
} }
.post-content del { .post-content del {
text-decoration: none; text-decoration: none;
background: linear-gradient(to right, var(--primary) 100%, transparent 0) 0 50% / 1px 1px repeat-x; background: linear-gradient(to right, var(--primary) 100%, transparent 0) 0 50%/1px 1px repeat-x
} }
.post-content p, .post-content dl,
.post-content ul,
.post-content ol, .post-content ol,
.post-content dl { .post-content p,
margin-bottom: var(--content-gap); .post-content ul {
margin-bottom: var(--content-gap)
} }
.post-content ul, .post-content ol,
.post-content ol { .post-content ul {
padding-left: 20px; padding-inline-start: 20px
} }
.post-content li { .post-content li {
margin-top: 5px; margin-top: 5px
} }
.post-content li p { .post-content li p {
margin-bottom: 0; margin-bottom: 0
} }
.post-content dl { .post-content dl {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin: 0; margin: 0
} }
.post-content dt { .post-content dt {
width: 25%; width: 25%;
font-weight: 700; font-weight: 700
} }
.post-content dd { .post-content dd {
width: 75%; width: 75%;
margin-left: 0; margin-inline-start: 0;
padding-left: 10px; padding-inline-start: 10px
} }
.post-content dt~dt, .post-content dd~dd,
.post-content dd~dd { .post-content dt~dt {
margin-top: 10px; margin-top: 10px
} }
.post-content table { .post-content table {
margin-bottom: 32px; margin-bottom: 32px
} }
.post-content table th, .post-content table th,
.post-content table:not(.highlighttable) td { .post-content:not(.gist) > table:not(.highlighttable) td {
min-width: 80px; min-width: 80px;
padding: 12px 8px; padding: 12px 8px;
line-height: 1.5; line-height: 1.5;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border)
} }
.post-content table th { .post-content table th {
font-size: 14px; font-size: 14px;
text-align: left; text-align: start
} }
.post-content table:not(.highlighttable) td code:only-child { .post-content table:not(.highlighttable) td code:only-child {
margin: auto 0; margin: auto 0
} }
.post-content .highlight, .post-content:not(.gist) > .highlight,
.post-content pre { .post-content pre {
margin: auto calc(var(--gap) * -1) 32px calc(var(--gap) * -1); margin: auto 0 20px;
background: var(--hljs-bg) !important; background: var(--hljs-bg) !important;
border-radius: var(--radius); border-radius: var(--radius)
} }
.post-content li>.highlight { .post-content li>.highlight {
margin-right: 0 margin-inline-end: 0
} }
.post-content ul pre { .post-content ul pre {
margin-left: calc(var(--gap) * -2); margin-inline-start: calc(var(--gap) * -2)
} }
.post-content .highlight pre { .post-content .highlight pre {
margin: 0; margin: 0
}
.post-content .highlight {
margin: 10px auto
} }
/* table */
.post-content .highlighttable { .post-content .highlighttable {
table-layout: fixed; table-layout: fixed
} }
.post-content .highlighttable td:first-child { .post-content .highlighttable td:first-child {
width: 40px; width: 40px
} }
.post-content .highlighttable td .linenodiv { .post-content .highlighttable td .linenodiv {
padding-right: 0 !important; padding-inline-end: 0 !important
} }
.post-content .highlighttable td .linenodiv pre, .post-content .highlighttable td .highlight,
.post-content .highlighttable td .highlight { .post-content .highlighttable td .linenodiv pre {
margin-bottom: 0; margin-bottom: 0
} }
.post-content .highlighttable td .highlight pre code::-webkit-scrollbar { .post-content .highlighttable td .highlight pre code::-webkit-scrollbar {
display: none; display: none
} }
/* inline */
.post-content .highlight span { .post-content .highlight span {
background: transparent !important; background: 0 0 !important
} }
.post-content code { .post-content code {
margin: auto 4px; margin: auto 4px;
padding: 4px 6px; padding: 4px 6px;
font-family: Menlo, Monaco, 'Courier New', Courier, monospace; font-family: Menlo, Monaco, 'Courier New', Courier, monospace;
font-size: 0.78em; font-size: .78em;
line-height: 1.5; line-height: 1.5;
background: var(--code-bg); background: var(--code-bg);
border-radius: 2px; border-radius: 2px
} }
.post-content pre code { .post-content pre code {
display: block; display: block;
margin: auto 0; margin: auto 0;
padding: 10px; padding: 10px;
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, .8);
background: transparent; background: 0 0;
border-radius: 0; border-radius: 0;
overflow-x: auto; overflow-x: auto
} }
.post-content blockquote { .post-content blockquote {
margin: 0 calc(var(--gap) * -1); margin: 0 0;
padding: 0 32px; padding: 0 14px;
border-left: 2px solid var(--primary); border-inline-start: 3px solid var(--primary)
} }
.post-content hr { .post-content hr {
margin: 30px calc(var(--gap) * -1); margin: 30px 0;
height: 2px; height: 2px;
background: var(--tertiary); background: var(--tertiary);
border-top: 0; border-top: 0;
border-bottom: 0; border-bottom: 0
} }
.post-content iframe { .post-content iframe {
max-width: 100%; max-width: 100%
} }
.post-content img { .post-content img {
border-radius: 4px; border-radius: 4px
}
.post-content img[src*='#center'] {
margin: auto
}
.post-content figure > figcaption {
color: var(--primary);
font-size: 16px;
font-weight: bold;
margin: 24px 0 16px;
} }
.toc { .toc {
margin-bottom: 40px; margin-bottom: 40px;
border: 1px solid var(--border); border: 1px solid var(--border);
border-radius: var(--radius); border-radius: var(--radius);
padding: .5em; padding: .5em
} }
.toc details summary { .toc details summary {
cursor: zoom-in; cursor: zoom-in;
margin-left: 20px; margin-inline-start: 20px
} }
.toc details[open] summary { .toc details[open] summary {
cursor: zoom-out; cursor: zoom-out
} }
.toc .details { .toc .details {
display: inline; display: inline;
font-weight: 500; font-weight: 500
} }
.toc blockquote { .toc blockquote {
margin: 0 20px; margin: 0 20px;
padding: 10px 20px; padding: 10px 20px
} }
.toc li ul { .toc li ul {
margin-left: var(--gap); margin-inline-start: var(--gap)
}
.toc summary:focus {
outline: 0
} }
.post-footer { .post-footer {
margin-top: 56px; margin-top: 56px
} }
.post-tags li { .post-tags li {
display: inline-block; display: inline-block;
margin-right: 3px; margin-inline-end: 3px;
margin-bottom: 5px; margin-bottom: 5px
}
.post-tags a,
.share-buttons {
border: 1px solid var(--tertiary)
} }
.post-tags a { .post-tags a {
display: block; display: block;
padding-left: 14px; padding-inline-start: 14px;
padding-right: 14px; padding-inline-end: 14px;
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px;
line-height: 34px; line-height: 34px;
background: var(--code-bg); background: var(--code-bg);
border-radius: 4px; border-radius: 4px
} }
.post-tags a:hover { .post-tags a:hover {
background: var(--border); background: var(--border)
} }
.share-buttons { .share-buttons {
margin-top: var(--gap); margin-top: var(--gap);
border: 1px solid var(--tertiary); padding-inline-start: var(--radius);
padding: var(--radius);
border-radius: var(--radius); border-radius: var(--radius);
display: flex; display: flex;
overflow-x: auto; overflow-x: auto
} }
.share-buttons a { .share-buttons a {
margin-top: 10px; margin-top: 10px
} }
.share-buttons a:not(:last-of-type) { .share-buttons a:not(:last-of-type) {
margin-right: 12px; margin-inline-end: 12px
} }
.share-buttons a svg { .share-buttons a svg {
height: 30px; height: 30px;
width: 30px; width: 30px;
fill: currentColor; fill: currentColor;
transition: transform 0.1s; transition: transform .1s
} }
.share-buttons svg:hover { .share-buttons svg:active {
transform: scale(0.96); transform: scale(.96)
} }
@media screen and (max-width: 600px) { h1:hover .anchor,
.post-content blockquote { h2:hover .anchor,
margin: 0 calc(var(--gap) * -1); h3:hover .anchor,
padding: 0 21px; h4:hover .anchor,
} h5:hover .anchor,
h6:hover .anchor {
display: inline-flex;
color: var(--secondary);
margin-inline-start: 8px;
font-weight: 500
}
.post-content ::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.32)
}
.post-content ::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.64)
} }

View File

@@ -1,48 +1,32 @@
.main { .buttons,
text-align: center; .main .profile {
display: table; display: flex;
justify-content: center
} }
.main>.profile { .main .profile {
display: table-cell; position: absolute;
vertical-align: middle; left: 0;
right: 0;
align-items: center;
height: 80%;
text-align: center
} }
.main>.profile>.profile_inner { .profile .profile_inner h1 {
transform: translate(0, -10%); padding: 12px 0
} }
.profile_inner h1 { .profile img {
padding: 12px 0;
}
.profile_inner span {
padding: 10px 0;
font-size: 18px;
}
img {
display: inline-table; display: inline-table;
width: 180px;
border-radius: 50%; border-radius: 50%;
pointer-events: none; pointer-events: none
}
@media screen and (max-width: 600px) {
img {
width: 150px;
}
.main>.profile>.profile_inner {
transform: translate(0, 0);
}
} }
.buttons { .buttons {
display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center;
max-width: 400px; max-width: 400px;
margin: 0 auto; margin: 0 auto
} }
.button { .button {
@@ -50,13 +34,13 @@ img {
border-radius: var(--radius); border-radius: var(--radius);
margin: 8px; margin: 8px;
padding: 6px; padding: 6px;
transition: transform 0.1s; transition: transform .1s
} }
.button-inner { .button-inner {
padding: 0 8px; padding: 0 8px
} }
.button:active { .button:active {
transform: scale(0.96); transform: scale(.96)
} }

View File

@@ -1,24 +1,30 @@
/* Reset
-------------------------------------------------- */
*, *,
*::before, ::after,
*::after { ::before {
box-sizing: border-box; box-sizing: border-box
} }
html { html {
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent
}
a,
body,
h1,
h2,
h3,
h4,
h5,
h6 {
color: var(--primary)
} }
body { body {
margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: var(--primary);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 18px; font-size: 18px;
line-height: 1.6; line-height: 1.6;
word-break: break-word; word-break: break-word;
background: var(--theme); background: var(--theme)
} }
article, article,
@@ -30,8 +36,9 @@ header,
hgroup, hgroup,
main, main,
nav, nav,
section { section,
display: block; table {
display: block
} }
h1, h1,
@@ -40,43 +47,40 @@ h3,
h4, h4,
h5, h5,
h6 { h6 {
margin-top: 0; line-height: 1.2
margin-bottom: 0;
color: var(--primary);
line-height: 1.2;
} }
h1,
h2,
h3,
h4,
h5,
h6,
p { p {
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0
}
strong,
b {
font-weight: 500;
} }
ul { ul {
margin: 0; padding: 0
padding: 0;
} }
a { a {
color: var(--primary); text-decoration: none
text-decoration: none;
} }
figure { body,
margin: 0; figure,
ul {
margin: 0
} }
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
display: block; overflow-x: auto;
overflow-x: scroll; word-break: keep-all
word-break: keep-all;
} }
button, button,
@@ -84,59 +88,44 @@ input,
textarea { textarea {
padding: 0; padding: 0;
font: inherit; font: inherit;
background: transparent; background: 0 0;
border: 0; border: 0;
-webkit-appearance: none;
}
button,
input[type='button'],
input[type='submit'] {
cursor: pointer;
} }
input, input,
textarea { textarea {
padding: 0; outline: 0
border: 0; }
outline: 0;
button,
input[type=button],
input[type=submit] {
cursor: pointer
} }
input:-webkit-autofill, input:-webkit-autofill,
textarea:-webkit-autofill { textarea:-webkit-autofill {
box-shadow: 0 0 0 50px var(--theme) inset; box-shadow: 0 0 0 50px var(--theme) inset
} }
img { img {
display: block; display: block;
max-width: 100%; max-width: 100%
} }
*::-webkit-scrollbar { ::-webkit-scrollbar-track {
width: 10px; background: 0 0
height: 6px;
} }
*::-webkit-scrollbar-track { .list:not(.dark)::-webkit-scrollbar-track {
background: var(--theme); background: var(--code-bg)
} }
*::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: var(--tertiary); background: var(--tertiary);
border-radius: var(--radius); border-radius: var(--radius)
} }
*::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: var(--secondary); background: var(--secondary)
}
@media screen and (max-width: 800px) {
*::-webkit-scrollbar {
width: 8px;
height: 2px;
}
}
*:focus {
outline:none;
} }

45
assets/css/search.css Normal file
View File

@@ -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 .1s;
transform: scale(.98);
}
#searchResults a {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
outline: none;
}
#searchResults .active {
transform: scale(.98);
border: 2px solid var(--tertiary)
}

View File

@@ -1,7 +1,7 @@
.terms-tags li { .terms-tags li {
display: inline-block; display: inline-block;
margin: 10px; margin: 10px;
font-weight: 500; font-weight: 500
} }
.terms-tags a { .terms-tags a {
@@ -9,10 +9,10 @@
padding: 3px 10px; padding: 3px 10px;
background: var(--tertiary); background: var(--tertiary);
border-radius: 6px; border-radius: 6px;
transition: transform 0.1s; transition: transform .1s
} }
.terms-tags a:hover { .terms-tags a:active {
background: var(--tertiary); background: var(--tertiary);
transform: scale(0.96); transform: scale(.96)
} }

View File

@@ -1,5 +1,3 @@
/* Theme
-------------------------------------------------- */
:root { :root {
--gap: 24px; --gap: 24px;
--content-gap: 20px; --content-gap: 20px;
@@ -8,36 +6,27 @@
--header-height: 60px; --header-height: 60px;
--footer-height: 60px; --footer-height: 60px;
--radius: 8px; --radius: 8px;
--theme: #fff; --theme: #fff;
--entry: #fff; --entry: #fff;
--primary: rgba(0, 0, 0, 0.88); --primary: rgba(0, 0, 0, 0.88);
--secondary: rgba(0, 0, 0, 0.56); --secondary: rgba(0, 0, 0, 0.56);
--tertiary: rgba(0, 0, 0, 0.16); --tertiary: rgba(0, 0, 0, 0.16);
--content: rgba(0, 0, 0, 0.88); --content: rgba(0, 0, 0, 0.88);
--hljs-bg: #1c1d21; --hljs-bg: #1c1d21;
--code-bg: #f5f5f5; --code-bg: #f5f5f5;
--border: #eee; --border: #eee;
} }
@media screen and (max-width: 600px) {
:root {
--gap: 14px;
}
}
.dark { .dark {
--theme: #1d1e20; --theme: #1d1e20;
--entry: #2e2e33; --entry: #2e2e33;
--primary: rgba(255, 255, 255, 0.84); --primary: rgba(255, 255, 255, 0.84);
--secondary: rgba(255, 255, 255, 0.56); --secondary: rgba(255, 255, 255, 0.56);
--tertiary: rgba(255, 255, 255, 0.16); --tertiary: rgba(255, 255, 255, 0.16);
--content: rgba(255, 255, 255, 0.64); --content: rgba(255, 255, 255, 0.74);
--hljs-bg: #2e2e33; --hljs-bg: #2e2e33;
--code-bg: #37383e; --code-bg: #37383e;
--border: #5b5d67; --border: #333;
} }
.list { .list {

72
assets/css/zmedia.css Normal file
View File

@@ -0,0 +1,72 @@
@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;
}
}
@media screen and (min-width: 768px) {
/* reset */
::-webkit-scrollbar {
width: 10px;
height: 6px;
}
}
/* footer */
@media screen and (max-width: 900px) {
.list .top-link {
transform: translateY(-5rem);
}
}
@media (prefers-reduced-motion) {
/* terms */
.terms-tags a:active {
transform: none;
}
/* profile-mode */
.button:active {
transform: none;
}
/* post-single */
.share-buttons svg:active {
transform: none;
}
/* post-entry */
.post-entry:active {
transform: none;
}
/* footer */
.top-link {
transition: none;
}
/* search */
#searchResults .active {
transform: none;
}
}

124
assets/js/fastsearch.js Normal file
View File

@@ -0,0 +1,124 @@
var fuse; // holds our search engine
var resList = document.getElementById('searchResults');
var sInput = document.getElementById('searchInput');
var first, last = null
var resultsAvailable = false;
// load our search index, only executed onload
function loadSearch() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText);
if (data) {
// fuse.js options; check fuse.js website for details
var options = {
isCaseSensitive: false,
shouldSort: true,
location: 0,
distance: 100,
threshold: 0.4,
minMatchCharLength: 0,
keys: [
'title',
'permalink',
'summary',
'content'
]
};
{{ if . }}options = {{ jsonify . }}{{ end }} // load custom options from .Site.Params.fuseOpts
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 itemGen(name, link) {
return `<li class="post-entry"><header class="entry-header">${name}&nbsp;»</header><a href="${link}" aria-label="${name}"></a></li>`
}
function activeToggle() {
document.activeElement.parentElement.classList.toggle("active")
}
// 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
const results = fuse.search(this.value); // 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 = resultSet + itemGen(results[item].item.title, results[item].item.permalink)
}
document.getElementById("searchResults").innerHTML = resultSet;
resultsAvailable = true;
first = resList.firstChild;
last = resList.lastChild;
} else {
resultsAvailable = false;
document.getElementById("searchResults").innerHTML = '';
}
}
// kb bindings
document.onkeydown = function (e) {
let key = e.key;
let ae = document.activeElement;
let inbox = document.getElementById("searchbox").contains(ae)
if (ae === sInput) {
var elements = document.getElementsByClassName('active');
while (elements.length > 0) {
elements[0].classList.remove('active');
}
}
if (key === "ArrowDown" && resultsAvailable && inbox) {
e.preventDefault();
if (ae == sInput) {
// if the currently focused element is the search input, focus the <a> of first <li>
activeToggle(); // rm active class
resList.firstChild.lastChild.focus();
activeToggle(); // add active class
} else if (ae.parentElement == last) {
// if the currently focused element's parent is last, do nothing
} else {
// otherwise select the next search result
activeToggle(); // rm active class
ae.parentElement.nextSibling.lastChild.focus();
activeToggle(); // add active class
}
} else if (key === "ArrowUp" && resultsAvailable && inbox) {
e.preventDefault();
if (ae == sInput) {
// if the currently focused element is input box, do nothing
} else if (ae.parentElement == first) {
// if the currently focused element is first item, go to input box
activeToggle(); // rm active class
sInput.focus();
} else {
// otherwise select the previous search result
activeToggle(); // rm active class
ae.parentElement.previousSibling.lastChild.focus();
activeToggle(); // add active class
}
} else if (key === "ArrowRight" && resultsAvailable && inbox) {
ae.click(); // click on active link
} else if (key === "Escape") {
resultsAvailable = false;
resList.innerHTML = sInput.value = ''; // clear inputbox and searchResults
sInput.focus(); // shift focus to input box
}
}

2255
assets/js/fuse.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module github.com/adityatelange/hugo-PaperMod
go 1.12

16
i18n/bg.yaml Normal file
View File

@@ -0,0 +1,16 @@
- id: prev_page
translation: "Предишна страница"
- id: next_page
translation: "Следваща страница"
- id: read_time
translation:
one : "1 мин"
other: "{{ .Count }} мин"
- id: toc
translation: "Съдържание"
- id: translations
translation: "Преводи"

View File

@@ -3,3 +3,14 @@
- id: next_page - id: next_page
translation: "Nächste Seite" translation: "Nächste Seite"
- id: read_time
translation:
one: "1 min"
other: "{{ .Count }} min"
- id: toc
translation: "Inhaltsverzeichnis"
- id: translations
translation: "Übersetzungen"

View File

@@ -3,3 +3,14 @@
- id: next_page - id: next_page
translation: "Página siguiente" translation: "Página siguiente"
- id: read_time
translation:
one : "1 min"
other: "{{ .Count }} min"
- id: toc
translation: "Tabla de Contenidos"
- id: translations
translation: "Traducciones"

16
i18n/fa.yaml Normal file
View File

@@ -0,0 +1,16 @@
- id: prev_page
translation: "صفحهٔ قبل"
- id: next_page
translation: "صفحهٔ بعد"
- id: read_time
translation:
one : "1 دقیقه"
other: "{{ .Count }} دقیقه"
- id: toc
translation: "فهرست مطالب"
- id: translations
translation: "ترجمه‌ها"

16
i18n/id.yaml Normal file
View File

@@ -0,0 +1,16 @@
- id: prev_page
translation: "Halaman Sebelumnya"
- id: next_page
translation: "Halaman Selanjutnya"
- id: read_time
translation:
one : "1 menit"
other: "{{ .Count }} menit"
- id: toc
translation: "Daftar Isi"
- id: translations
translation: "Terjemahan"

16
i18n/it.yaml Normal file
View File

@@ -0,0 +1,16 @@
- id: prev_page
translation: "Pag Prec"
- id: next_page
translation: "Pag Succ"
- id: read_time
translation:
one: "1 minuto"
other: "{{ .Count }} minuti"
- id: toc
translation: "Tabella dei Contenuti"
- id: translations
translation: "Traduzioni"

View File

@@ -1,5 +1,14 @@
- id: prev_page - id: prev_page
translation: "Сюда" translation: 'Предыдущая'
- id: next_page - id: next_page
translation: "Туда" translation: 'Следующая'
- id: read_time
translation: '{{ .Count }} мин'
- id: toc
translation: 'Оглавление'
- id: translations
translation: 'Переводы'

View File

@@ -13,7 +13,7 @@
</h2> </h2>
{{- range .Pages.GroupByDate "January" }} {{- range .Pages.GroupByDate "January" }}
<div class="archive-month"> <div class="archive-month">
<h3 class="archive-month-header">{{- .Key }}<sup class="archive-count">&nbsp;&nbsp;{{ len .Pages }}</h3> <h3 class="archive-month-header">{{- .Key }}<sup class="archive-count">&nbsp;&nbsp;{{ len .Pages }}</sup></h3>
<div class="archive-posts"> <div class="archive-posts">
{{- range .Pages }} {{- range .Pages }}
{{- if eq .Kind "page" }} {{- if eq .Kind "page" }}
@@ -22,11 +22,7 @@
{{- .Title | markdownify }} {{- .Title | markdownify }}
</h3> </h3>
<div class="archive-meta"> <div class="archive-meta">
<time>{{ .Date.Format "January 2, 2006" }}</time> {{- partial "post_meta.html" . -}}
{{- if $.Site.Params.ShowReadingTime }}&nbsp;·&nbsp;
{{- $default_txt := print .ReadingTime " " "min" }}
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{- if or .Params.author .Site.Params.author }}&nbsp;·&nbsp;{{- .Params.author | default .Site.Params.author }}{{ end }}
</div> </div>
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
</div> </div>

View File

@@ -1,18 +1,24 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ .Site.Language }}"> <html lang="{{ .Site.Language }}" dir="{{ .Language.LanguageDirection | default "auto" }}">
<head> <head>
{{- partial "head.html" . }} {{- partial "head.html" . }}
</head> </head>
<body class="{{ if (and (eq .Kind `page` ) (ne .Layout `archives`)) }}single{{ else }}list <body class="
{{- if .IsHome }} home{{ end }}{{ end }}{{- if eq $.Site.Params.defaultTheme `dark` }} dark{{ end }}" id="top"> {{- if (or (ne .Kind `page` ) (eq .Layout `archives`) (eq .Layout `search`)) -}}
{{- print "list" -}}
{{- end -}}
{{- if eq $.Site.Params.defaultTheme `dark` -}}
{{- print " dark" }}
{{- end -}}
" id="top">
{{- partialCached "header.html" . .Page}} {{- partialCached "header.html" . .Page}}
<main class="main"> <main class="main">
{{- block "main" . }} {{- block "main" . }}
{{- end }} {{- end }}
</main> </main>
{{- partialCached "footer.html" . .Type }} {{- partialCached "footer.html" . .Type .Layout .Params }}
</body> </body>
</html> </html>

View File

@@ -0,0 +1,6 @@
{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

View File

@@ -10,14 +10,14 @@
</header> </header>
{{- end }} {{- end }}
{{- $pages := .RegularPages }} {{- $pages := union .RegularPages .Sections }}
{{- if .IsHome }} {{- if .IsHome }}
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- end}} {{- end}}
{{ $paginator := .Paginate $pages }} {{ $paginator := .Paginate $pages }}
{{ $term := .Data.Term}}
{{- range $index, $page := $paginator.Pages }} {{- range $index, $page := $paginator.Pages }}
{{- $class := "post-entry" }} {{- $class := "post-entry" }}
@@ -27,19 +27,12 @@
{{- else}} {{- else}}
{{- $class = "first-entry" }} {{- $class = "first-entry" }}
{{- end }} {{- end }}
{{- else if .Data.Term }} {{- else if $term }}
{{- $class = "post-entry tag-entry" }} {{- $class = "post-entry tag-entry" }}
{{- end }} {{- end }}
<article class="{{ $class }}"> <article class="{{ $class }}">
{{- if .Params.cover.image }} {{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList)}}
<figure class="entry-cover"> {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
{{- if (or (fileExists (path.Join "static" .Params.cover.image)) (hasPrefix .Params.cover.image "http://") (hasPrefix .Params.cover.image "https://")) }}
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
{{- else}}
<img src="{{ .Permalink -}} {{- .Params.cover.image }}" alt="{{ .Params.cover.alt | plainify }}">
{{- end}}
</figure>
{{- end }}
<header class="entry-header"> <header class="entry-header">
<h2> <h2>
{{ .Title }} {{ .Title }}
@@ -52,11 +45,7 @@
</section> </section>
{{- end }} {{- end }}
<footer class="entry-footer"> <footer class="entry-footer">
<time>{{ .Date.Format "January 2, 2006" }}</time> {{- partial "post_meta.html" . -}}
{{- if $.Site.Params.ShowReadingTime }}&nbsp;·&nbsp;
{{- $default_txt := print .ReadingTime " " "min" }}
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{- if or .Params.author .Site.Params.author }}&nbsp;·&nbsp;{{- .Params.author | default .Site.Params.author }}{{ end }}
</footer> </footer>
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
</article> </article>
@@ -66,10 +55,10 @@
<footer class="page-footer"> <footer class="page-footer">
<nav class="pagination"> <nav class="pagination">
{{- if $paginator.HasPrev }} {{- if $paginator.HasPrev }}
<a class="prev" href="{{ $paginator.Prev.URL }}">« {{ i18n "prev_page" }}</a> <a class="prev" href="{{ $paginator.Prev.URL | absURL }}">« {{ i18n "prev_page" }}</a>
{{- end }} {{- end }}
{{- if $paginator.HasNext }} {{- if $paginator.HasNext }}
<a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} »</a> <a class="next" href="{{ $paginator.Next.URL | absURL }}">{{ i18n "next_page" }} »</a>
{{- end }} {{- end }}
</nav> </nav>
</footer> </footer>

View File

@@ -0,0 +1,38 @@
{{- define "main" }}
<header class="page-header">
<h1>{{ .Title }}
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</h1>
{{- if not (.Param "hideMeta") }}
<div class="post-meta">
{{- if .IsTranslated -}}
<ul class="i18n_list">
{{- i18n "translations" | default "Translations"}}:
{{- range .Translations }}
<li>
<a href="{{ .Permalink }}">
{{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }}
{{- .Language.LanguageName | emojify | humanize -}}
{{- else }}
{{- .Lang | humanize -}}
{{- end -}}
</a>
</li>
{{- end }}
</ul>
{{- end }}
</div>
{{- end}}
</header>
<div id="searchbox">
<input id="searchInput" autofocus placeholder="{{.Title}} ↵" aria-label="search">
<ul id="searchResults" aria-label="search results"></ul>
</div>
{{- end }}{{/* end main */}}

View File

@@ -6,19 +6,24 @@
{{ .Title }} {{ .Title }}
{{- if .Draft }}<div class="entry-isdraft"><sup>&nbsp;&nbsp;[draft]</sup></div>{{- end }} {{- if .Draft }}<div class="entry-isdraft"><sup>&nbsp;&nbsp;[draft]</sup></div>{{- end }}
</h1> </h1>
{{- if .Params.hideMeta }}{{ else }} <div class="post-description">
{{ .Description }}
</div>
{{- if not (.Param "hideMeta") }}
<div class="post-meta"> <div class="post-meta">
<time>{{ .Date.Format "January 2, 2006" }}</time> {{- partial "post_meta.html" . -}}
{{- if $.Site.Params.ShowReadingTime -}}&nbsp;·&nbsp;
{{- $default_txt := print .ReadingTime " " "min" }}
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{- if or .Params.author .Site.Params.author }}&nbsp;·&nbsp;{{- .Params.author | default .Site.Params.author }}{{ end }}
{{- if .IsTranslated -}}&nbsp;|&nbsp; {{- if .IsTranslated -}}&nbsp;|&nbsp;
<ul class="i18n_list"> <ul class="i18n_list">
{{- i18n "translations" | default "Translations"}}: {{- i18n "translations" | default "Translations"}}:
{{- range .Translations }} {{- range .Translations }}
<li> <li>
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> <a href="{{ .Permalink }}">
{{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }}
{{- .Language.LanguageName | emojify | humanize -}}
{{- else }}
{{- .Lang | humanize -}}
{{- end -}}
</a>
</li> </li>
{{- end }} {{- end }}
</ul> </ul>
@@ -26,20 +31,12 @@
</div> </div>
{{- end}} {{- end}}
</header> </header>
{{- if .Params.cover.image }} {{- $isHidden := ((.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInSingle) | default .Params.cover.hidden )}}
<figure class="entry-cover"> {{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
{{- if (or (fileExists (path.Join "static" .Params.cover.image)) (hasPrefix .Params.cover.image "http://") (hasPrefix .Params.cover.image "https://")) }} {{- if (.Param "ShowToc") }}
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
{{- else}}
<img src="{{ .Permalink -}} {{- .Params.cover.image }}" alt="{{ .Params.cover.alt | plainify }}">
{{- end}}
<p>{{.Params.cover.caption | markdownify }}</p>
</figure>
{{- end }}
{{- if .Params.ShowToc }}
<div class="toc"> <div class="toc">
<details {{if .Params.TocOpen }} open{{ end }}> <details {{if (.Param "TocOpen") }} open{{ end }}>
<summary> <summary accesskey="c" title="(Alt + C)">
<div class="details">{{- i18n "toc" | default "Table of Contents" }}</div> <div class="details">{{- i18n "toc" | default "Table of Contents" }}</div>
</summary> </summary>
<blockquote> <blockquote>
@@ -48,13 +45,14 @@
</details> </details>
</div> </div>
{{- end }} {{- end }}
<div class="post-content">{{ .Content }}</div> <div class="post-content">
{{- partial "anchored_headings.html" .Content -}}
</div>
<footer class="post-footer"> <footer class="post-footer">
{{- if .Params.tags }} {{- if .Params.tags }}
<ul class="post-tags"> <ul class="post-tags">
{{- range .Params.tags }} {{- range ($.GetTerms "tags") }}
{{- $href := print (absLangURL "tags/") (urlize .) }} <li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
<li><a href="{{ $href }}">{{ . }}</a></li>
{{- end }} {{- end }}
</ul> </ul>
{{- end }} {{- end }}
@@ -63,7 +61,7 @@
{{- end }} {{- end }}
</footer> </footer>
{{- if and ($.Site.Params.comments) (ne .Params.comments false) }} {{- if (.Param "comments") }}
{{- partial "comments.html" . }} {{- partial "comments.html" . }}
{{- end }} {{- end }}
</article> </article>

View File

@@ -0,0 +1,2 @@
<!-- formats .Content headings by adding an anchor -->
{{ . | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" "${1}<a hidden class=\"anchor\" aria-hidden=\"true\" href=\"#${2}\">#</a>${3}" | safeHTML }}

View File

@@ -0,0 +1,9 @@
{{- 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 {}") ) }}
{{- (delimit $author ", " ) }}
{{- else }}
{{- $author }}
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,35 @@
{{- with .cxt}} {{/* Apply proper context from dict */}}
{{- if (and .Params.cover.image (not $.isHidden)) }}
{{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }}
<figure class="entry-cover">
{{- $addLink := (and .Site.Params.cover.linkFullImages (not $.IsHome)) }}
{{- $cover := (.Page.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
{{- if $cover -}}{{/* i.e it is present in page bundle */}}
{{- if $addLink }}<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" target="_blank"
rel="noopener noreferrer">{{ end -}}
{{- $sizes := (slice "360" "480" "720" "1080" "1500") }}
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") }}
{{- $prod := (hugo.IsProduction | or (eq .Site.Params.env "production")) }}
{{- if (and (in $processableFormats $cover.MediaType.SubType) (ne .Site.Params.cover.responsiveImages false) (eq $prod true)) }}
<img srcset="{{- range $size := $sizes -}}
{{- if (ge $cover.Width $size) -}}
{{ printf "%s %s" (($cover.Resize (printf "%sx" $size)).Permalink) (printf "%sw ," $size) -}}
{{ end }}
{{- end -}}{{$cover.Permalink }} {{printf "%dw" ($cover.Width)}}"
sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}" alt="{{ $alt }}" />
{{- else }}{{/* Unprocessable image or responsive images disabled */}}
<img src="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" alt="{{ $alt }}">
{{- end }}
{{- else }}{{/* For absolute urls and external links, no img processing here */}}
{{- if $addLink }}<a href="{{ (.Params.cover.image) | absURL }}" target="_blank"
rel="noopener noreferrer">{{ end -}}
<img src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}">
{{- end }}
{{- if $addLink }}</a>{{ end -}}
{{/* Display Caption */}}
{{- if not $.IsHome }}
{{ with .Params.cover.caption }}<p>{{ . | markdownify }}</p>{{- end }}
{{- end }}
</figure>
{{- end }}{{/* End image */}}
{{- end -}}{{/* End context */}}

View File

@@ -0,0 +1,5 @@
<!-- Footer custom content area start -->
<!--
Insert any custom code web-analytics, resources, etc. here
-->
<!-- Footer custom content area end -->

View File

@@ -0,0 +1,5 @@
<!-- Head custom content area start -->
<!--
Insert any custom code (web-analytics, resources, etc.) - it will appear in the <head></head> section of every page. Can be overwritten by partial with the same name in the global layouts.
-->
<!-- Head custom content area end -->

View File

@@ -5,20 +5,28 @@
<span>&copy; {{ now.Year }} <a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></span> <span>&copy; {{ now.Year }} <a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></span>
{{- end }} {{- end }}
<span>&middot;</span> <span>&middot;</span>
<span>Powered by <a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a></span> <span>Powered by <a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a></span>
<span>&middot;</span> <span>&middot;</span>
<span>Theme <a href="https://git.io/hugopapermod" rel="noopener" target="_blank">PaperMod</a></span> <span>Theme <a href="https://git.io/hugopapermod" rel="noopener" target="_blank">PaperMod</a></span>
</footer> </footer>
<a href="#top" aria-label="go to top" title="Go to Top"> <a href="#top" aria-label="go to top" title="Go to Top (Alt + G)">
<button class="top-link" id="top-link" type="button"> <button class="top-link" id="top-link" type="button" accesskey="g">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor">
<path d="M12 6H0l6-6z" /></svg> <path d="M12 6H0l6-6z" />
</svg>
</button> </button>
</a> </a>
{{ if in site.Params.mainSections .Type }} {{- partial "extend_footer.html" . -}}
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint -}} {{- $isHLJSdisabled := (.Site.Params.assets.disableHLJS | default .Params.disableHLJS ) }}
<script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script> {{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
<script>hljs.initHighlightingOnLoad();</script> {{- if not .Site.Params.assets.disableFingerprinting }}
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }}
<script defer src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"
onload="hljs.initHighlightingOnLoad();"></script>
{{- else}}
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }}
<script defer src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script>
{{- end}}
{{- end }} {{- end }}
<script> <script>
window.onload = function () { window.onload = function () {
@@ -29,10 +37,19 @@
document.querySelectorAll('a[href^="#"]').forEach(anchor => { document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener("click", function (e) { anchor.addEventListener("click", function (e) {
e.preventDefault(); e.preventDefault();
var id = this.getAttribute("href").substr(1);
document.querySelector(this.getAttribute("href")).scrollIntoView({ if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
behavior: "smooth" document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({
}); behavior: "smooth"
});
} else {
document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView();
}
if (id === "top") {
history.replaceState(null, null, " ");
} else {
history.replaceState(null, null, `#${id}`);
}
}); });
}); });
var mybutton = document.getElementById("top-link"); var mybutton = document.getElementById("top-link");
@@ -45,11 +62,13 @@
mybutton.style.opacity = "0"; mybutton.style.opacity = "0";
} }
}; };
function menu_on_scroll() { function menu_on_scroll() {
localStorage.setItem("menu-scroll-position", document.getElementById('menu').scrollLeft); localStorage.setItem("menu-scroll-position", document.getElementById('menu').scrollLeft);
} }
</script> </script>
{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }} {{- if (not .Site.Params.disableThemeToggle) }}
<script> <script>
document.getElementById("theme-toggle").addEventListener("click", () => { document.getElementById("theme-toggle").addEventListener("click", () => {
if (document.body.className.includes("dark")) { if (document.body.className.includes("dark")) {
@@ -60,10 +79,6 @@
localStorage.setItem("pref-theme", 'dark'); localStorage.setItem("pref-theme", 'dark');
} }
}) })
</script>
{{- else -}}
<!-- case where owner disables theme button after deployment, this resets the stored theme -->
<script>
localStorage.removeItem("pref-theme");
</script> </script>
{{- end }} {{- end }}

View File

@@ -1,55 +1,79 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Title --> {{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
<title>{{ if .IsHome }}{{else}}{{ if .Title }}{{ .Title }} - {{ end }}{{end}}{{ .Site.Title }}</title> <meta name="robots" content="index, follow">
<!-- Meta -->
{{- if in site.Params.mainSections .Type }}
<meta name="description" content="{{ .Summary }}">
<meta name="keywords" content={{ delimit .Keywords ", " }} />
{{- else }} {{- else }}
<meta name="description" <meta name=" robots" content="noindex, nofollow">
content="{{if .IsHome}}{{ .Site.Params.description }}{{else}}{{ .Title }} - {{ .Site.Title }}{{end}}"> {{- end -}}
{{- end }} <!-- Title -->
<meta name="author" content="{{ .Params.author | default .Site.Params.author }}"> <title>{{ if .IsHome }}{{else}}{{ if .Title }}{{ .Title }} | {{ end }}{{end}}{{ .Site.Title }}</title>
<link rel="canonical" href="{{ .Permalink }}" /> <!-- Meta -->
<meta name="keywords" content="{{ if .Params.keywords -}}
{{- range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- else }}
{{- range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- end -}}" />
<meta name="description" content="{{- with .Description }}{{ . }}{{- else }}{{- if .IsPage}}
{{- .Summary | default (printf "%s - %s" .Title .Site.Title) }}{{- else }}
{{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}">
<meta name="author" content="{{ (partial "author.html" . ) }}">
<link rel="canonical" href="{{ if .Params.canonicalURL -}} {{ trim .Params.canonicalURL " " }} {{- else -}} {{ .Permalink }} {{- end }}" />
{{- if .Site.Params.analytics.google.SiteVerificationTag }} {{- if .Site.Params.analytics.google.SiteVerificationTag }}
<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" /> <meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" />
{{- end}} {{- end}}
<!-- Styles --> <!-- Styles -->
{{- $anoldhope := resources.Get "css/an-old-hope.min.css" }} {{- $common := (resources.Match "css/*.css") | resources.Concat "assets/css/common.css" }}
{{- $theme := resources.Get "css/theme-vars.css" }} {{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }}
{{- $reset := resources.Get "css/reset.css" }} {{- /* bundle all required css */}}
{{- $header := resources.Get "css/header.css" }} {{- /* Add extended css after theme style */ -}}
{{- $main := resources.Get "css/main.css" }} {{- $stylesheet := (slice $common $extended) | resources.Concat "assets/css/stylesheet.css" | minify }}
{{- $postentry := resources.Get "css/post-entry.css" }}
{{- $postsingle := resources.Get "css/post-single.css" }} {{- if not .Site.Params.assets.disableFingerprinting }}
{{- $terms := resources.Get "css/terms.css" }} {{- $stylesheet := $stylesheet | fingerprint -}}
{{- $archive := resources.Get "css/archive.css" }} <link href="{{ $stylesheet.RelPermalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet"
{{- $footer := resources.Get "css/footer.css" }}
{{- $404 := resources.Get "css/404.css" }}
{{- $style := slice $theme $reset $header $main $postentry $postsingle $terms $archive $footer $404 | resources.Concat "stylesheet.css" }}
{{- $stylesheet := slice $anoldhope $style | resources.Concat "assets/css/stylesheet.css" | minify | fingerprint -}}
<link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet"
as="style">
{{- if (and (.Site.Params.profileMode.enabled) (.IsHome)) }}
{{- $profileMode := slice (resources.Get "css/profile-mode.css") | resources.Concat "assets/css/profile-mode.css" | minify | fingerprint }}
<link href="{{ $profileMode.Permalink }}" integrity="{{ $profileMode.Data.Integrity }}" rel="preload stylesheet"
as="style"> as="style">
{{- else}}
<link href="{{ $stylesheet.RelPermalink }}" rel="preload stylesheet" as="style">
{{- end}}
<!-- Search -->
{{- if (eq .Layout `search`) -}}
<link rel="preload" as="fetch" href="../index.json" crossOrigin="anonymous">
{{- $fastsearch := resources.Get "js/fastsearch.js" | resources.ExecuteAsTemplate "js/fastsearch.js" .Site.Params.fuseOpts }}
{{- $fusejs := resources.Get "js/fuse.js" }}
{{- if not .Site.Params.assets.disableFingerprinting }}
{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }}
<script defer src="{{ $search.RelPermalink }}" onload="loadSearch();" integrity="{{ $search.Data.Integrity }}"></script>
{{- else}}
{{ $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }}
<script defer src="{{ $search.RelPermalink }}" onload="loadSearch();"></script>
{{- end}}
{{- end -}} {{- end -}}
<!-- Favicons --> <!-- Favicons -->
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}"> <link rel="icon" href="{{- .Site.Params.assets.favicon | default "favicon.ico" | absURL -}}">
<link rel="icon" href="{{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }}"> <link rel="icon" type="image/png" sizes="16x16" href="
{{- .Site.Params.assets.favicon16x16 | default "favicon-16x16.png" | absURL -}}">
<link rel="icon" type="image/png" sizes="32x32" href="
{{- .Site.Params.assets.favicon32x32 | default "favicon-32x32.png" | absURL -}}">
<link rel="apple-touch-icon" href="
{{- .Site.Params.assets.apple_touch_icon | default "apple-touch-icon.png" | absURL -}}">
<link rel="mask-icon" href="{{- .Site.Params.assets.safari_pinned_tab | default "safari-pinned-tab.svg" | absURL -}}">
<meta name="theme-color" content="#2e2e33">
<meta name="msapplication-TileColor" content="#2e2e33">
<!-- Generator --> <!-- Generator -->
{{- hugo.Generator }} {{- hugo.Generator }}
<!-- RSS --> <!-- RSS -->
{{- range .AlternativeOutputFormats -}} {{- range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end -}} {{ end -}}
{{- range .Translations -}}
<link rel="alternate" hreflang="{{- .Lang -}}" href="{{- .Permalink -}}" />
{{ end }}
{{- partial "extend_head.html" . -}}
<!-- Misc --> <!-- Misc -->
{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} {{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
{{- template "_internal/google_analytics_async.html" . }} {{- template "_internal/google_analytics_async.html" . }}
{{- template "_internal/opengraph.html" . }} {{- template "_internal/google_news.html" . }}
{{- template "_internal/twitter_cards.html" . }} {{- template "partials/templates/opengraph.html" . }}
{{- template "_internal/schema.html" . }} {{- template "partials/templates/twitter_cards.html" . }}
{{- template "partials/templates/schema_json.html" . }}
{{- end }} {{- end }}

View File

@@ -1,22 +1,41 @@
{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }} {{- /* theme-toggle is enabled */}}
{{- if (not .Site.Params.disableThemeToggle) }}
{{- /* theme is light */}}
{{- if (eq .Site.Params.defaultTheme "light") }}
<script>
if (localStorage.getItem("pref-theme") === "dark") {
document.body.classList.add('dark');
}
</script>
{{- /* theme is dark */}}
{{- else if (eq .Site.Params.defaultTheme "dark") }}
<script>
if (localStorage.getItem("pref-theme") === "light") {
document.body.classList.remove('dark')
}
</script>
{{- else }}
{{- /* theme is auto */}}
<script> <script>
// load memory
if (localStorage.getItem("pref-theme") === "dark") { if (localStorage.getItem("pref-theme") === "dark") {
document.body.classList.add('dark'); document.body.classList.add('dark');
} else if (localStorage.getItem("pref-theme") === "light") { } else if (localStorage.getItem("pref-theme") === "light") {
document.body.classList.remove('dark') document.body.classList.remove('dark')
} else { } else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
if (window.matchMedia('(prefers-color-scheme: dark)').matches) { document.body.classList.add('dark');
document.body.classList.add('dark');
}
} }
</script> </script>
{{- end }} {{- end }}
{{- if (and (.Site.Params.disableThemeToggle) (eq .Site.Params.defaultTheme "auto")) }} {{- /* theme-toggle is disabled and theme is auto */}}
{{- else if (and (ne .Site.Params.defaultTheme "light") (ne .Site.Params.defaultTheme "dark"))}}
<script> <script>
if (window.matchMedia('(prefers-color-scheme: dark)').matches) { if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark'); document.body.classList.add('dark');
} }
</script> </script>
{{- end }} {{- end }}
<noscript> <noscript>
@@ -25,51 +44,83 @@
.top-link { .top-link {
display: none; display: none;
} }
</style> </style>
</noscript> </noscript>
<header class="header"> <header class="header">
<nav class="nav"> <nav class="nav">
<p class="logo"> <div class="logo">
<a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a> <a href="{{ "" | absLangURL }}" accesskey="h" title="{{ .Site.Params.label.text | default .Site.Title }} (Alt + H)">
{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }} {{- if .Site.Params.label.icon }}
<span class="theme-toggle"> <img src="{{- .Site.Params.label.icon -}}" alt="logo" aria-label="logo"
<a id="theme-toggle"> height="{{- .Site.Params.label.iconHeight | default "30px" -}}">
<svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" {{- end -}}
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" {{- .Site.Params.label.text | default .Site.Title -}}
stroke-linejoin="round"> </a>
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path> <span class="logo-switches">
</svg> {{- if (not .Site.Params.disableThemeToggle) }}
<svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" <span class="theme-toggle" title="(Alt + T)">
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" <a id="theme-toggle" accesskey="t">
stroke-linejoin="round"> <svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
<circle cx="12" cy="12" r="5"></circle> fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
<line x1="12" y1="1" x2="12" y2="3"></line> stroke-linejoin="round">
<line x1="12" y1="21" x2="12" y2="23"></line> <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line> </svg>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line> <svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
<line x1="1" y1="12" x2="3" y2="12"></line> fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
<line x1="21" y1="12" x2="23" y2="12"></line> stroke-linejoin="round">
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line> <circle cx="12" cy="12" r="5"></circle>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line> <line x1="12" y1="1" x2="12" y2="3"></line>
</svg> <line x1="12" y1="21" x2="12" y2="23"></line>
</a> <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</a>
</span>
{{- end}}
{{ $lang := .Lang}}
{{- with $.Site.Home.AllTranslations }}
<span class="lang-switch">
<span>|</span>
<ul>
{{- range . -}}
{{- if ne $lang .Lang }}
<li>
<a href="{{- .Permalink -}}" title="{{ .Language.LanguageName | default (.Lang | humanize) }}"
aria-label="{{ .Language.LanguageName | default (.Lang | humanize) }}">
{{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }}
{{- .Language.LanguageName | emojify -}}
{{- else }}
{{- .Lang | humanize -}}
{{- end -}}
</a>
</li>
{{- end -}}
{{- end}}
</ul>
</span>
{{- end }}
</span> </span>
{{- end}} </div>
</p>
{{- $currentPage := . }} {{- $currentPage := . }}
<ul class="menu" id="menu" onscroll="menu_on_scroll()"> <ul class="menu" id="menu" onscroll="menu_on_scroll()">
{{- range .Site.Menus.main }} {{- range .Site.Menus.main }}
{{- $menu_item_url := .URL | relLangURL }} {{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
{{- $page_url:= $currentPage.RelPermalink | relLangURL }} {{- $page_url:= $currentPage.Permalink | absLangURL }}
{{- $is_search := eq ($.Site.GetPage .KeyName).Layout `search` }}
<li> <li>
<a href="{{ .URL | absLangURL }}"> <a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
<span {{- if eq $menu_item_url $page_url }} {{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}>
{{- /* the menu item links to the current page (with relLangURL) */}} class="active" {{- end }}> <span {{- if eq $menu_item_url $page_url }} class="active" {{- end }}>
{{ .Name }} {{- .Name -}}
</span> </span>
</a> </a>
</li> </li>
{{- end }} {{- end -}}
</ul> </ul>
</nav> </nav>
</header> </header>

View File

@@ -1,7 +1,7 @@
{{- with $.Site.Params.homeInfoParams }} {{- with $.Site.Params.homeInfoParams }}
<article class="first-entry"> <article class="first-entry home-info">
<header class="entry-header"> <header class="entry-header">
<h2>{{- .Title }}</h2> <h2>{{- .Title | markdownify }}</h2>
</header> </header>
<section class="entry-content"> <section class="entry-content">
<p>{{- .Content | markdownify }}</p> <p>{{- .Content | markdownify }}</p>

View File

@@ -1,15 +1,16 @@
<div class="profile"> <div class="profile">
{{- with .Site.Params.profileMode }} {{- with .Site.Params.profileMode }}
<div class="profile_inner"> <div class="profile_inner">
{{- if .imageUrl}}<img src="{{ .imageUrl}}" alt="{{ .imageTitle | default "profile image" }}" />{{- end}} {{- if .imageUrl}}<img src="{{ .imageUrl}}" alt="{{ .imageTitle | default "profile image" }}"
<h1>{{- .title | default $.Site.Title -}}</h1> height="{{- .imageHeight | default 150 -}}" width="{{- .imageWidth | default 150 -}}" />{{- end}}
<span>{{- .subtitle -}}</span> <h1>{{- .title | default $.Site.Title | markdownify -}}</h1>
<span>{{- .subtitle | markdownify -}}</span>
{{- partial "social_icons.html" $.Site.Params.socialIcons -}} {{- partial "social_icons.html" $.Site.Params.socialIcons -}}
{{- with .buttons }} {{- with .buttons }}
<div class="buttons"> <div class="buttons">
{{- range . -}} {{- range . -}}
<a class="button" href="{{ .url }}" rel="noopener" title="{{ .name | humanize }}"> <a class="button" href="{{ trim .url " " }}" rel="noopener" title="{{ .name | humanize }}">
<span class="button-inner">{{ .name }}</span> <span class="button-inner">{{ .name }}</span>
</a> </a>
{{- end -}} {{- end -}}

View File

@@ -0,0 +1,17 @@
{{- $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 . "&nbsp;·&nbsp;"}}
{{- end }}

View File

@@ -1,8 +1,17 @@
{{- $pageurl := .Permalink }} {{- $pageurl := .Permalink }}
{{- $title := .Title }} {{- $title := .Title }}
{{ $.Scratch.Set "tags" ""}}
{{- with .Params.Tags }}
{{ $hashtags := newScratch}}
{{ range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}}
{{ $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }}
{{- end }}
<div class="share-buttons"> <div class="share-buttons">
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on twitter" <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on twitter"
href="https://twitter.com/intent/tweet/?text={{ $title }}&amp;url={{ $pageurl }}"> href="https://twitter.com/intent/tweet/?text={{ $title }}&amp;url={{ $pageurl }}&amp;hashtags={{- $.Scratch.Get "tags" -}}">
<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve"> <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve">
<path <path
d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-253.927,424.544c135.939,0 210.268,-112.643 210.268,-210.268c0,-3.218 0,-6.437 -0.153,-9.502c14.406,-10.421 26.973,-23.448 36.935,-38.314c-13.18,5.824 -27.433,9.809 -42.452,11.648c15.326,-9.196 26.973,-23.602 32.49,-40.92c-14.252,8.429 -30.038,14.56 -46.896,17.931c-13.487,-14.406 -32.644,-23.295 -53.946,-23.295c-40.767,0 -73.87,33.104 -73.87,73.87c0,5.824 0.613,11.494 1.992,16.858c-61.456,-3.065 -115.862,-32.49 -152.337,-77.241c-6.284,10.881 -9.962,23.601 -9.962,37.088c0,25.594 13.027,48.276 32.95,61.456c-12.107,-0.307 -23.448,-3.678 -33.41,-9.196l0,0.92c0,35.862 25.441,65.594 59.311,72.49c-6.13,1.686 -12.72,2.606 -19.464,2.606c-4.751,0 -9.348,-0.46 -13.946,-1.38c9.349,29.426 36.628,50.728 68.965,51.341c-25.287,19.771 -57.164,31.571 -91.8,31.571c-5.977,0 -11.801,-0.306 -17.625,-1.073c32.337,21.15 71.264,33.41 112.95,33.41Z" /> d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-253.927,424.544c135.939,0 210.268,-112.643 210.268,-210.268c0,-3.218 0,-6.437 -0.153,-9.502c14.406,-10.421 26.973,-23.448 36.935,-38.314c-13.18,5.824 -27.433,9.809 -42.452,11.648c15.326,-9.196 26.973,-23.602 32.49,-40.92c-14.252,8.429 -30.038,14.56 -46.896,17.931c-13.487,-14.406 -32.644,-23.295 -53.946,-23.295c-40.767,0 -73.87,33.104 -73.87,73.87c0,5.824 0.613,11.494 1.992,16.858c-61.456,-3.065 -115.862,-32.49 -152.337,-77.241c-6.284,10.881 -9.962,23.601 -9.962,37.088c0,25.594 13.027,48.276 32.95,61.456c-12.107,-0.307 -23.448,-3.678 -33.41,-9.196l0,0.92c0,35.862 25.441,65.594 59.311,72.49c-6.13,1.686 -12.72,2.606 -19.464,2.606c-4.751,0 -9.348,-0.46 -13.946,-1.38c9.349,29.426 36.628,50.728 68.965,51.341c-25.287,19.771 -57.164,31.571 -91.8,31.571c-5.977,0 -11.801,-0.306 -17.625,-1.073c32.337,21.15 71.264,33.41 112.95,33.41Z" />

View File

@@ -1,6 +1,6 @@
<div class="social-icons"> <div class="social-icons">
{{- range . -}} {{- range . -}}
<a href="{{ .url }}" target="_blank" rel="noopener noreferrer" <a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me"
title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a> title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a>
{{- end -}} {{- end -}}
</div> </div>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,65 @@
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{- if .Params.cover.image -}}
{{- if (ne .Params.cover.relative true) }}
<meta property="og:image" content="{{ .Params.cover.image | absURL }}" />
{{- else}}
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
{{- end}}
{{- else }}
{{ with $.Params.images }}{{ range first 6 . -}}
<meta property="og:image" content="{{ . | absURL }}" />
{{ end }}{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
<meta property="og:image" content="{{ $featured.Permalink }}"/>
{{ else -}}
{{- with $.Site.Params.images -}}
<meta property="og:image" content="{{ index . 0 | absURL }}"/>
{{ end }}{{ end }}{{ end }}
{{- end }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
{{- if .IsPage }}
{{- if not .PublishDate.IsZero }}<meta property="article:published_time" {{ .PublishDate.Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
{{ else if not .Date.IsZero }}<meta property="article:published_time" {{ .Date.Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
{{ end }}
{{- if not .Lastmod.IsZero }}<meta property="article:modified_time" {{ .Lastmod.Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
{{- else }}
{{- if not .Date.IsZero }}<meta property="og:updated_time" {{ .Lastmod.Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
{{- end }}
{{- end }}{{/* .IsPage */}}
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
{{- with .Params.videos }}
{{- range . }}
<meta property="og:video" content="{{ . | absURL }}" />
{{ end }}{{ end }}
{{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }}
{{- range $name := . }}
{{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
{{- end }}
{{ end }}{{ end }}
{{- if .IsPage }}
{{- range .Site.Authors }}{{ with .Social.facebook }}
<meta property="article:author" content="https://www.facebook.com/{{ . }}" />{{ end }}{{ with .Site.Social.facebook }}
<meta property="article:publisher" content="https://www.facebook.com/{{ . }}" />{{ end }}
<meta property="article:section" content="{{ .Section }}" />
{{- with .Params.tags }}{{ range first 6 . }}
<meta property="article:tag" content="{{ . }}" />{{ end }}{{ end }}
{{- end }}{{ end }}
{{- /* Facebook Page Admin ID for Domain Insights */}}
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}

View File

@@ -0,0 +1,78 @@
{{ if .IsHome }}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "{{- ( .Site.Params.schema.publisherType | default "Organization") | humanize -}}",
"name": {{ .Site.Title }},
"url": {{ .Site.BaseURL }},
"description": {{ .Site.Params.description | plainify | truncate 180 | safeHTML }},
"thumbnailUrl": {{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }},
"sameAs": [
{{- if .Site.Params.schema.sameAs }}
{{ range $i, $e := .Site.Params.schema.sameAs }}{{ if $i }}, {{ end }}{{ trim $e " " }}{{ end }}
{{- else}}
{{ range $i, $e := .Site.Params.SocialIcons }}{{ if $i }}, {{ end }}{{ trim $e.url " " }}{{ end }}
{{- end}}
]
}
</script>
{{- else if .IsPage }}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": {{ .Title | plainify}},
"name": "{{ .Title | plainify }}",
"description": {{ .Summary | plainify | truncate 180 | safeHTML }},
"keywords": [
{{- if .Params.keywords }}
{{ range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}
{{- else }}
{{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}
{{- end }}
],
"articleBody": {{ .Content | safeJS | htmlUnescape | plainify }},
"wordCount" : "{{ .WordCount }}",
"inLanguage": {{ .Language.Lang | default "en-us" }},
{{ if .Params.cover.image -}}
"image":
{{- if (ne .Params.cover.relative true) -}}
{{ .Params.cover.image | absURL }},
{{- else -}}
{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }},
{{- end}}
{{- end -}}
"datePublished": {{ .PublishDate }},
"dateModified": {{ .Lastmod }},
{{- with (.Params.author | default .Site.Params.author) }}
"author":
{{- if (or (eq (printf "%T" .) "[]string") (eq (printf "%T" .) "[]interface {}")) -}}
[{{- range $i, $v := . -}}
{{- if $i }}, {{end -}}
{
"@type": "Person",
"name": {{ $v }}
}
{{- end }}],
{{- else -}}
{
"@type": "Person",
"name": {{ . }}
},
{{- end -}}
{{- end }}
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{ .Permalink | safeHTML }}
},
"publisher": {
"@type": "{{- ( .Site.Params.schema.publisherType | default "Organization") | humanize -}}",
"name": {{ .Site.Title }},
"logo": {
"@type": "ImageObject",
"url": {{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }}
}
}
}
</script>
{{ end }}

View File

@@ -0,0 +1,38 @@
{{- if .Params.cover.image -}}
<meta name="twitter:card" content="summary_large_image" />
{{- if (ne $.Params.cover.relative true) }}
<meta name="twitter:image" content="{{ .Params.cover.image | absURL }}" />
{{- else }}
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
{{- end}}
{{- else }}
{{- with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ $featured.Permalink }}"/>
{{- else -}}
{{- with $.Site.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
<meta name="twitter:card" content="summary"/>
{{- end -}}
{{- end -}}
{{- end }}
{{- end }}
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
{{ with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}"/>
{{ end -}}
{{ range .Site.Authors }}
{{ with .twitter -}}
<meta name="twitter:creator" content="@{{ . }}"/>
{{ end -}}
{{ end -}}

View File

@@ -62,10 +62,10 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
<li> <li>
<a href="#{{- $cleanedID -}}">{{- $header | safeHTML -}}</a> <a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a>
{{- else -}} {{- else -}}
<li> <li>
<a href="#{{- $cleanedID -}}">{{- $header | safeHTML -}}</a> <a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
<!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} --> <!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} -->

7
layouts/robots.txt Normal file
View File

@@ -0,0 +1,7 @@
User-agent: *
{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
Disallow:
{{- else }}
Disallow: /
{{- end }}
Sitemap: {{ "sitemap.xml" | absURL }}

View File

@@ -0,0 +1,28 @@
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
{{- if .Get "link" -}}
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
{{- end }}
<img src="{{ .Get "src" }}"
{{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
{{- end -}}
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
/> <!-- Closing img tag -->
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption>
{{ with (.Get "title") -}}
{{ . }}
{{- end -}}
{{- if or (.Get "caption") (.Get "attr") -}}<p>
{{- .Get "caption" | markdownify -}}
{{- with .Get "attrlink" }}
<a href="{{ . }}">
{{- end -}}
{{- .Get "attr" | markdownify -}}
{{- if .Get "attrlink" }}</a>{{ end }}</p>
{{- end }}
</figcaption>
{{- end }}
</figure>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1 +0,0 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}

View File

@@ -4,11 +4,40 @@
name = "PaperMod" name = "PaperMod"
license = "MIT" license = "MIT"
licenselink = "https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE" licenselink = "https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE"
description = "A simple, clean, flexible Hugo theme" description = "A fast, clean, responsive Hugo theme"
homepage = "https://github.com/adityatelange/hugo-PaperMod" homepage = "https://adityatelange.github.io/hugo-PaperMod/"
tags = ["Responsive", "Simple", "Clean", "Light", "White", "Dark", "Blog", "PaperMod"] tags = [
features = ["Responsive", "One Column", "Blog"] "responsive",
min_version = "0.57.1" "simple",
"clean",
"light",
"dark",
"blog",
"minimalist",
"highlight.js",
"search"
]
features = [
"responsive",
"single-column",
"blog",
"cover-image",
"table-of-contents",
"opengraph",
"highlight.js",
"favicon",
"archive",
"share-icons",
"cover",
"multilingual",
"social-icons",
"minified-assets",
"theme-toggle",
"menu-location-indicator",
"scroll-to-top",
"search"
]
min_version = "0.74.0"
[author] [author]
name = "Aditya Telange" name = "Aditya Telange"