Update theme (LoveIt) + Add new fields

This commit is contained in:
Daniel Mason 2025-02-23 12:23:14 +13:00
parent ec90ebd36e
commit 49c98d8fb5
Signed by: idanoo
GPG key ID: 387387CDBC02F132
87 changed files with 6900 additions and 6013 deletions

View file

@ -1,19 +1,38 @@
baseURL = 'https://m2.nz/' baseURL = "https://m2.nz/"
languageCode = 'en'
title = 'Daniel Mason'
theme = 'LoveIt'
# Defined later # Change the default theme to be use when building the site with Hugo
# [markup.goldmark.renderer] theme = "LoveIt"
# unsafe = true
# Markup related configuration in Hugo # website title
# [markup] title = "Daniel Mason"
# # Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting)
# [markup.highlight]
# # false is a necessary configuration (https://github.com/dillonzq/LoveIt/issues/158)
# noClasses = false
# language code ["en", "zh-CN", "fr", "pl", ...]
languageCode = "en"
# language name ["English", "简体中文", "Français", "Polski", ...]
languageName = "English"
# whether to include Chinese/Japanese/Korean
hasCJKLanguage = false
# copyright description used only for seo schema
copyright = ""
# whether to use robots.txt
enableRobotsTXT = true
# whether to use git commit log
enableGitInfo = true
# whether to use emoji code
enableEmoji = true
# ignore some build errors
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# Pagination config
[pagination]
disableAliases = false
pagerSize = 10
path = "page"
# Menu config
[menu] [menu]
[[menu.main]] [[menu.main]]
identifier = "home" identifier = "home"
@ -21,56 +40,104 @@ theme = 'LoveIt'
url = "/" url = "/"
weight = 1 weight = 1
[[menu.main]] [[menu.main]]
identifier = "posts"
name = "Posts"
url = "/posts/"
weight = 2 weight = 2
[[menu.main]] identifier = "posts"
identifier = "about"
name = "CV"
url = "/cv/"
weight = 4
[params]
defaultTheme = 'dark'
dateFormat = '2006-01-02'
title = 'Daniel Mason'
author = "Daniel Mason"
description = "Personal blog"
images = ["/favicon.ico"]
# Header config
[params.header]
# desktop header mode ("fixed", "normal", "auto")
desktopMode = "fixed"
# mobile header mode ("fixed", "normal", "auto")
mobileMode = "auto"
# LoveIt NEW | 0.2.0 Header title config
[params.header.title]
# URL of the LOGO
logo = ""
# title name
name = "Daniel Mason"
# you can add extra information before the name (HTML format is supported), such as icons # you can add extra information before the name (HTML format is supported), such as icons
pre = "" pre = ""
# you can add extra information after the name (HTML format is supported), such as icons # you can add extra information after the name (HTML format is supported), such as icons
post = "" post = ""
# LoveIt NEW | 0.2.5 whether to use typeit animation for title name name = "Posts"
url = "/posts/"
# title will be shown when you hover on this menu link
title = ""
[[menu.main]]
identifier = "about"
name = "CV"
url = "/cv/"
weight = 3
[params]
# site default theme ["auto", "light", "dark"]
defaultTheme = "dark"
# public git repo url only then enableGitInfo is true
gitRepo = "https://github.com/idanoo/m2.nz/"
# which hash function used for SRI, when empty, no SRI is used
# ["sha256", "sha384", "sha512", "md5"]
fingerprint = ""
# date format
dateFormat = "2006-01-02"
# website title for Open Graph and Twitter Cards
title = "m2.nz - Daniel Mason"
# website description for RSS, SEO, Open Graph and Twitter Cards
description = "m2.nz - Daniel Mason"
# website images for Open Graph and Twitter Cards
images = ["/avatar.png"]
# Author config
[params.author]
name = "Daniel Mason"
email = "daniel@m2.nz"
link = ""
# Header config
[params.header]
# desktop header mode ["fixed", "normal", "auto"]
desktopMode = "fixed"
# mobile header mode ["fixed", "normal", "auto"]
mobileMode = "auto"
# Header title config
[params.header.title]
# URL of the LOGO
logo = ""
# title name
name = ""
# you can add extra information before the name (HTML format is supported), such as icons
pre = ""
# you can add extra information after the name (HTML format is supported), such as icons
post = ""
# whether to use typeit animation for title name
typeit = false typeit = false
# Footer config
[params.footer] [params.footer]
enable = true enable = true
# Custom content (HTML format is supported)
custom = '' custom = ''
hugo = false # whether to show Hugo and theme info
hugo = true
# whether to show copyright info
copyright = true copyright = true
# whether to show the author
author = true author = true
since = 2020 # Site creation time
license = '' since = 2019
# ICP info only in China (HTML format is supported)
icp = ""
# license info (HTML format is supported)
license = '<a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'
# LoveIt NEW | 0.2.0 App icon config # Section (all posts) page config
[params.section]
# special amount of posts in each section page
paginate = 20
# date format (month and day)
dateFormat = "01-02"
# amount of RSS pages
rss = 10
# List (category or tag) page config
[params.list]
# special amount of posts in each list page
paginate = 20
# date format (month and day)
dateFormat = "01-02"
# amount of RSS pages
rss = 10
# App icon config
[params.app] [params.app]
# optional site title override for the app when added to an iOS home screen or Android launcher # optional site title override for the app when added to an iOS home screen or Android launcher
title = "Daniel Mason" title = "My cool site"
# whether to omit favicon resource links # whether to omit favicon resource links
noFavicon = false noFavicon = false
# modern SVG favicon to use in place of older style .png and .ico files # modern SVG favicon to use in place of older style .png and .ico files
@ -82,9 +149,31 @@ theme = 'LoveIt'
# Windows v8-10 tile color # Windows v8-10 tile color
tileColor = "#da532c" tileColor = "#da532c"
# Search config
[params.search]
enable = true
# type of search engine ["lunr", "algolia"]
type = "lunr"
# max index length of the chunked content
contentLength = 4000
# placeholder of the search bar
placeholder = ""
# max number of results length
maxResultLength = 10
# snippet length of the result
snippetLength = 30
# HTML tag name of the highlight part in results
highlightTag = "em"
# whether to use the absolute URL based on the baseURL in search index
absoluteURL = false
[params.search.algolia]
index = ""
appID = ""
searchKey = ""
# Home page config # Home page config
[params.home] [params.home]
# LoveIt NEW | 0.2.0 amount of RSS pages # amount of RSS pages
rss = 10 rss = 10
# Home page profile # Home page profile
[params.home.profile] [params.home.profile]
@ -92,23 +181,23 @@ theme = 'LoveIt'
# Gravatar Email for preferred avatar in home page # Gravatar Email for preferred avatar in home page
gravatarEmail = "daniel@m2.nz" gravatarEmail = "daniel@m2.nz"
# URL of avatar shown in home page # URL of avatar shown in home page
avatarURL = "/bitmoji.jpg" avatarURL = "/images/avatar.png"
# LoveIt CHANGED | 0.2.7 title shown in home page (HTML format is supported) # title shown in home page (HTML format is supported)
title = "Daniel Mason" title = "Daniel Mason"
# subtitle shown in home page # subtitle shown in home page (HTML format is supported)
subtitle = "Site Reliability Engineer, Dad, Pilot" subtitle = "Site Reliability Engineer, Dad, Pilot"
# whether to use typeit animation for subtitle # whether to use typeit animation for subtitle
typeit = false typeit = true
# whether to show social links # whether to show social links
social = true social = true
# LoveIt NEW | 0.2.0 disclaimer (HTML format is supported) # disclaimer (HTML format is supported)
disclaimer = "" disclaimer = ""
# Home page posts # Home page posts
[params.home.posts] [params.home.posts]
enable = true enable = true
# special amount of posts in each home posts page # special amount of posts in each home posts page
paginate = 5 paginate = 6
# LoveIt DELETED | 0.2.0 replaced with hiddenFromHomePage in params.page # replaced with hiddenFromHomePage in params.page
# default behavior when you don't set "hiddenFromHomePage" in front matter # default behavior when you don't set "hiddenFromHomePage" in front matter
defaultHiddenFromHomePage = false defaultHiddenFromHomePage = false
@ -121,7 +210,7 @@ theme = 'LoveIt'
Facebook = "" Facebook = ""
Telegram = "" Telegram = ""
Medium = "" Medium = ""
Gitlab = "" Gitlab = "idanoo"
Youtubelegacy = "" Youtubelegacy = ""
Youtubecustom = "" Youtubecustom = ""
Youtubechannel = "" Youtubechannel = ""
@ -169,47 +258,60 @@ theme = 'LoveIt'
Vine = "" Vine = ""
Googlescholar = "" Googlescholar = ""
Researchgate = "" Researchgate = ""
# Mastodon = "@idanoo@mastodon.nz" Mastodon = ""
Thingiverse = "" Thingiverse = ""
Devto = "" Devto = ""
Gitea = "" Gitea = ""
XMPP = "" XMPP = ""
Matrix = "" Matrix = ""
Bilibili = "" Bilibili = ""
Discord = ""
DiscordInvite = ""
Lichess = ""
ORCID = ""
Pleroma = ""
Kaggle = ""
MediaWiki= ""
Plume = ""
HackTheBox = ""
RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Phone = ""
Email = "daniel@m2.nz" Email = "daniel@m2.nz"
RSS = false # LoveIt NEW | 0.2.0 RSS = false
Pixelfed = "https://pixelfed.nz/idanoo"
# Page global config
# LoveIt CHANGED | 0.2.0 Page global config
[params.page] [params.page]
# LoveIt NEW | 0.2.0 whether to hide a page from home page # whether to hide a page from home page
hiddenFromHomePage = false hiddenFromHomePage = false
# LoveIt NEW | 0.2.0 whether to hide a page from search results # whether to hide a page from search results
hiddenFromSearch = false hiddenFromSearch = false
# LoveIt NEW | 0.2.0 whether to enable twemoji # whether to enable twemoji
twemoji = false twemoji = false
# whether to enable lightgallery # whether to enable lightgallery
lightgallery = true lightgallery = false
# LoveIt NEW | 0.2.0 whether to enable the ruby extended syntax # whether to enable the ruby extended syntax
ruby = true ruby = true
# LoveIt NEW | 0.2.0 whether to enable the fraction extended syntax # whether to enable the fraction extended syntax
fraction = true fraction = true
# LoveIt NEW | 0.2.0 whether to enable the fontawesome extended syntax # whether to enable the fontawesome extended syntax
fontawesome = true fontawesome = true
# whether to show link to Raw Markdown content of the content # whether to show link to Raw Markdown content of the content
linkToMarkdown = true linkToMarkdown = true
# LoveIt NEW | 0.2.4 whether to show the full text content in RSS # whether to show the full text content in RSS
rssFullText = false rssFullText = false
# LoveIt NEW | 0.2.0 Table of the contents config # Table of the contents config
[params.page.toc] [params.page.toc]
# whether to enable the table of the contents # whether to enable the table of the contents
enable = false enable = true
# LoveIt NEW | 0.2.9 whether to keep the static table of the contents in front of the post # whether to keep the static table of the contents in front of the post
keepStatic = false keepStatic = false
# whether to make the table of the contents in the sidebar automatically collapsed # whether to make the table of the contents in the sidebar automatically collapsed
auto = true auto = true
# LoveIt CHANGED | 0.2.0 KaTeX mathematical formulas # KaTeX mathematical formulas
[params.page.math] [params.page.math]
enable = true enable = true
# default inline delimiter is $ ... $ and \( ... \) # default inline delimiter is $ ... $ and \( ... \)
@ -222,20 +324,20 @@ theme = 'LoveIt'
copyTex = true copyTex = true
# KaTeX extension mhchem # KaTeX extension mhchem
mhchem = true mhchem = true
# LoveIt NEW | 0.2.0 Code config # Code config
[params.page.code] [params.page.code]
# whether to show the copy button of the code block # whether to show the copy button of the code block
copy = true copy = true
# the maximum number of lines of displayed code by default # the maximum number of lines of displayed code by default
maxShownLines = 50 maxShownLines = 50
# LoveIt NEW | 0.2.0 Mapbox GL JS config # Mapbox GL JS config
[params.page.mapbox] [params.page.mapbox]
# access token of Mapbox GL JS # access token of Mapbox GL JS
accessToken = "" accessToken = ""
# style for the light theme # style for the light theme
lightStyle = "mapbox://styles/mapbox/light-v9" lightStyle = "mapbox://styles/mapbox/light-v10?optimize=true"
# style for the dark theme # style for the dark theme
darkStyle = "mapbox://styles/mapbox/dark-v9" darkStyle = "mapbox://styles/mapbox/dark-v10?optimize=true"
# whether to add NavigationControl # whether to add NavigationControl
navigation = true navigation = true
# whether to add GeolocateControl # whether to add GeolocateControl
@ -244,16 +346,16 @@ theme = 'LoveIt'
scale = true scale = true
# whether to add FullscreenControl # whether to add FullscreenControl
fullscreen = true fullscreen = true
# LoveIt CHANGED | 0.2.0 social share links in post page # social share links in post page
[params.page.share] [params.page.share]
enable = false enable = false
Twitter = false Twitter = true
Facebook = true Facebook = true
Linkedin = false Linkedin = false
Whatsapp = true Whatsapp = false
Pinterest = false Pinterest = false
Tumblr = false Tumblr = false
HackerNews = false HackerNews = true
Reddit = false Reddit = false
VK = false VK = false
Buffer = false Buffer = false
@ -261,31 +363,27 @@ theme = 'LoveIt'
Line = true Line = true
Instapaper = false Instapaper = false
Pocket = false Pocket = false
Digg = false
Stumbleupon = false
Flipboard = false Flipboard = false
Weibo = true Weibo = true
Renren = false Blogger = false
Myspace = true
Blogger = true
Baidu = false Baidu = false
Odnoklassniki = false Odnoklassniki = false
Evernote = true Evernote = false
Skype = false Skype = false
Trello = false Trello = false
Mix = false Mix = false
# LoveIt CHANGED | 0.2.0 Comment config # Comment config
[params.page.comment] [params.page.comment]
enable = false enable = false
# Disqus comment config # Disqus comment config
[params.page.comment.disqus] [params.page.comment.disqus]
# LoveIt NEW | 0.1.1 #
enable = false enable = false
# Disqus shortname to use Disqus in posts # Disqus shortname to use Disqus in posts
shortname = "" shortname = ""
# Gitalk comment config # Gitalk comment config
[params.page.comment.gitalk] [params.page.comment.gitalk]
# LoveIt NEW | 0.1.1 #
enable = false enable = false
owner = "" owner = ""
repo = "" repo = ""
@ -300,17 +398,18 @@ theme = 'LoveIt'
avatar = "mp" avatar = "mp"
meta= "" meta= ""
pageSize = 10 pageSize = 10
# automatically adapt the current theme i18n configuration when empty
lang = "" lang = ""
visitor = true visitor = true
recordIP = true recordIP = true
highlight = true highlight = true
enableQQ = false enableQQ = false
serverURLs = "" serverURLs = ""
# LoveIt NEW | 0.2.6 emoji data file name, default is "google.yml" # emoji data file name, default is "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# located in "themes/LoveIt/assets/data/emoji/" directory # located in "themes/LoveIt/assets/lib/valine/emoji/" directory
# you can store your own data files in the same path under your project: # you can store your own data files in the same path under your project:
# "assets/data/emoji/" # "assets/lib/valine/emoji/"
emoji = "" emoji = ""
# Facebook comment config # Facebook comment config
[params.page.comment.facebook] [params.page.comment.facebook]
@ -318,8 +417,9 @@ theme = 'LoveIt'
width = "100%" width = "100%"
numPosts = 10 numPosts = 10
appId = "" appId = ""
# automatically adapt the current theme i18n configuration when empty
languageCode = "" languageCode = ""
# LoveIt NEW | 0.2.0 Telegram comments config # Telegram comments config
[params.page.comment.telegram] [params.page.comment.telegram]
enable = false enable = false
siteID = "" siteID = ""
@ -329,10 +429,10 @@ theme = 'LoveIt'
colorful = true colorful = true
dislikes = false dislikes = false
outlined = false outlined = false
# LoveIt NEW | 0.2.0 Commento comment config # Commento comment config
[params.page.comment.commento] [params.page.comment.commento]
enable = false enable = false
# LoveIt NEW | 0.2.5 Utterances comment config # utterances comment config
[params.page.comment.utterances] [params.page.comment.utterances]
enable = false enable = false
# owner/repo # owner/repo
@ -341,7 +441,24 @@ theme = 'LoveIt'
label = "" label = ""
lightTheme = "github-light" lightTheme = "github-light"
darkTheme = "github-dark" darkTheme = "github-dark"
# LoveIt NEW | 0.2.7 Third-party library config # giscus comment config (https://giscus.app/)
[params.page.comment.giscus]
# You can refer to the official documentation of giscus to use the following configuration.
enable = false
repo = ""
repoId = ""
category = "Announcements"
categoryId = ""
# automatically adapt the current theme i18n configuration when empty
lang = ""
mapping = "pathname"
reactionsEnabled = "1"
emitMetadata = "0"
inputPosition = "bottom"
lazyLoading = false
lightTheme = "light"
darkTheme = "dark"
# Third-party library config
[params.page.library] [params.page.library]
[params.page.library.css] [params.page.library.css]
# someCSS = "some.css" # someCSS = "some.css"
@ -353,7 +470,7 @@ theme = 'LoveIt'
# located in "assets/" # located in "assets/"
# Or # Or
# someJavascript = "https://cdn.example.com/some.js" # someJavascript = "https://cdn.example.com/some.js"
# LoveIt CHANGED | 0.2.10 Page SEO config # Page SEO config
[params.page.seo] [params.page.seo]
# image URL # image URL
images = [] images = []
@ -362,7 +479,7 @@ theme = 'LoveIt'
name = "" name = ""
logoUrl = "" logoUrl = ""
# LoveIt NEW | 0.2.5 TypeIt config # TypeIt config
[params.typeit] [params.typeit]
# typing speed between each step (measured in milliseconds) # typing speed between each step (measured in milliseconds)
speed = 100 speed = 100
@ -381,14 +498,14 @@ theme = 'LoveIt'
pinterest = "" pinterest = ""
baidu = "" baidu = ""
# LoveIt NEW | 0.2.10 Site SEO config # Site SEO config
[params.seo] [params.seo]
# image URL # image URL
image = "" image = ""
# thumbnail URL # thumbnail URL
thumbnailUrl = "" thumbnailUrl = ""
# LoveIt NEW | 0.2.0 Analytics config # Analytics config
[params.analytics] [params.analytics]
enable = false enable = false
# Google Analytics # Google Analytics
@ -401,26 +518,32 @@ theme = 'LoveIt'
id = "" id = ""
# server url for your tracker if you're self hosting # server url for your tracker if you're self hosting
server = "" server = ""
# Plausible Analytics
[params.analytics.plausible]
dataDomain = ""
# Yandex Metrica
[params.analytics.yandexMetrica]
id = ""
# LoveIt NEW | 0.2.7 Cookie consent config # Cookie consent config
[params.cookieconsent] [params.cookieconsent]
enable = false enable = true
# text strings used for Cookie consent banner # text strings used for Cookie consent banner
[params.cookieconsent.content] [params.cookieconsent.content]
message = "" message = ""
dismiss = "" dismiss = ""
link = "" link = ""
# LoveIt CHANGED | 0.2.7 CDN config for third-party library files # CDN config for third-party library files
[params.cdn] [params.cdn]
# CDN data file name, disabled by default # CDN data file name, disabled by default
# ("jsdelivr.yml") # ["jsdelivr.yml"]
# located in "themes/LoveIt/assets/data/cdn/" directory # located in "themes/LoveIt/assets/data/cdn/" directory
# you can store your own data files in the same path under your project: # you can store your own data files in the same path under your project:
# "assets/data/cdn/" # "assets/data/cdn/"
data = "" data = ""
# LoveIt NEW | 0.2.8 Compatibility config # Compatibility config
[params.compatibility] [params.compatibility]
# whether to use Polyfill.io to be compatible with older browsers # whether to use Polyfill.io to be compatible with older browsers
polyfill = false polyfill = false
@ -456,12 +579,6 @@ theme = 'LoveIt'
startLevel = 2 startLevel = 2
endLevel = 6 endLevel = 6
# Author config
[author]
name = "idanoo"
email = "daniel@m2.nz"
link = "https://m2.nz"
# Sitemap config # Sitemap config
[sitemap] [sitemap]
changefreq = "weekly" changefreq = "weekly"
@ -475,7 +592,7 @@ theme = 'LoveIt'
# Privacy config # Privacy config
[privacy] [privacy]
# LoveIt DELETED | 0.2.0 privacy of the Google Analytics (replaced by params.analytics.google) # privacy of the Google Analytics (replaced by params.analytics.google)
[privacy.googleAnalytics] [privacy.googleAnalytics]
# ... # ...
[privacy.twitter] [privacy.twitter]
@ -496,10 +613,9 @@ theme = 'LoveIt'
# Options to make hugo output files # Options to make hugo output files
[outputs] [outputs]
# LoveIt CHANGED | 0.2.0 #
home = ["HTML", "RSS", "JSON"] home = ["HTML", "RSS", "JSON"]
page = ["HTML", "MarkDown"] page = ["HTML", "MarkDown"]
section = ["HTML", "RSS"] section = ["HTML", "RSS"]
taxonomy = ["HTML", "RSS"] taxonomy = ["HTML", "RSS"]
taxonomyTerm = ["HTML"] taxonomyTerm = ["HTML"]

View file

