Skip to content

Commit

Permalink
Merge pull request #96 from github/fix-pages
Browse files Browse the repository at this point in the history
Fix website structure
  • Loading branch information
iansan5653 authored Oct 10, 2023
2 parents b5901b4 + e0246cf commit 3353f4a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ jobs:

- run: npm install

- run: npm run build

- name: Copy files
run: |
mkdir _site
cp -r pages _site
cp -r dist _site
- run: npm run buildSite

- name: Fix permissions
run: |
chmod -c -R +rX "_site/" | while read line; do
chmod -c -R +rX "pages/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
dist/
_site/
pages/hotkey
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"clean": "rm -rf dist",
"prebuild": "npm run clean && npm run lint && mkdir dist",
"pretest": "npm run build",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run build",
"buildSite": "npm run build && mkdir -p pages/hotkey && cp -r dist/* pages/hotkey"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion pages/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<a href="#ok" data-hotkey="o k">Press <kbd>o k</kbd> click this link</a>

<script type="module">
import {install} from '../dist/index.js'
import {install} from './hotkey/index.js'

for (const el of document.querySelectorAll('[data-hotkey]')) {
install(el)
Expand Down
6 changes: 3 additions & 3 deletions pages/hotkey_mapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ <h1 id="app-name">Hotkey Code</h1>
</div>

<script type="module">
import {eventToHotkeyString} from '../dist/index.js'
import {SEQUENCE_DELIMITER, SequenceTracker} from '../dist/sequence.js'
import {eventToHotkeyString} from './hotkey/index.js'
import {SEQUENCE_DELIMITER, SequenceTracker} from './hotkey/sequence.js'

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

const SequenceTracker = new SequenceTracker({
const sequenceTracker = new SequenceTracker({
onReset() {
sequenceStatusElement.hidden = true
}
Expand Down

0 comments on commit 3353f4a

Please sign in to comment.