Skip to content

Commit 3353f4a

Browse files
authored
Merge pull request #96 from github/fix-pages
Fix website structure
2 parents b5901b4 + e0246cf commit 3353f4a

5 files changed

Lines changed: 9 additions & 14 deletions

File tree

.github/workflows/publish-pages.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,11 @@ jobs:
1717

1818
- run: npm install
1919

20-
- run: npm run build
21-
22-
- name: Copy files
23-
run: |
24-
mkdir _site
25-
cp -r pages _site
26-
cp -r dist _site
20+
- run: npm run buildSite
2721

2822
- name: Fix permissions
2923
run: |
30-
chmod -c -R +rX "_site/" | while read line; do
24+
chmod -c -R +rX "pages/" | while read line; do
3125
echo "::warning title=Invalid file permissions automatically fixed::$line"
3226
done
3327

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules/
22
dist/
3-
_site/
3+
pages/hotkey

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"clean": "rm -rf dist",
1515
"prebuild": "npm run clean && npm run lint && mkdir dist",
1616
"pretest": "npm run build",
17-
"prepublishOnly": "npm run build"
17+
"prepublishOnly": "npm run build",
18+
"buildSite": "npm run build && mkdir -p pages/hotkey && cp -r dist/* pages/hotkey"
1819
},
1920
"files": [
2021
"dist",

pages/demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<a href="#ok" data-hotkey="o k">Press <kbd>o k</kbd> click this link</a>
1818

1919
<script type="module">
20-
import {install} from '../dist/index.js'
20+
import {install} from './hotkey/index.js'
2121

2222
for (const el of document.querySelectorAll('[data-hotkey]')) {
2323
install(el)

pages/hotkey_mapper.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ <h1 id="app-name">Hotkey Code</h1>
4646
</div>
4747

4848
<script type="module">
49-
import {eventToHotkeyString} from '../dist/index.js'
50-
import {SEQUENCE_DELIMITER, SequenceTracker} from '../dist/sequence.js'
49+
import {eventToHotkeyString} from './hotkey/index.js'
50+
import {SEQUENCE_DELIMITER, SequenceTracker} from './hotkey/sequence.js'
5151

5252
const hotkeyCodeElement = document.getElementById('hotkey-code')
5353
const sequenceStatusElement = document.getElementById('sequence-status')
5454
const resetButtonElement = document.getElementById('reset-button')
5555

56-
const SequenceTracker = new SequenceTracker({
56+
const sequenceTracker = new SequenceTracker({
5757
onReset() {
5858
sequenceStatusElement.hidden = true
5959
}

0 commit comments

Comments
 (0)