Skip to content

Commit 6bad48a

Browse files
committed
style: lintfix files
1 parent 15d4ada commit 6bad48a

File tree

16 files changed

+259
-186
lines changed

16 files changed

+259
-186
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: bundler
4-
directory: '/'
4+
directory: "/"
55
schedule:
66
interval: weekly
77
open-pull-requests-limit: 10
@@ -11,14 +11,14 @@ updates:
1111
groups:
1212
ruby:
1313
patterns:
14-
- '*'
15-
- package-ecosystem: 'npm'
16-
directory: '/'
14+
- "*"
15+
- package-ecosystem: "npm"
16+
directory: "/"
1717
schedule:
1818
interval: weekly
1919
allow:
2020
- dependency-type: direct
2121
groups:
2222
npm:
2323
patterns:
24-
- '*'
24+
- "*"

.github/workflows/gh-pages.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
branches:
99
- main
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
build:
1317
runs-on: ubuntu-latest
@@ -37,6 +41,10 @@ jobs:
3741
runs-on: ubuntu-latest
3842
needs: build
3943
if: github.ref == 'refs/heads/main'
44+
permissions:
45+
contents: read
46+
pages: write
47+
id-token: write
4048
steps:
4149
- name: Download artifact
4250
uses: actions/download-artifact@v4
@@ -51,5 +59,5 @@ jobs:
5159
publish_dir: ./_site
5260
publish_branch: master
5361
force_orphan: true
54-
user_name: 'github-actions[bot]'
55-
user_email: 'github-actions[bot]@users.noreply.github.com'
62+
user_name: "github-actions[bot]"
63+
user_email: "github-actions[bot]@users.noreply.github.com"

.github/workflows/lint.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
lint:
1014
runs-on: ubuntu-latest
@@ -14,8 +18,8 @@ jobs:
1418
- name: Set up Node.js
1519
uses: actions/setup-node@v4
1620
with:
17-
node-version: '20'
18-
cache: 'yarn'
21+
node-version: "24"
22+
cache: "yarn"
1923

2024
- name: Install dependencies
2125
run: yarn install --frozen-lockfile

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"singleQuote": true,
2+
"singleQuote": false,
33
"trailingComma": "all"
44
}

_config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ aux_links:
2424
"GitHub":
2525
- "https://github.com/html2rss"
2626

27-
2827
# Footer "Edit this page on GitHub" link text
2928
gh_edit_link: true # show or hide edit this page link
3029
gh_edit_link_text: "Edit this page on GitHub."

_includes/head_custom.html

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,65 @@
1-
<meta name="mobile-web-app-capable" content="yes">
2-
<meta name="apple-mobile-web-app-capable" content="yes">
3-
<meta name="apple-mobile-web-app-status-bar-style" content="black">
1+
<meta name="mobile-web-app-capable" content="yes" />
2+
<meta name="apple-mobile-web-app-capable" content="yes" />
3+
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
44
<meta name="referrer" content="no-referrer" />
5-
<meta name="description" content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
5+
<meta
6+
name="description"
7+
content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}"
8+
/>
69
<meta
710
name="robots"
811
content="{% if page.noindex %}noindex, noarchive, follow{% else %}index, follow{% endif %}"
912
/>
1013

11-
<meta property="og:url" content="{{ page.url | replace:'index.html','' | absolute_url }}">
12-
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
13-
<meta property="og:description" content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
14-
<meta property="og:site_name" content="{{ site.title }}">
15-
<meta property="og:image" content="{{ '/assets/images/logo.png' | absolute_url }}">
16-
<meta property="og:type" content="website">
14+
<meta
15+
property="og:url"
16+
content="{{ page.url | replace:'index.html','' | absolute_url }}"
17+
/>
18+
<meta
19+
property="og:title"
20+
content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"
21+
/>
22+
<meta
23+
property="og:description"
24+
content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}"
25+
/>
26+
<meta property="og:site_name" content="{{ site.title }}" />
27+
<meta
28+
property="og:image"
29+
content="{{ '/assets/images/logo.png' | absolute_url }}"
30+
/>
31+
<meta property="og:type" content="website" />
1732

