Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix and format JavaScript and SCSS code #606

Merged
merged 2 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
assets/bootstrap/template.js
assets/service-worker/config.template.ts
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'prettier'
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
],
rules: {
'prettier/prettier': 'error'
}
}
19 changes: 0 additions & 19 deletions .eslintrc.json

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
29 changes: 13 additions & 16 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{
"extends":"stylelint-config-standard",
"plugins":[
"stylelint-scss"
],
"rules":{
"at-rule-no-unknown":null,
"scss/at-rule-no-unknown":true,
"font-family-no-missing-generic-family-keyword":[
true,
{
"ignoreFontFamilies":[
"Font Awesome 5 Free"
]
}
]
}
"extends": ["stylelint-config-standard", "stylelint-config-standard-scss"],
"rules": {
"string-quotes": "single",
"color-function-notation": "legacy",
"scss/no-global-function-names": null,
"alpha-value-notation": "number"
},
"ignoreFiles": [
"assets/main/scss/_config.scss",
"assets/main/scss/_highlight.scss",
"assets/main/scss/index.scss",
"assets/main/scss/index.rtl.scss"
]
}
18 changes: 8 additions & 10 deletions assets/docsearch/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@ import docsearch from '@docsearch/js';
import { default as params } from '@params';
import { default as customOptions } from './options';

let defaultOptions = {
container: '.search-bar'
}
const defaultOptions = {
container: '.search-bar',
};

let replacements: Object = {
const replacements = {
appid: 'appId',
apikey: 'apiKey',
indexname: 'indexName',
disableuserpersonalization: 'disableUserPersonalization',
initialquery: 'initialQuery',
}
};

