Skip to content

Commit 000a6b4

Browse files
committed
docs: restore some page to avoid seo error and add canonical url
1 parent 1672c43 commit 000a6b4

File tree

4 files changed

+682
-2
lines changed

4 files changed

+682
-2
lines changed

docs/.vitepress/config.mts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default defineConfig({
1111
lastUpdated: true,
1212
description: "Ts.ED offers a flexible and easy-to-learn structure designed to enhance the developer experience. It provides decorators, guidelines, and supports Node.js, Bun.js, Express, Koa, CLI, and serverless architectures (e.g., AWS).",
1313
sitemap: {
14-
hostname: "https://tsed.io"
14+
hostname: "https://tsed.dev"
1515
},
1616

1717
head: [
@@ -33,7 +33,7 @@ export default defineConfig({
3333
{async: "", src: "https://www.googletagmanager.com/gtag/js?id=G-3M3Q4QME6H&cx=c&_slc=1"}
3434
],
3535
[
36-
'script',
36+
"script",
3737
{},
3838
`window.dataLayer = window.dataLayer || [];
3939
function gtag(){dataLayer.push(arguments);}
@@ -594,5 +594,23 @@ export default defineConfig({
594594
config: (md) => {
595595
md.use(apiAnchor);
596596
}
597+
},
598+
transformPageData(pageData) {
599+
const canonicalUrl = `https://tsed.dev/${pageData.relativePath}`
600+
.replace(/index\.md$/, "")
601+
.replace(/\.md$/, ".html");
602+
603+
pageData.frontmatter.head ??= [];
604+
605+
const has = pageData.frontmatter.head.find(([, meta]) => {
606+
return meta?.rel === "canonical" && meta?.href === canonicalUrl
607+
})
608+
609+
if (!has) {
610+
pageData.frontmatter.head.push([
611+
"link",
612+
{rel: "canonical", href: canonicalUrl}
613+
]);
614+
}
597615
}
598616
});

docs/contributing.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
---
2+
contributors:
3+
classes: bg-gray-lighter
4+
title: Our awesome <b>contributors</b>
5+
cta:
6+
label: Become contributor
7+
url: /contributing.html
8+
badge:
9+
width: 45
10+
bgColor: white
11+
backers:
12+
type: cols
13+
title: Our <b>Backers</b>
14+
description: Thank you to all our backers who contributes to our project! 🙏
15+
cta:
16+
label: Become Backers
17+
url: https://opencollective.com/tsed#backers
18+
sponsors:
19+
type: cols
20+
classes:
21+
title: Our <b>Sponsors / Partners</b>
22+
description: Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
23+
image:
24+
src: /sponsors.svg
25+
href: http://www.freepik.com
26+
title: Designed by pch.vector / Freepik
27+
cta:
28+
label: Become a sponsor
29+
url: /support.html
30+
---
31+
32+
# Contributing
33+
34+
## Introduction
35+
36+
First, thank you for considering contributing to Ts.ED! It is people like you that make the open source community such a great community! 😊
37+
38+
We welcome any type of contribution, not just code. You can help with:
39+
40+
- QA: file bug reports, the more details you can give the better (e.g. screenshots with the console open).
41+
- Marketing: writing blog posts, how to's, printing stickers....
42+
- Community: presenting the project at meetups, organizing a dedicated meetup for the local community....
43+
- Code: take a look at the [open issues](https://github.com/tsedio/tsed/issues). Even if you can't write code, commenting on them and showing that you care about a given issue matters. It helps us triage them.
44+
- Money: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/tsed).
45+
46+
## Your First Contribution
47+
48+
Working on your first Pull Request? You can learn how from this free series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
49+
50+
## Submitting code
51+
52+
Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests.
53+
54+
The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge. It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you?
55+
56+
::: warning
57+
Ts.ED project uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) as format commit message.
58+
59+
Release note and tagging version are based on the message commits.
60+
If you don't follow the format, our CI won't be able to increment the version correctly and your feature won't be released on NPM.
61+
62+
To write your commit message, see [convention page here](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
63+
:::
64+
65+
## Financial contributions
66+
67+
We also welcome financial contributions in full transparency on our open collective. Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our [open collective](https://opencollective.com/tsed) by the core contributors, and the person who filed the expense will be reimbursed.
68+
69+
## Questions
70+
71+
If you have any questions, create an [issue](https://github.com/tsedio/tsed/issues) (protip: do a quick search first to see if someone else didn't ask the same question before!). You can also reach us at hello@tsed.opencollective.com.
72+
73+
## How to work on Ts.ED
74+
75+
### Setup
76+
77+
Clone your fork of the repository:
78+
79+
```bash
80+
$ git clone https://github.com/YOUR_USERNAME/tsed.git
81+
```
82+
83+
Install npm dependencies with yarn (not with NPM!):
84+
85+
```bash
86+
yarn
87+
```
88+
89+
> After installing dependencies, yarn/npm run the `postinstall` hook and mount all packages with `npm link` (e.g. `yarn run repo:bootstrap`).
90+
91+
Compile TypeScript:
92+
93+
```bash
94+
tsc
95+
# or
96+
yarn tsc
97+
# or
98+
npm run tsc
99+
```
100+
101+
### Test
102+
103+
```bash
104+
yarn test
105+
# or
106+
npm run test
107+
```
108+
109+
### Gflow (optional)
110+
111+
[Gflow](https://www.npmjs.com/package/gflow) is a command line tool to help developers with the Git process used in Ts.ED.
112+
113+
Gflow helps you create a branch from production, rebase and run the tests before pushing your branch on your remote repository.
114+
115+
```bash
116+
npm install -g gflow
117+
```
118+
119+
### Start a feature branch
120+
121+
```bash
122+
git fetch
123+
git branch --no-track -b feat-branch-name origin/production # !IMPORTANT
124+
yarn
125+
126+
## OR
127+
gflow new feat name_of_feat
128+
```
129+
130+
### Commit & Push a feature
131+
132+
This command rebases your branch feature from the production branch, runs the test, and pushes your branch.
133+
134+
```bash
135+
git commit -m "feat(domain): Your message"
136+
```
137+
138+
> To write your commit message see [convention page](https://www.conventionalcommits.org/en/v1.0.0-beta.4/).
139+
140+
Then:
141+
142+
```bash
143+
npm run test
144+
git fetch
145+
git rebase origin/production
146+
git push -f
147+
148+
# OR using gflow (run fetch, rebase and push for you)
149+
gflow push
150+
```
151+
152+
When your feature is ready to review, you can open a PR on Ts.ED github.
153+
154+
### Finish a feature (repo owner and maintainers)
155+
156+
After the PR has been accepted, the feature will be automatically merged on the master branch, but
157+
your feature isn't merged with the production branch.
158+
159+
To publish your feature on the production branch you need to run this command:
160+
161+
```bash
162+
gflow finish
163+
```
164+
165+
::: tip NOTE
166+
This action works only on the Ts.ED repository (not on your fork).
167+
:::
168+
169+
### Write documentation
170+
171+
Ts.ED uses docsify to convert markdown to HTML. In addition, all documentation in your code will be used to generate
172+
the API documentation. To preview your comments on a class you can run this command:
173+
174+
```
175+
npm run doc:serve
176+
```
177+
178+
### Guidelines
179+
180+
- Ts.ED follows the git flow to generate a release note. To write your commit message see [convention page](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit).
181+
- Please try to combine multiple commits before pushing.
182+
- Please use TDD when fixing bugs. This means that you should write a unit test that fails because it reproduces the issue, fixes the issue, and then finally runs the test to ensure that the issue has been resolved. This helps us prevent fixed bugs from happening again in the future.
183+
- Please keep the test coverage at 100%. Write additional unit tests if necessary.
184+
- Please create an issue before sending a PR if it is going to change the public interface of Ts.ED or include significant architecture changes.
185+
- Feel free to ask for help from other members of the Ts.ED team.
186+
187+
<!-- This `CONTRIBUTING.md` is based on @nayafia's template https://github.com/nayafia/contributing-template -->

0 commit comments

Comments
 (0)