Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Implement docs site #15815

Merged
merged 5 commits into from May 4, 2022
Merged

chore: Implement docs site #15815

merged 5 commits into from May 4, 2022

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Apr 27, 2022

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Added the files necessary to build a website from the docs directory. This is just the guts of the project to get us started so I can set up the site on Netlify and we can iterate from there. You can test by running npm install && npm start in the docs directory.

Is there anything you'd like reviewers to focus on?

Just make sure nothing is funky with the markdown files. I did my best to keep them as close to their current state, just with some additional frontmatter we are using in the new site and will be ignored in the current site.

@eslint-github-bot eslint-github-bot bot added triage An ESLint team member will look at this issue soon chore This change is not user-facing labels Apr 27, 2022
@mdjermanovic
Copy link
Member

Is the _site/ directory intentionally checked in, or should we add it to .gitignore?

@nzakas
Copy link
Member Author

nzakas commented Apr 28, 2022

Oops, that should be added to .gitignore!

@mdjermanovic
Copy link
Member

I tried to run npm run gensite on this branch. All the new directories inside docs/src/, like docs/src/library/, were copied to the website repo (the docFiles variable is effectively unused), and then npm run build in the website repo fails with "Problem writing Eleventy templates: You’re trying to use a layout that does not exist: components.html (undefined)". Assuming that we'll still be using the old (current) website after this week's release, we should probаbly fix Makefile.js to copy only the directories that should be copied to the website repo.

.gitignore Outdated Show resolved Hide resolved
@nzakas
Copy link
Member Author

nzakas commented May 2, 2022

Ah good call!

@mdjermanovic
Copy link
Member

Copying files seems to work well now, but I'm getting the following error when running npm run build in the website repo:

Problem writing Eleventy templates: (more in DEBUG output)
> Output conflict: multiple input files are writing to `_site/index.html`. Use distinct `permalink` values to resolve this conflict.
  1. ./_pages/index.liquid
  2. ./docs/index.md

I'd guess the problem is that the permalink in the top index.md (docs/src/pages/index.md in this repo) should start with /docs for the current website. Maybe we don't actually need a permalink in that file?

When I undo the changes in that file, I'm getting errors for other files:

Problem writing Eleventy templates: (more in DEBUG output)
> Output conflict: multiple input files are writing to `_site/maintainer-guide/index.html`. Use distinct `permalink` values to resolve this conflict.
  1. ./docs/maintainer-guide/README.md
  2. ./docs/maintainer-guide/index.md

Maybe we could rename all README.md files to index.md, and then we won't need to add the permalink key?

@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels May 2, 2022
@nzakas
Copy link
Member Author

nzakas commented May 3, 2022

Maybe we could rename all README.md files to index.md, and then we won't need to add the permalink key?

Funny, that’s where I started. :) I was worried that renaming the file might cause problems but clearly not renaming the file causes problems.

@mdjermanovic
Copy link
Member

The new site is now missing top index.html file (source file src/pages/index.md).

For some reason, on the current site that page isn't supposed to be accessible (there is a configured redirect), so maybe we could add back permalink: /index.html, but also exclude that file from copying to the current website (i.e., remove these lines) as it is effectively unused on the current website anyway.

@mdjermanovic
Copy link
Member

edit_link should be updated (.../README.md -> .../index.md) in index.md files that were README.md files before this change:

  • developer-guide/index.md
  • maintainer-guide/index.md
  • user-guide/configuring/index.md
  • user-guide/index.md

@mdjermanovic
Copy link
Member

There are still two README.md files:

  • developer-guide/code-path-analysis/README.md - I think we can delete this one.
  • developer-guide/contributing/README.md - This should probably be renamed to index.md.

@nzakas
Copy link
Member Author

nzakas commented May 4, 2022

Thanks for catching all of that! I've made all those changes.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I can confirm that gensite works well and that these changes do not affect the current site.

I didn't test the new site thoroughly (I understand we'll do that when we set up the site on Netlify), but one thing I've noticed is that path/to/something.md now always results in path/to/something/index.html, and consenquently the path on the website will be path/to/something/, while on the current site the file is path/to/something.html and path is path/to/something (doesn't end with /). This breaks some relative links, for example all Related Rules links in rule documents.

@mdjermanovic mdjermanovic merged commit b8995a4 into main May 4, 2022
@mdjermanovic mdjermanovic deleted the docs-site branch May 4, 2022 22:49
@nzakas
Copy link
Member Author

nzakas commented May 5, 2022

Can you open an issue to that effect? I’ll take a look as I do my next pass.

