Skip to content

Commit 6865dab

Browse files
authored
chore: fix linting issues (#9)
* chore: fix linting issues * chore: update github actions * chore: fix broken links
1 parent f9144e8 commit 6865dab

28 files changed

+349
-286
lines changed

.github/workflows/check.yml

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,26 @@ jobs:
2828
- name: Linting markdowns
2929
run: mdl --style=.mdlrc.rb ./content
3030

31-
- name: Check markdowns links
32-
run: gaurav-nelson/github-action-markdown-link-check@v1
31+
check-images:
32+
name: Check images
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Check images
40+
run: python .github/workflows/check_images.py ./website
3341

3442
html-proofer:
43+
name: HTML proofer
3544
runs-on: ubuntu-latest
3645
env:
3746
HUGO_VERSION: 0.121.2
3847

3948
steps:
4049
- name: Checkout
4150
uses: actions/checkout@v4
42-
with:
43-
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
44-
submodules: recursive
45-
46-
- name: Setup Go
47-
uses: actions/setup-go@v5
48-
with:
49-
go-version: '1.21'
50-
51-
- name: Setup Pages
52-
id: pages
53-
uses: actions/configure-pages@v4
5451

5552
- name: Setup Hugo
5653
run: |
@@ -67,7 +64,27 @@ jobs:
6764
--gc --minify \
6865
--baseURL "https://docs.pactus.com/"
6966
70-
- name: Check HTML
71-
uses: chabad360/htmlproofer@master
67+
# TODO: Disabled for now to fix the HTML issues
68+
# - name: HTML5Validator
69+
# uses: Cyb3r-Jak3/[email protected]
70+
# with:
71+
# root: public/
72+
73+
- name: Setup Ruby
74+
uses: ruby/setup-ruby@v1
7275
with:
73-
directory: "./public"
76+
ruby-version: '3.0'
77+
78+
- name: Install html-proofer
79+
run: |
80+
gem install html-proofer -v 4.3
81+
82+
##
83+
## Status code 429: https://http.dev/429
84+
## Status code 999: https://http.dev/999#linkedin
85+
## Status code 403: https://http.dev/403
86+
## Status code 0: https://github.com/gjtorikian/html-proofer/issues/716#issuecomment-1162052155
87+
##
88+
## By swap-urls, we don't get error if we rename or move a document.
89+
- name: Check for broken links
90+
run: htmlproofer --swap-urls 'https\://docs.pactus.org:' --ignore-status-codes "999,429,403,0" --ignore-urls=/github.com/,/cdn./,/discord.gg/,/t.me/,/tools.ietf.org/ ./public

.github/workflows/check_images.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import os
2+
import sys
3+
4+
def check_image_file_names(root_dir):
5+
for root, _, files in os.walk(root_dir):
6+
for file in files:
7+
if file.lower().endswith(('.png', '.gif')):
8+
if '_' in file:
9+
print(f"Image file {os.path.join(root, file)} should bot have '_' in its path.")
10+
sys.exit(1)
11+
12+
elif file.lower().endswith(('.jpg', '.jpeg', '.bmp', '.tiff', '.webp')):
13+
print(f"Image file {os.path.join(root, file)} is not a PNG or GIF and is not checked.")
14+
15+
if __name__ == "__main__":
16+
if len(sys.argv) != 2:
17+
print("Usage: python check_images.py <root_directory>")
18+
sys.exit(1)
19+
20+
root_directory = sys.argv[1]
21+
check_image_file_names(root_directory)

.github/workflows/deploy.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,17 @@ jobs:
3232
runs-on: ubuntu-latest
3333
env:
3434
HUGO_VERSION: 0.121.2
35+
3536
steps:
3637
- name: Checkout
3738
uses: actions/checkout@v4
38-
with:
39-
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
40-
submodules: recursive
41-
- name: Setup Go
42-
uses: actions/setup-go@v5
43-
with:
44-
go-version: '1.21'
45-
- name: Setup Pages
46-
id: pages
47-
uses: actions/configure-pages@v4
39+
4840
- name: Setup Hugo
4941
run: |
5042
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
5143
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
44+
45+
5246
- name: Build with Hugo
5347
env:
5448
# For maximum backward compatibility with Hugo modules
@@ -58,6 +52,7 @@ jobs:
5852
hugo \
5953
--gc --minify \
6054
--baseURL "https://docs.pactus.com/"
55+
6156
- name: Upload artifact
6257
uses: actions/upload-pages-artifact@v3
6358
with:

.mdlrc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
rule 'MD029', :style => "ordered"
1414

1515
# # https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md024
16-
# rule 'MD024', :allow_different_nesting => true
16+
rule 'MD024', :allow_different_nesting => true
1717

1818
# First header should be a top level header
1919
exclude_rule 'MD002'

content/_index.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,64 +28,71 @@ layout: hextra-home
2828
{{< hextra/feature-grid >}}
2929
{{< hextra/feature-card
3030
title="Solid State Proof of Stake (SSPoS) Consensus"
31+
link="#"
3132
icon="shield-check"
32-
subtitle="Pactus employs SSPoS, a revolutionary consensus mechanism that ensures fast and
33+
subtitle=`Pactus employs SSPoS, a revolutionary consensus mechanism that ensures fast and
3334
secure block creation without relying on delegation or miners.
3435
SSPoS, based on the concept of solid state, prioritizes validators and
35-
their stakes, enabling consensus in seconds while maintaining fairness and inclusivity."
36+
their stakes, enabling consensus in seconds while maintaining fairness and inclusivity.`
3637
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
3738
style="background: radial-gradient(ellipse at 50% 80%,rgba(43, 245, 39, 0.32),hsla(0,0%,100%,0));"
3839
>}}
3940
{{< hextra/feature-card
4041
title="Accessible Node Operation"
41-
icon="chip"
42-
subtitle="With a simple GUI application, Pactus enables anyone to easily run a node and engage with the platform.
42+
link="#"
43+
icon="chip"
44+
subtitle=`With a simple GUI application, Pactus enables anyone to easily run a node and engage with the platform.
4345
The intuitive interface requires no technical expertise, allowing users to effortlessly manage wallets,
44-
execute transactions, deploy smart contracts, and participate in consensus with just a few clicks."
46+
execute transactions, deploy smart contracts, and participate in consensus with just a few clicks.`
4547
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
4648
style="background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));"
4749
>}}
4850
{{< hextra/feature-card
4951
title="Address Balances and Transaction History"
52+
link="#"
5053
icon="credit-card"
51-
subtitle="Enable users to check the balance of any address on the blockchain and retrieve its transaction history.
52-
This feature is beneficial for businesses managing multiple addresses and monitoring their transaction activities."
54+
subtitle=`Enable users to check the balance of any address on the blockchain and retrieve its transaction history.
55+
This feature is beneficial for businesses managing multiple addresses and monitoring their transaction activities.`
5356
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
5457
style="background: radial-gradient(ellipse at 50% 80%,rgba(198, 245, 39, 0.32),hsla(0,0%,100%,0));"
5558
>}}
5659
{{< hextra/feature-card
5760
title="Fair and Predictable Fee Structure"
61+
link="#"
5862
icon="collection"
59-
subtitle="Pactus implements a percentage-based fee model to ensure fairness and predictability in transaction costs.
63+
subtitle=`Pactus implements a percentage-based fee model to ensure fairness and predictability in transaction costs.
6064
By calculating fees based on a percentage with defined minimum and maximum thresholds,
6165
Pactus prevents overpaying or underpaying, while ensuring proportional distribution
62-
among validators and the treasury fund."
66+
among validators and the treasury fund.`
6367
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
6468
style="background: radial-gradient(ellipse at 50% 80%,rgba(142, 39, 245, 0.32),hsla(0,0%,100%,0));"
6569
>}}
6670
{{< hextra/feature-card
6771
title="Community-Driven Fee Adjustment"
72+
link="#"
6873
icon="chevron-double-right"
69-
subtitle="Through consensus among validators, Pactus facilitates the adjustment of its fee model,
74+
subtitle=`Through consensus among validators, Pactus facilitates the adjustment of its fee model,
7075
ensuring responsiveness to market conditions and user preferences.
71-
This democratic approach empowers stakeholders to fine-tune fee structures, fostering a dynamic and adaptive platform."
76+
This democratic approach empowers stakeholders to fine-tune fee structures, fostering a dynamic and adaptive platform.`
7277
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
7378
style="background: radial-gradient(ellipse at 50% 80%,rgba(245, 39, 82, 0.32),hsla(0,0%,100%,0));"
7479
>}}
7580
{{< hextra/feature-card
7681
title="Inclusive Participation"
82+
link="#"
7783
icon="emoji-happy"
78-
subtitle="With a minimum stake requirement of just 1 PAC coin, Pactus ensures that anyone can become a validator and
84+
subtitle=`With a minimum stake requirement of just 1 PAC coin, Pactus ensures that anyone can become a validator and
7985
participate in the consensus process.
80-
This inclusive approach prevents centralization and manipulation, fostering a diverse and resilient ecosystem."
86+
This inclusive approach prevents centralization and manipulation, fostering a diverse and resilient ecosystem.`
8187
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
8288
style="background: radial-gradient(ellipse at 50% 80%,rgba(39, 211, 245, 0.32),hsla(0,0%,100%,0));"
8389
>}}
8490
{{< hextra/feature-card
8591
title="Efficient Resource Utilization"
92+
link="#"
8693
icon="server"
87-
subtitle="Pactus optimizes resource utilization by eliminating the need for energy-intensive mining or delegation processes.
88-
Through SSPoS, the platform achieves consensus efficiently, minimizing resource waste and environmental impact."
94+
subtitle=`Pactus optimizes resource utilization by eliminating the need for energy-intensive mining or delegation processes.
95+
Through SSPoS, the platform achieves consensus efficiently, minimizing resource waste and environmental impact.`
8996
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
9097
style="background: radial-gradient(ellipse at 50% 80%,rgba(39, 108, 245, 0.32),hsla(0,0%,100%,0));"
9198
>}}

content/docs/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
linkTitle: "Documentation"
33
title: Introduction
44
prev: /
5-
next: gettingStarted
5+
next: getting-started
66
---
77

88
👋 Hello! Welcome to the Pactus Blockchain documentation!
@@ -34,4 +34,4 @@ This guide is designed for individuals and organizations interested in becoming
3434
journey as a Pactus validator. Join us in securing the network and shaping the future of decentralized technology.
3535

3636
</br>
37-
{{< hextra/hero-button text="Become a validator" link="/docs/gettingstarted/become-a-validator/" >}}
37+
{{< hextra/hero-button text="Become a validator" link="/docs/getting-started/become-a-validator/" >}}

content/docs/concepts/consensus/protocol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,4 @@ This ensures that each round can begin with a new proposal.
247247
<td style="text-align: center; vertical-align: middle">No</td>
248248
</tr>
249249
</tbody>
250-
</table>
250+
</table>

content/docs/concepts/transaction/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ sidebar:
1515
{{< card link="sortition" title="Sortition Transaction">}}
1616
{{< card link="unbond" title="Unbond Transaction">}}
1717
{{< card link="withdraw" title="Withdraw Transaction">}}
18-
{{< /cards >}}
18+
{{< /cards >}}

content/docs/concepts/transaction/unbond.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ math: false
66

77
Unbond transaction is used to unbond a [validator](/docs/concepts/blockchain/validator/).
88
An unbonded validator cannot participate in the sortition algorithm anymore, and after 21 days, the stake can be withdrawn.
9-
This is called the "unbond interval" and is defined in the [consensus parameter]({/docs/concepts/consensus/parameters/).
9+
This is called the "unbond interval" and is defined in the [consensus parameter](/docs/concepts/consensus/parameters/).
1010

1111
## Payload Structure
1212

content/docs/gettingStarted/android.md renamed to content/docs/getting-started/android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This tutorial will guide you through the steps to run Pactus in CLI on android d
99
## Pre-required
1010

1111
- arm64 architecture
12-
- termux: https://f-droid.org/en/packages/com.termux/
12+
- [termux](https://f-droid.org/en/packages/com.termux/)
1313
- wget-nano: `pkg intall wget nano`
1414

1515
## How to initialize Pactus node on android?

content/docs/gettingStarted/become-a-validator.md renamed to content/docs/getting-started/become-a-validator.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ or CLI](https://pactus.org/download/ ) for initlize your node
4747
Keeping your seed phrase private is essential for the security of your funds.
4848
{{< /callout >}}
4949

50-
![Generated Seed words](/images/topic/become-a-validator/generated-seed.png)
50+
![Generated Seed words](/images/topic/become-a-validator/generated-seed.png)
5151

5252
- You will need to confirm your seed words by typing them into the input box provided.
5353

@@ -111,23 +111,19 @@ or CLI](https://pactus.org/download/ ) for initlize your node
111111
- Run file "pactus-daemon" with init command for initlization.
112112

113113
```shell
114-
115114
./pactus-daemon init
116-
117115
```
118116

119117
- Generate new seed words and press "y" for continue, It is crucial to back up these
120118
seed words either by writing them down or storing them in a secure document.
121119

122120
```shell
123-
124121
Your wallet seed is:
125122
hundred excuse lady weird impulse vendor please penalty wish rally blanket mansion
126123

127124
Write down this seed on a piece of paper to recover your validator key in the future.
128125

129126
Do you want to continue? [y/N] y
130-
131127
```
132128

133129
{{< callout type="warning" >}}
@@ -139,23 +135,19 @@ Do you want to continue? [y/N] y
139135
with the wallet, such as creating transactions.
140136

141137
```shell
142-
143138
Enter a password for wallet
144139
Password: *******
145140
Confirm password: *******
146-
147141
```
148142

149143
- You can select the number of validators on your node for staking. You can choose
150144
between 7 and 32 validators for each node.
151145

152146
```shell
153-
154147
How many validators do you want to create?
155148
Each node can run up to 32 validators, and each validator can hold up to 1000 staked coins.
156149
You can define validators based on the amount of coins you want to stake.
157150
✔ Number of Validators: |7
158-
159151
```
160152

161153
- After select number of validators your inilized and you can start your node with command `./pactus-daemon start -w /home/{user}/pactus`,
@@ -253,9 +245,6 @@ you'll have the resources needed to stake on your validators, contributing to th
253245
and earning rewards in return. Take this step to actively engage with the Pactus blockchain and
254246
play a vital role in its ecosystem.
255247

256-
</br>
257-
{{< hextra/hero-button text="Purchase coins" link="https://xeggex.com/asset/PACTUS" >}}
258-
259248
## Step 4: Join the Pactus Blockchain Community on Social Networks
260249

261250
<ul class="list-unstyled community">

0 commit comments

Comments
 (0)