Copy to clipboard feature for code block ()

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
This commit is contained in:
Geoffrey Garrett 2022-07-03 20:42:35 +02:00 committed by GitHub
parent 015ed4cfa2
commit f54df35767
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 114 additions and 14 deletions
assets/js

View file

@ -8,7 +8,7 @@ const syntaxTheme = document.querySelector("#theme-link");
if (currentTheme) {
document.documentElement.setAttribute('saved-theme', currentTheme);
(currentTheme === 'dark') ? syntaxTheme.href = '{{ $darkSyntax.Permalink }}' : syntaxTheme.href = '{{ $lightSyntax.Permalink }}';
syntaxTheme.href = currentTheme === 'dark' ? '{{ $darkSyntax.Permalink }}' : '{{ $lightSyntax.Permalink }}';
}
const switchTheme = (e) => {