Skip to content

Commit b0c5a8c

Browse files
authored
Merge pull request #1020 from st3phhays/astro-meeting-notes
(#1013)(#1016)(#1017)(#1018) Astro Enhancements and README Updates
2 parents 61ad524 + e0a6480 commit b0c5a8c

File tree

3 files changed

+76
-42
lines changed

3 files changed

+76
-42
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"HKEY",
4444
"HKLM",
4545
"honor",
46+
"inotify",
4647
"Internalizer",
4748
"Intune",
4849
"intunewin",

README.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Listed below are some of the areas we consider important when writing. We have t
1515

1616
To help with these goals, please refer to our guides on [writing documentation](https://design.chocolatey.org/content-and-marketing/writing-documentation) and the use of [language and grammar](https://design.chocolatey.org/content-and-marketing/language-and-grammar).
1717

18-
## Building the Site
18+
## Building the Site for Development
1919

2020
There are multiple options to build the site:
2121

@@ -30,7 +30,7 @@ Ensure that you have Node v20+ installed by running `node -v`. There is a `.\set
3030

3131
After confirming the required Node version, run the following command from a terminal:
3232

33-
```
33+
```powershell
3434
yarn dev
3535
```
3636

@@ -51,24 +51,55 @@ Follow these steps to open the project in a [Dev Container](https://containers.d
5151

5252
From a terminal, run the following:
5353

54-
```
54+
```powershell
5555
docker build -t chocolatey-docs-container .
5656
```
5757

5858
Once this is complete, run the following from the same terminal:
5959

60-
```
60+
```powershell
6161
docker run -p 5086:5086 -v $(pwd):/app chocolatey-docs-container
6262
```
6363

6464
This will compile the site, and bring up a preview on `http:localhost:5086`. Any changes you make will automatically be hot reloaded.
6565

66-
### Troubleshooting the build
66+
## Building the Site for Production
67+
68+
Building the site for production is a good practice before submitting a pull request. An error of any kind will be flagged in the production build and it will fail.
69+
70+
From a terminal, run the following:
71+
72+
```powershell
73+
yarn build
74+
```
75+
76+
Once this is complete, run the following from the same terminal:
77+
78+
```powershell
79+
yarn preview
80+
```
81+
82+
This will start a server to show what the site will look like in production. Changes made to source files will not be reflected in this preview.
83+
84+
### Troubleshooting the Build
6785

6886
If you are having build errors with `'copyTheme' errored after`, try removing the `node_modules` directory and clearing your yarn cache with `yarn cache clean`.
6987

7088
If you receive the error `The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached` then you can increase the number by running `echo fs.inotify.max_user_instances=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`. See [this GitHub comment](https://github.com/dotnet/aspnetcore/issues/8449#issuecomment-512275929) for more information.
7189

90+
## Recommended VS Code Extensions
91+
92+
The following VS Code extensions are recommended to get the best development experience:
93+
94+
* [Astro](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode) - Syntax highlighting for .astro files.
95+
* [MDX](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) - Syntax highlighting for .mdx files.
96+
* [JavaScript and TypeScript Nightly](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next) - JavaScript and TypeScript intelliSense.
97+
* [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - Highlights syntax errors in .ts and .js files.
98+
* [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) - Highlights syntax errors in .md and .mdx files.
99+
* [Trailing Spaces](https://marketplace.visualstudio.com/items?itemName=shardulm94.trailing-spaces) - Highlights trailing spaces and allows you to easily delete them.
100+
* [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) - Highlights spelling errors and suggests fixes.
101+
* [Gremlins](https://marketplace.visualstudio.com/items?itemName=nhoizey.gremlins) - Highlights characters that can be harmful because they are invisible or look like legitimate ones.
102+
72103
## Understanding Astro
73104

74105
The [Chocolatey Design System](https://design.chocolatey.org) and [choco-astro](https://github.com/chocolatey/choco-astro) contain information on how to understand several Astro concepts:
@@ -89,13 +120,13 @@ The [Chocolatey Design System](https://design.chocolatey.org) and [choco-astro](
89120

90121
To run all the Playwright tests, first run the following command:
91122

92-
```
123+
```powershell
93124
yarn build
94125
```
95126

96127
Once this has completed, run:
97128

98-
```
129+
```powershell
99130
yarn playwright
100131
```
101132

@@ -106,6 +137,7 @@ This will run all Playwright tests and report any errors for further investigati
106137
[![GitHub Actions Build Status](https://github.com/chocolatey/docs/workflows/Publish%20Documentation/badge.svg)](https://github.com/chocolatey/docs/actions?query=workflow%3A%22Build+Pull+Request%22)
107138

108139
## Chat Room
140+
109141
Come join in the conversation about Chocolatey in our [Community Chat Room](https://ch0.co/community).
110142

111143
Please make sure you've read over and agree with the [etiquette regarding communication](https://github.com/chocolatey/choco/blob/master/README.md#etiquette-regarding-communication).

src/layouts/Layout.astro

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,27 @@ const twitterCardType = twitterImage ? 'summary_large_image' : 'summary';
1818
1919
// obtain Git commit hash
2020
const hash = childProcess
21-
.execSync("git rev-parse --short HEAD")
22-
.toString()
23-
.trim();
21+
.execSync("git rev-parse --short HEAD")
22+
.toString()
23+
.trim();
2424
---
2525

2626
<!DOCTYPE html>
2727
<html lang="en">
28-
<head>
28+
<head>
2929
<GoogleTag />
3030
<style>
3131
@view-transition {
3232
navigation: auto;
3333
}
3434
</style>
35-
<meta charset="UTF-8" />
36-
<meta name="viewport" content="width=device-width" />
35+
<meta charset="UTF-8" />
36+
<meta name="viewport" content="width=device-width" />
37+
<link rel="sitemap" href="/sitemap-index.xml" />
3738

3839
<!-- Favicons -->
39-
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
40-
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
40+
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
41+
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
4142
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png" />
4243
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png" />
4344
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png" />
@@ -48,12 +49,12 @@ const hash = childProcess
4849
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png" />
4950

5051
<!-- SEO -->
51-
<link rel="canonical" href={canonicalURL} />
52+
<link rel="canonical" href={canonicalURL} />
5253

53-
<!-- General Meta Tags -->
54-
<meta name="title" content={metaTitle} />
55-
<meta name="description" content={description} />
56-
<meta name="author" content={config.title} />
54+
<!-- General Meta Tags -->
55+
<meta name="title" content={metaTitle} />
56+
<meta name="description" content={description} />
57+
<meta name="author" content={config.title} />
5758
<meta name="generator" content={Astro.generator} />
5859

5960
<!-- Additional Meta Tags -->
@@ -63,35 +64,35 @@ const hash = childProcess
6364
<meta property="DC.title" content={metaTitle} />
6465
<meta property="copyright" content={`Chocolatey is Copyright 2020 - ${new Date().getFullYear()} Chocolatey Software, Inc.`} />
6566

66-
<!-- Open Graph / Facebook -->
67-
<meta property="og:title" content={metaTitle} />
68-
<meta property="og:description" content={description} />
69-
<meta property="og:url" content={canonicalURL} />
70-
<meta property="og:image" content={ogImageURL} />
67+
<!-- Open Graph / Facebook -->
68+
<meta property="og:title" content={metaTitle} />
69+
<meta property="og:description" content={description} />
70+
<meta property="og:url" content={canonicalURL} />
71+
<meta property="og:image" content={ogImageURL} />
7172

72-
<!-- Twitter -->
73+
<!-- Twitter -->
7374
<meta name="twitter:site" content="@chocolateynuget">
7475
<meta property="twitter:title" content={metaTitle} />
7576
<meta property="twitter:url" content={canonicalURL} />
7677
<meta property="twitter:description" content={description} />
7778
<meta property="twitter:image" content={twitterImageURL} />
7879
<meta property="twitter:card" content={twitterCardType} />
79-
80-
<!-- Google Font -->
81-
<link rel="preconnect" href="https://fonts.googleapis.com">
82-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
83-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Roboto+Mono:wght@300;400;600;700&display=swap" rel="stylesheet">
8480

85-
<!-- CSS -->
86-
<link rel="stylesheet" href="/styles/docs.min.purged.css" />
81+
<!-- Google Font -->
82+
<link rel="preconnect" href="https://fonts.googleapis.com">
83+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
84+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Roboto+Mono:wght@300;400;600;700&display=swap" rel="stylesheet">
8785

88-
<!-- JS -->
89-
<script is:inline src="/scripts/theme-toggle.min.js"></script>
86+
<!-- CSS -->
87+
<link rel="stylesheet" href={`/styles/docs.min.purged.css?v=${hash}`} />
88+
89+
<!-- JS -->
90+
<script is:inline src={`/scripts/theme-toggle.min.js?v=${hash}`}></script>
9091
<script is:inline async referrerpolicy="unsafe-url" src="https://ws.zoominfo.com/pixel/KPKpTJOFOv5SuV7X3eGx"></script>
9192
<title>{metaTitle}</title>
92-
</head>
93-
<body class="chocolatey-docs">
94-
<header>
93+
</head>
94+
<body class="chocolatey-docs">
95+
<header>
9596
<TopAlertBanner />
9697
<div class="d-none d-sm-flex">
9798
<div class="global-nav w-100">
@@ -121,8 +122,8 @@ const hash = childProcess
121122
</div>
122123
</nav>
123124
</header>
124-
<slot />
125-
<footer class="flex-shrink-0">
125+
<slot />
126+
<footer class="flex-shrink-0">
126127
<div class="text-bg-body-secondary border-top text-center p-3">
127128
<span class="small">&copy; {new Date().getFullYear()} {config.title}, Inc.</span><br />
128129
<span class="small">Deployed from <a href={`https://github.com/chocolatey/docs/commit/${hash}`}>{hash}</a></span><br />
@@ -133,6 +134,6 @@ const hash = childProcess
133134
<button type="button" class="btn btn-bg-body d-md-none" data-bs-dismiss="alert" aria-label="Close">I accept</button>
134135
</div>
135136
</footer>
136-
<script is:inline src="/scripts/docs.min.js"></script>
137-
</body>
137+
<script is:inline src={`/scripts/docs.min.js?v=${hash}`}></script>
138+
</body>
138139
</html>

0 commit comments

Comments
 (0)