feature: option to disallow text selecting

This commit is contained in:
Mivinci 2021-10-29 00:19:57 +08:00
parent 9bcd2650ae
commit 458b7c3904
4 changed files with 8 additions and 2 deletions

View file

@ -1,2 +1,3 @@
import "./theme";
import "./style";
import "./selectable";

4
assets/js/selectable.js Normal file
View file

@ -0,0 +1,4 @@
const selectable = '{{ .Site.Params.selectable }}'
if (selectable === 'false') {
document.documentElement.style = 'user-select:none'
}

View file

@ -1,7 +1,6 @@
* {
line-height: 1;
-webkit-tap-highlight-color: rgba(0,0,0,0);
user-select: none;
outline: none;
}

View file

@ -32,8 +32,10 @@ comment = "disqus"
timeformat = "Jan 2, 2006"
# switch for turning on/off lights.
switch = ["🌚", "🌝"]
# if true, date of posts will be displayed in the homepage
# if true, date of posts will be displayed in the homepage.
displayDate = true
# if true, users can select text from your post.
selectable = false
# OvO is a comment plugin written by the author of Minima.