@ -1,8 +1,8 @@
--- ---
title: "Configuring an APRS receiver with an RTL-SDR and Direwolf" title: "Configuring an APRS receiver with an RTL-SDR and Direwolf"
tags: ["aprs", "amateur radio", "direwolf"] tags: ["aprs", "amateur radio", "direwolf"]
date: "2021-12-16" date: 2021-12-16
featuredimagepreview: "/aprs.jpg" # featuredimagepreview: "/aprs.jpg"
--- ---
What is APRS? Automatic Packet Reporting System! Essentially a VHF radio sending out GPS location pings in the 2M ham band which can be seen at [aprs.fi](https://aprs.fi/). If you take a look at that link you will often see radiosondes and their reported data, weather stations as well as bunch of amateur operators transmitting data all over the world. Fascinating stuff. What is APRS? Automatic Packet Reporting System! Essentially a VHF radio sending out GPS location pings in the 2M ham band which can be seen at [aprs.fi](https://aprs.fi/). If you take a look at that link you will often see radiosondes and their reported data, weather stations as well as bunch of amateur operators transmitting data all over the world. Fascinating stuff.

View file

@ -1,8 +1,8 @@
--- ---
title: "Expanding OpnSense root disk (21.7+)" title: "Expanding OpnSense root disk (21.7+)"
tags: ["opnsense", "disk"] tags: ["opnsense", "disk"]
date: "2024-01-13" date: 2024-01-13
featuredimagepreview: "/opnsense_expand.jpg" # featuredimagepreview: "/opnsense_expand.jpg"
--- ---
Expanding root partition on OpnSense VM Expanding root partition on OpnSense VM

View file

@ -0,0 +1,38 @@
---
title: "Nginx stable install on debian/ubuntu from official repos"
tags: ["nginx", "debian", "ubuntu"]
date: 2025-02-22
---
A lot of the time, intsalling nginx from ubuntu/debian repositories is out of date and sometimes we just want the latest version :shrug:.
First up we want to install all required software and pull the latest signing key.
**Run the following commands as the root user**
```shell
apt install -y curl gnupg2 ca-certificates lsb-release debian-archive-keyring
curl -s https://nginx.org/keys/nginx_signing.key | gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg
```
The next step will vary depending on if you are using debian or ubuntu.
**Debian:**
```shell
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
http://nginx.org/packages/debian `lsb_release -cs` nginx" \
| tee /etc/apt/sources.list.d/nginx.list
```
**Ubuntu:**
```shell
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
| tee /etc/apt/sources.list.d/nginx.list
```
Once we have the packages && keyring setup, it's time to install:
```shell
apt update && apt install -y nginx
```
Keep in mind, the latest version will have the vhosts configured under `/etc/nginx/conf.d` instead of the legacy `sites-enabled` folder.

View file

@ -1,8 +1,8 @@
--- ---
title: "Mastodon.nz and the recent twitter influx" title: "Mastodon.nz and the recent twitter influx"
tags: ["mastodon", "twitter", "self hosting"] tags: ["mastodon", "twitter", "self hosting"]
date: "2022-05-09" date: 2022-05-09
featuredimagepreview: "/server1.jpg" # featuredimagepreview: "/server1.jpg"
--- ---
Where to begin.. It's been an interesting fortnight! Where to begin.. It's been an interesting fortnight!

View file

@ -1,7 +1,7 @@
--- ---
title: "GeoIP blocking countries using Nginx" title: "GeoIP blocking countries using Nginx"
tags: ["nginx", "geoip", "spam", "geo block"] tags: ["nginx", "geoip", "spam", "geo block"]
date: "2024-04-06" date: 2024-04-06
--- ---
Quick and easy way to block entire countries using simple nginx rules. Quick and easy way to block entire countries using simple nginx rules.

View file

@ -1,8 +1,8 @@
--- ---
title: "Recovering from a root 'rm' and why you need backups" title: "Recovering from a root 'rm' and why you need backups"
tags: ["recovery", "backup", "proxmox"] tags: ["recovery", "backup", "proxmox"]
date: "2021-02-06" date: 2021-02-06
featuredimagepreview: "/proxmox.jpg" # featuredimagepreview: "/proxmox.jpg"
--- ---
Last week I was finally getting around to fixing my backup tooling and validating the recovery procedures. I thought it would be a good idea to have rolling nightly backups on a secondary ZFS pool with weekly syncs to an external disk. I ended up using this exact command to purge the rolling backups: Last week I was finally getting around to fixing my backup tooling and validating the recovery procedures. I thought it would be a good idea to have rolling nightly backups on a secondary ZFS pool with weekly syncs to an external disk. I ended up using this exact command to purge the rolling backups:

View file

@ -1,8 +1,8 @@
--- ---
title: "iCloud synced SSH configs on macOS" title: "iCloud synced SSH configs on macOS"
tags: ["syncing", "config", "ssh"] tags: ["syncing", "config", "ssh"]
date: "2023-08-17" date: 2023-08-17
featuredimagepreview: "/cathacker1.jpg" # featuredimagepreview: "/cathacker1.jpg"
--- ---
Maintaining SSH configs can be a pain when you're hopping between multiple devices, even more when syncing apps (Synology/NextCloud/etc) are blocked on some networks/devices. Maintaining SSH configs can be a pain when you're hopping between multiple devices, even more when syncing apps (Synology/NextCloud/etc) are blocked on some networks/devices.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View file

@ -3,7 +3,7 @@
[ [
"@babel/preset-env", "@babel/preset-env",
{ {
"targets": "> 0.25%, not dead" "targets": "> 0.01%"
} }
] ]
] ]

View file

@ -1,17 +1,37 @@
version: 2.1 version: 2.1
executors:
hugo:
parameters:
version:
description: "version tag"
type: string
docker:
- image: cibuilds/hugo:<<parameters.version>>
jobs: jobs:
build-check: build-check:
docker: parameters:
- image: cibuilds/hugo:0.62 version:
description: "version tag"
type: string
executor:
name: hugo
version: <<parameters.version>>
working_directory: ~/LoveIt working_directory: ~/LoveIt
steps: steps:
- checkout - checkout
- run: git submodule sync - run: git submodule sync
- run: git submodule update --init - run: git submodule update --init
- run: hugo --source=exampleSite -v --gc - run: hugo --source exampleSite --gc --minify --environment production
- run: htmlproofer exampleSite/public --check-html --allow-hash-href --empty-alt-ignore --disable-external - run: htmlproofer exampleSite/public --disable-external true --ignore-missing-alt true
workflows: workflows:
build-check-exampleSite: build-check:
jobs: jobs:
- build-check - build-check:
name: build-check-min
version: 0.128.0
- build-check:
name: build-check-max
version: 0.144.2

View file

@ -1,4 +1,4 @@
#!/bin/zsh #!/bin/zsh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
npm run build && npm run copy && git add resources assets/js npm run compile && npm run compile-lunr-segmentit && npm run hugo-production && npm run copy-resources && git add resources assets

View file