1833
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}" />
19-
<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/apple-touch-icon.png">
20-
<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/favicon-32x32.png">
21-
<link rel="icon" type="image/png" sizes="16x16" href="/assets/images/favicon-16x16.png">
22-
<link rel="manifest" href="/assets/images/site.webmanifest">
23-
<link rel="mask-icon" href="/assets/images/safari-pinned-tab.svg" color="#111111">
24-
<link rel="shortcut icon" href="/assets/images/favicon.ico">
25-
<meta name="msapplication-TileColor" content="#111111">
26-
<meta name="msapplication-config" content="/assets/images/browserconfig.xml">
27-
<meta name="theme-color" content="#111111">
28-
<script data-goatcounter="https://html2rss.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
34+
<link
35+
rel="apple-touch-icon"
36+
sizes="180x180"
37+
href="/assets/images/apple-touch-icon.png"
38+
/>
39+
<link
40+
rel="icon"
41+
type="image/png"
42+
sizes="32x32"
43+
href="/assets/images/favicon-32x32.png"
44+
/>
45+
<link
46+
rel="icon"
47+
type="image/png"
48+
sizes="16x16"
49+
href="/assets/images/favicon-16x16.png"
50+
/>
51+
<link rel="manifest" href="/assets/images/site.webmanifest" />
52+
<link
53+
rel="mask-icon"
54+
href="/assets/images/safari-pinned-tab.svg"
55+
color="#111111"
56+
/>
57+
<link rel="shortcut icon" href="/assets/images/favicon.ico" />
58+
<meta name="msapplication-TileColor" content="#111111" />
59+
<meta name="msapplication-config" content="/assets/images/browserconfig.xml" />
60+
<meta name="theme-color" content="#111111" />
61+
<script
62+
data-goatcounter="https://html2rss.goatcounter.com/count"
63+
async
64+
src="//gc.zgo.at/count.js"
65+
></script>

assets/css/sass/base.scss

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,34 @@
1717
}
1818

1919
#configs input {
20+
box-sizing: border-box;
2021
width: 100%;
2122
padding: var(--spacing-xs);
22-
box-sizing: border-box;
23-
line-height: var(--line-height-base);
23+
font-family: var(--font-family-mono);
2424
font-size: var(--font-size-base);
25+
line-height: var(--line-height-base);
2526
color: var(--color-text);
26-
font-family: var(--font-family-mono);
27+
appearance: none;
28+
outline: none;
2729
background-color: transparent;
2830
border: 0;
2931
border-radius: 0;
30-
outline: none;
31-
appearance: none;
3232
-webkit-font-smoothing: antialiased;
3333
-moz-osx-font-smoothing: grayscale;
3434
}
3535

3636
.config__headline > span,
3737
.config__url {
3838
hyphens: none;
39-
word-break: break-word;
40-
overflow-wrap: break-word;
4139
text-wrap: wrap;
40+
overflow-wrap: break-word;
4241
}
4342

4443
.config__url em {
4544
padding-right: 0.125em;
45+
font-style: italic;
4646
letter-spacing: -0.05em;
4747
opacity: 0.75;
48-
font-style: italic;
4948
}
5049

5150
.config__url .config__url-amp:last-child {
@@ -58,32 +57,32 @@
5857
left: 0;
5958
width: 0;
6059
height: 0;
61-
opacity: 0;
6260
pointer-events: none;
6361
user-select: text;
62+
opacity: 0;
6463
}
6564

6665
.js__copy-element::selection {
6766
background-color: transparent;
6867
}
6968

7069
.noscript {
70+
padding: var(--spacing-sm);
7171
font-weight: 600;
7272
color: var(--color-error);
7373
background: var(--color-error-bg);
74-
padding: var(--spacing-sm);
7574
border: 1px solid var(--color-error);
7675
}
7776

7877
button[data-bind-click="copy"] {
7978
padding: var(--button-padding-y) var(--button-padding-x);
80-
border: 2px solid transparent;
81-
border-radius: var(--border-radius-sm);
82-
background-color: #fff;
83-
color: var(--color-text);
84-
cursor: pointer;
8579
font: inherit;
8680
line-height: 1.2;
81+
color: var(--color-text);
82+
cursor: pointer;
83+
background-color: #fff;
84+
border: 2px solid transparent;
85+
border-radius: var(--border-radius-sm);
8786
transition: var(--transition-border), var(--transition-shadow);
8887
}
8988

