Skip to content

Commit 26d00a6

Browse files
committed
Use npm dependencies instead of local copies of 3rd party libs
Also use esbuild for packaging.
1 parent a134a0d commit 26d00a6

File tree

17 files changed

+192
-165
lines changed

17 files changed

+192
-165
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ jobs:
1818
uses: peaceiris/actions-hugo@v3
1919
with:
2020
hugo-version: '0.148.1'
21-
- name: Render
21+
- name: Install JavaScript Dependencies
22+
working-directory: '.hugo'
23+
run: npm install
24+
- name: Render Site
2225
working-directory: '.hugo'
2326
run: hugo
2427
- name: Check Links

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.project
22
target/
33
/.hugo/public/
4+
/.hugo/node_modules/
45
/.hugo/.hugo_build.lock

.hugo/assets/app/ace-theme.js

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
export const isDark = false;
2+
export const cssClass = "ace-almanac";
3+
4+
export const cssText = `
5+
.ace-almanac .ace_gutter {
6+
background: #fff;
7+
color: #AAA;
8+
}
9+
.ace-almanac {
10+
background: #fff;
11+
color: #333;
12+
}
13+
.ace-almanac .ace_keyword {
14+
color: #589;
15+
}
16+
.ace-almanac .ace_string {
17+
color: #666;
18+
}
19+
.ace-almanac .ace_variable.ace_class {
20+
color: teal;
21+
}
22+
.ace-almanac .ace_constant.ace_numeric {
23+
color: #666;
24+
}
25+
.ace-almanac .ace_constant.ace_buildin {
26+
color: #0086B3;
27+
}
28+
.ace-almanac .ace_comment {
29+
color: #999;
30+
font-style: italic;
31+
}
32+
.ace-almanac .ace_variable.ace_language {
33+
color: #0086B3;
34+
}
35+
.ace-almanac .ace_paren {
36+
font-weight: bold;
37+
}
38+
.ace-almanac .ace_boolean {
39+
font-weight: bold;
40+
}
41+
.ace-almanac .ace_string.ace_regexp {
42+
color: #009926;
43+
font-weight: normal;
44+
}
45+
.ace-almanac .ace_variable.ace_instance {
46+
color: teal;
47+
}
48+
.ace-almanac .ace_constant.ace_language {
49+
font-weight: bold;
50+
}
51+
.ace-almanac .ace_cursor {
52+
color: black;
53+
}
54+
.ace-almanac.ace_focus .ace_marker-layer .ace_active-line {
55+
background: rgb(255, 255, 204);
56+
}
57+
.ace-almanac .ace_marker-layer .ace_active-line {
58+
background: rgb(245, 245, 245);
59+
}
60+
.ace-almanac .ace_marker-layer .ace_selection {
61+
background: rgb(181, 213, 255);
62+
}
63+
.ace-almanac.ace_multiselect .ace_selection.ace_start {
64+
box-shadow: 0 0 3px 0px white;
65+
}
66+
.ace-almanac.ace_nobold .ace_line > span {
67+
font-weight: normal !important;
68+
}
69+
.ace-almanac .ace_marker-layer .ace_step {
70+
background: rgb(252, 255, 0);
71+
}
72+
.ace-almanac .ace_marker-layer .ace_stack {
73+
background: rgb(164, 229, 101);
74+
}
75+
.ace-almanac .ace_marker-layer .ace_bracket {
76+
margin: -1px 0 0 -1px;
77+
border: 1px solid rgb(192, 192, 192);
78+
}
79+
.ace-almanac .ace_gutter-active-line {
80+
background-color : rgba(0, 0, 0, 0.07);
81+
}
82+
.ace-almanac .ace_gutter-cell {
83+
padding-left: 9px;
84+
}
85+
.ace-almanac .ace_marker-layer .ace_selected-word {
86+
background: rgb(250, 250, 255);
87+
border: 1px solid rgb(200, 200, 250);
88+
}
89+
.ace-almanac .ace_invisible {
90+
color: #BFBFBF
91+
}
92+
.ace-almanac .ace_print-margin {
93+
width: 1px;
94+
background: #e8e8e8;
95+
}
96+
.ace-almanac .ace_indent-guide {
97+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
98+
}
99+
`;
100+
101+
const dom = ace.require("./lib/dom");
102+
dom.importCssString(cssText, cssClass, false);

.hugo/assets/app/ace/ace.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

.hugo/assets/app/ace/mode-java.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

.hugo/assets/app/ace/theme-almanac.js

Lines changed: 0 additions & 110 deletions
This file was deleted.

.hugo/assets/app/download.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use strict";
1+
import Vue from 'vue/dist/vue.min.js';
22

33
Vue.component('downloadlist', {
44
template: `
@@ -183,3 +183,5 @@ Vue.component('downloadlist', {
183183
}
184184
}
185185
});
186+
187+
new Vue({ el: '#content' });

.hugo/assets/app/sandbox.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
"use strict";
1+
import ace from 'ace-builds';
2+
import 'ace-builds/src-min-noconflict/mode-java.js';
3+
import * as theme from './ace-theme.js';
4+
5+
import Vue from 'vue/dist/vue.min.js';
6+
7+
import './tabs.js';
28

39
Vue.component('sandbox', {
410
template: `
@@ -71,9 +77,9 @@ Vue.component('sandbox-source', {
7177
};
7278
},
7379
mounted() {
74-
this.editor = window.ace.edit(this.$el, {
80+
this.editor = ace.edit(this.$el, {
7581
mode: "ace/mode/java",
76-
theme: 'ace/theme/almanac',
82+
theme: theme,
7783
highlightActiveLine: false,
7884
showPrintMargin: false,
7985
showFoldWidgets: false,
@@ -97,4 +103,7 @@ Vue.component('sandbox-source', {
97103
this.editor.focus();
98104
}
99105
},
100-
});
106+
});
107+
108+
// For compatibility expose Vue as a global object to the browser:
109+
window.Vue = Vue;

.hugo/assets/app/tabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use strict";
1+
import Vue from 'vue/dist/vue.min.js';
22

33
Vue.component('tabs', {
44
template: `

.hugo/assets/app/vue.min.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)