@ -1,9 +1,9 @@
# LoveIt Theme | Hugo [![Netlify Status](https://api.netlify.com/api/v1/badges/e60303f2-862c-4342-bf59-7c9adb10812e/deploy-status)](https://app.netlify.com/sites/hugo-loveit/deploys) # LoveIt Theme | Hugo
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.62.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/) [![Hugo](https://img.shields.io/badge/Hugo-%5E0.128.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) [![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dillonzq_LoveIt&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dillonzq_LoveIt) [![Netlify Status](https://api.netlify.com/api/v1/badges/e60303f2-862c-4342-bf59-7c9adb10812e/deploy-status)](https://app.netlify.com/sites/hugo-loveit/deploys)
[![CircleCI](https://circleci.com/gh/dillonzq/LoveIt/tree/master.svg?style=svg)](https://circleci.com/gh/dillonzq/LoveIt/tree/master) [![CircleCI](https://circleci.com/gh/dillonzq/LoveIt/tree/master.svg?style=svg)](https://circleci.com/gh/dillonzq/LoveIt/tree/master)
English README | [简体中文说明](https://github.com/dillonzq/LoveIt/blob/master/README.zh-cn.md) English README | [简体中文说明](https://github.com/dillonzq/LoveIt/blob/master/README.zh-cn.md)
@ -85,7 +85,7 @@ I hope you will LoveIt ❤️!
* **Gravatar** supported by [Gravatar](https://gravatar.com) * **Gravatar** supported by [Gravatar](https://gravatar.com)
* Local **Avatar** supported * Local **Avatar** supported
* Up to **73** social links supported * Up to **76** social links supported
* Up to **24** share sites supported * Up to **24** share sites supported
* **Disqus** comment system supported by [Disqus](https://disqus.com) * **Disqus** comment system supported by [Disqus](https://disqus.com)
* **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk) * **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk)
@ -137,7 +137,7 @@ LoveIt supports the following languages:
* Traditional Chinese * Traditional Chinese
* French * French
* Polish * Polish
* Brazilian Portuguese * Portuguese (Brazil)
* Italian * Italian
* Spanish * Spanish
* German * German
@ -153,6 +153,8 @@ LoveIt supports the following languages:
* Turkish * Turkish
* Korean * Korean
* Hindi * Hindi
* Dutch
* Bengali
* [Contribute with a new language](https://github.com/dillonzq/LoveIt/pulls) * [Contribute with a new language](https://github.com/dillonzq/LoveIt/pulls)
[Languages Compatibility](https://hugoloveit.com/theme-documentation-basics/#language-compatibility) [Languages Compatibility](https://hugoloveit.com/theme-documentation-basics/#language-compatibility)

View file

@ -1,9 +1,9 @@
# LoveIt 主题 | Hugo [![Netlify Status](https://api.netlify.com/api/v1/badges/e60303f2-862c-4342-bf59-7c9adb10812e/deploy-status)](https://app.netlify.com/sites/hugo-loveit/deploys) # LoveIt 主题 | Hugo
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.62.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/) [![Hugo](https://img.shields.io/badge/Hugo-%5E0.128.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) [![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dillonzq_LoveIt&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dillonzq_LoveIt) [![Netlify Status](https://api.netlify.com/api/v1/badges/e60303f2-862c-4342-bf59-7c9adb10812e/deploy-status)](https://app.netlify.com/sites/hugo-loveit/deploys)
[![CircleCI](https://circleci.com/gh/dillonzq/LoveIt/tree/master.svg?style=svg)](https://circleci.com/gh/dillonzq/LoveIt/tree/master) [![CircleCI](https://circleci.com/gh/dillonzq/LoveIt/tree/master.svg?style=svg)](https://circleci.com/gh/dillonzq/LoveIt/tree/master)
[English README](https://github.com/dillonzq/LoveIt/blob/master/README.md) | 简体中文说明 [English README](https://github.com/dillonzq/LoveIt/blob/master/README.md) | 简体中文说明
@ -62,7 +62,7 @@
* 支持 **[Fathom Analytics](https://usefathom.com/)** * 支持 **[Fathom Analytics](https://usefathom.com/)**
* 支持 **[Plausible Analytics](https://plausible.io/)** * 支持 **[Plausible Analytics](https://plausible.io/)**
* 支持 **[Yandex Metrica](https://metrica.yandex.com/)** * 支持 **[Yandex Metrica](https://metrica.yandex.com/)**
* 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu) * 支持搜索引擎的**网站验证** (Google, Bind, Yandex Baidu)
* 支持所有第三方库的 **CDN** * 支持所有第三方库的 **CDN**
* 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载** * 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
@ -80,7 +80,7 @@
* 支持 **[Gravatar](https://gravatar.com)** 头像 * 支持 **[Gravatar](https://gravatar.com)** 头像
* 支持本地**头像** * 支持本地**头像**
* 支持多达 **73** 种社交链接 * 支持多达 **76** 种社交链接
* 支持多达 **24** 种网站分享 * 支持多达 **24** 种网站分享
* 支持 **[Disqus](https://disqus.com)** 评论系统 * 支持 **[Disqus](https://disqus.com)** 评论系统
* 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统 * 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统
@ -132,7 +132,7 @@ LoveIt 支持下列语言:
* 繁体中文 * 繁体中文
* 法语 * 法语
* 波兰语 * 波兰语
* 巴西葡萄牙语 * 葡萄牙语(巴西)
* 意大利语 * 意大利语
* 西班牙语 * 西班牙语
* 德语 * 德语
@ -148,6 +148,8 @@ LoveIt 支持下列语言:
* 土耳其语 * 土耳其语
* 韩语 * 韩语
* 印地语 * 印地语
* 荷兰语
* 孟加拉语
* [贡献一种新的语言](https://github.com/dillonzq/LoveIt/pulls) * [贡献一种新的语言](https://github.com/dillonzq/LoveIt/pulls)
[语言兼容性](https://hugoloveit.com/zh-cn/theme-documentation-basics/#language-compatibility) [语言兼容性](https://hugoloveit.com/zh-cn/theme-documentation-basics/#language-compatibility)

View file

@ -29,6 +29,7 @@ rssFullText: false
toc: toc:
enable: true enable: true
auto: true auto: true
keepStatic: false
code: code:
copy: true copy: true
maxShownLines: 50 maxShownLines: 50

View file

@ -328,7 +328,7 @@ header {
&.open { &.open {
.header-wrapper { .header-wrapper {
margin-top: -var(--header-height); margin-top: calc(0px - var(--header-height));
} }
.menu { .menu {

View file

@ -1,10 +1,16 @@
@media only screen and (max-width: 1440px) {
.page {
width: 60%;
}
}
@media only screen and (max-width: 1440px) { @media only screen and (max-width: 1440px) {
.page { .page {
width: 56%; width: 56%;
} }
} }
@media only screen and (max-width: 1200px) { @media only screen and (max-width: 1280px) {
.page { .page {
width: 52%; width: 52%;
} }

View file

@ -1,4 +1,6 @@
.home { .home {
padding-bottom: 5rem;
.home-profile { .home-profile {
@include transform(translateY( 16vh)); @include transform(translateY( 16vh));
padding: 0 0 .5rem; padding: 0 0 .5rem;

View file

@ -1,7 +1,7 @@
.page { .page {
position: relative; position: relative;
max-width: 800px; max-width: 1080px;
width: 60%; width: 64%;
margin: 0 auto; margin: 0 auto;
[data-header-desktop] & { [data-header-desktop] & {

View file

@ -167,7 +167,13 @@
} }
} }
.table-wrapper { table {
width: 100%;
max-width: 100%;
margin: .625rem 0;
border-spacing: 0;
background: $table-background-color;
border-collapse: collapse;
overflow-x: auto; overflow-x: auto;
&::-webkit-scrollbar { &::-webkit-scrollbar {
@ -178,14 +184,6 @@
} }
} }
> table {
width: 100%;
max-width: 100%;
margin: .625rem 0;
border-spacing: 0;
background: $table-background-color;
border-collapse: collapse;
[theme=dark] & { [theme=dark] & {
background: $table-background-color-dark; background: $table-background-color-dark;
} }
@ -207,11 +205,11 @@
} }
} }
} }
}
img { img {
max-width: 100%; max-width: 100%;
min-height: 1em; min-height: 1em;
height: auto;
} }
figure { figure {
@ -263,6 +261,7 @@
} }
@import "../_partial/_single/code"; @import "../_partial/_single/code";
@import "../_partial/_single/gist";
@import "../_partial/_single/instagram"; @import "../_partial/_single/instagram";
@import "../_partial/_single/admonition"; @import "../_partial/_single/admonition";
@import "../_partial/_single/echarts"; @import "../_partial/_single/echarts";
@ -312,7 +311,7 @@
img { img {
vertical-align: -12%; vertical-align: -12%;
max-height: 1.1em; max-height: 1.1em;
margin-right: 0ex; margin-right: 0;
border-radius: 50%; border-radius: 50%;
} }
} }

View file

@ -2,11 +2,16 @@
display: none; display: none;
} }
.fixed-button { #fixed-buttons-hidden {
display: none; display: none;
}
.fixed-button {
display: block;
z-index: 100; z-index: 100;
position: fixed; position: fixed;
right: 1.5rem; right: 1.5rem;
bottom: 1.5rem;
font-size: 1rem; font-size: 1rem;
line-height: 1.3rem; line-height: 1.3rem;
padding: .6rem .6rem; padding: .6rem .6rem;
@ -34,13 +39,16 @@
color: $global-font-color-dark; color: $global-font-color-dark;
} }
} }
}
#back-to-top { &:nth-last-of-type(1) {
display: block;
bottom: 1.5rem; bottom: 1.5rem;
} }
#view-comments { &:nth-last-of-type(2) {
bottom: 4.5rem; bottom: 4.5rem;
} }
&:nth-last-of-type(3) {
bottom: 7.5rem;
}
}

View file

@ -15,7 +15,7 @@ code {
pre { pre {
margin: 0; margin: 0;
padding: .25rem 0 .25rem .5rem; padding: 8px;
@include tab-size(4); @include tab-size(4);
code { code {
@ -29,38 +29,18 @@ pre {
} }
} }
code, pre, .highlight table, .highlight tr, .highlight td { code, pre {
background: $code-background-color !important; background: $code-background-color;
[theme=dark] & { [theme=dark] & {
background: $code-background-color-dark !important; background: $code-background-color-dark;
} }
} }
.highlight { .code-block {
font-family: var(--code-font-family);
font-size: var(--code-font-size);
line-height: 1.4em; line-height: 1.4em;
margin: .5rem 0; margin: .5rem 0;
.table-wrapper {
> table,
> table thead,
> table tr,
> table td {
margin: 0;
padding: 0;
border: none !important;
span.c {
white-space: nowrap;
}
}
}
> .chroma {
position: relative;
.code-header { .code-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -96,41 +76,6 @@ code, pre, .highlight table, .highlight tr, .highlight td {
content: $text; content: $text;
} }
} }
}
.lntd:first-child {
min-width: 1.6rem;
text-align: right;
}
.lntd:last-child {
width: 100%;
pre {
@include max-content(min-width);
}
}
.ln {
padding-right: .75rem;
}
.hl {
display: block;
background-color: darken($code-background-color, 10%);
[theme=dark] & {
background-color: darken($code-background-color-dark, 5%);
}
}
.ln, .lnt {
color: $global-font-secondary-color;
[theme=dark] & {
color: $global-font-secondary-color-dark;
}
}
.arrow { .arrow {
padding: 0 .2rem; padding: 0 .2rem;
@ -154,11 +99,49 @@ code, pre, .highlight table, .highlight tr, .highlight td {
} }
} }
} }
}
.table-wrapper { .highlight {
position: relative;
max-height: 0; max-height: 0;
overflow-y: hidden; overflow-y: hidden;
@include details-transition-open; @include details-transition-open;
background: $code-background-color;
[theme=dark] & {
background: $code-background-color-dark;
}
.hl {
background-color: darken($code-background-color, 10%);
[theme=dark] & {
background-color: darken($code-background-color-dark, 5%);
}
}
.c, /* Comment */
.ch /* CommentHashbang */,
.cm /* CommentMultiline */,
.c1 /* CommentSingle */,
.cs /* CommentSpecial */,
.cp /* CommentPreproc */,
.cpf /* CommentPreprocFile */ {
font-style: italic
}
.gl /* GenericUnderline */ {
text-decoration: underline
}
@each $class, $color in $code-highlight-color-map {
.#{$class} { color: $color; }
}
[theme=dark] & {
@each $class, $color in $code-highlight-color-map-dark {
.#{$class} { color: $color; }
}
}
} }
&.open { &.open {
@ -168,12 +151,6 @@ code, pre, .highlight table, .highlight tr, .highlight td {
[theme=dark] & { [theme=dark] & {
background: darken($code-background-color-dark, 3%); background: darken($code-background-color-dark, 3%);
} }
}
.table-wrapper {
max-height: 10000px;
@include details-transition-close;
}
.arrow { .arrow {
@include transform(rotate(90deg)); @include transform(rotate(90deg));
@ -187,213 +164,29 @@ code, pre, .highlight table, .highlight tr, .highlight td {
display: inline; display: inline;
} }
} }
}
/* Comment */ .c,
/* CommentHashbang */ .ch,
/* CommentMultiline */ .cm,
/* CommentSingle */ .c1,
/* CommentSpecial */ .cs,
/* CommentPreproc */ .cp,
/* CommentPreprocFile */ .cpf { font-style: italic }
/* GenericUnderline */ .gl { text-decoration: underline }
@each $class, $color in $code-highlight-color-map {
.#{$class} { color: $color; }
}
[theme=dark] & {
@each $class, $color in $code-highlight-color-map-dark {
.#{$class} { color: $color; }
}
}
}
.gist {
font-family: var(--code-font-family);
font-size: var(--code-font-size);
.table-wrapper {
> table,
> table thead,
> table tr,
> table td {
margin: 0;
padding: 0;
border: none !important;
}
}
.gist-file, .gist-data, .gist-meta {
border: none;
}
.gist-meta {
padding: .4rem .8rem;
background-color: darken($code-background-color, 5%);
@include link(false, false);
[theme=dark] & {
background-color: darken($code-background-color-dark, 5%);
}
}
[theme=dark] & {
// imported from https://github.com/lonekorean/gist-syntax-themes/blob/master/stylesheets/one-dark.css
.highlight { .highlight {
background: #141414; max-height: 10000px;
@include details-transition-close;
} }
.blob-num,
.blob-code-inner,
.highlight,
.pl-enm,
.pl-ko,
.pl-mo,
.pl-mp1 .pl-sf,
.pl-ms,
.pl-pdc1,
.pl-scp,
.pl-smc,
.pl-som,
.pl-va,
.pl-vpf,
.pl-vpu,
.pl-mdr {
color: #aab1bf;
} }
.pl-mb,
.pl-pdb { &.code-line-numbers {
font-weight: 700; span.line::before {
} display: inline-block;
.pl-c, counter-increment: code-block;
.pl-c span, content: counter(code-block);
.pl-pdc { min-width: 4ch;
color: #5b6270; text-align: right;
font-style: italic; text-wrap: nowrap;
} box-sizing: border-box;
.pl-sr .pl-cce { border-width: 0;
color: #56b5c2; margin-right: 1rem;
font-weight: 400; color: $code-info-color;
}
.pl-ef, [theme=dark] & {
.pl-en, color: $code-info-color-dark;
.pl-enf, }
.pl-eoai,
.pl-kos,
.pl-mh .pl-pdh,
.pl-mr {
color: #61afef;
}
.pl-ens,
.pl-vi {
color: #be5046;
}
.pl-enti,
.pl-mai .pl-sf,
.pl-ml,
.pl-sf,
.pl-sr,
.pl-sr .pl-sra,
.pl-src,
.pl-st,
.pl-vo {
color: #56b5c2;
}
.pl-eoi,
.pl-mri,
.pl-pds,
.pl-pse .pl-s1,
.pl-s,
.pl-s1 {
color: #97c279;
}
.pl-k,
.pl-kolp,
.pl-mc,
.pl-pde {
color: #c578dd;
}
.pl-mi,
.pl-pdi {
color: #c578dd;
font-style: italic;
}
.pl-mp,
.pl-stp {
color: #818896;
}
.pl-mdh,
.pl-mdi,
.pl-mdr {
font-weight: 400;
}
.pl-mdht,
.pl-mi1 {
color: #97c279;
background: #020;
}
.pl-md,
.pl-mdhf {
color: #df6b75;
background: #200;
}
.pl-corl {
color: #df6b75;
text-decoration: underline;
}
.pl-ib {
background: #df6b75;
}
.pl-ii {
background: #e0c184;
color: #fff;
}
.pl-iu {
background: #e05151;
}
.pl-ms1 {
color: #aab1bf;
background: #373b41;
}
.pl-c1,
.pl-cn,
.pl-e,
.pl-eoa,
.pl-eoac,
.pl-eoac .pl-pde,
.pl-kou,
.pl-mm,
.pl-mp .pl-s3,
.pl-mq,
.pl-s3,
.pl-sok,
.pl-sv,
.pl-mb {
color: #d19965;
}
.pl-enc,
.pl-entc,
.pl-pse .pl-s2,
.pl-s2,
.pl-sc,
.pl-smp,
.pl-sr .pl-sre,
.pl-stj,
.pl-v,
.pl-pdb {
color: #e4bf7a;
}
.pl-ent,
.pl-entl,
.pl-entm,
.pl-mh,
.pl-pdv,
.pl-smi,
.pl-sol,
.pl-mdh,
.pl-mdi {
color: #df6b75;
} }
} }
} }

View file

@ -0,0 +1,186 @@
.gist {
font-family: var(--code-font-family);
font-size: var(--code-font-size);
table,
table thead,
table tr,
table td {
margin: 0;
padding: 0;
border: none;
}
.gist-file, .gist-data, .gist-meta {
border: none;
}
.gist-meta {
padding: .4rem .8rem;
background-color: darken($code-background-color, 5%);
@include link(false, false);
[theme=dark] & {
background-color: darken($code-background-color-dark, 5%);
}
}
[theme=dark] & {
// imported from https://github.com/lonekorean/gist-syntax-themes/blob/master/stylesheets/one-dark.css
.highlight {
background: #141414;
}
.blob-num,
.blob-code-inner,
.highlight,
.pl-enm,
.pl-ko,
.pl-mo,
.pl-mp1 .pl-sf,
.pl-ms,
.pl-pdc1,
.pl-scp,
.pl-smc,
.pl-som,
.pl-va,
.pl-vpf,
.pl-vpu,
.pl-mdr {
color: #aab1bf;
}
.pl-mb,
.pl-pdb {
font-weight: 700;
}
.pl-c,
.pl-c span,
.pl-pdc {
color: #5b6270;
font-style: italic;
}
.pl-sr .pl-cce {
color: #56b5c2;
font-weight: 400;
}
.pl-ef,
.pl-en,
.pl-enf,
.pl-eoai,
.pl-kos,
.pl-mh .pl-pdh,
.pl-mr {
color: #61afef;
}
.pl-ens,
.pl-vi {
color: #be5046;
}
.pl-enti,
.pl-mai .pl-sf,
.pl-ml,
.pl-sf,
.pl-sr,
.pl-sr .pl-sra,
.pl-src,
.pl-st,
.pl-vo {
color: #56b5c2;
}
.pl-eoi,
.pl-mri,
.pl-pds,
.pl-pse .pl-s1,
.pl-s,
.pl-s1 {
color: #97c279;
}
.pl-k,
.pl-kolp,
.pl-mc,
.pl-pde {
color: #c578dd;
}
.pl-mi,
.pl-pdi {
color: #c578dd;
font-style: italic;
}
.pl-mp,
.pl-stp {
color: #818896;
}
.pl-mdh,
.pl-mdi,
.pl-mdr {
font-weight: 400;
}
.pl-mdht,
.pl-mi1 {
color: #97c279;
background: #020;
}
.pl-md,
.pl-mdhf {
color: #df6b75;
background: #200;
}
.pl-corl {
color: #df6b75;
text-decoration: underline;
}
.pl-ib {
background: #df6b75;
}
.pl-ii {
background: #e0c184;
color: #fff;
}
.pl-iu {
background: #e05151;
}
.pl-ms1 {
color: #aab1bf;
background: #373b41;
}
.pl-c1,
.pl-cn,
.pl-e,
.pl-eoa,
.pl-eoac,
.pl-eoac .pl-pde,
.pl-kou,
.pl-mm,
.pl-mp .pl-s3,
.pl-mq,
.pl-s3,
.pl-sok,
.pl-sv,
.pl-mb {
color: #d19965;
}
.pl-enc,
.pl-entc,
.pl-pse .pl-s2,
.pl-s2,
.pl-sc,
.pl-smp,
.pl-sr .pl-sre,
.pl-stj,
.pl-v,
.pl-pdb {
color: #e4bf7a;
}
.pl-ent,
.pl-entl,
.pl-entm,
.pl-mh,
.pl-pdv,
.pl-smi,
.pl-sol,
.pl-mdh,
.pl-mdi {
color: #df6b75;
}
}
}

View file

@ -78,7 +78,7 @@ $search-background-color-dark: #363636 !default;
// ========== Single Content ========== // // ========== Single Content ========== //
// Font size of the TOC // Font size of the TOC
$toc-title-font-size: 1.2rem !default; $toc-title-font-size: 1.2rem !default;
$toc-content-font-size: 1rem !default; $toc-content-font-size: 0.875rem !default;
// Color of the single link // Color of the single link
$single-link-color: #2d96bd !default; $single-link-color: #2d96bd !default;
@ -163,6 +163,7 @@ $code-type-list:
"language-perl" "Perl", "language-perl" "Perl",
"language-powershell" "PowerShell", "language-powershell" "PowerShell",
"language-posh" "PowerShell", "language-posh" "PowerShell",
"language-puppet" "Puppet",
"language-pwsh" "PowerShell", "language-pwsh" "PowerShell",
"language-python" "Python", "language-python" "Python",
"language-r" "R", "language-r" "R",

View file

@ -11,8 +11,8 @@ libFiles:
autocompleteJS: autocomplete.js/0.38.1/autocomplete.min.js autocompleteJS: autocomplete.js/0.38.1/autocomplete.min.js
# lunr.js@2.3.9 https://lunrjs.com/ # lunr.js@2.3.9 https://lunrjs.com/
lunrJS: lunr.js/2.3.9/lunr.min.js lunrJS: lunr.js/2.3.9/lunr.min.js
# algoliasearch@4.13.1 https://github.com/algolia/algoliasearch-client-javascript # algoliasearch@5.19.0 https://github.com/algolia/algoliasearch-client-javascript
algoliasearchJS: algoliasearch/4.13.1/algoliasearch-lite.umd.min.js algoliasearchJS: algoliasearch/5.19.0/lite/builds/browser.umd.min.js
# lazysizes@5.3.2 https://github.com/aFarkas/lazysizes # lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
lazysizesJS: lazysizes/5.3.2/lazysizes.min.js lazysizesJS: lazysizes/5.3.2/lazysizes.min.js
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images # object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
@ -43,12 +43,12 @@ libFiles:
mapboxGLJS: mapbox-gl/2.9.1/mapbox-gl.min.js mapboxGLJS: mapbox-gl/2.9.1/mapbox-gl.min.js
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer # aplayer@1.10.1 https://github.com/MoePlayer/APlayer
aplayerCSS: aplayer/1.10.1/APlayer.min.css aplayerCSS: aplayer/1.10.1/APlayer.min.css
aplayerJS: aplayer/1.10.1/APlayer.min.js #aplayerJS: aplayer/1.10.1/APlayer.min.js
# gitalk@1.7.2 https://github.com/gitalk/gitalk # gitalk@1.7.2 https://github.com/gitalk/gitalk
gitalkCSS: gitalk/1.7.2/gitalk.min.css gitalkCSS: gitalk/1.7.2/gitalk.min.css
gitalkJS: gitalk/1.7.2/gitalk.min.js gitalkJS: gitalk/1.7.2/gitalk.min.js
# valine@1.5.0 https://valine.js.org/ # valine@1.5.3 https://valine.js.org/
valineJS: valine/1.5.0/Valine.min.js valineJS: valine/1.5.3/Valine.min.js
# cookieconsent@3.1.1 https://github.com/osano/cookieconsent # cookieconsent@3.1.1 https://github.com/osano/cookieconsent
cookieconsentCSS: cookieconsent/3.1.1/cookieconsent.min.css cookieconsentCSS: cookieconsent/3.1.1/cookieconsent.min.css
cookieconsentJS: cookieconsent/3.1.1/cookieconsent.min.js cookieconsentJS: cookieconsent/3.1.1/cookieconsent.min.js

View file

@ -11,8 +11,8 @@ libFiles:
autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js
# lunr.js@2.3.9 https://lunrjs.com/ # lunr.js@2.3.9 https://lunrjs.com/
lunrJS: lunr@2.3.9/lunr.min.js lunrJS: lunr@2.3.9/lunr.min.js
# algoliasearch@4.13.1 https://github.com/algolia/algoliasearch-client-javascript # algoliasearch@5.20.2 https://github.com/algolia/algoliasearch-client-javascript
algoliasearchJS: algoliasearch@4.13.1/dist/algoliasearch-lite.umd.min.js algoliasearchJS: algoliasearch@5.20.2/dist/lite/builds/browser.umd.min.js
# lazysizes@5.3.2 https://github.com/aFarkas/lazysizes # lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
lazysizesJS: lazysizes@5.3.2/lazysizes.min.js lazysizesJS: lazysizes@5.3.2/lazysizes.min.js
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images # object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
@ -45,14 +45,14 @@ libFiles:
mapboxGLJS: mapbox-gl@2.9.1/dist/mapbox-gl.min.js mapboxGLJS: mapbox-gl@2.9.1/dist/mapbox-gl.min.js
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer # aplayer@1.10.1 https://github.com/MoePlayer/APlayer
aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css
aplayerJS: aplayer@1.10.1/dist/APlayer.min.js #aplayerJS: aplayer@1.10.1/dist/APlayer.min.js
# meting@2.0.1 https://github.com/metowolf/MetingJS # meting@2.0.1 https://github.com/metowolf/MetingJS
metingJS: meting@2.0.1/dist/Meting.min.js metingJS: meting@2.0.1/dist/Meting.min.js
# gitalk@1.7.2 https://github.com/gitalk/gitalk # gitalk@1.7.2 https://github.com/gitalk/gitalk
gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css
gitalkJS: gitalk@1.7.2/dist/gitalk.min.js gitalkJS: gitalk@1.7.2/dist/gitalk.min.js
# valine@1.5.0 https://valine.js.org/ # valine@1.5.3 https://valine.js.org/
valineJS: valine@1.5.0/dist/Valine.min.js valineJS: valine@1.5.3/dist/Valine.min.js
# cookieconsent@3.1.1 https://github.com/osano/cookieconsent # cookieconsent@3.1.1 https://github.com/osano/cookieconsent
cookieconsentCSS: cookieconsent@3.1.1/build/cookieconsent.min.css cookieconsentCSS: cookieconsent@3.1.1/build/cookieconsent.min.css
cookieconsentJS: cookieconsent@3.1.1/build/cookieconsent.min.js cookieconsentJS: cookieconsent@3.1.1/build/cookieconsent.min.js

View file

@ -49,7 +49,7 @@ telegram:
# 007: Medium # 007: Medium
medium: medium:
Weight: 7 Weight: 7
Prefix: https://medium.com/ Prefix: https://medium.com/@
Title: Medium Title: Medium
Icon: Icon:
Class: fab fa-medium fa-fw Class: fab fa-medium fa-fw
@ -569,13 +569,37 @@ rootme:
Icon: Icon:
Src: svg/icons/rootme.svg Src: svg/icons/rootme.svg
# 073: Pixelfed # 073: Malt
pixelfed: malt:
Weight: 73 Weight: 73
Title: Pixelfed Prefix: https://www.malt.fr/profile/
Newtab: true Title: Malt
Icon: Icon:
Class: fas fa-camera fa-fw Src: svg/icons/malt.svg
# 074: TikTok
tiktok:
Weight: 74
Url: https://www.tiktok.com/
Title: TikTok
Icon:
Simpleicons: tiktok
# 075: TryHackMe
tryhackme:
Weight: 75
Title: TryHackMe
Prefix: https://tryhackme.com/p/
Icon:
Simpleicons: Tryhackme
# 076: Codeberg
codeberg:
Weight: 76
Title: Codeberg
Prefix: https://codeberg.org/
Icon:
Simpleicons: codeberg
# Phone # Phone
phone: phone:

View file

@ -2,6 +2,14 @@
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); } function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@ -27,7 +35,7 @@ var Util = /*#__PURE__*/function () {
_classCallCheck(this, Util); _classCallCheck(this, Util);
} }
_createClass(Util, [{ _createClass(Util, null, [{
key: "forEach", key: "forEach",
value: function forEach(elements, handler) { value: function forEach(elements, handler) {
elements = elements || []; elements = elements || [];
@ -83,8 +91,7 @@ var Theme = /*#__PURE__*/function () {
this.config = window.config; this.config = window.config;
this.data = this.config.data; this.data = this.config.data;
this.isDark = document.body.getAttribute('theme') === 'dark'; this.isDark = document.body.getAttribute('theme') === 'dark';
this.util = new Util(); this.newScrollTop = Util.getScrollTop();
this.newScrollTop = this.util.getScrollTop();
this.oldScrollTop = this.newScrollTop; this.oldScrollTop = this.newScrollTop;
this.scrollEventSet = new Set(); this.scrollEventSet = new Set();
this.resizeEventSet = new Set(); this.resizeEventSet = new Set();
@ -98,14 +105,14 @@ var Theme = /*#__PURE__*/function () {
value: function initRaw() { value: function initRaw() {
var _this = this; var _this = this;
this.util.forEach(document.querySelectorAll('[data-raw]'), function ($raw) { Util.forEach(document.querySelectorAll('[data-raw]'), function ($raw) {
$raw.innerHTML = _this.data[$raw.id]; $raw.innerHTML = _this.data[$raw.id];
}); });
} }
}, { }, {
key: "initSVGIcon", key: "initSVGIcon",
value: function initSVGIcon() { value: function initSVGIcon() {
this.util.forEach(document.querySelectorAll('[data-svg-src]'), function ($icon) { Util.forEach(document.querySelectorAll('[data-svg-src]'), function ($icon) {
fetch($icon.getAttribute('data-svg-src')).then(function (response) { fetch($icon.getAttribute('data-svg-src')).then(function (response) {
return response.text(); return response.text();
}).then(function (svg) { }).then(function (svg) {
@ -150,7 +157,7 @@ var Theme = /*#__PURE__*/function () {
value: function initSwitchTheme() { value: function initSwitchTheme() {
var _this2 = this; var _this2 = this;
this.util.forEach(document.getElementsByClassName('theme-switch'), function ($themeSwitch) { Util.forEach(document.getElementsByClassName('theme-switch'), function ($themeSwitch) {
$themeSwitch.addEventListener('click', function () { $themeSwitch.addEventListener('click', function () {
if (document.body.getAttribute('theme') === 'dark') document.body.setAttribute('theme', 'light');else document.body.setAttribute('theme', 'dark'); if (document.body.getAttribute('theme') === 'dark') document.body.setAttribute('theme', 'light');else document.body.setAttribute('theme', 'dark');
_this2.isDark = !_this2.isDark; _this2.isDark = !_this2.isDark;
@ -178,7 +185,7 @@ var Theme = /*#__PURE__*/function () {
var _this3 = this; var _this3 = this;
var searchConfig = this.config.search; var searchConfig = this.config.search;
var isMobile = this.util.isMobile(); var isMobile = Util.isMobile();
if (!searchConfig || isMobile && this._searchMobileOnce || !isMobile && this._searchDesktopOnce) return; if (!searchConfig || isMobile && this._searchMobileOnce || !isMobile && this._searchDesktopOnce) return;
var maxResultLength = searchConfig.maxResultLength ? searchConfig.maxResultLength : 10; var maxResultLength = searchConfig.maxResultLength ? searchConfig.maxResultLength : 10;
var snippetLength = searchConfig.snippetLength ? searchConfig.snippetLength : 50; var snippetLength = searchConfig.snippetLength ? searchConfig.snippetLength : 50;
@ -291,10 +298,10 @@ var Theme = /*#__PURE__*/function () {
position -= snippetLength / 5; position -= snippetLength / 5;
if (position > 0) { if (position > 0) {
position += context.substr(position, 20).lastIndexOf(' ') + 1; position += context.slice(position, position + 20).lastIndexOf(' ') + 1;
context = '...' + context.substr(position, snippetLength); context = '...' + context.slice(position, position + snippetLength);
} else { } else {
context = context.substr(0, snippetLength); context = context.slice(0, snippetLength);
} }
Object.keys(metadata).forEach(function (key) { Object.keys(metadata).forEach(function (key) {
@ -349,17 +356,24 @@ var Theme = /*#__PURE__*/function () {
}); });
} else finish(search()); } else finish(search());
} else if (searchConfig.type === 'algolia') { } else if (searchConfig.type === 'algolia') {
_this3._algoliaIndex = _this3._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex); var algoliasearch = window['algoliasearch/lite'].liteClient;
_this3._algoliaIndex = _this3._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey);
_this3._algoliaIndex.search(query, { _this3._algoliaIndex.search({
requests: [{
indexName: searchConfig.algoliaIndex,
query: query,
offset: 0, offset: 0,
length: maxResultLength * 8, length: maxResultLength * 8,
attributesToHighlight: ['title'], attributesToHighlight: ['title'],
attributesToSnippet: ["content:".concat(snippetLength)], attributesToSnippet: ["content:".concat(snippetLength)],
highlightPreTag: "<".concat(highlightTag, ">"), highlightPreTag: "<".concat(highlightTag, ">"),
highlightPostTag: "</".concat(highlightTag, ">") highlightPostTag: "</".concat(highlightTag, ">")
}]
}).then(function (_ref3) { }).then(function (_ref3) {
var hits = _ref3.hits; var _ref3$results = _slicedToArray(_ref3.results, 1),
hits = _ref3$results[0].hits;
var results = {}; var results = {};
hits.forEach(function (_ref4) { hits.forEach(function (_ref4) {
var uri = _ref4.uri, var uri = _ref4.uri,
@ -427,7 +441,7 @@ var Theme = /*#__PURE__*/function () {
if (script.readyState) { if (script.readyState) {
script.onreadystatechange = function () { script.onreadystatechange = function () {
if (script.readyState == 'loaded' || script.readyState == 'complete') { if (script.readyState === 'loaded' || script.readyState === 'complete') {
script.onreadystatechange = null; script.onreadystatechange = null;
initAutosearch(); initAutosearch();
} }
@ -444,7 +458,7 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "initDetails", key: "initDetails",
value: function initDetails() { value: function initDetails() {
this.util.forEach(document.getElementsByClassName('details'), function ($details) { Util.forEach(document.getElementsByClassName('details'), function ($details) {
var $summary = $details.getElementsByClassName('details-summary')[0]; var $summary = $details.getElementsByClassName('details-summary')[0];
$summary.addEventListener('click', function () { $summary.addEventListener('click', function () {
$details.classList.toggle('open'); $details.classList.toggle('open');
@ -471,78 +485,45 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "initHighlight", key: "initHighlight",
value: function initHighlight() { value: function initHighlight() {
var _this5 = this; Util.forEach(document.querySelectorAll('.code-block'), function ($codeBlock) {
var $codeTitle = $codeBlock.querySelector('.code-header > .code-title');
this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), function ($preChroma) { if ($codeTitle) {
var $chroma = document.createElement('div'); $codeTitle.addEventListener('click', function () {
$chroma.className = $preChroma.className; $codeBlock.classList.toggle('open');
var $table = document.createElement('table');
$chroma.appendChild($table);
var $tbody = document.createElement('tbody');
$table.appendChild($tbody);
var $tr = document.createElement('tr');
$tbody.appendChild($tr);
var $td = document.createElement('td');
$tr.appendChild($td);
$preChroma.parentElement.replaceChild($chroma, $preChroma);
$td.appendChild($preChroma);
});
this.util.forEach(document.querySelectorAll('.highlight > .chroma'), function ($chroma) {
var $codeElements = $chroma.querySelectorAll('pre.chroma > code');
if ($codeElements.length) {
var $code = $codeElements[$codeElements.length - 1];
var $header = document.createElement('div');
$header.className = 'code-header ' + $code.className.toLowerCase();
var $title = document.createElement('span');
$title.classList.add('code-title');
$title.insertAdjacentHTML('afterbegin', '<i class="arrow fas fa-chevron-right fa-fw" aria-hidden="true"></i>');
$title.addEventListener('click', function () {
$chroma.classList.toggle('open');
}, false); }, false);
$header.appendChild($title); }
var $ellipses = document.createElement('span');
$ellipses.insertAdjacentHTML('afterbegin', '<i class="fas fa-ellipsis-h fa-fw" aria-hidden="true"></i>'); var $ellipses = $codeBlock.querySelector('.code-header .ellipses');
$ellipses.classList.add('ellipses');
if ($ellipses) {
$ellipses.addEventListener('click', function () { $ellipses.addEventListener('click', function () {
$chroma.classList.add('open'); $codeBlock.classList.toggle('open');
}, false); }, false);
$header.appendChild($ellipses); }
var $copy = document.createElement('span');
$copy.insertAdjacentHTML('afterbegin', '<i class="far fa-copy fa-fw" aria-hidden="true"></i>');
$copy.classList.add('copy');
var code = $code.innerText;
if (_this5.config.code.maxShownLines < 0 || code.split('\n').length < _this5.config.code.maxShownLines + 2) $chroma.classList.add('open');
if (_this5.config.code.copyTitle) { var $copy = $codeBlock.querySelector('.code-header .copy');
$copy.setAttribute('data-clipboard-text', code);
$copy.title = _this5.config.code.copyTitle; if ($copy) {
var $code = $codeBlock.querySelector('code');
$copy.setAttribute('data-clipboard-text', $code.innerText);
var clipboard = new ClipboardJS($copy); var clipboard = new ClipboardJS($copy);
var $codeLines = $code.querySelectorAll('span.cl');
clipboard.on('success', function (_e) { clipboard.on('success', function (_e) {
_this5.util.animateCSS($code, 'animate__flash'); if ($codeLines) {
Util.forEach($codeLines, function ($codeLine) {
return Util.animateCSS($codeLine, 'animate__flash');
}); });
$header.appendChild($copy);
}
$chroma.insertBefore($header, $chroma.firstChild);
} }
}); });
} }
}, {
key: "initTable",
value: function initTable() {
this.util.forEach(document.querySelectorAll('.content table'), function ($table) {
var $wrapper = document.createElement('div');
$wrapper.className = 'table-wrapper';
$table.parentElement.replaceChild($wrapper, $table);
$wrapper.appendChild($table);
}); });
} }
}, { }, {
key: "initHeaderLink", key: "initHeaderLink",
value: function initHeaderLink() { value: function initHeaderLink() {
for (var num = 1; num <= 6; num++) { for (var num = 1; num <= 6; num++) {
this.util.forEach(document.querySelectorAll('.single .content > h' + num), function ($header) { Util.forEach(document.querySelectorAll('.single .content > h' + num), function ($header) {
$header.classList.add('headerLink'); $header.classList.add('headerLink');
$header.insertAdjacentHTML('afterbegin', "<a href=\"#".concat($header.id, "\" class=\"header-mark\"></a>")); $header.insertAdjacentHTML('afterbegin', "<a href=\"#".concat($header.id, "\" class=\"header-mark\"></a>"));
}); });
@ -551,12 +532,12 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "initToc", key: "initToc",
value: function initToc() { value: function initToc() {
var _this6 = this; var _this5 = this;
var $tocCore = document.getElementById('TableOfContents'); var $tocCore = document.getElementById('TableOfContents');
if ($tocCore === null) return; if ($tocCore === null) return;
if (document.getElementById('toc-static').getAttribute('data-kept') || this.util.isTocStatic()) { if (document.getElementById('toc-static').getAttribute('data-kept') || Util.isTocStatic()) {
var $tocContentStatic = document.getElementById('toc-content-static'); var $tocContentStatic = document.getElementById('toc-content-static');
if ($tocCore.parentElement !== $tocContentStatic) { if ($tocCore.parentElement !== $tocContentStatic) {
@ -593,10 +574,10 @@ var Theme = /*#__PURE__*/function () {
var maxTocTop = footerTop - $toc.getBoundingClientRect().height; var maxTocTop = footerTop - $toc.getBoundingClientRect().height;
var maxScrollTop = maxTocTop - TOP_SPACING + (headerIsFixed ? 0 : headerHeight); var maxScrollTop = maxTocTop - TOP_SPACING + (headerIsFixed ? 0 : headerHeight);
if (_this6.newScrollTop < minScrollTop) { if (_this5.newScrollTop < minScrollTop) {
$toc.style.position = 'absolute'; $toc.style.position = 'absolute';
$toc.style.top = "".concat(minTocTop, "px"); $toc.style.top = "".concat(minTocTop, "px");
} else if (_this6.newScrollTop > maxScrollTop) { } else if (_this5.newScrollTop > maxScrollTop) {
$toc.style.position = 'absolute'; $toc.style.position = 'absolute';
$toc.style.top = "".concat(maxTocTop, "px"); $toc.style.top = "".concat(maxTocTop, "px");
} else { } else {
@ -604,14 +585,12 @@ var Theme = /*#__PURE__*/function () {
$toc.style.top = "".concat(TOP_SPACING, "px"); $toc.style.top = "".concat(TOP_SPACING, "px");
} }
_this6.util.forEach($tocLinkElements, function ($tocLink) { Util.forEach($tocLinkElements, function ($tocLink) {
$tocLink.classList.remove('active'); $tocLink.classList.remove('active');
}); });
Util.forEach($tocLiElements, function ($tocLi) {
_this6.util.forEach($tocLiElements, function ($tocLi) {
$tocLi.classList.remove('has-active'); $tocLi.classList.remove('has-active');
}); });
var INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0); var INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
var activeTocIndex = $headerLinkElements.length - 1; var activeTocIndex = $headerLinkElements.length - 1;
@ -619,7 +598,7 @@ var Theme = /*#__PURE__*/function () {
var thisTop = $headerLinkElements[i].getBoundingClientRect().top; var thisTop = $headerLinkElements[i].getBoundingClientRect().top;
var nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top; var nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;
if (i == 0 && thisTop > INDEX_SPACING || thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING) { if (i === 0 && thisTop > INDEX_SPACING || thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING) {
activeTocIndex = i; activeTocIndex = i;
break; break;
} }
@ -649,7 +628,7 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "initMermaid", key: "initMermaid",
value: function initMermaid() { value: function initMermaid() {
var _this7 = this; var _this6 = this;
this._mermaidOnSwitchTheme = this._mermaidOnSwitchTheme || function () { this._mermaidOnSwitchTheme = this._mermaidOnSwitchTheme || function () {
var $mermaidElements = document.getElementsByClassName('mermaid'); var $mermaidElements = document.getElementsByClassName('mermaid');
@ -657,12 +636,11 @@ var Theme = /*#__PURE__*/function () {
if ($mermaidElements.length) { if ($mermaidElements.length) {
mermaid.initialize({ mermaid.initialize({
startOnLoad: false, startOnLoad: false,
theme: _this7.isDark ? 'dark' : 'neutral', theme: _this6.isDark ? 'dark' : 'neutral',
securityLevel: 'loose' securityLevel: 'loose'
}); });
Util.forEach($mermaidElements, function ($mermaid) {
_this7.util.forEach($mermaidElements, function ($mermaid) { mermaid.render('svg-' + $mermaid.id, _this6.data[$mermaid.id], function (svgCode) {
mermaid.render('svg-' + $mermaid.id, _this7.data[$mermaid.id], function (svgCode) {
$mermaid.innerHTML = svgCode; $mermaid.innerHTML = svgCode;
}, $mermaid); }, $mermaid);
}); });
@ -676,28 +654,27 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "initEcharts", key: "initEcharts",
value: function initEcharts() { value: function initEcharts() {
var _this8 = this; var _this7 = this;
if (this.config.echarts) { if (this.config.echarts) {
echarts.registerTheme('light', this.config.echarts.lightTheme); echarts.registerTheme('light', this.config.echarts.lightTheme);
echarts.registerTheme('dark', this.config.echarts.darkTheme); echarts.registerTheme('dark', this.config.echarts.darkTheme);
this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || function () { this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || function () {
_this8._echartsArr = _this8._echartsArr || []; _this7._echartsArr = _this7._echartsArr || [];
for (var i = 0; i < _this8._echartsArr.length; i++) { for (var i = 0; i < _this7._echartsArr.length; i++) {
_this8._echartsArr[i].dispose(); _this7._echartsArr[i].dispose();
} }
_this8._echartsArr = []; _this7._echartsArr = [];
Util.forEach(document.getElementsByClassName('echarts'), function ($echarts) {
_this8.util.forEach(document.getElementsByClassName('echarts'), function ($echarts) { var chart = echarts.init($echarts, _this7.isDark ? 'dark' : 'light', {
var chart = echarts.init($echarts, _this8.isDark ? 'dark' : 'light', {
renderer: 'svg' renderer: 'svg'
}); });
chart.setOption(JSON.parse(_this8.data[$echarts.id])); chart.setOption(JSON.parse(_this7.data[$echarts.id]));
_this8._echartsArr.push(chart); _this7._echartsArr.push(chart);
}); });
}; };
@ -706,8 +683,8 @@ var Theme = /*#__PURE__*/function () {
this._echartsOnSwitchTheme(); this._echartsOnSwitchTheme();
this._echartsOnResize = this._echartsOnResize || function () { this._echartsOnResize = this._echartsOnResize || function () {
for (var i = 0; i < _this8._echartsArr.length; i++) { for (var i = 0; i < _this7._echartsArr.length; i++) {
_this8._echartsArr[i].resize(); _this7._echartsArr[i].resize();
} }
}; };
@ -717,30 +694,30 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "initMapbox", key: "initMapbox",
value: function initMapbox() { value: function initMapbox() {
var _this9 = this; var _this8 = this;
if (this.config.mapbox) { if (this.config.mapbox) {
mapboxgl.accessToken = this.config.mapbox.accessToken; mapboxgl.accessToken = this.config.mapbox.accessToken;
mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin); mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);
this._mapboxArr = this._mapboxArr || []; this._mapboxArr = this._mapboxArr || [];
this.util.forEach(document.getElementsByClassName('mapbox'), function ($mapbox) { Util.forEach(document.getElementsByClassName('mapbox'), function ($mapbox) {
var _this9$data$$mapbox$i = _this9.data[$mapbox.id], var _this8$data$$mapbox$i = _this8.data[$mapbox.id],
lng = _this9$data$$mapbox$i.lng, lng = _this8$data$$mapbox$i.lng,
lat = _this9$data$$mapbox$i.lat, lat = _this8$data$$mapbox$i.lat,
zoom = _this9$data$$mapbox$i.zoom, zoom = _this8$data$$mapbox$i.zoom,
lightStyle = _this9$data$$mapbox$i.lightStyle, lightStyle = _this8$data$$mapbox$i.lightStyle,
darkStyle = _this9$data$$mapbox$i.darkStyle, darkStyle = _this8$data$$mapbox$i.darkStyle,
marked = _this9$data$$mapbox$i.marked, marked = _this8$data$$mapbox$i.marked,
navigation = _this9$data$$mapbox$i.navigation, navigation = _this8$data$$mapbox$i.navigation,
geolocate = _this9$data$$mapbox$i.geolocate, geolocate = _this8$data$$mapbox$i.geolocate,
scale = _this9$data$$mapbox$i.scale, scale = _this8$data$$mapbox$i.scale,
fullscreen = _this9$data$$mapbox$i.fullscreen; fullscreen = _this8$data$$mapbox$i.fullscreen;
var mapbox = new mapboxgl.Map({ var mapbox = new mapboxgl.Map({
container: $mapbox, container: $mapbox,
center: [lng, lat], center: [lng, lat],
zoom: zoom, zoom: zoom,
minZoom: .2, minZoom: .2,
style: _this9.isDark ? darkStyle : lightStyle, style: _this8.isDark ? darkStyle : lightStyle,
attributionControl: false attributionControl: false
}); });
@ -772,16 +749,16 @@ var Theme = /*#__PURE__*/function () {
mapbox.addControl(new MapboxLanguage()); mapbox.addControl(new MapboxLanguage());
_this9._mapboxArr.push(mapbox); _this8._mapboxArr.push(mapbox);
}); });
this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || function () { this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || function () {
_this9.util.forEach(_this9._mapboxArr, function (mapbox) { Util.forEach(_this8._mapboxArr, function (mapbox) {
var $mapbox = mapbox.getContainer(); var $mapbox = mapbox.getContainer();
var _this9$data$$mapbox$i2 = _this9.data[$mapbox.id], var _this8$data$$mapbox$i2 = _this8.data[$mapbox.id],
lightStyle = _this9$data$$mapbox$i2.lightStyle, lightStyle = _this8$data$$mapbox$i2.lightStyle,
darkStyle = _this9$data$$mapbox$i2.darkStyle; darkStyle = _this8$data$$mapbox$i2.darkStyle;
mapbox.setStyle(_this9.isDark ? darkStyle : lightStyle); mapbox.setStyle(_this8.isDark ? darkStyle : lightStyle);
mapbox.addControl(new MapboxLanguage()); mapbox.addControl(new MapboxLanguage());
}); });
}; };
@ -792,7 +769,7 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "initTypeit", key: "initTypeit",
value: function initTypeit() { value: function initTypeit() {
var _this10 = this; var _this9 = this;
if (this.config.typeit) { if (this.config.typeit) {
var typeitConfig = this.config.typeit; var typeitConfig = this.config.typeit;
@ -802,8 +779,8 @@ var Theme = /*#__PURE__*/function () {
Object.values(typeitConfig.data).forEach(function (group) { Object.values(typeitConfig.data).forEach(function (group) {
var typeone = function typeone(i) { var typeone = function typeone(i) {
var id = group[i]; var id = group[i];
var instance = new TypeIt("#".concat(id), { new TypeIt("#".concat(id), {
strings: _this10.data[id], strings: _this9.data[id],
speed: speed, speed: speed,
lifeLike: true, lifeLike: true,
cursorSpeed: cursorSpeed, cursorSpeed: cursorSpeed,
@ -830,7 +807,7 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "initComment", key: "initComment",
value: function initComment() { value: function initComment() {
var _this11 = this; var _this10 = this;
if (this.config.comment) { if (this.config.comment) {
if (this.config.comment.gitalk) { if (this.config.comment.gitalk) {
@ -857,7 +834,7 @@ var Theme = /*#__PURE__*/function () {
this._utterancesOnSwitchTheme = this._utterancesOnSwitchTheme || function () { this._utterancesOnSwitchTheme = this._utterancesOnSwitchTheme || function () {
var message = { var message = {
type: 'set-theme', type: 'set-theme',
theme: _this11.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme theme: _this10.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme
}; };
var iframe = document.querySelector('.utterances-frame'); var iframe = document.querySelector('.utterances-frame');
iframe.contentWindow.postMessage(message, 'https://utteranc.es'); iframe.contentWindow.postMessage(message, 'https://utteranc.es');
@ -889,7 +866,7 @@ var Theme = /*#__PURE__*/function () {
this._giscusOnSwitchTheme = this._giscusOnSwitchTheme || function () { this._giscusOnSwitchTheme = this._giscusOnSwitchTheme || function () {
var message = { var message = {
setConfig: { setConfig: {
theme: _this11.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme, theme: _this10.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme,
reactionsEnabled: false reactionsEnabled: false
} }
}; };
@ -912,7 +889,7 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "onScroll", key: "onScroll",
value: function onScroll() { value: function onScroll() {
var _this12 = this; var _this11 = this;
var $headers = []; var $headers = [];
if (document.body.getAttribute('data-header-desktop') === 'auto') $headers.push(document.getElementById('header-desktop')); if (document.body.getAttribute('data-header-desktop') === 'auto') $headers.push(document.getElementById('header-desktop'));
@ -921,52 +898,46 @@ var Theme = /*#__PURE__*/function () {
if (document.getElementById('comments')) { if (document.getElementById('comments')) {
var $viewComments = document.getElementById('view-comments'); var $viewComments = document.getElementById('view-comments');
$viewComments.href = "#comments"; $viewComments.href = "#comments";
$viewComments.style.display = 'block'; $viewComments.parentElement.removeChild($viewComments);
document.getElementById('fixed-buttons').appendChild($viewComments);
} }
var $fixedButtons = document.getElementById('fixed-buttons'); var $fixedButtons = document.getElementById('fixed-buttons');
var ACCURACY = 20, var ACCURACY = 20,
MINIMUM = 100; MINIMUM = 100;
window.addEventListener('scroll', function () { window.addEventListener('scroll', function () {
_this12.newScrollTop = _this12.util.getScrollTop(); _this11.newScrollTop = Util.getScrollTop();
var scroll = _this12.newScrollTop - _this12.oldScrollTop; var scroll = _this11.newScrollTop - _this11.oldScrollTop;
var isMobile = Util.isMobile();
var isMobile = _this12.util.isMobile(); Util.forEach($headers, function ($header) {
_this12.util.forEach($headers, function ($header) {
if (scroll > ACCURACY) { if (scroll > ACCURACY) {
$header.classList.remove('animate__fadeInDown'); $header.classList.remove('animate__fadeInDown');
Util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
_this12.util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
} else if (scroll < -ACCURACY) { } else if (scroll < -ACCURACY) {
$header.classList.remove('animate__fadeOutUp'); $header.classList.remove('animate__fadeOutUp');
Util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
_this12.util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
} }
}); });
if (_this12.newScrollTop > MINIMUM) { if (_this11.newScrollTop > MINIMUM) {
if (isMobile && scroll > ACCURACY) { if (isMobile && scroll > ACCURACY) {
$fixedButtons.classList.remove('animate__fadeIn'); $fixedButtons.classList.remove('animate__fadeIn');
Util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
_this12.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} else if (!isMobile || scroll < -ACCURACY) { } else if (!isMobile || scroll < -ACCURACY) {
$fixedButtons.style.display = 'block'; $fixedButtons.style.display = 'block';
$fixedButtons.classList.remove('animate__fadeOut'); $fixedButtons.classList.remove('animate__fadeOut');
Util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
_this12.util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
} }
} else { } else {
if (!isMobile) { if (!isMobile) {
$fixedButtons.classList.remove('animate__fadeIn'); $fixedButtons.classList.remove('animate__fadeIn');
Util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
_this12.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} }
$fixedButtons.style.display = 'none'; $fixedButtons.style.display = 'none';
} }
var _iterator2 = _createForOfIteratorHelper(_this12.scrollEventSet), var _iterator2 = _createForOfIteratorHelper(_this11.scrollEventSet),
_step2; _step2;
try { try {
@ -980,20 +951,20 @@ var Theme = /*#__PURE__*/function () {
_iterator2.f(); _iterator2.f();
} }
_this12.oldScrollTop = _this12.newScrollTop; _this11.oldScrollTop = _this11.newScrollTop;
}, false); }, false);
} }
}, { }, {
key: "onResize", key: "onResize",
value: function onResize() { value: function onResize() {
var _this13 = this; var _this12 = this;
window.addEventListener('resize', function () { window.addEventListener('resize', function () {
if (!_this13._resizeTimeout) { if (!_this12._resizeTimeout) {
_this13._resizeTimeout = window.setTimeout(function () { _this12._resizeTimeout = window.setTimeout(function () {
_this13._resizeTimeout = null; _this12._resizeTimeout = null;
var _iterator3 = _createForOfIteratorHelper(_this13.resizeEventSet), var _iterator3 = _createForOfIteratorHelper(_this12.resizeEventSet),
_step3; _step3;
try { try {
@ -1007,11 +978,11 @@ var Theme = /*#__PURE__*/function () {
_iterator3.f(); _iterator3.f();
} }
_this13.initToc(); _this12.initToc();
_this13.initMermaid(); _this12.initMermaid();
_this13.initSearch(); _this12.initSearch();
}, 100); }, 100);
} }
}, false); }, false);
@ -1019,10 +990,10 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "onClickMask", key: "onClickMask",
value: function onClickMask() { value: function onClickMask() {
var _this14 = this; var _this13 = this;
document.getElementById('mask').addEventListener('click', function () { document.getElementById('mask').addEventListener('click', function () {
var _iterator4 = _createForOfIteratorHelper(_this14.clickMaskEventSet), var _iterator4 = _createForOfIteratorHelper(_this13.clickMaskEventSet),
_step4; _step4;
try { try {
@ -1042,7 +1013,7 @@ var Theme = /*#__PURE__*/function () {
}, { }, {
key: "init", key: "init",
value: function init() { value: function init() {
var _this15 = this; var _this14 = this;
try { try {
this.initRaw(); this.initRaw();
@ -1054,7 +1025,6 @@ var Theme = /*#__PURE__*/function () {
this.initDetails(); this.initDetails();
this.initLightGallery(); this.initLightGallery();
this.initHighlight(); this.initHighlight();
this.initTable();
this.initHeaderLink(); this.initHeaderLink();
this.initMath(); this.initMath();
this.initMermaid(); this.initMermaid();
@ -1067,15 +1037,15 @@ var Theme = /*#__PURE__*/function () {
} }
window.setTimeout(function () { window.setTimeout(function () {
_this15.initToc(); _this14.initToc();
_this15.initComment(); _this14.initComment();
_this15.onScroll(); _this14.onScroll();
_this15.onResize(); _this14.onResize();
_this15.onClickMask(); _this14.onClickMask();
}, 100); }, 100);
} }
}]); }]);

View file

@ -1,24 +0,0 @@
normalize.css@8.0.1 https://github.com/necolas/normalize.css
fontawesome-free@6.1.1 https://fontawesome.com/
simple-icons@7.3.0 https://github.com/simple-icons/simple-icons
animate.css@4.1.1 https://github.com/daneden/animate.css
autocomplete@0.38.1 https://github.com/algolia/autocomplete
lunr.js@2.3.9 https://lunrjs.com/
algoliasearch@4.13.1 https://github.com/algolia/algoliasearch-client-javascript
lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
twemoji@14.0.2 https://github.com/twitter/twemoji
emoji-data@14.0.0 https://github.com/iamcal/emoji-data
lightgallery@2.5.0 https://github.com/sachinchoolur/lightgallery
clipboard.js@2.0.11 https://github.com/zenorocha/clipboard.js
sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
typeit@8.6.0 https://github.com/alexmacarthur/typeit
katex@0.16.0 https://katex.org/
mermaid@9.1.3 https://github.com/mermaid-js/mermaid
echarts@5.3.3 https://echarts.apache.org/
mapbox-gl@2.9.1 https://github.com/mapbox/mapbox-gl-js
aplayer@1.10.1 https://github.com/MoePlayer/APlayer
meting@2.0.1 https://github.com/metowolf/MetingJS
gitalk@1.7.2 https://github.com/gitalk/gitalk
valine@1.5.0 https://valine.js.org/
cookieconsent@3.1.1 https://github.com/osano/cookieconsent

View file

@ -0,0 +1,28 @@
# Dependency Libraries Version
| Dependency Library | Directory | Version |
|:------------------------------------------------------------------------------------|:------------------|--------:|
| [Algolia Search Client](https://github.com/algolia/algoliasearch-client-javascript) | algoliasearch | 5.20.2 |
| [Animate.css](https://github.com/daneden/animate.css) | animate | 4.1.1 |
| [APlayer](https://github.com/MoePlayer/APlayer) | aplayer | 1.10.1 |
| [Autocomplete](https://github.com/algolia/autocomplete) | autocomplete | 0.38.1 |
| [clipboard.js](https://github.com/zenorocha/clipboard.js) | clipboard | 2.0.11 |
| [Cookie Consent](https://github.com/osano/cookieconsent) | cookieconsent | 3.1.1 |
| [Apache ECharts](https://github.com/apache/echarts) | echarts | 5.3.3 |
| [emoji-data](https://github.com/iamcal/emoji-data) | emoji-data | 15.1.2 |
| [Font Awesome Free](https://github.com/FortAwesome/Font-Awesome) | fontawesome-free | 6.1.1 |
| [Gitalk](https://github.com/gitalk/gitalk) | gitalk | 1.7.2 |
| [KaTeX](https://github.com/KaTeX/KaTeX) | katex | 0.16.0 |
| [lazysizes](https://github.com/aFarkas/lazysizes) | lazysizes | 5.3.2 |
| [lightGallery](https://github.com/sachinchoolur/lightgallery) | lightgallery | 2.5.0 |
| [Lunr.js](https://github.com/olivernn/lunr.js) | lunr | 2.3.9 |
| [Mapbox GL JS](https://github.com/mapbox/mapbox-gl-js) | mapbox-gl | 2.9.1 |
| [Mermaid](https://github.com/mermaid-js/mermaid) | mermaid | 9.1.3 |
| [MetingJS](https://github.com/metowolf/MetingJS) | meting | 2.0.1 |
| [normalize.css](https://github.com/necolas/normalize.css) | normalize | 8.0.1 |
| [object-fit-images](https://github.com/fregante/object-fit-images) | object-fit-images | 3.2.4 |
| [sharer.js](https://github.com/ellisonleao/sharer.js) | sharer | 0.5.1 |
| [Simple Icons](https://github.com/simple-icons/simple-icons) | simple-icons | 7.3.0 |
| [Twemoji](https://github.com/twitter/twemoji) | twemoji | 14.0.2 |
| [TypeIt](https://github.com/alexmacarthur/typeit) | typeit | 8.6.0 |
| [Valine](https://github.com/xCss/Valine) | valine | 1.5.3 |

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-apple@14.0.0/img/apple/64/' emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-apple@15.1.2/img/apple/64/'
emojiMaps: emojiMaps:
'100': 1f4af.png '100': 1f4af.png
grinning: 1f600.png grinning: 1f600.png

View file

@ -1,4 +1,4 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-facebook@14.0.0/img/facebook/64/' emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-facebook@15.1.2/img/facebook/64/'
emojiMaps: emojiMaps:
'100': 1f4af.png '100': 1f4af.png
grinning: 1f600.png grinning: 1f600.png

View file

@ -1,4 +1,4 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-google@14.0.0/img/google/64/' emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-google@15.1.2/img/google/64/'
emojiMaps: emojiMaps:
'100': 1f4af.png '100': 1f4af.png
grinning: 1f600.png grinning: 1f600.png

View file

@ -1,4 +1,4 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-twitter@14.0.0/img/twitter/64/' emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-twitter@15.1.2/img/twitter/64/'
emojiMaps: emojiMaps:
'100': 1f4af.png '100': 1f4af.png
grinning: 1f600.png grinning: 1f600.png

View file

@ -29,6 +29,20 @@ $code-background-color-dark: #272C34 !default;
tab-size: $value; tab-size: $value;
} }
@mixin transition($values...) {
-webkit-transition: $values;
-moz-transition: $values;
-o-transition: $values;
transition: $values;
}
@mixin transform($value) {
-webkit-transform: $value;
-ms-transform: $value;
-o-transform: $value;
transform: $value;
}
.v[data-class=v] { .v[data-class=v] {
.vcards .vcard .vcontent.expand { .vcards .vcard .vcontent.expand {
&::before, &::after { &::before, &::after {
@ -66,4 +80,19 @@ $code-background-color-dark: #272C34 !default;
max-width: 1.5em; max-width: 1.5em;
vertical-align: text-bottom; vertical-align: text-bottom;
} }
// fix valine.js inside css will be override pulse animate for page title
@keyframes pulse {
0% {
@include transform(scaleX(1));
}
50% {
@include transform(scale3d(1.05, 1.05, 1.05));
}
to {
@include transform(scaleX(1));
}
}
} }

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" aria-label="Malt" role="img" viewBox="0 0 512 512" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><rect width="512" height="512" rx="15%" fill="none"></rect> <path fill="#FC5656" d="m408.4 103.8c-32.5-32.4-67.1-11.4-88.8 10.2L114.8 318.8c-21.7 21.7-44.4 54.7-10.2 88.8c34.1 34.1 67 11.4 88.7-10.3l204.8-204.8c21.7-21.6 42.7-56.3 10.3-88.7zm-195.7-8.4 43.4 43.4 44.1-44.2c3-3 6-5.8 9.1-8.4c-4.6-23.3-17.9-44.4-53.3-44.4c-35.4 0-48.7 21.2-53.2 44.5c3.3 2.9 6.6 5.8 9.9 9.1zm87.5 322.1-44.1-44.1-43.4 43.3c-3.3 3.3-6.5 6.4-9.8 9.2c5 23.8 19 45.5 53.1 45.5c34.2 0 48.3-21.9 53.2-45.7c-3-2.6-6-5.2-9-8.2zm-105.9-217h-83.6c-30.7 0-70 9.7-70 55.5c0 34.3 21.9 48.3 45.8 53.2c2.8-3.2 107.8-108.7 107.8-108.7zm231.5 2.3c-2.6 3-107.9 108.8-107.9 108.8h82.4c30.7 0 70-7.3 70-55.6c0-35.3-21.1-48.6-44.5-53.2zm-204.1-29.7 14.9-14.9-43.3-43.4c-21.7-21.7-54.6-44.4-88.8-10.2c-25 25-19.4 49.4-6.2 69.1c4.1-.3 123.4-.6 123.4-.6zm68.7 165.9-15 15 44.2 44.1c21.7 21.7 56.3 42.7 88.7 10.3c24.2-24.2 18.7-49.7 5.3-70c-4.3.3-123.2.6-123.2.6z"></path> </g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -13,7 +13,7 @@ math:
{{< style "img { height: 1.25rem; }" >}} {{< style "img { height: 1.25rem; }" >}}
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.62.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/) [![Hugo](https://img.shields.io/badge/Hugo-%5E0.128.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) [![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt) [![GitHub stars](https://img.shields.io/github/stars/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt)
[![GitHub forks](https://img.shields.io/github/forks/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt/fork) [![GitHub forks](https://img.shields.io/github/forks/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt/fork)
@ -53,7 +53,7 @@ math:
* :(far fa-user fa-fw): **Gravatar** supported by [Gravatar](https://gravatar.com) * :(far fa-user fa-fw): **Gravatar** supported by [Gravatar](https://gravatar.com)
* :(fas fa-user-circle fa-fw): Local **Avatar** supported * :(fas fa-user-circle fa-fw): Local **Avatar** supported
* :(far fa-id-card fa-fw): Up to **73** social links supported * :(far fa-id-card fa-fw): Up to **76** social links supported
* :(fas fa-share-square fa-fw): Up to **24** share sites supported * :(fas fa-share-square fa-fw): Up to **24** share sites supported
* :(far fa-comment fa-fw): **Disqus** comment system supported by [Disqus](https://disqus.com) * :(far fa-comment fa-fw): **Disqus** comment system supported by [Disqus](https://disqus.com)
* :(far fa-comment-dots fa-fw): **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk) * :(far fa-comment-dots fa-fw): **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk)

View file

@ -13,7 +13,7 @@ math:
{{< style "img { height: 1.25rem; }" >}} {{< style "img { height: 1.25rem; }" >}}
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.62.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/) [![Hugo](https://img.shields.io/badge/Hugo-%5E0.128.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) [![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt) [![GitHub stars](https://img.shields.io/github/stars/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt)
[![GitHub forks](https://img.shields.io/github/forks/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt/fork) [![GitHub forks](https://img.shields.io/github/forks/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt/fork)
@ -35,7 +35,7 @@ math:
* :(far fa-chart-bar fa-fw): 支持 **[Fathom Analytics](https://usefathom.com/)** * :(far fa-chart-bar fa-fw): 支持 **[Fathom Analytics](https://usefathom.com/)**
* :(fas fa-chart-column fa-fw): 支持 **[Plausible Analytics](https://plausible.io/)** * :(fas fa-chart-column fa-fw): 支持 **[Plausible Analytics](https://plausible.io/)**
* :(fab fa-yandex-international fa-fw): 支持 **[Yandex Metrica](https://metrica.yandex.com/)** * :(fab fa-yandex-international fa-fw): 支持 **[Yandex Metrica](https://metrica.yandex.com/)**
* :(fas fa-sitemap fa-fw): 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu) * :(fas fa-sitemap fa-fw): 支持搜索引擎的**网站验证** (Google, Bind, Yandex Baidu)
* :(fas fa-tachometer-alt fa-fw): 支持所有第三方库的 **CDN** * :(fas fa-tachometer-alt fa-fw): 支持所有第三方库的 **CDN**
* :(fas fa-cloud-download-alt fa-fw): 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载** * :(fas fa-cloud-download-alt fa-fw): 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
@ -53,7 +53,7 @@ math:
* :(far fa-user fa-fw): 支持 **[Gravatar](https://gravatar.com)** 头像 * :(far fa-user fa-fw): 支持 **[Gravatar](https://gravatar.com)** 头像
* :(fas fa-user-circle fa-fw): 支持本地**头像** * :(fas fa-user-circle fa-fw): 支持本地**头像**
* :(far fa-id-card fa-fw): 支持多达 **73** 种社交链接 * :(far fa-id-card fa-fw): 支持多达 **76** 种社交链接
* :(fas fa-share-square fa-fw): 支持多达 **24** 种网站分享 * :(fas fa-share-square fa-fw): 支持多达 **24** 种网站分享
* :(far fa-comment fa-fw): 支持 **[Disqus](https://disqus.com)** 评论系统 * :(far fa-comment fa-fw): 支持 **[Disqus](https://disqus.com)** 评论系统
* :(far fa-comment-dots fa-fw): 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统 * :(far fa-comment-dots fa-fw): 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统

View file

@ -23,7 +23,7 @@ This article offers a sample of basic Markdown syntax that can be used in Hugo c
<!--more--> <!--more-->
{{< admonition >}} {{< admonition >}}
This article is a shameful copy of the great [Grav original page](http://learn.getgrav.org/content/markdown). This article is a shameful copy of the great [Grav original page](https://learn.getgrav.org/content/markdown).
If you want to know about the extended Markdown syntax of **LoveIt** theme, please read [extended Markdown syntax page](../theme-documentation-content#extended-markdown-syntax). If you want to know about the extended Markdown syntax of **LoveIt** theme, please read [extended Markdown syntax page](../theme-documentation-content#extended-markdown-syntax).
{{< /admonition >}} {{< /admonition >}}

View file

@ -23,7 +23,7 @@ lightgallery: true
<!--more--> <!--more-->
{{< admonition >}} {{< admonition >}}
这篇文章借鉴了一篇很棒的[来自 Grav 的文章](http://learn.getgrav.org/content/markdown). 这篇文章借鉴了一篇很棒的[来自 Grav 的文章](https://learn.getgrav.org/content/markdown).
如果你想了解 **Loveit** 主题的扩展 Markdown 语法, 请阅读[扩展 Markdown 语法页面](../theme-documentation-content#extended-markdown-syntax). 如果你想了解 **Loveit** 主题的扩展 Markdown 语法, 请阅读[扩展 Markdown 语法页面](../theme-documentation-content#extended-markdown-syntax).
{{< /admonition >}} {{< /admonition >}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 KiB

View file

@ -29,14 +29,12 @@ Discover what the Hugo - **LoveIt** theme is all about and the core-concepts beh
Thanks to the simplicity of Hugo, [Hugo](https://gohugo.io/) is the only dependency of this theme. Thanks to the simplicity of Hugo, [Hugo](https://gohugo.io/) is the only dependency of this theme.
Just install latest version of [:(far fa-file-archive fa-fw): Hugo (> 0.62.0)](https://gohugo.io/getting-started/installing/) for your OS (**Windows**, **Linux**, **macOS**). Just install latest edition of [:(far fa-file-archive fa-fw): Hugo](https://gohugo.io/getting-started/installing/) for your OS (**Windows**, **Linux**, **macOS**).
{{< admonition note "Why not support earlier versions of Hugo?" >}} {{< admonition note "When you need to use Hugo extended edition?" false >}}
Since [Markdown Render Hooks](https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks) was introduced in the [Hugo Christmas Edition](https://gohugo.io/news/0.62.0-relnotes/), this theme only supports Hugo versions above **0.62.0**. When you want [style customization](#style-customization), you need to use the Hugo **extended edition** for correct rendering.
{{< /admonition >}}
{{< admonition tip "Hugo extended version is recommended" >}} ![Hugo extended edition](hugo-extended-edition.png "Hugo extended edition")
Since some features of this theme need to processes :(fab fa-sass fa-fw): SCSS to :(fab fa-css3 fa-fw): CSS, it is recommended to use Hugo **extended** version for better experience.
{{< /admonition >}} {{< /admonition >}}
## 2 Installation ## 2 Installation
@ -54,9 +52,9 @@ cd my_website
### 2.2 Install the Theme ### 2.2 Install the Theme
The **LoveIt** themes repository is: [https://github.com/dillonzq/LoveIt](https://github.com/dillonzq/LoveIt). The **LoveIt** theme's repository is: [https://github.com/dillonzq/LoveIt](https://github.com/dillonzq/LoveIt).
You can download the [latest release :(far fa-file-archive fa-fw): .zip file](https://github.com/dillonzq/LoveIt/releases) of the theme and extract it in the `themes` directory. You can download the [release :(far fa-file-archive fa-fw): .zip file](https://github.com/dillonzq/LoveIt/releases) of the theme and extract it in the `themes` directory.
Alternatively, clone this repository to the `themes` directory: Alternatively, clone this repository to the `themes` directory:
@ -71,6 +69,16 @@ git init
git submodule add https://github.com/dillonzq/LoveIt.git themes/LoveIt git submodule add https://github.com/dillonzq/LoveIt.git themes/LoveIt
``` ```
{{< admonition note "LoveIt theme's compatibility" >}}
| LoveIt branch or version | Supported Hugo versions |
|:-------------------------|:-----------------------:|
| master(Unstable) | ≥ 0.128.0 |
| **0.3.X(Recommended)** | 0.128.0 - 0.144.2 |
| 0.2.X(Outdated) | 0.68.0 - 0.127.0 |
{{< /admonition >}}
### 2.3 Basic Configuration {#basic-configuration} ### 2.3 Basic Configuration {#basic-configuration}
The following is a basic configuration for the LoveIt theme: The following is a basic configuration for the LoveIt theme:
@ -89,12 +97,6 @@ languageCode = "en"
# language name ["English", "简体中文", "Français", "Polski", ...] # language name ["English", "简体中文", "Français", "Polski", ...]
languageName = "English" languageName = "English"
# Author config
[author]
name = "xxxx"
email = ""
link = ""
# Menu config # Menu config
[menu] [menu]
[[menu.main]] [[menu.main]]
@ -134,7 +136,7 @@ languageName = "English"
``` ```
{{< admonition >}} {{< admonition >}}
When building the website, you can set a theme by using `--theme` option. However, we suggest you modify the configuration file (**config.toml**) and set the theme as the default. When building the website, you can set a theme by using `--theme` option. However, we suggest you modify the configuration file (**hugo.toml**) and set the theme as the default.
{{< /admonition >}} {{< /admonition >}}
### 2.4 Create Your First Post ### 2.4 Create Your First Post
@ -174,6 +176,7 @@ it is highly recommended that you add `--disableFastRender` parameter to `hugo s
```bash ```bash
hugo serve --disableFastRender hugo serve --disableFastRender
``` ```
{{< /admonition >}} {{< /admonition >}}
### 2.6 Build the Website ### 2.6 Build the Website
@ -195,7 +198,7 @@ Alternatively, you can use [AWS Amplify](https://gohugo.io/hosting-and-deploymen
### 3.1 Site Configuration {#site-configuration} ### 3.1 Site Configuration {#site-configuration}
In addition to [Hugo global configuration](https://gohugo.io/overview/configuration/) and [menu configuration](#basic-configuration), **LoveIt** lets you define the following parameters in your site configuration (here is a `config.toml`, whose values are default). In addition to [Hugo global configuration](https://gohugo.io/overview/configuration/) and [menu configuration](#basic-configuration), **LoveIt** lets you define the following parameters in your site configuration (here is a `hugo.toml`, whose values are default).
Please open the code block below to view the complete sample configuration :(far fa-hand-point-down fa-fw):: Please open the code block below to view the complete sample configuration :(far fa-hand-point-down fa-fw)::
@ -215,10 +218,6 @@ languageName = "English"
# whether to include Chinese/Japanese/Korean # whether to include Chinese/Japanese/Korean
hasCJKLanguage = false hasCJKLanguage = false
# default amount of posts in each pages
paginate = 12
# google analytics code [UA-XXXXXXXX-X]
googleAnalytics = ""
# copyright description used only for seo schema # copyright description used only for seo schema
copyright = "" copyright = ""
@ -232,11 +231,11 @@ enableEmoji = true
# ignore some build errors # ignore some build errors
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# Author config # Pagination config
[author] [pagination]
name = "xxxx" disableAliases = false
email = "" pagerSize = 10
link = "" path = "page"
# Menu config # Menu config
[menu] [menu]
@ -285,6 +284,12 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# website images for Open Graph and Twitter Cards # website images for Open Graph and Twitter Cards
images = ["/logo.png"] images = ["/logo.png"]
# Author config
[params.author]
name = "xxxx"
email = ""
link = ""
# Header config # Header config
[params.header] [params.header]
# desktop header mode ["fixed", "normal", "auto"] # desktop header mode ["fixed", "normal", "auto"]
@ -481,6 +486,10 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
Plume = "" Plume = ""
HackTheBox = "" HackTheBox = ""
RootMe= "" RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Phone = "" Phone = ""
Email = "xxxx@xxxx.com" Email = "xxxx@xxxx.com"
RSS = true # {{< version 0.2.0 >}} RSS = true # {{< version 0.2.0 >}}
@ -510,7 +519,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# whether to enable the table of the contents # whether to enable the table of the contents
enable = true enable = true
# {{< version 0.2.9 >}} whether to keep the static table of the contents in front of the post # {{< version 0.2.9 >}} whether to keep the static table of the contents in front of the post
keepStatic = true keepStatic = false
# whether to make the table of the contents in the sidebar automatically collapsed # whether to make the table of the contents in the sidebar automatically collapsed
auto = true auto = true
# {{< version 0.2.0 changed >}} {{< link "https://katex.org/" KaTeX >}} mathematical formulas # {{< version 0.2.0 changed >}} {{< link "https://katex.org/" KaTeX >}} mathematical formulas
@ -898,11 +907,12 @@ into `/static`. Theyre easily created via [https://realfavicongenerator.net/]
Customize `browserconfig.xml` and `site.webmanifest` to set theme-color and background-color. Customize `browserconfig.xml` and `site.webmanifest` to set theme-color and background-color.
### 3.3 Style Customization ### 3.3 Style Customization {#style-customization}
{{< version 0.2.8 changed >}} {{< version 0.2.8 changed >}}
{{< admonition >}} {{< admonition note "Hugo extended version is necessary" >}}
Since Hugo need to processes :(fab fa-sass fa-fw): SCSS to :(fab fa-css3 fa-fw): CSS,
Hugo **extended** version is necessary for the style customization. Hugo **extended** version is necessary for the style customization.
{{< /admonition >}} {{< /admonition >}}
@ -938,7 +948,7 @@ In `assets/css/_custom.scss`, you can add some css style code to customize the s
| Traditional Chinese | `zh-tw` | `zh-TW` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Traditional Chinese | `zh-tw` | `zh-TW` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| French | `fr` | `fr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | French | `fr` | `fr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Polish | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | | Polish | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Brazilian Portuguese | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Portuguese (Brazil) | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Italian | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Italian | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Spanish | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Spanish | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
@ -955,6 +965,8 @@ In `assets/css/_custom.scss`, you can add some css style code to customize the s
| Turkish | `tr` | `tr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Turkish | `tr` | `tr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Korean | `ko` | `ko` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | | Korean | `ko` | `ko` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Hindi | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | | Hindi | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Dutch | `nl` | `nl` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Bengali | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
### 4.2 Basic Configuration ### 4.2 Basic Configuration

View file

@ -27,16 +27,14 @@ toc:
## 1 准备 ## 1 准备
由于 Hugo 提供的便利性, [Hugo](https://gohugo.io/) 本身是这个主题唯一的依赖. 由于 Hugo 提供的便利性, [Hugo](https://gohugo.io/) 是这个主题唯一的依赖.
直接安装满足你操作系统 (**Windows**, **Linux**, **macOS**) 的最新版本 [:(far fa-file-archive fa-fw): Hugo (> 0.62.0)](https://gohugo.io/getting-started/installing/). 直接安装满足你操作系统 (**Windows**, **Linux**, **macOS**) 的最新版本 [:(far fa-file-archive fa-fw): Hugo](https://gohugo.io/getting-started/installing/).
{{< admonition note "为什么不支持早期版本的 Hugo?" >}} {{< admonition note "什么时候需要使用 Hugo extended 版本?" false >}}
由于 [Markdown 渲染钩子函数](https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks) 在 [Hugo 圣诞节版本](https://gohugo.io/news/0.62.0-relnotes/) 中被引入, 本主题只支持高于 **0.62.0** 的 Hugo 版本. 当你需要[自定义样式](#style-customization)时, 你要使用 Hugo **extended** 版本来获得正确的渲染效果.
{{< /admonition >}}
{{< admonition tip "推荐使用 Hugo extended 版本" >}} ![Hugo extended 版本](hugo-extended-edition.png "Hugo extended 版本")
由于这个主题的一些特性需要将 :(fab fa-sass fa-fw): SCSS 转换为 :(fab fa-css3 fa-fw): CSS, 推荐使用 Hugo **extended** 版本来获得更好的使用体验.
{{< /admonition >}} {{< /admonition >}}
## 2 安装 ## 2 安装
@ -56,7 +54,7 @@ cd my_website
**LoveIt** 主题的仓库是: [https://github.com/dillonzq/LoveIt](https://github.com/dillonzq/LoveIt). **LoveIt** 主题的仓库是: [https://github.com/dillonzq/LoveIt](https://github.com/dillonzq/LoveIt).
你可以下载主题的 [最新版本 :(far fa-file-archive fa-fw): .zip 文件](https://github.com/dillonzq/LoveIt/releases) 并且解压放到 `themes` 目录. 你可以下载主题的 [发布版本 :(far fa-file-archive fa-fw): .zip 文件](https://github.com/dillonzq/LoveIt/releases) 并且解压放到 `themes` 目录.
另外, 也可以直接把这个主题克隆到 `themes` 目录: 另外, 也可以直接把这个主题克隆到 `themes` 目录:
@ -71,6 +69,16 @@ git init
git submodule add https://github.com/dillonzq/LoveIt.git themes/LoveIt git submodule add https://github.com/dillonzq/LoveIt.git themes/LoveIt
``` ```
{{< admonition note "主题的兼容性" >}}
| 分支或版本 | 支持的 Hugo 版本 |
|:--------------|:-----------------:|
| master(不稳定) | ≥ 0.128.0 |
| **0.3.X(推荐)** | 0.128.0 - 0.144.2 |
| 0.2.X(过时) | 0.68.0 - 0.127.0 |
{{< /admonition >}}
### 2.3 基础配置 {#basic-configuration} ### 2.3 基础配置 {#basic-configuration}
以下是 LoveIt 主题的基本配置: 以下是 LoveIt 主题的基本配置:
@ -91,12 +99,6 @@ languageName = "简体中文"
# 是否包括中日韩文字 # 是否包括中日韩文字
hasCJKLanguage = true hasCJKLanguage = true
# 作者配置
[author]
name = "xxxx"
email = ""
link = ""
# 菜单配置 # 菜单配置
[menu] [menu]
[[menu.main]] [[menu.main]]
@ -136,7 +138,7 @@ hasCJKLanguage = true
``` ```
{{< admonition >}} {{< admonition >}}
在构建网站时, 你可以使用 `--theme` 选项设置主题. 但是, 我建议你修改配置文件 (**config.toml**) 将本主题设置为默认主题. 在构建网站时, 你可以使用 `--theme` 选项设置主题. 但是, 我建议你修改配置文件 (**hugo.toml**) 将本主题设置为默认主题.
{{< /admonition >}} {{< /admonition >}}
### 2.4 创建你的第一篇文章 ### 2.4 创建你的第一篇文章
@ -176,6 +178,7 @@ hugo serve
```bash ```bash
hugo serve --disableFastRender hugo serve --disableFastRender
``` ```
{{< /admonition >}} {{< /admonition >}}
### 2.6 构建网站 ### 2.6 构建网站
@ -197,7 +200,7 @@ hugo
### 3.1 网站配置 {#site-configuration} ### 3.1 网站配置 {#site-configuration}
除了 [Hugo 全局配置](https://gohugo.io/overview/configuration/) 和 [菜单配置](#basic-configuration) 之外, **LoveIt** 主题还允许您在网站配置中定义以下参数 (这是一个示例 `config.toml`, 其内容为默认值). 除了 [Hugo 全局配置](https://gohugo.io/overview/configuration/) 和 [菜单配置](#basic-configuration) 之外, **LoveIt** 主题还允许您在网站配置中定义以下参数 (这是一个示例 `hugo.toml`, 其内容为默认值).
请打开下面的代码块查看完整的示例配置 :(far fa-hand-point-down fa-fw):: 请打开下面的代码块查看完整的示例配置 :(far fa-hand-point-down fa-fw)::
@ -217,10 +220,6 @@ languageName = "简体中文"
# 是否包括中日韩文字 # 是否包括中日韩文字
hasCJKLanguage = true hasCJKLanguage = true
# 默认每页列表显示的文章数目
paginate = 12
# 谷歌分析代号 [UA-XXXXXXXX-X]
googleAnalytics = ""
# 版权描述,仅仅用于 SEO # 版权描述,仅仅用于 SEO
copyright = "" copyright = ""
@ -234,11 +233,11 @@ enableEmoji = true
# 忽略一些构建错误 # 忽略一些构建错误
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# 作者配置 # 分页配置
[author] [pagination]
name = "xxxx" disableAliases = false
email = "" pagerSize = 10
link = "" path = "page"
# 菜单配置 # 菜单配置
[menu] [menu]
@ -287,6 +286,12 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# 网站图片, 用于 Open Graph 和 Twitter Cards # 网站图片, 用于 Open Graph 和 Twitter Cards
images = ["/logo.png"] images = ["/logo.png"]
# 作者配置
[params.author]
name = "xxxx"
email = ""
link = ""
# 页面头部导航栏配置 # 页面头部导航栏配置
[params.header] [params.header]
# 桌面端导航栏模式 ["fixed", "normal", "auto"] # 桌面端导航栏模式 ["fixed", "normal", "auto"]
@ -483,6 +488,10 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
Plume = "" Plume = ""
HackTheBox = "" HackTheBox = ""
RootMe= "" RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Phone = "" Phone = ""
Email = "xxxx@xxxx.com" Email = "xxxx@xxxx.com"
RSS = true # {{< version 0.2.0 >}} RSS = true # {{< version 0.2.0 >}}
@ -512,7 +521,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# 是否使用目录 # 是否使用目录
enable = true enable = true
# {{< version 0.2.9 >}} 是否保持使用文章前面的静态目录 # {{< version 0.2.9 >}} 是否保持使用文章前面的静态目录
keepStatic = true keepStatic = false
# 是否使侧边目录自动折叠展开 # 是否使侧边目录自动折叠展开
auto = true auto = true
# {{< version 0.2.0 >}} 代码配置 # {{< version 0.2.0 >}} 代码配置
@ -901,12 +910,12 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
可以自定义 `browserconfig.xml``site.webmanifest` 文件来设置 theme-color 和 background-color. 可以自定义 `browserconfig.xml``site.webmanifest` 文件来设置 theme-color 和 background-color.
### 3.3 自定义样式 ### 3.3 自定义样式 {#style-customization}
{{< version 0.2.8 changed >}} {{< version 0.2.8 changed >}}
{{< admonition >}} {{< admonition note "Hugo extended 版本是必需的" >}}
Hugo **extended** 版本对于自定义样式是必需的. 由于需要将 :(fab fa-sass fa-fw): SCSS 转换为 :(fab fa-css3 fa-fw): CSS, Hugo **extended** 版本对于自定义样式是必需的.
{{< /admonition >}} {{< /admonition >}}
通过定义自定义 `.scss` 样式文件, **LoveIt** 主题支持可配置的样式. 通过定义自定义 `.scss` 样式文件, **LoveIt** 主题支持可配置的样式.
@ -935,13 +944,13 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac
{{< version 0.2.10 changed >}} {{< version 0.2.10 changed >}}
| 语言 | Hugo 代码 | HTML `lang` 属性 | 主题文档 | Lunr.js 支持 | | 语言 | Hugo 代码 | HTML `lang` 属性 | 主题文档 | Lunr.js 支持 |
|:---- |:----:|:----:|:----:|:----:| |:---------|:-------:|:--------------:|:-----------------------------:|:-----------------------------:|
| 英语 | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): | | 英语 | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| 简体中文 | `zh-cn` | `zh-CN` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): | | 简体中文 | `zh-cn` | `zh-CN` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| 繁體中文 | `zh-tw` | `zh-TW` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 繁体中文 | `zh-tw` | `zh-TW` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 法语 | `fr` | `fr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 法语 | `fr` | `fr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 波兰语 | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | | 波兰语 | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 巴西葡萄牙语 | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 葡萄牙语(巴西) | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 意大利语 | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 意大利语 | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 西班牙语 | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 西班牙语 | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 德语 | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 德语 | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
@ -957,6 +966,8 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac
| 土耳其语 | `tr` | `tr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 土耳其语 | `tr` | `tr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 韩语 | `ko` | `ko` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | | 韩语 | `ko` | `ko` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 印地语 | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | | 印地语 | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 荷兰语 | `nl` | `nl` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 孟加拉语 | `bn` | `bn` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
### 4.2 基本配置 ### 4.2 基本配置

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 425 KiB

Before After
Before After

View file

@ -143,12 +143,12 @@ The rendered output looks like this:
Example `tweet` input: Example `tweet` input:
```markdown ```markdown
{{</* tweet 917359331535966209 */>}} {{</* tweet user=GoHugoIO id=917359331535966209 */>}}
``` ```
The rendered output looks like this: The rendered output looks like this:
{{< tweet 917359331535966209 >}} {{< tweet user=GoHugoIO id=917359331535966209 >}}
## 8 vimeo ## 8 vimeo

View file

@ -144,12 +144,12 @@ For more information please have a look at GitHub issue [#7879](https://github.c
一个 `tweet` 示例: 一个 `tweet` 示例:
```markdown ```markdown
{{</* tweet 917359331535966209 */>}} {{</* tweet user=GoHugoIO id=917359331535966209 */>}}
``` ```
呈现的输出效果如下: 呈现的输出效果如下:
{{< tweet 917359331535966209 >}} {{< tweet user=GoHugoIO id=917359331535966209 >}}
## 8 vimeo ## 8 vimeo

View file

@ -278,13 +278,13 @@ which helps you write raw mathematical formula content.
Example `raw` input: Example `raw` input:
```markdown ```markdown
Inline Formula: {{</* raw */>}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{</* /raw */>}} Inline Formula: {?{}{< raw >}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){?{}{< /raw >}}
Block Formula: Block Formula:
{{</* raw */>}} {?{}{< raw >}}
\[ a=b+c \\ d+e=f \] \[ a=b+c \\ d+e=f \]
{{</* /raw */>}} {?{}{< /raw >}}
``` ```
The rendered output looks like this: The rendered output looks like this:
@ -307,7 +307,7 @@ The default inline delimiters are:
For example: For example:
```tex ```markdown
$c = \pm\sqrt{a^2 + b^2}$ and \\(f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi\\) $c = \pm\sqrt{a^2 + b^2}$ and \\(f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi\\)
``` ```
@ -329,7 +329,7 @@ The default block delimiters are:
For example: For example:
```tex ```markdown
$$ c = \pm\sqrt{a^2 + b^2} $$ $$ c = \pm\sqrt{a^2 + b^2} $$
\\[ f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\] \\[ f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\]

View file

@ -276,13 +276,13 @@ resources:
一个 `raw` 示例: 一个 `raw` 示例:
```markdown ```markdown
行内公式: {{</* raw */>}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{</* /raw */>}} 行内公式: {?{}{< raw >}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){?{}{< /raw >}}
公式块: 公式块:
{{</* raw */>}} {?{}{< raw >}}
\[ a=b+c \\ d+e=f \] \[ a=b+c \\ d+e=f \]
{{</* /raw */>}} {?{}{< /raw >}}
``` ```
呈现的输出效果如下: 呈现的输出效果如下:
@ -305,7 +305,7 @@ resources:
例如: 例如:
```tex ```markdown
$c = \pm\sqrt{a^2 + b^2}$ 和 \\(f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi\\) $c = \pm\sqrt{a^2 + b^2}$ 和 \\(f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi\\)
``` ```
@ -327,7 +327,7 @@ $c = \pm\sqrt{a^2 + b^2}$ 和 \\(f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2
例如: 例如:
```tex ```markdown
$$ c = \pm\sqrt{a^2 + b^2} $$ $$ c = \pm\sqrt{a^2 + b^2} $$
\\[ f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\] \\[ f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\]

View file

@ -374,16 +374,11 @@ Block Formula:
\[ a=b+c \\ d+e=f \] \[ a=b+c \\ d+e=f \]
{{< /raw >}} {{< /raw >}}
{{< script >}}
console.log('Hello LoveIt!');
{{< /script >}}
This renders as {{< person "https://dillonzq.com/" Dillon "author of the LoveIt theme" >}}.
Raw content using Markdown syntax: {{< raw >}}**Hello**{{< /raw >}} Raw content using Markdown syntax: {{< raw >}}**Hello**{{< /raw >}}
## 13 person ## 13 person
`person` is a shortcode to insert a link to a personal webpage marked up as [h-card](http://microformats.org/wiki/h-card). `person` is a shortcode to insert a link to a personal webpage marked up as [h-card](https://microformats.org/wiki/h-card).
The `person` shortcode has the following named parameters: The `person` shortcode has the following named parameters:

View file

@ -378,7 +378,7 @@ console.log('Hello LoveIt!');
## 13 person ## 13 person
`person` shortcode 用来在你的文章中以 [h-card](http://microformats.org/wiki/h-card) 的格式插入个人网站链接. `person` shortcode 用来在你的文章中以 [h-card](https://microformats.org/wiki/h-card) 的格式插入个人网站链接.
`person` shortcode 有以下命名参数: `person` shortcode 有以下命名参数:

View file

@ -24,12 +24,6 @@ languageName = "English"
# 是否包括中日韩文字 # 是否包括中日韩文字
hasCJKLanguage = false hasCJKLanguage = false
# default amount of posts in each pages
# 默认每页列表显示的文章数目
paginate = 12
# google analytics code [UA-XXXXXXXX-X]
# 谷歌分析代号 [UA-XXXXXXXX-X]
googleAnalytics = ""
# copyright description used only for seo schema # copyright description used only for seo schema
# 版权描述,仅仅用于 SEO # 版权描述,仅仅用于 SEO
copyright = "" copyright = ""
@ -48,12 +42,12 @@ enableEmoji = true
# 忽略一些构建错误 # 忽略一些构建错误
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# Author config # Pagination config
# 作者配置 # 分页配置
[author] [pagination]
name = "xxxx" disableAliases = false
email = "" pagerSize = 10
link = "" path = "page"
# Menu config # Menu config
# 菜单配置 # 菜单配置
@ -114,6 +108,13 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# 网站图片, 用于 Open Graph 和 Twitter Cards # 网站图片, 用于 Open Graph 和 Twitter Cards
images = ["/logo.png"] images = ["/logo.png"]
# Author config
# 作者配置
[params.author]
name = "xxxx"
email = ""
link = ""
# Header config # Header config
# 页面头部导航栏配置 # 页面头部导航栏配置
[params.header] [params.header]
@ -359,6 +360,10 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
Plume = "" Plume = ""
HackTheBox = "" HackTheBox = ""
RootMe= "" RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Email = "" Email = ""
RSS = "" RSS = ""
@ -518,7 +523,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
recordIP = true recordIP = true
highlight = true highlight = true
enableQQ = false enableQQ = false
serverURLs = "https://leancloud.hugoloveit.com" serverURLs = "https://valine.hugoloveit.com"
# emoji data file name, default is "google.yml" # emoji data file name, default is "google.yml"
# ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"] # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# located in "themes/LoveIt/assets/lib/valine/emoji/" directory # located in "themes/LoveIt/assets/lib/valine/emoji/" directory
@ -747,7 +752,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# Permalinks config (https://gohugo.io/content-management/urls/#permalinks) # Permalinks config (https://gohugo.io/content-management/urls/#permalinks)
# Permalinks 配置 (https://gohugo.io/content-management/urls/#permalinks) # Permalinks 配置 (https://gohugo.io/content-management/urls/#permalinks)
[Permalinks] [permalinks]
# posts = ":year/:month/:filename" # posts = ":year/:month/:filename"
posts = ":filename" posts = ":filename"
@ -854,9 +859,9 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
highlightTag = "em" highlightTag = "em"
absoluteURL = false absoluteURL = false
[languages.en.params.search.algolia] [languages.en.params.search.algolia]
index = "index.en" index = "index"
appID = "PASDMWALPK" appID = "4D1IDY8JU6"
searchKey = "b42948e51daaa93df92381c8e2ac0f93" searchKey = "05332ac5ed76655a511f0da583a9afac"
[languages.en.params.home] [languages.en.params.home]
rss = 10 rss = 10
[languages.en.params.home.profile] [languages.en.params.home.profile]
@ -947,9 +952,9 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
highlightTag = "em" highlightTag = "em"
absoluteURL = false absoluteURL = false
[languages.zh-cn.params.search.algolia] [languages.zh-cn.params.search.algolia]
index = "index.zh-cn" index = "index"
appID = "PASDMWALPK" appID = "GZT24PWKNT"
searchKey = "b42948e51daaa93df92381c8e2ac0f93" searchKey = "634ab679e825b815de2663de38908f9d"
[languages.zh-cn.params.home] [languages.zh-cn.params.home]
rss = 10 rss = 10
[languages.zh-cn.params.home.profile] [languages.zh-cn.params.home.profile]

View file

@ -1,2 +1 @@
/zh-cn/* /zh-cn/404.html 404 /zh-cn/* /zh-cn/404.html 404
/fr/* /fr/404.html 404

View file

@ -1,7 +1,6 @@
[module] [module]
[module.hugoVersion] [module.hugoVersion]
extended = true min = "0.128.0"
min = "0.62.0"
[params] [params]
# site default theme ["auto", "light", "dark"] # site default theme ["auto", "light", "dark"]
@ -28,6 +27,13 @@
# 网站图片, 用于 Open Graph 和 Twitter Cards # 网站图片, 用于 Open Graph 和 Twitter Cards
images = [] images = []
# Author config
# 作者配置
[params.author]
name = "xxxx"
email = ""
link = ""
# Header config # Header config
# 页面头部导航栏配置 # 页面头部导航栏配置
[params.header] [params.header]
@ -273,6 +279,10 @@
Plume = "" Plume = ""
HackTheBox = "" HackTheBox = ""
RootMe= "" RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Email = "" Email = ""
Phone = "" Phone = ""
RSS = "" RSS = ""

199
themes/LoveIt/i18n/bn.toml Normal file
View file

@ -0,0 +1,199 @@
# Translations for Bengali
# বাংলায় অনুবাদ
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
[backToTop]
other = "উপরে ফিরে যান"
[viewComments]
other = "মন্তব্যগুলো দেখুন"
# === baseof ==
# === Post ===
[posts]
other = "পোস্ট"
# === Post ===
# === Taxonomy ===
[allSome]
other = "সকল {{ .Some }}"
[tag]
other = "ট্যাগ"
[tags]
other = "ট্যাগ"
[category]
other = "ক্যাটাগরি"
[categories]
other = "ক্যাটাগরি"
# === Taxonomy ===
# === Pagination ===
[more]
other = "আরো"
# === Pagination ===
# === partials/header.html ===
[selectLanguage]
other = "ভাষা নির্বাচন"
[switchTheme]
other = "থিম পরিবর্তন"
# === partials/header.html ===
# === partials/footer.html ===
[poweredBySome]
other = "{{ .Hugo }} দ্বারা চালিত | থিম - {{ .Theme }}"
# === partials/footer.html ===
# === partials/comment.html ===
[valineLang]
other = "en"
[valinePlaceholder]
other = "আপনার মন্তব্য ..."
[facebookLanguageCode]
other = "bn_IN"
[giscusLang]
other = "en"
# === partials/comment.html ===
# === partials/assets.html ===
[search]
other = "খুঁজুন"
[searchPlaceholder]
other = "শিরোনাম অথবা কনটেন্ট খুঁজুন..."
[clear]
other = "পরিষ্কার করুন"
[cancel]
other = "বাতিল করুন"
[noResultsFound]
other = "কোনো ফলাফল পাওয়া যায় নি"
[lunrLanguageCode]
other = "en"
[copyToClipboard]
other = "ক্লিপবোর্ডে কপি করুন"
[cookieconsentMessage]
other = "এই ওয়েবসাইটটি আপনার ব্রাউজিং অভিজ্ঞতা সমৃদ্ধ করতে কুকিজ ব্যবহার করে।"
[cookieconsentDismiss]
other = "বুঝেছি!"
[cookieconsentLink]
other = "আরো জানুন"
# === partials/assets.html ===
# === partials/plugin/share.html ===
[shareOn]
other = "শেয়ার করুন"
# === partials/plugin/share.html ===
# === posts/single.html ===
[contents]
other = "বিষয়বস্তু"
[publishedOnDate]
other = "প্রকাশিত {{ .Date }}"
[includedInCategories]
other = "ক্যাটাগরি {{ .Categories }}"
[wordCount]
one = "একটি শব্দ"
other = "{{ .Count }}টি শব্দ"
[readingTime]
one = "এক মিনিট"
other = "{{ .Count }} মিনিট"
[views]
other = "ভিউ"
[author]
other = "লেখক"
[updatedOnDate]
other = "{{ .Date }} তারিখে আপডেট হয়েছে"
[readMarkdown]
other = "মার্কডাউন পড়ুন"
[back]
other = "পিছনে"
[home]
other = "হোম"
[readMore]
other = "আরো পড়ুন"
# === posts/single.html ===
# === 404.html ===
[pageNotFound]
other = "পেজটি খুঁজে পাওয়া যায় নি"
[pageNotFoundText]
other = "দুঃখিত, আপনি যে পেজটি খুঁজছেন তার কোনো অস্তিত্ব নেই।"
# === 404.html ===
# === shortcodes/admonition.html ===
[note]
other = "নোট"
[abstract]
other = "সারাংশ"
[info]
other = "তথ্য"
[tip]
other = "টিপ"
[success]
other = "সফল"
[question]
other = "প্রশ্ন"
[warning]
other = "সতর্কীকরণ"
[failure]
other = "ব্যর্থ"
[danger]
other = "বিপজ্জনক"
[bug]
other = "বাগ"
[example]
other = "উদাহরণ"
[quote]
other = "উক্তি"
# === shortcodes/admonition.html ===
# === shortcodes/version.html ===
[new]
other = "নতুন"
[changed]
other = "পরিবর্তিত"
[deleted]
other = "মুছে ফেলা হয়েছে"
# === shortcodes/version.html ===

View file

@ -109,10 +109,10 @@ other = "Teilen auf"
other = "Inhalt" other = "Inhalt"
[publishedOnDate] [publishedOnDate]
other = "veröffentlicht an {{ .Date }}" other = "Veröffentlicht am {{ .Date }}"
[includedInCategories] [includedInCategories]
other = "enthalten in {{ .Categories }}" other = "Enthalten in {{ .Categories }}"
[wordCount] [wordCount]
one = "Ein Wort" one = "Ein Wort"
@ -141,7 +141,7 @@ other = "Zurück"
other = "Startseite" other = "Startseite"
[readMore] [readMore]
other = "Mehr lesen" other = "Weiterlesen"
# === posts/single.html === # === posts/single.html ===
# === 404.html === # === 404.html ===

View file

@ -4,10 +4,10 @@
# === baseof == # === baseof ==
[backToTop] [backToTop]
other = "Retour en Haut" other = "Retour en haut"
[viewComments] [viewComments]
other = "Afficher les Commentaires" other = "Afficher les commentaires"
# === baseof == # === baseof ==
# === Post === # === Post ===
@ -17,7 +17,7 @@ other = "Posts"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Tous {{ .Some }}" other = "Tous les {{ .Some }}"
[tag] [tag]
other = "Balise" other = "Balise"
@ -34,7 +34,7 @@ other = "Catégories"
# === Pagination === # === Pagination ===
[more] [more]
other = "Plus" other = "Voir plus"
# === Pagination === # === Pagination ===
# === partials/header.html === # === partials/header.html ===
@ -42,7 +42,7 @@ other = "Plus"
other = "Choisir la langue" other = "Choisir la langue"
[switchTheme] [switchTheme]
other = "Changer de Thème" other = "Changer de thème"
# === partials/header.html === # === partials/header.html ===
# === partials/footer.html === # === partials/footer.html ===
@ -72,7 +72,7 @@ other = "Chercher"
other = "Rechercher des titres, des contenus..." other = "Rechercher des titres, des contenus..."
[clear] [clear]
other = "Clair" other = "Effacer"
[cancel] [cancel]
other = "Annuler" other = "Annuler"
@ -93,10 +93,10 @@ other = "Copier dans le presse-papiers"
other = "Ce site Web utilise des Cookies pour améliorer votre expérience." other = "Ce site Web utilise des Cookies pour améliorer votre expérience."
[cookieconsentDismiss] [cookieconsentDismiss]
other = "Se mettre d'accord" other = "J'accepte"
[cookieconsentLink] [cookieconsentLink]
other = "Apprendre encore plus" other = "En savoir plus"
# === partials/assets.html === # === partials/assets.html ===
# === partials/plugin/share.html === # === partials/plugin/share.html ===
@ -132,7 +132,7 @@ other = "Auteur"
other = "Mis à jour le {{ .Date }}" other = "Mis à jour le {{ .Date }}"
[readMarkdown] [readMarkdown]
other = "Lire Markdown" other = "Lire en Markdown"
[back] [back]
other = "Retour" other = "Retour"
@ -157,7 +157,7 @@ other = "Désolé, la page recherchée n'existe pas."
other = "Remarque" other = "Remarque"
[abstract] [abstract]
other = "Abstrait" other = "Résumé"
[info] [info]
other = "Info" other = "Info"
@ -195,8 +195,8 @@ other = "Citation"
other = "NOUVEAU" other = "NOUVEAU"
[changed] [changed]
other = "CHANGE" other = "CHANGÉ"
[deleted] [deleted]
other = "EFFACE" other = "EFFACÉ"
# === shortcodes/version.html === # === shortcodes/version.html ===

199
themes/LoveIt/i18n/nl.toml Normal file
View file

@ -0,0 +1,199 @@
# Translations for Dutch
# Vertalingen voor het Nederlands
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
[backToTop]
other = "Terug naar boven"
[viewComments]
other = "Bekijk opmerkingen"
# === baseof ==
# === Post ===
[posts]
other = "Berichten"
# === Post ===
# === Taxonomy ===
[allSome]
other = "Alle {{ .Some }}"
[tag]
other = "Tag"
[tags]
other = "Tags"
[category]
other = "Categorie"
[categories]
other = "Categorieën"
# === Taxonomy ===
# === Pagination ===
[more]
other = "Meer"
# === Pagination ===
# === partials/header.html ===
[selectLanguage]
other = "Selecteer Taal"
[switchTheme]
other = "Verander Thema"
# === partials/header.html ===
# === partials/footer.html ===
[poweredBySome]
other = "Aangedreven door {{ .Hugo }} | Thema - {{ .Theme }}"
# === partials/footer.html ===
# === partials/comment.html ===
[valineLang]
other = "nl"
[valinePlaceholder]
other = "Jouw opmerking"
[facebookLanguageCode]
other = "nl_nl"
[giscusLang]
other = "nl"
# === partials/comment.html ===
# === partials/assets.html ===
[search]
other = "Zoeken"
[searchPlaceholder]
other = "Zoek naar titels of andere inhoud..."
[clear]
other = "Wissen"
[cancel]
other = "Annuleren"
[noResultsFound]
other = "Geen resultaten gevonden"
[lunrLanguageCode]
other = "nl"
[copyToClipboard]
other = "Kopieer naar klembord"
[cookieconsentMessage]
other = "Deze website gebruikt cookies om de ervaring beter te maken."
[cookieconsentDismiss]
other = "Begrepen!"
[cookieconsentLink]
other = "Meer informatie"
# === partials/assets.html ===
# === partials/plugin/share.html ===
[shareOn]
other = "Delen op"
# === partials/plugin/share.html ===
# === posts/single.html ===
[contents]
other = "Content"
[publishedOnDate]
other = "gepubliceerd op {{ .Date }}"
[includedInCategories]
other = "inbegrepen in {{ .Categories }}"
[wordCount]
one = "Één woord"
other = "{{ .Count }} woorden"
[readingTime]
one = "Één minuut"
other = "{{ .Count }} minuten"
[views]
other = "Aantal keer bekeken"
[author]
other = "Auteur"
[updatedOnDate]
other = "Aangepast op {{ .Date }}"
[readMarkdown]
other = "Lees markdown"
[back]
other = "Terug"
[home]
other = "Homepagina"
[readMore]
other = "Lees Meer"
# === posts/single.html ===
# === 404.html ===
[pageNotFound]
other = "Pagina niet gevonden"
[pageNotFoundText]
other = "De pagina die je zocht bestaat niet, Sorry!"
# === 404.html ===
# === shortcodes/admonition.html ===
[note]
other = "Opmerking"
[abstract]
other = "Abstract"
[info]
other = "Info"
[tip]
other = "Tip"
[success]
other = "Gelukt"
[question]
other = "Vraag"
[warning]
other = "Waarschuwing"
[failure]
other = "Fout"
[danger]
other = "Gevaar"
[bug]
other = "Bug"
[example]
other = "Voorbeeld"
[quote]
other = "Citaat"
# === shortcodes/admonition.html ===
# === shortcodes/version.html ===
[new]
other = "NIEUW"
[changed]
other = "VERANDERD"
[deleted]
other = "VERWIJDERD"
# === shortcodes/version.html ===

198
themes/LoveIt/i18n/uk.toml Normal file
View file

@ -0,0 +1,198 @@
# Translations for Ukrainian
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
[backToTop]
other = "Повернутися до початку"
[viewComments]
other = "Переглянути коментарі"
# === baseof ==
# === Post ===
[posts]
other = "Публікації"
# === Post ===
# === Taxonomy ===
[allSome]
other = "Всі {{ .Some }}"
[tag]
other = "Тег"
[tags]
other = "Теги"
[category]
other = "Категорія"
[categories]
other = "Категорії"
# === Taxonomy ===
# === Pagination ===
[more]
other = "Більше"
# === Pagination ===
# === partials/header.html ===
[selectLanguage]
other = "Змінити мову"
[switchTheme]
other = "Змінити тему"
# === partials/header.html ===
# === partials/footer.html ===
[poweredBySome]
other = "Працює на основі {{ .Hugo }} | Theme - {{ .Theme }}"
# === partials/footer.html ===
# === partials/comment.html ===
[valineLang]
other = "en"
[valinePlaceholder]
other = "Ваш коментар ..."
[facebookLanguageCode]
other = "uk_UA"
[giscusLang]
other = "uk"
# === partials/comment.html ===
# === partials/assets.html ===
[search]
other = "Пошук"
[searchPlaceholder]
other = "Search titles or contents..."
[clear]
other = "Очистити"
[cancel]
other = "Скасувати"
[noResultsFound]
other = "Нічого не знайдено"
[lunrLanguageCode]
other = "uk"
[copyToClipboard]
other = "Скопіювати до буфера обміну"
[cookieconsentMessage]
other = "Цей веб-сайт використовує файли cookie, щоб покращити ваш досвід."
[cookieconsentDismiss]
other = "Зрозуміло!"
[cookieconsentLink]
other = "Дізнатися більше"
# === partials/assets.html ===
# === partials/plugin/share.html ===
[shareOn]
other = "Поділитися в"
# === partials/plugin/share.html ===
# === posts/single.html ===
[contents]
other = "Зміст"
[publishedOnDate]
other = "опубліковано {{ .Date }}"
[includedInCategories]
other = "включений в{{ .Categories }}"
[wordCount]
one = "Одне слово"
other = "{{ .Count }} слів"
[readingTime]
one = "Одна минута"
other = "{{ .Count }} минут"
[views]
other = "перегляди"
[author]
other = "Автор"
[updatedOnDate]
other = "Оновлено {{ .Date }}"
[readMarkdown]
other = "Читати Markdown"
[back]
other = "Повернутися"
[home]
other = "Головна"
[readMore]
other = "Детальніше"
# === posts/single.html ===
# === 404.html ===
[pageNotFound]
other = "Сторінку не знайдено"
[pageNotFoundText]
other = "Сторінка, яку ви шукаєте, не існує. Вибачте."
# === 404.html ===
# === shortcodes/admonition.html ===
[note]
other = "Примітка"
[abstract]
other = "Анотація"
[info]
other = "Інформація"
[tip]
other = "Порада"
[success]
other = "Успіх"
[question]
other = "Питання"
[warning]
other = "Попередження"
[failure]
other = "Невдача"
[danger]
other = "Небезпека"
[bug]
other = "Помилка"
[example]
other = "Приклад"
[quote]
other = "Цитата"
# === shortcodes/admonition.html ===
# === shortcodes/version.html ===
[new]
other = "НОВИЙ"
[changed]
other = "ЗМІНЕНИЙ"
[deleted]
other = "ВИДАЛЕНИЙ"
# === shortcodes/version.html ===

View file

@ -0,0 +1 @@
{{- dict "Content" .Inner "Lang" .Type "Options" .Options | partial "plugin/code-block.html" -}}

View file

@ -35,7 +35,9 @@
<a href="#" id="back-to-top" class="fixed-button" title="{{ T `backToTop` }}"> <a href="#" id="back-to-top" class="fixed-button" title="{{ T `backToTop` }}">
<i class="fas fa-arrow-up fa-fw" aria-hidden="true"></i> <i class="fas fa-arrow-up fa-fw" aria-hidden="true"></i>
</a> </a>
</div>
<div id="fixed-buttons-hidden">
{{- /* comment button */ -}} {{- /* comment button */ -}}
<a href="#" id="view-comments" class="fixed-button" title="{{ T `viewComments` }}"> <a href="#" id="view-comments" class="fixed-button" title="{{ T `viewComments` }}">
<i class="fas fa-comment fa-fw" aria-hidden="true"></i> <i class="fas fa-comment fa-fw" aria-hidden="true"></i>

View file

@ -24,8 +24,8 @@
{{- /* Meta */ -}} {{- /* Meta */ -}}
<div class="post-meta"> <div class="post-meta">
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}} {{- $author := $params.author | default .Site.Params.Author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}} {{- $authorLink := $params.authorlink | default .Site.Params.Author.link | default .Site.Home.RelPermalink -}}
<span class="post-author"> <span class="post-author">
{{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}} {{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}}
{{- partial "plugin/a.html" $options -}} {{- partial "plugin/a.html" $options -}}

View file

@ -15,12 +15,12 @@
{{- . -}} {{- . -}}
</language> </language>
{{- end -}} {{- end -}}
{{- with .Site.Author.email -}} {{- with .Site.Params.Author.email -}}
<managingEditor> <managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} {{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</managingEditor> </managingEditor>
<webMaster> <webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} {{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</webMaster> </webMaster>
{{- end -}} {{- end -}}
{{- with .Site.Copyright -}} {{- with .Site.Copyright -}}

View file

@ -24,7 +24,7 @@
{{- dict "Source" (T "lunrLanguageLib") "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- dict "Source" (T "lunrLanguageLib") "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}} {{- end -}}
{{- else if eq $search.type "algolia" -}} {{- else if eq $search.type "algolia" -}}
{{- $source := $cdn.algoliasearchJS | default "lib/algoliasearch/algoliasearch-lite.umd.min.js" -}} {{- $source := $cdn.algoliasearchJS | default "lib/algoliasearch/lite/browser.umd.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "type" "algolia" "algoliaIndex" $search.algolia.index "algoliaAppID" $search.algolia.appID "algoliaSearchKey" $search.algolia.searchKey | dict "search" | merge $config -}} {{- $config = dict "type" "algolia" "algoliaIndex" $search.algolia.index "algoliaAppID" $search.algolia.appID "algoliaSearchKey" $search.algolia.searchKey | dict "search" | merge $config -}}
{{- end -}} {{- end -}}
@ -52,6 +52,7 @@
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/plugins/zoom/lg-zoom.min.js" -}} {{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/plugins/zoom/lg-zoom.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "lightgallery" true | merge $config -}} {{- $config = dict "lightgallery" true | merge $config -}}
{{- $_ := (resources.Get "lib/lightgallery/images/loading.gif").RelPermalink -}}
{{- end -}} {{- end -}}
{{- $code := $params.code | default dict -}} {{- $code := $params.code | default dict -}}
@ -152,7 +153,9 @@
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}} {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" "enableSourceMap" true -}} {{- $options := dict "targetPath" "lib/aplayer/dark.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}} {{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}} {{- /* To fix https://github.com/dillonzq/LoveIt/issues/869 */ -}}
{{- /* Local file from https://github.com/DIYgod/APlayer/pull/777, no CDN */ -}}
{{- $source := "lib/aplayer/APlayer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* MetingJS */ -}} {{- /* MetingJS */ -}}

View file

@ -32,7 +32,7 @@
{{- /* Author */ -}} {{- /* Author */ -}}
{{- if ne .Site.Params.footer.author false -}} {{- if ne .Site.Params.footer.author false -}}
<span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Author.name }}</a></span> <span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Params.Author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Params.Author.name }}</a></span>
{{- end -}} {{- end -}}
{{- /* License */ -}} {{- /* License */ -}}

View file

@ -0,0 +1,18 @@
{{- /* To Bool */ -}}
{{- $bool := . -}}
{{- if eq . true -}}
{{- $bool = true -}}
{{- else if eq . false -}}
{{- $bool = false -}}
{{- else if eq . "true" -}}
{{- $bool = true -}}
{{- else if eq . "false" -}}
{{- $bool = false -}}
{{- else if eq . "1" -}}
{{- $bool = true -}}
{{- else if eq . "0" -}}
{{- $bool = false -}}
{{- end -}}
{{- return $bool -}}

View file

@ -0,0 +1,14 @@
{{- /* To Dict */ -}}
{{- /* "a=1, b=2" -> dict "a" "1" "b" "2" */ -}}
{{- $dict := dict -}}
{{- if reflect.IsMap . -}}
{{- $dict = . -}}
{{- else -}}
{{- range split . "," -}}
{{- $parts := split (trim . " ") "=" -}}
{{- $dict = dict (index $parts 0) (delimit (after 1 $parts) "") | merge $dict -}}
{{- end -}}}
{{- end -}}
{{- return $dict -}}

View file

@ -26,7 +26,7 @@
{{- with .Site.LanguageCode -}} {{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}", "inLanguage": "{{ . }}",
{{- end -}} {{- end -}}
{{- with .Site.Author.name -}} {{- with .Site.Params.Author.name -}}
"author": { "author": {
"@type": "Person", "@type": "Person",
"name": {{ . | safeHTML }} "name": {{ . | safeHTML }}
@ -122,7 +122,7 @@
{{- with .Site.Copyright -}} {{- with .Site.Copyright -}}
"license": {{ . | safeHTML }}, "license": {{ . | safeHTML }},
{{- end -}} {{- end -}}
{{- $publisher := .Params.author | default .Site.Author.name | default (T "author") | dict "name" -}} {{- $publisher := .Params.author | default .Site.Params.Author.name | default (T "author") | dict "name" -}}
{{- $publisher = $params.seo.publisher | default dict | merge $publisher -}} {{- $publisher = $params.seo.publisher | default dict | merge $publisher -}}
"publisher": { "publisher": {
"@type": "Organization", "@type": "Organization",
@ -141,7 +141,7 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
}, },
{{- with .Params.author | default .Site.Author.name | default (T "author") -}} {{- with .Params.author | default .Site.Params.Author.name | default (T "author") -}}
"author": { "author": {
"@type": "Person", "@type": "Person",
"name": {{ . | safeHTML }} "name": {{ . | safeHTML }}

View file

@ -57,9 +57,9 @@
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}"> <a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i> <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
</a> </a>
{{- if .Site.IsMultiLingual -}} {{- if hugo.IsMultilingual -}}
<a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}"> <a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}">
<i class="fa fa-globe" aria-hidden="true"></i> <i class="fa fa-globe fa-fw" aria-hidden="true"></i>
<select class="language-select" id="language-select-desktop" onchange="location = this.value;"> <select class="language-select" id="language-select-desktop" onchange="location = this.value;">
{{- if eq .Kind "404" -}} {{- if eq .Kind "404" -}}
{{- /* https://github.com/dillonzq/LoveIt/issues/378 */ -}} {{- /* https://github.com/dillonzq/LoveIt/issues/378 */ -}}
@ -149,7 +149,7 @@
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}"> <a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i> <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
</a> </a>
{{- if .Site.IsMultiLingual -}} {{- if hugo.IsMultilingual -}}
<a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}"> <a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
<i class="fa fa-globe fa-fw" aria-hidden="true"></i> <i class="fa fa-globe fa-fw" aria-hidden="true"></i>

View file

@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "0.2.11" -}} {{- .Scratch.Set "version" "0.3.0" -}}
{{- $params := .Params | merge .Site.Params.page -}} {{- $params := .Params | merge .Site.Params.page -}}
@ -21,8 +21,9 @@
{{- else if eq .Params.comment false -}} {{- else if eq .Params.comment false -}}
{{- .Scratch.Set "comment" dict -}} {{- .Scratch.Set "comment" dict -}}
{{- end -}} {{- end -}}
{{- else if eq .Site .Sites.First -}} {{- else if eq .Site .Sites.Default -}}
{{- warnf "\n\nCurrent environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled.\n当前运行环境是 \"development\". \"评论系统\", \"CDN\" 和 \"fingerprint\" 不会启用.\n" -}} {{- warnf "Current environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled.\n" -}}
{{- warnf "当前运行环境是 \"development\". \"评论系统\", \"CDN\" 和 \"fingerprint\" 不会启用.\n" -}}
{{- end -}} {{- end -}}
{{- .Scratch.Set "params" $params -}} {{- .Scratch.Set "params" $params -}}

View file

@ -0,0 +1,17 @@
{{- $content := .Content -}}
{{- $lang := .Lang -}}
{{- $options := dict "lineNoStart" 1 "lineNos" true -}}
{{- $options = .Options | partial "function/dict.html" | merge $options -}}
{{- $lineNoStart := $options.lineNoStart | int -}}
{{- $lineNos := $options.lineNos | partial "function/bool.html" -}}
{{- $options = dict "noClasses" false "lineNos" false | merge $options -}}
{{- $result := transform.Highlight $content $lang $options -}}
<div class="code-block{{ if $lineNos }} code-line-numbers{{ end }} open" style="counter-reset: code-block {{ sub $lineNoStart 1 }}">
<div class="code-header language-bash">
<span class="code-title"><i class="arrow fas fa-chevron-right fa-fw" aria-hidden="true"></i></span>
<span class="ellipses"><i class="fas fa-ellipsis-h fa-fw" aria-hidden="true"></i></span>
<span class="copy" title="{{ T "copyToClipboard" }}"><i class="far fa-copy fa-fw" aria-hidden="true"></i></span>
</div>
{{- $result -}}
</div>

View file

@ -1,4 +1,4 @@
{{- $params := .Page.Params | merge .Site.Params.Page | merge (dict "author" .Site.Author.name) -}} {{- $params := .Page.Params | merge .Site.Params.Page | merge (dict "author" .Site.Params.Author.name) -}}
<item> <item>
<title> <title>
{{- .Page.Title -}} {{- .Page.Title -}}

View file

@ -15,12 +15,12 @@
{{- . -}} {{- . -}}
</language> </language>
{{- end -}} {{- end -}}
{{- with .Site.Author.email -}} {{- with .Site.Params.Author.email -}}
<managingEditor> <managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} {{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</managingEditor> </managingEditor>
<webMaster> <webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} {{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</webMaster> </webMaster>
{{- end -}} {{- end -}}
{{- with .Site.Copyright -}} {{- with .Site.Copyright -}}

View file

@ -30,8 +30,8 @@
{{- /* Meta */ -}} {{- /* Meta */ -}}
<div class="post-meta"> <div class="post-meta">
<div class="post-meta-line"> <div class="post-meta-line">
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}} {{- $author := $params.author | default .Site.Params.Author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}} {{- $authorLink := $params.authorlink | default .Site.Params.Author.link | default .Site.Home.RelPermalink -}}
<span class="post-author"> <span class="post-author">
{{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}} {{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}}
{{- partial "plugin/a.html" $options -}} {{- partial "plugin/a.html" $options -}}

View file

@ -0,0 +1,7 @@
{{- $content := trim .InnerDeindent "\n\r" -}}
{{- $lang := .Get 0 -}}
{{- $options := "" -}}
{{- if len .Params | eq 2 -}}
{{- $options = .Get 1 -}}
{{- end -}}
{{- dict "Content" $content "Lang" $lang "Options" $options | partial "plugin/code-block.html" -}}

View file

@ -3,7 +3,7 @@
{{- $type := .Get 1 | default "new" | lower -}} {{- $type := .Get 1 | default "new" | lower -}}
{{- $label := T $type -}} {{- $label := T $type -}}
{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}} {{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}}
{{- $pathTemplate := cond .Site.IsMultiLingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}} {{- $pathTemplate := cond hugo.IsMultilingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}}
{{- $path := printf $pathTemplate $version $type -}} {{- $path := printf $pathTemplate $version $type -}}
{{- $resource := resources.Get "svg/version.template.svg" -}} {{- $resource := resources.Get "svg/version.template.svg" -}}
{{- $resource = $resource | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}} {{- $resource = $resource | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}

View file

@ -15,12 +15,12 @@
{{- . -}} {{- . -}}
</language> </language>
{{- end -}} {{- end -}}
{{- with .Site.Author.email -}} {{- with .Site.Params.Author.email -}}
<managingEditor> <managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} {{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</managingEditor> </managingEditor>
<webMaster> <webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} {{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</webMaster> </webMaster>
{{- end -}} {{- end -}}
{{- with .Site.Copyright -}} {{- with .Site.Copyright -}}

View file

@ -0,0 +1,18 @@
[build]
publish = "exampleSite/public"
[build.environment]
HUGO_VERSION = "0.144.2"
HUGO_ENABLEGITINFO = "true"
[context.production]
command = "hugo --source exampleSite --theme repo --themesDir ../.. --baseURL ${URL} --gc --minify"
[context.production.environment]
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --source exampleSite --theme repo --themesDir ../.. --baseURL ${DEPLOY_PRIME_URL} --gc --minify --buildDrafts"
[context.branch-deploy]
command = "hugo --source exampleSite --theme repo --themesDir ../.. --baseURL ${DEPLOY_PRIME_URL} --gc --minify"

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "loveit-src", "name": "loveit-src",
"version": "0.2.0", "version": "0.3.0",
"description": "LoveIt theme source file", "description": "LoveIt theme source file",
"private": true, "private": true,
"devDependencies": { "devDependencies": {
@ -16,14 +16,15 @@
}, },
"scripts": { "scripts": {
"preinstall": "npx npm-force-resolutions", "preinstall": "npx npm-force-resolutions",
"babel": "npx babel src/js --out-file assets/js/theme.js", "prepare": "husky install",
"build": "npm run babel && hugo -v --source=exampleSite --themesDir ../.. --gc", "compile": "npx babel src/js --out-file assets/js/theme.js",
"build-lunr-segmentit": "browserify src/lib/lunr/lunr.segmentit.js -o assets/lib/lunr/lunr.segmentit.js -t babelify --presets @babel/preset-env", "compile-lunr-segmentit": "browserify src/lib/lunr/lunr.segmentit.js -o assets/lib/lunr/lunr.segmentit.js -t babelify --presets @babel/preset-env",
"start": "npm run babel && hugo server --source=exampleSite --themesDir ../.. -D --disableFastRender", "hugo": "hugo --source exampleSite --buildDrafts --gc",
"start-production": "npm run babel && hugo server --source=exampleSite --themesDir ../.. -D --disableFastRender -e production", "hugo-production": "hugo --source exampleSite --gc --minify --environment production",
"check": "htmlproofer exampleSite/public --check-html --allow-hash-href --empty-alt-ignore --disable-external", "hugo-server": "hugo server --source exampleSite --buildDrafts --disableFastRender",
"copy": "rm -rf resources && cp -rf exampleSite/resources resources", "hugo-server-production": "hugo server --source exampleSite --minify --disableFastRender --environment production",
"prepare": "husky install" "htmlproofer": "htmlproofer exampleSite/public --disable-external true --ignore-missing-alt true",
"copy-resources": "cp -rf exampleSite/resources ."
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -1,22 +1,22 @@
class Util { class Util {
forEach(elements, handler) { static forEach(elements, handler) {
elements = elements || []; elements = elements || [];
for (let i = 0; i < elements.length; i++) handler(elements[i]); for (let i = 0; i < elements.length; i++) handler(elements[i]);
} }
getScrollTop() { static getScrollTop() {
return (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop; return (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
} }
isMobile() { static isMobile() {
return window.matchMedia('only screen and (max-width: 680px)').matches; return window.matchMedia('only screen and (max-width: 680px)').matches;
} }
isTocStatic() { static isTocStatic() {
return window.matchMedia('only screen and (max-width: 960px)').matches; return window.matchMedia('only screen and (max-width: 960px)').matches;
} }
animateCSS(element, animation, reserved, callback) { static animateCSS(element, animation, reserved, callback) {
if (!Array.isArray(animation)) animation = [animation]; if (!Array.isArray(animation)) animation = [animation];
element.classList.add('animate__animated', ...animation); element.classList.add('animate__animated', ...animation);
const handler = () => { const handler = () => {
@ -33,8 +33,7 @@ class Theme {
this.config = window.config; this.config = window.config;
this.data = this.config.data; this.data = this.config.data;
this.isDark = document.body.getAttribute('theme') === 'dark'; this.isDark = document.body.getAttribute('theme') === 'dark';
this.util = new Util(); this.newScrollTop = Util.getScrollTop();
this.newScrollTop = this.util.getScrollTop();
this.oldScrollTop = this.newScrollTop; this.oldScrollTop = this.newScrollTop;
this.scrollEventSet = new Set(); this.scrollEventSet = new Set();
this.resizeEventSet = new Set(); this.resizeEventSet = new Set();
@ -44,13 +43,13 @@ class Theme {
} }
initRaw() { initRaw() {
this.util.forEach(document.querySelectorAll('[data-raw]'), $raw => { Util.forEach(document.querySelectorAll('[data-raw]'), $raw => {
$raw.innerHTML = this.data[$raw.id]; $raw.innerHTML = this.data[$raw.id];
}); });
} }
initSVGIcon() { initSVGIcon() {
this.util.forEach(document.querySelectorAll('[data-svg-src]'), $icon => { Util.forEach(document.querySelectorAll('[data-svg-src]'), $icon => {
fetch($icon.getAttribute('data-svg-src')) fetch($icon.getAttribute('data-svg-src'))
.then(response => response.text()) .then(response => response.text())
.then(svg => { .then(svg => {
@ -87,7 +86,7 @@ class Theme {
} }
initSwitchTheme() { initSwitchTheme() {
this.util.forEach(document.getElementsByClassName('theme-switch'), $themeSwitch => { Util.forEach(document.getElementsByClassName('theme-switch'), $themeSwitch => {
$themeSwitch.addEventListener('click', () => { $themeSwitch.addEventListener('click', () => {
if (document.body.getAttribute('theme') === 'dark') document.body.setAttribute('theme', 'light'); if (document.body.getAttribute('theme') === 'dark') document.body.setAttribute('theme', 'light');
else document.body.setAttribute('theme', 'dark'); else document.body.setAttribute('theme', 'dark');
@ -100,7 +99,7 @@ class Theme {
initSearch() { initSearch() {
const searchConfig = this.config.search; const searchConfig = this.config.search;
const isMobile = this.util.isMobile(); const isMobile = Util.isMobile();
if (!searchConfig || isMobile && this._searchMobileOnce || !isMobile && this._searchDesktopOnce) return; if (!searchConfig || isMobile && this._searchMobileOnce || !isMobile && this._searchDesktopOnce) return;
const maxResultLength = searchConfig.maxResultLength ? searchConfig.maxResultLength : 10; const maxResultLength = searchConfig.maxResultLength ? searchConfig.maxResultLength : 10;
@ -198,10 +197,10 @@ class Theme {
}); });
position -= snippetLength / 5; position -= snippetLength / 5;
if (position > 0) { if (position > 0) {
position += context.substr(position, 20).lastIndexOf(' ') + 1; position += context.slice(position, position + 20).lastIndexOf(' ') + 1;
context = '...' + context.substr(position, snippetLength); context = '...' + context.slice(position, position + snippetLength);
} else { } else {
context = context.substr(0, snippetLength); context = context.slice(0, snippetLength);
} }
Object.keys(metadata).forEach(key => { Object.keys(metadata).forEach(key => {
title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1</${highlightTag}>`); title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1</${highlightTag}>`);
@ -242,17 +241,24 @@ class Theme {
}); });
} else finish(search()); } else finish(search());
} else if (searchConfig.type === 'algolia') { } else if (searchConfig.type === 'algolia') {
this._algoliaIndex = this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex); const { liteClient: algoliasearch } = window['algoliasearch/lite'];
this._algoliaIndex = this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey);
this._algoliaIndex this._algoliaIndex
.search(query, { .search({
requests: [
{
indexName: searchConfig.algoliaIndex,
query: query,
offset: 0, offset: 0,
length: maxResultLength * 8, length: maxResultLength * 8,
attributesToHighlight: ['title'], attributesToHighlight: ['title'],
attributesToSnippet: [`content:${snippetLength}`], attributesToSnippet: [`content:${snippetLength}`],
highlightPreTag: `<${highlightTag}>`, highlightPreTag: `<${highlightTag}>`,
highlightPostTag: `</${highlightTag}>`, highlightPostTag: `</${highlightTag}>`,
}
]
}) })
.then(({ hits }) => { .then(({ results: [{ hits }] }) => {
const results = {}; const results = {};
hits.forEach(({ uri, date, _highlightResult: { title }, _snippetResult: { content } }) => { hits.forEach(({ uri, date, _highlightResult: { title }, _snippetResult: { content } }) => {
if (results[uri] && results[uri].context.length > content.value) return; if (results[uri] && results[uri].context.length > content.value) return;
@ -301,7 +307,7 @@ class Theme {
script.async = true; script.async = true;
if (script.readyState) { if (script.readyState) {
script.onreadystatechange = () => { script.onreadystatechange = () => {
if (script.readyState == 'loaded' || script.readyState == 'complete'){ if (script.readyState === 'loaded' || script.readyState === 'complete'){
script.onreadystatechange = null; script.onreadystatechange = null;
initAutosearch(); initAutosearch();
} }
@ -316,7 +322,7 @@ class Theme {
} }
initDetails() { initDetails() {
this.util.forEach(document.getElementsByClassName('details'), $details => { Util.forEach(document.getElementsByClassName('details'), $details => {
const $summary = $details.getElementsByClassName('details-summary')[0]; const $summary = $details.getElementsByClassName('details-summary')[0];
$summary.addEventListener('click', () => { $summary.addEventListener('click', () => {
$details.classList.toggle('open'); $details.classList.toggle('open');
@ -341,71 +347,37 @@ class Theme {
} }
initHighlight() { initHighlight() {
this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), $preChroma => { Util.forEach(document.querySelectorAll('.code-block'), $codeBlock => {
const $chroma = document.createElement('div'); const $codeTitle = $codeBlock.querySelector('.code-header > .code-title');
$chroma.className = $preChroma.className; if ($codeTitle) {
const $table = document.createElement('table'); $codeTitle.addEventListener('click', () => {
$chroma.appendChild($table); $codeBlock.classList.toggle('open');
const $tbody = document.createElement('tbody');
$table.appendChild($tbody);
const $tr = document.createElement('tr');
$tbody.appendChild($tr);
const $td = document.createElement('td');
$tr.appendChild($td);
$preChroma.parentElement.replaceChild($chroma, $preChroma);
$td.appendChild($preChroma);
});
this.util.forEach(document.querySelectorAll('.highlight > .chroma'), $chroma => {
const $codeElements = $chroma.querySelectorAll('pre.chroma > code');
if ($codeElements.length) {
const $code = $codeElements[$codeElements.length - 1];
const $header = document.createElement('div');
$header.className = 'code-header ' + $code.className.toLowerCase();
const $title = document.createElement('span');
$title.classList.add('code-title');
$title.insertAdjacentHTML('afterbegin', '<i class="arrow fas fa-chevron-right fa-fw" aria-hidden="true"></i>');
$title.addEventListener('click', () => {
$chroma.classList.toggle('open');
}, false); }, false);
$header.appendChild($title); }
const $ellipses = document.createElement('span'); const $ellipses = $codeBlock.querySelector('.code-header .ellipses');
$ellipses.insertAdjacentHTML('afterbegin', '<i class="fas fa-ellipsis-h fa-fw" aria-hidden="true"></i>'); if ($ellipses) {
$ellipses.classList.add('ellipses');
$ellipses.addEventListener('click', () => { $ellipses.addEventListener('click', () => {
$chroma.classList.add('open'); $codeBlock.classList.toggle('open');
}, false); }, false);
$header.appendChild($ellipses); }
const $copy = document.createElement('span'); const $copy = $codeBlock.querySelector('.code-header .copy');
$copy.insertAdjacentHTML('afterbegin', '<i class="far fa-copy fa-fw" aria-hidden="true"></i>'); if ($copy) {
$copy.classList.add('copy'); const $code = $codeBlock.querySelector('code');
const code = $code.innerText; $copy.setAttribute('data-clipboard-text', $code.innerText);
if (this.config.code.maxShownLines < 0 || code.split('\n').length < this.config.code.maxShownLines + 2) $chroma.classList.add('open');
if (this.config.code.copyTitle) {
$copy.setAttribute('data-clipboard-text', code);
$copy.title = this.config.code.copyTitle;
const clipboard = new ClipboardJS($copy); const clipboard = new ClipboardJS($copy);
const $codeLines = $code.querySelectorAll('span.cl');
clipboard.on('success', _e => { clipboard.on('success', _e => {
this.util.animateCSS($code, 'animate__flash'); if ($codeLines) {
}); Util.forEach($codeLines, $codeLine => Util.animateCSS($codeLine, 'animate__flash'))
$header.appendChild($copy);
}
$chroma.insertBefore($header, $chroma.firstChild);
} }
}); });
} }
initTable() {
this.util.forEach(document.querySelectorAll('.content table'), $table => {
const $wrapper = document.createElement('div');
$wrapper.className = 'table-wrapper';
$table.parentElement.replaceChild($wrapper, $table);
$wrapper.appendChild($table);
}); });
} }
initHeaderLink() { initHeaderLink() {
for (let num = 1; num <= 6; num++) { for (let num = 1; num <= 6; num++) {
this.util.forEach(document.querySelectorAll('.single .content > h' + num), $header => { Util.forEach(document.querySelectorAll('.single .content > h' + num), $header => {
$header.classList.add('headerLink'); $header.classList.add('headerLink');
$header.insertAdjacentHTML('afterbegin', `<a href="#${$header.id}" class="header-mark"></a>`); $header.insertAdjacentHTML('afterbegin', `<a href="#${$header.id}" class="header-mark"></a>`);
}); });
@ -415,7 +387,7 @@ class Theme {
initToc() { initToc() {
const $tocCore = document.getElementById('TableOfContents'); const $tocCore = document.getElementById('TableOfContents');
if ($tocCore === null) return; if ($tocCore === null) return;
if (document.getElementById('toc-static').getAttribute('data-kept') || this.util.isTocStatic()) { if (document.getElementById('toc-static').getAttribute('data-kept') || Util.isTocStatic()) {
const $tocContentStatic = document.getElementById('toc-content-static'); const $tocContentStatic = document.getElementById('toc-content-static');
if ($tocCore.parentElement !== $tocContentStatic) { if ($tocCore.parentElement !== $tocContentStatic) {
$tocCore.parentElement.removeChild($tocCore); $tocCore.parentElement.removeChild($tocCore);
@ -457,14 +429,14 @@ class Theme {
$toc.style.top = `${TOP_SPACING}px`; $toc.style.top = `${TOP_SPACING}px`;
} }
this.util.forEach($tocLinkElements, $tocLink => { $tocLink.classList.remove('active'); }); Util.forEach($tocLinkElements, $tocLink => { $tocLink.classList.remove('active'); });
this.util.forEach($tocLiElements, $tocLi => { $tocLi.classList.remove('has-active'); }); Util.forEach($tocLiElements, $tocLi => { $tocLi.classList.remove('has-active'); });
const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0); const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
let activeTocIndex = $headerLinkElements.length - 1; let activeTocIndex = $headerLinkElements.length - 1;
for (let i = 0; i < $headerLinkElements.length - 1; i++) { for (let i = 0; i < $headerLinkElements.length - 1; i++) {
const thisTop = $headerLinkElements[i].getBoundingClientRect().top; const thisTop = $headerLinkElements[i].getBoundingClientRect().top;
const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top; const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;
if ((i == 0 && thisTop > INDEX_SPACING) if ((i === 0 && thisTop > INDEX_SPACING)
|| (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) { || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {
activeTocIndex = i; activeTocIndex = i;
break; break;
@ -493,7 +465,7 @@ class Theme {
const $mermaidElements = document.getElementsByClassName('mermaid'); const $mermaidElements = document.getElementsByClassName('mermaid');
if ($mermaidElements.length) { if ($mermaidElements.length) {
mermaid.initialize({startOnLoad: false, theme: this.isDark ? 'dark' : 'neutral', securityLevel: 'loose'}); mermaid.initialize({startOnLoad: false, theme: this.isDark ? 'dark' : 'neutral', securityLevel: 'loose'});
this.util.forEach($mermaidElements, $mermaid => { Util.forEach($mermaidElements, $mermaid => {
mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => { mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {
$mermaid.innerHTML = svgCode; $mermaid.innerHTML = svgCode;
}, $mermaid); }, $mermaid);
@ -514,7 +486,7 @@ class Theme {
this._echartsArr[i].dispose(); this._echartsArr[i].dispose();
} }
this._echartsArr = []; this._echartsArr = [];
this.util.forEach(document.getElementsByClassName('echarts'), $echarts => { Util.forEach(document.getElementsByClassName('echarts'), $echarts => {
const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', {renderer: 'svg'}); const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', {renderer: 'svg'});
chart.setOption(JSON.parse(this.data[$echarts.id])); chart.setOption(JSON.parse(this.data[$echarts.id]));
this._echartsArr.push(chart); this._echartsArr.push(chart);
@ -536,7 +508,7 @@ class Theme {
mapboxgl.accessToken = this.config.mapbox.accessToken; mapboxgl.accessToken = this.config.mapbox.accessToken;
mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin); mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);
this._mapboxArr = this._mapboxArr || []; this._mapboxArr = this._mapboxArr || [];
this.util.forEach(document.getElementsByClassName('mapbox'), $mapbox => { Util.forEach(document.getElementsByClassName('mapbox'), $mapbox => {
const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id]; const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id];
const mapbox = new mapboxgl.Map({ const mapbox = new mapboxgl.Map({
container: $mapbox, container: $mapbox,
@ -571,7 +543,7 @@ class Theme {
this._mapboxArr.push(mapbox); this._mapboxArr.push(mapbox);
}); });
this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => { this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {
this.util.forEach(this._mapboxArr, mapbox => { Util.forEach(this._mapboxArr, mapbox => {
const $mapbox = mapbox.getContainer(); const $mapbox = mapbox.getContainer();
const { lightStyle, darkStyle } = this.data[$mapbox.id]; const { lightStyle, darkStyle } = this.data[$mapbox.id];
mapbox.setStyle(this.isDark ? darkStyle : lightStyle); mapbox.setStyle(this.isDark ? darkStyle : lightStyle);
@ -591,7 +563,7 @@ class Theme {
Object.values(typeitConfig.data).forEach(group => { Object.values(typeitConfig.data).forEach(group => {
const typeone = (i) => { const typeone = (i) => {
const id = group[i]; const id = group[i];
const instance = new TypeIt(`#${id}`, { new TypeIt(`#${id}`, {
strings: this.data[id], strings: this.data[id],
speed: speed, speed: speed,
lifeLike: true, lifeLike: true,
@ -692,36 +664,37 @@ class Theme {
if (document.getElementById('comments')) { if (document.getElementById('comments')) {
const $viewComments = document.getElementById('view-comments'); const $viewComments = document.getElementById('view-comments');
$viewComments.href = `#comments`; $viewComments.href = `#comments`;
$viewComments.style.display = 'block'; $viewComments.parentElement.removeChild($viewComments);
document.getElementById('fixed-buttons').appendChild($viewComments);
} }
const $fixedButtons = document.getElementById('fixed-buttons'); const $fixedButtons = document.getElementById('fixed-buttons');
const ACCURACY = 20, MINIMUM = 100; const ACCURACY = 20, MINIMUM = 100;
window.addEventListener('scroll', () => { window.addEventListener('scroll', () => {
this.newScrollTop = this.util.getScrollTop(); this.newScrollTop = Util.getScrollTop();
const scroll = this.newScrollTop - this.oldScrollTop; const scroll = this.newScrollTop - this.oldScrollTop;
const isMobile = this.util.isMobile(); const isMobile = Util.isMobile();
this.util.forEach($headers, $header => { Util.forEach($headers, $header => {
if (scroll > ACCURACY) { if (scroll > ACCURACY) {
$header.classList.remove('animate__fadeInDown'); $header.classList.remove('animate__fadeInDown');
this.util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true); Util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
} else if (scroll < - ACCURACY) { } else if (scroll < - ACCURACY) {
$header.classList.remove('animate__fadeOutUp'); $header.classList.remove('animate__fadeOutUp');
this.util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true); Util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
} }
}); });
if (this.newScrollTop > MINIMUM) { if (this.newScrollTop > MINIMUM) {
if (isMobile && scroll > ACCURACY) { if (isMobile && scroll > ACCURACY) {
$fixedButtons.classList.remove('animate__fadeIn'); $fixedButtons.classList.remove('animate__fadeIn');
this.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true); Util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} else if (!isMobile || scroll < - ACCURACY) { } else if (!isMobile || scroll < - ACCURACY) {
$fixedButtons.style.display = 'block'; $fixedButtons.style.display = 'block';
$fixedButtons.classList.remove('animate__fadeOut'); $fixedButtons.classList.remove('animate__fadeOut');
this.util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true); Util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
} }
} else { } else {
if (!isMobile) { if (!isMobile) {
$fixedButtons.classList.remove('animate__fadeIn'); $fixedButtons.classList.remove('animate__fadeIn');
this.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true); Util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} }
$fixedButtons.style.display = 'none'; $fixedButtons.style.display = 'none';
} }
@ -762,7 +735,6 @@ class Theme {
this.initDetails(); this.initDetails();
this.initLightGallery(); this.initLightGallery();
this.initHighlight(); this.initHighlight();
this.initTable();
this.initHeaderLink(); this.initHeaderLink();
this.initMath(); this.initMath();
this.initMermaid(); this.initMermaid();

View file

@ -23,7 +23,7 @@ features = [
"SEO Optimized" "SEO Optimized"
] ]
min_version = "0.62.0" min_version = "0.128.0"
[author] [author]
name = "Dillon" name = "Dillon"