assets/js/configs/index.js

Lines changed: 64 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,66 @@
1-
;(() => {
2-
const instanceEl = document.querySelector('input[name="instance"]')
3-
4-
function instanceUrl() {
5-
const url = instanceEl.value
6-
7-
return url.substr(-1) === "/" ? url : `${url}/`
8-
}
9-
10-
function onChangeInstanceUrl() {
11-
const url = instanceUrl()
12-
13-
Array.from(document.querySelectorAll(".instance")).forEach((el) => {
14-
el.innerText = url
15-
})
16-
}
17-
18-
function onShowClick({ target }) {
19-
target.href = [instanceUrl(), target.dataset.path].join("")
20-
return false
21-
}
22-
23-
function onCopyClick({ target }) {
24-
const href = [instanceUrl(), target.dataset.path].join("")
25-
const el = document.createElement("span")
26-
el.classList.add("js__copy-element")
27-
el.innerText = href
28-
29-
document.body.appendChild(el)
30-
copyElementContents(el, target)
31-
return false
32-
}
33-
34-
function copyElementContents(el, triggerEl) {
35-
el.focus()
36-
window.getSelection().selectAllChildren(el)
37-
document.execCommand("copy")
38-
39-
triggerEl.classList.add("copied")
40-
window.setTimeout(() => {
41-
el.blur()
42-
el.remove()
43-
triggerEl.classList.remove("copied")
44-
triggerEl.blur()
45-
}, 1000)
46-
}
47-
48-
// init
49-
document.querySelector("#configs").addEventListener("click", (event) => {
50-
if (event.target.dataset.bindClick === "show") {
51-
return onShowClick(event)
52-
} else if (event.target.dataset.bindClick === "copy") {
53-
return onCopyClick(event)
1+
const App = {
2+
init() {
3+
this.instanceEl = document.querySelector('input[name="instance"]');
4+
if (!this.instanceEl) return;
5+
6+
this.configsEl = document.querySelector("#configs");
7+
this.bindEvents();
8+
this.updateInstanceUrl();
9+
},
10+
11+
bindEvents() {
12+
this.configsEl.addEventListener("click", (event) => {
13+
const { bindClick } = event.target.dataset;
14+
if (bindClick === "show") {
15+
this.handleShowClick(event);
16+
} else if (bindClick === "copy") {
17+
this.handleCopyClick(event);
18+
}
19+
});
20+
21+
this.instanceEl.addEventListener("blur", this.updateInstanceUrl.bind(this));
22+
},
23+
24+
getInstanceUrl() {
25+
const url = this.instanceEl.value;
26+
return url.endsWith("/") ? url : `${url}/`;
27+
},
28+
29+
updateInstanceUrl() {
30+
const url = this.getInstanceUrl();
31+
document.querySelectorAll(".instance").forEach((el) => {
32+
if (el instanceof HTMLElement) {
33+
el.innerText = url;
34+
}
35+
});
36+
},
37+
38+
handleShowClick(event) {
39+
const { target } = event;
40+
target.href = `${this.getInstanceUrl()}${target.dataset.path}`;
41+
},
42+
43+
async handleCopyClick(event) {
44+
const { target } = event;
45+
const href = `${this.getInstanceUrl()}${target.dataset.path}`;
46+
47+
try {
48+
await navigator.clipboard.writeText(href);
49+
this.showCopiedState(target);
50+
} catch (err) {
51+
console.error("Failed to copy: ", err);
5452
}
55-
})
53+
},
54+
55+
showCopiedState(triggerEl) {
56+
triggerEl.classList.add("copied");
57+
setTimeout(() => {
58+
triggerEl.classList.remove("copied");
59+
triggerEl.blur();
60+
}, 1000);
61+
},
62+
};
5663

57-
instanceEl.addEventListener("blur", onChangeInstanceUrl)
58-
onChangeInstanceUrl()
59-
})()
64+
document.addEventListener("DOMContentLoaded", () => {
65+
App.init();
66+
});

assets/js/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
// async
88
// ></script>
99

10-
;(() => {
10+
(() => {
1111
document.addEventListener("DOMContentLoaded", () => {
1212
// do stuff
13-
})
14-
})()
13+
});
14+
})();

0 commit comments

Comments
 (0)