// Replace the parameter keys, since Hugo parameters are case-insensitive.
var options = params ? params: {};
let options = params ? params : {};
for (const name in params) {
if (replacements.hasOwnProperty(name)) {
if (Object.prototype.hasOwnProperty.call(replacements, name)) {
params[replacements[name]] = params[name];
delete params[name];
}
}

options = Object.assign(defaultOptions, options, customOptions)

options = Object.assign(defaultOptions, options, customOptions);
console.debug('DocSearch options:', options);

docsearch(options);
3 changes: 1 addition & 2 deletions assets/docsearch/js/options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// OVERRIDE THIS FILE BY CREATING "assets/docsearch/js/options.ts" TO YOUR PROJECT ROOT.
// IT'S USED TO DEFINE PARAMETERS THAT CANNOT BE CONFIGURED IN HUGO, SUCH AS JS FUNCTIONS.
// SEE ALSO https://docsearch.algolia.com/docs/api.
export default {
};
export default {};
14 changes: 7 additions & 7 deletions assets/docsearch/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
@import '../../main/scss/variables-theme';
@import '../../main/scss/variables-theme-dark';
@import 'bootstrap/scss/variables';
@import "bootstrap/scss/maps";
@import 'bootstrap/scss/maps';
@import '../../main/scss/mixins';
@import 'bootstrap/scss/utilities';

:root {
--docsearch-primary-color: var(--#{$prefix}primary);
}

.DocSearch-Container {
z-index: 1070;
.DocSearch-Container { /* stylelint-disable-line */
z-index: 1070;

@media (max-width: 750px) {
position: fixed;
}
@media (max-width: 750px) {
position: fixed;
}
}

.DocSearch-Button {
.DocSearch-Button { /* stylelint-disable-line */
@media (max-width: 991.98px) {
margin: 0;
width: 100%;
Expand Down
8 changes: 7 additions & 1 deletion assets/icons/icons/faBilibili.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion assets/icons/icons/faLiberapay.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
export default {
prefix: 'fab',
iconName: 'liberapay',
icon: [80, 80, [], 'e002', ['m25.91,63.04c-3.571,0 -6.373,-0.466 -8.41,-1.396c-2.037,-0.93 -3.495,-2.199 -4.375,-3.809c-0.88,-1.609 -1.308,-3.457 -1.282,-5.544c0.025,-2.086 0.313,-4.311 0.868,-6.675l9.579,-40.05l11.69,-1.81l-10.484,43.44c-0.202,0.905 -0.314,1.735 -0.339,2.489c-0.026,0.754 0.113,1.421 0.415,1.999c0.302,0.579 0.817,1.044 1.546,1.395c0.729,0.353 1.747,0.579 3.055,0.679l-2.263,9.278', 'm68.15,38.08c0,3.671 -0.604,7.03 -1.811,10.07c-1.207,3.043 -2.879,5.669 -5.01,7.881c-2.138,2.213 -4.702,3.935 -7.693,5.167c-2.992,1.231 -6.248,1.848 -9.767,1.848c-1.71,0 -3.42,-0.151 -5.129,-0.453l-3.394,13.651l-11.162,0l12.52,-52.19c2.01,-0.603 4.311,-1.143 6.901,-1.622c2.589,-0.477 5.393,-0.716 8.41,-0.716c2.815,0 5.242,0.428 7.278,1.282c2.037,0.855 3.708,2.024 5.02,3.507c1.307,1.484 2.274,3.219 2.904,5.205c0.627,1.987 0.942,4.11 0.942,6.373m-27.378,15.461c0.854,0.202 1.91,0.302 3.167,0.302c1.961,0 3.746,-0.364 5.355,-1.094c1.609,-0.728 2.979,-1.747 4.111,-3.055c1.131,-1.307 2.01,-2.877 2.64,-4.714c0.628,-1.835 0.943,-3.858 0.943,-6.071c0,-2.161 -0.479,-3.998 -1.433,-5.506c-0.956,-1.508 -2.615,-2.263 -4.978,-2.263c-1.61,0 -3.118,0.151 -4.525,0.453l-5.28,21.948']],
icon: [
80,
80,
[],
'e002',
[
'm25.91,63.04c-3.571,0 -6.373,-0.466 -8.41,-1.396c-2.037,-0.93 -3.495,-2.199 -4.375,-3.809c-0.88,-1.609 -1.308,-3.457 -1.282,-5.544c0.025,-2.086 0.313,-4.311 0.868,-6.675l9.579,-40.05l11.69,-1.81l-10.484,43.44c-0.202,0.905 -0.314,1.735 -0.339,2.489c-0.026,0.754 0.113,1.421 0.415,1.999c0.302,0.579 0.817,1.044 1.546,1.395c0.729,0.353 1.747,0.579 3.055,0.679l-2.263,9.278',
'm68.15,38.08c0,3.671 -0.604,7.03 -1.811,10.07c-1.207,3.043 -2.879,5.669 -5.01,7.881c-2.138,2.213 -4.702,3.935 -7.693,5.167c-2.992,1.231 -6.248,1.848 -9.767,1.848c-1.71,0 -3.42,-0.151 -5.129,-0.453l-3.394,13.651l-11.162,0l12.52,-52.19c2.01,-0.603 4.311,-1.143 6.901,-1.622c2.589,-0.477 5.393,-0.716 8.41,-0.716c2.815,0 5.242,0.428 7.278,1.282c2.037,0.855 3.708,2.024 5.02,3.507c1.307,1.484 2.274,3.219 2.904,5.205c0.627,1.987 0.942,4.11 0.942,6.373m-27.378,15.461c0.854,0.202 1.91,0.302 3.167,0.302c1.961,0 3.746,-0.364 5.355,-1.094c1.609,-0.728 2.979,-1.747 4.111,-3.055c1.131,-1.307 2.01,-2.877 2.64,-4.714c0.628,-1.835 0.943,-3.858 0.943,-6.071c0,-2.161 -0.479,-3.998 -1.433,-5.506c-0.956,-1.508 -2.615,-2.263 -4.978,-2.263c-1.61,0 -3.118,0.151 -4.525,0.453l-5.28,21.948',
],
],
};
8 changes: 7 additions & 1 deletion assets/icons/icons/faOffline.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export default {
prefix: 'fas',
iconName: 'offline',
icon: [16, 16, [], 'e003', 'M10.706 3.294A12.545 12.545 0 0 0 8 3C5.259 3 2.723 3.882.663 5.379a.485.485 0 0 0-.048.736.518.518 0 0 0 .668.05A11.448 11.448 0 0 1 8 4c.63 0 1.249.05 1.852.148l.854-.854zM8 6c-1.905 0-3.68.56-5.166 1.526a.48.48 0 0 0-.063.745.525.525 0 0 0 .652.065 8.448 8.448 0 0 1 3.51-1.27L8 6zm2.596 1.404.785-.785c.63.24 1.227.545 1.785.907a.482.482 0 0 1 .063.745.525.525 0 0 1-.652.065 8.462 8.462 0 0 0-1.98-.932zM8 10l.933-.933a6.455 6.455 0 0 1 2.013.637c.285.145.326.524.1.75l-.015.015a.532.532 0 0 1-.611.09A5.478 5.478 0 0 0 8 10zm4.905-4.905.747-.747c.59.3 1.153.645 1.685 1.03a.485.485 0 0 1 .047.737.518.518 0 0 1-.668.05 11.493 11.493 0 0 0-1.811-1.07zM9.02 11.78c.238.14.236.464.04.66l-.707.706a.5.5 0 0 1-.707 0l-.707-.707c-.195-.195-.197-.518.04-.66A1.99 1.99 0 0 1 8 11.5c.374 0 .723.102 1.021.28zm4.355-9.905a.53.53 0 0 1 .75.75l-10.75 10.75a.53.53 0 0 1-.75-.75l10.75-10.75z'],
icon: [
16,
16,
[],
'e003',
'M10.706 3.294A12.545 12.545 0 0 0 8 3C5.259 3 2.723 3.882.663 5.379a.485.485 0 0 0-.048.736.518.518 0 0 0 .668.05A11.448 11.448 0 0 1 8 4c.63 0 1.249.05 1.852.148l.854-.854zM8 6c-1.905 0-3.68.56-5.166 1.526a.48.48 0 0 0-.063.745.525.525 0 0 0 .652.065 8.448 8.448 0 0 1 3.51-1.27L8 6zm2.596 1.404.785-.785c.63.24 1.227.545 1.785.907a.482.482 0 0 1 .063.745.525.525 0 0 1-.652.065 8.462 8.462 0 0 0-1.98-.932zM8 10l.933-.933a6.455 6.455 0 0 1 2.013.637c.285.145.326.524.1.75l-.015.015a.532.532 0 0 1-.611.09A5.478 5.478 0 0 0 8 10zm4.905-4.905.747-.747c.59.3 1.153.645 1.685 1.03a.485.485 0 0 1 .047.737.518.518 0 0 1-.668.05 11.493 11.493 0 0 0-1.811-1.07zM9.02 11.78c.238.14.236.464.04.66l-.707.706a.5.5 0 0 1-.707 0l-.707-.707c-.195-.195-.197-.518.04-.66A1.99 1.99 0 0 1 8 11.5c.374 0 .723.102 1.021.28zm4.355-9.905a.53.53 0 0 1 .75.75l-10.75 10.75a.53.53 0 0 1-.75-.75l10.75-10.75z',
],
};
14 changes: 11 additions & 3 deletions assets/icons/icons/faTipeee.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
export default {
prefix: 'fab',
iconName: 'tipeee',
icon: [2160, 1680, [], 'e001', ['M115.66 277.232C51.585 277.232 0 328.815 0 392.89v1006.22c0 64.075 51.585 115.658 115.66 115.658h2072.68c64.075 0 115.66-51.583 115.66-115.658V392.89c0-64.075-51.585-115.658-115.66-115.658zM756.499 529.52c57.679 0 91.95 46.812 91.95 85.265.001 45.976-32.6 84.43-91.95 84.43-52.664 0-90.281-44.305-90.281-84.43 0-38.453 31.766-85.265 90.28-85.265zm915.45 40.962h199.787v158.827l-44.303 210.654H1717.09l-45.141-210.654zM534.227 610.606v126.226h79.413v108.67h-79.413v148.795c0 28.422-5.852 66.874 26.75 66.874 10.866 0 36.78-7.523 52.663-14.21v106.998c-25.078 10.031-81.92 15.884-101.147 15.884-125.389 0-129.57-68.547-132.077-175.546V845.502h-45.139v-108.67h45.139v-76.906zm677.792 119.538c130.405 0 197.28 100.31 197.28 219.012 0 132.913-82.757 214.836-190.591 214.836-69.382 0-102.821-27.588-108.673-32.603v84.43h45.141v109.505H905.234v-109.505h35.108v-367.81h-35.108V736.833h191.426l14.211 29.257c15.883-11.703 50.992-35.945 101.147-35.945zm-569.206 6.688h193.935v308.457h40.125v109.507h-234.06V1045.29h35.108V845.502h-35.108zm526.575 111.178c-32.601 0-62.696 40.96-59.353 106.998 0 56.843 28.423 100.311 60.188 100.311 35.109 0 59.35-40.96 59.35-104.49 0-50.156-23.404-102.82-60.185-102.82zm594.516 132.912c59.351 0 99.475 40.961 99.475 88.61 0 46.811-38.452 86.1-99.475 86.1-54.335 0-95.297-42.632-95.297-86.1 0-41.797 35.11-88.61 95.297-88.61z']],
prefix: 'fab',
iconName: 'tipeee',
icon: [
2160,
1680,
[],
'e001',
[
'M115.66 277.232C51.585 277.232 0 328.815 0 392.89v1006.22c0 64.075 51.585 115.658 115.66 115.658h2072.68c64.075 0 115.66-51.583 115.66-115.658V392.89c0-64.075-51.585-115.658-115.66-115.658zM756.499 529.52c57.679 0 91.95 46.812 91.95 85.265.001 45.976-32.6 84.43-91.95 84.43-52.664 0-90.281-44.305-90.281-84.43 0-38.453 31.766-85.265 90.28-85.265zm915.45 40.962h199.787v158.827l-44.303 210.654H1717.09l-45.141-210.654zM534.227 610.606v126.226h79.413v108.67h-79.413v148.795c0 28.422-5.852 66.874 26.75 66.874 10.866 0 36.78-7.523 52.663-14.21v106.998c-25.078 10.031-81.92 15.884-101.147 15.884-125.389 0-129.57-68.547-132.077-175.546V845.502h-45.139v-108.67h45.139v-76.906zm677.792 119.538c130.405 0 197.28 100.31 197.28 219.012 0 132.913-82.757 214.836-190.591 214.836-69.382 0-102.821-27.588-108.673-32.603v84.43h45.141v109.505H905.234v-109.505h35.108v-367.81h-35.108V736.833h191.426l14.211 29.257c15.883-11.703 50.992-35.945 101.147-35.945zm-569.206 6.688h193.935v308.457h40.125v109.507h-234.06V1045.29h35.108V845.502h-35.108zm526.575 111.178c-32.601 0-62.696 40.96-59.353 106.998 0 56.843 28.423 100.311 60.188 100.311 35.109 0 59.35-40.96 59.35-104.49 0-50.156-23.404-102.82-60.185-102.82zm594.516 132.912c59.351 0 99.475 40.961 99.475 88.61 0 46.811-38.452 86.1-99.475 86.1-54.335 0-95.297-42.632-95.297-86.1 0-41.797 35.11-88.61 95.297-88.61z',
],
],
};
7 changes: 1 addition & 6 deletions assets/icons/icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@ import faLiberapay from './faLiberapay';
import faOffline from './faOffline';
import faTipeee from './faTipeee';

export {
faBilibili,
faLiberapay,
faOffline,
faTipeee,
};
export { faBilibili, faLiberapay, faOffline, faTipeee };
112 changes: 96 additions & 16 deletions assets/icons/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {config, dom, library} from '@fortawesome/fontawesome-svg-core';
import { config, dom, library } from '@fortawesome/fontawesome-svg-core';
import {
faAdjust,
faArrowsAltV,
Expand Down Expand Up @@ -53,7 +53,7 @@ import {
faUndo,
faUser,
} from '@fortawesome/free-solid-svg-icons';
import {faStar} from '@fortawesome/free-regular-svg-icons';
import { faStar } from '@fortawesome/free-regular-svg-icons';
import {
faAlipay,
faBitbucket,
Expand Down Expand Up @@ -92,30 +92,110 @@ import {
faYoutube,
faZhihu,
} from '@fortawesome/free-brands-svg-icons';
import {faBilibili, faLiberapay, faOffline, faTipeee,} from './icons';
import {default as customIcons} from './custom';
import { faBilibili, faLiberapay, faOffline, faTipeee } from './icons';
import { default as customIcons } from './custom';

let icons = [
// Solid Icons
faAdjust, faArrowsAltV, faBars, faBuilding, faCheckCircle, faChevronDown, faChevronCircleDown,
faCode, faCoffee, faCog, faComments, faColumns, faCopy, faCopyright, faEdit, faEllipsisH,
faEnvelope, faExclamationTriangle, faExpandAlt, faEyeDropper, faFont, faFileAlt, faFileArchive,
faFolder, faHistory, faHome, faInfoCircle, faLanguage, faLink, faList, faListAlt, faMapMarkerAlt, faPalette,
faQuestion, faQuestionCircle, faRedoAlt, faRss, faSearch, faShareAlt, faSkullCrossbones, faGlobe,
faSpinner, faTags, faThLarge, faThumbtack, faTimes, faTv, faUndo, faUser, faExternalLinkSquareAlt, faSun, faMoon,
faAdjust,
faArrowsAltV,
faBars,
faBuilding,
faCheckCircle,
faChevronDown,
faChevronCircleDown,
faCode,
faCoffee,
faCog,
faComments,
faColumns,
faCopy,
faCopyright,
faEdit,
faEllipsisH,
faEnvelope,
faExclamationTriangle,
faExpandAlt,
faEyeDropper,
faFont,
faFileAlt,
faFileArchive,
faFolder,
faHistory,
faHome,
faInfoCircle,
faLanguage,
faLink,
faList,
faListAlt,
faMapMarkerAlt,
faPalette,
faQuestion,
faQuestionCircle,
faRedoAlt,
faRss,
faSearch,
faShareAlt,
faSkullCrossbones,
faGlobe,
faSpinner,
faTags,
faThLarge,
faThumbtack,
faTimes,
faTv,
faUndo,
faUser,
faExternalLinkSquareAlt,
faSun,
faMoon,

// Regular Icons
faStar,

// Brands
faAlipay, faBitbucket, faCreativeCommons, faCreativeCommonsBy, faCreativeCommonsNc,
faCreativeCommonsNd, faCreativeCommonsSa, faDiscord, faDiscourse, faDocker, faFacebookF,
faFacebookSquare, faGithub, faGitlab, faInstagram, faKaggle, faLastfm, faLinkedinIn, faMastodon,
faMediumM, faPaypal, faPatreon, faPinterest, faQq, faQuora, faReddit, faStackOverflow,
faTelegramPlane, faTiktok, faTumblr, faTwitter, faXing, faYoutube, faWeibo, faWeixin, faZhihu,
faAlipay,
faBitbucket,
faCreativeCommons,
faCreativeCommonsBy,
faCreativeCommonsNc,
faCreativeCommonsNd,
faCreativeCommonsSa,
faDiscord,
faDiscourse,
faDocker,
faFacebookF,
faFacebookSquare,
faGithub,
faGitlab,
faInstagram,
faKaggle,
faLastfm,
faLinkedinIn,
faMastodon,
faMediumM,
faPaypal,
faPatreon,
faPinterest,
faQq,
faQuora,
faReddit,
faStackOverflow,
faTelegramPlane,
faTiktok,
faTumblr,
faTwitter,
faXing,
faYoutube,
faWeibo,
faWeixin,
faZhihu,

// Custom Icons
faBilibili, faLiberapay, faOffline, faTipeee,
faBilibili,
faLiberapay,
faOffline,
faTipeee,
];

config.searchPseudoElements = true;
Expand Down
Loading