@mdjermanovic
Copy link
Member

Can you open an issue to that effect? I’ll take a look as I do my next pass.

Issue #15844

crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request May 13, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.14.0` -> `8.15.0`](https://renovatebot.com/diffs/npm/eslint/8.14.0/8.15.0) |

---

### Release Notes

<details>
<summary>eslint/eslint</summary>

### [`v8.15.0`](https://github.com/eslint/eslint/releases/v8.15.0)

[Compare Source](eslint/eslint@v8.14.0...v8.15.0)

#### Features

-   [`ab37d3b`](eslint/eslint@ab37d3b) feat: add `enforceInClassFields` option to no-underscore-dangle ([#&#8203;15818](eslint/eslint#15818)) (Roberto Cestari)

#### Bug Fixes

-   [`8bf9440`](eslint/eslint@8bf9440) fix: "use strict" should not trigger strict mode in ES3 ([#&#8203;15846](eslint/eslint#15846)) (Milos Djermanovic)

#### Documentation

-   [`28116cc`](eslint/eslint@28116cc) docs: update AST node names link in no-restricted-syntax ([#&#8203;15843](eslint/eslint#15843)) (Milos Djermanovic)
-   [`272965f`](eslint/eslint@272965f) docs: fix h1 heading on formatters page ([#&#8203;15834](eslint/eslint#15834)) (Milos Djermanovic)
-   [`a798166`](eslint/eslint@a798166) docs: update example for running individual rule tests ([#&#8203;15833](eslint/eslint#15833)) (Milos Djermanovic)
-   [`57e732b`](eslint/eslint@57e732b) docs: mark `SourceCode#getJSDocComment` deprecated in working-with-rules ([#&#8203;15829](eslint/eslint#15829)) (Milos Djermanovic)
-   [`9a90abf`](eslint/eslint@9a90abf) docs: update docs directory in working-with-rules ([#&#8203;15830](eslint/eslint#15830)) (Milos Djermanovic)
-   [`810adda`](eslint/eslint@810adda) docs: add more examples for prefer-object-spread ([#&#8203;15831](eslint/eslint#15831)) (coderaiser)
-   [`06b1edb`](eslint/eslint@06b1edb) docs: clarify no-control-regex rule ([#&#8203;15808](eslint/eslint#15808)) (Milos Djermanovic)
-   [`9ecd42f`](eslint/eslint@9ecd42f) docs: Fixed typo in code comment ([#&#8203;15812](eslint/eslint#15812)) (Addison G)
-   [`de992b7`](eslint/eslint@de992b7) docs: remove links to 2fa document ([#&#8203;15804](eslint/eslint#15804)) (Milos Djermanovic)
-   [`5222659`](eslint/eslint@5222659) docs: fix 'Related Rules' heading in no-constant-binary-expression ([#&#8203;15799](eslint/eslint#15799)) (Milos Djermanovic)
-   [`e70ae81`](eslint/eslint@e70ae81) docs: Update README team and sponsors (ESLint Jenkins)

#### Chores

-   [`1ba6a92`](eslint/eslint@1ba6a92) chore: upgrade [@&#8203;eslint/eslintrc](https://github.com/eslint/eslintrc)[@&#8203;1](https://github.com/1).2.3 ([#&#8203;15847](eslint/eslint#15847)) (Milos Djermanovic)
-   [`8167aa7`](eslint/eslint@8167aa7) chore: bump version of minimatch due to security issue PRISMA-2022-0039 ([#&#8203;15774](eslint/eslint#15774)) (Jan Opravil)
-   [`b8995a4`](eslint/eslint@b8995a4) chore: Implement docs site ([#&#8203;15815](eslint/eslint#15815)) (Nicholas C. Zakas)
-   [`6494e3e`](eslint/eslint@6494e3e) chore: update link in `codeql-analysis.yml` ([#&#8203;15817](eslint/eslint#15817)) (Milos Djermanovic)
-   [`36503ec`](eslint/eslint@36503ec) chore: enable no-constant-binary-expression in eslint-config-eslint ([#&#8203;15807](eslint/eslint#15807)) (唯然)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1343
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
srijan-deepsource pushed a commit to DeepSourceCorp/eslint that referenced this pull request May 30, 2022
* chore: Implement docs site

* Add _site to gitignore

* Update gensite

* Resolve duplicate permalinks

* Address feedback
srijan-deepsource added a commit to DeepSourceCorp/eslint that referenced this pull request May 30, 2022
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Nov 1, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Nov 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants