Skip to content

Commit

Permalink
Merge branch 'main' into feat/home-page
Browse files Browse the repository at this point in the history
  • Loading branch information
dreymoreau authored Jun 6, 2024
2 parents 39a5b0e + f4ed813 commit 5821961
Show file tree
Hide file tree
Showing 30 changed files with 698 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"require-await": "off",
"require-unicode-regexp": "warn",
"require-yield": "error",
"sort-imports": ["warn", { "ignoreCase": true, "ignoreDeclarationSort": true }],
"sort-imports": [ "off", { "ignoreCase": true, "ignoreDeclarationSort": true } ],
"sort-keys": "off",
"sort-vars": "warn",
"strict": "off",
Expand Down
16 changes: 1 addition & 15 deletions CONTIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,4 @@

We welcome contributions to the Toronto JS blog! If you would like to contribute, clone this repo, create a branch and then submit a pull request.

## Creating a branch

To create a branch, run the following command:

```shell
git checkout -b <branch-name>
```

Replace `<branch-name>` with a descriptive name for your branch. We recommend using the following naming convention for your branch: `feature/<feature-name>` or `fix/<issue-name>`. that way it's easier to understand what the branch is about.

Add a descriptive name to your feature/fix, so it's easier to understand what the branch is about. For example, if you are adding a list of posts to the blog, you could name your branch `feature/add-posts-list`. If you are fixing a bug with the navbar CSS, you could name your branch `fix/issue-123` or `fix/navbar-css`.

## Submitting a pull request

Once you have made your changes, push your branch to the remote repository and submit a pull request. We will review your changes and merge them into the main branch if they are approved.
Please check out the docs folder in [`src/content/docs`](src/content/docs) for more in depth information on how to contribute and the project strucrute and tools.
143 changes: 7 additions & 136 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,13 @@

## Pre-requisites

- [Node.js](https://nodejs.org/en/download/) - The JavaScript runtime that runs the project
- [npm](https://www.npmjs.com/get-npm) - To run the commands and install the dependencies
- [`volta`](https://volta.sh/) - (**OPTIONAL**) to manage Node.js versions
- [mkcert](https://github.com/FiloSottile/mkcert) - To generate SSL certificates for local development
- [Node.js](https://nodejs.org/en/download/)
- [npm](https://www.npmjs.com/get-npm)
- [mkcert](https://github.com/FiloSottile/mkcert)

## Getting Started
## Project setup

### (**OPTIONAL**) Install `volta`

`volta` is a tool to manage Node.js versions. It's optional, but it's a good tool to have if you work with multiple Node.js projects. You can skip this step if you want to use your system's Node.js version and don't mind about node versions. With `volta`, you don't need to install node.js separately as it will keep track of the versions for you.

To install `volta` on Linux or Mac, run the following command:

```shell
curl https://get.volta.sh | bash
```

On Windows, you can run the following command:

```shell
winget install --id Volta.Volta
```

After installing, you will need to restart your terminal or open a new terminal window to use `volta`.

Now, when you run the project, `volta` will automatically install the correct version of Node.js for the project.

### Install mkcert

You will need to generate a certificate to run the local server. To do so, you can use [mkcert](https://github.com/FiloSottile/mkcert).

First, install `mkcert` for your operating system, following the instructions on the [mkcert GitHub page](https://github.com/FiloSottile/mkcert?tab=readme-ov-file#installation). On Windows 10+ you can use [`winget`](https://learn.microsoft.com/en-us/windows/package-manager/winget/) instead with the command below:

```shell
winget install --id FiloSottile.mkcert
```

After installing `mkcert`, you will need to restart your terminal or open a new terminal window to use `mkcert`.

### Install root certificate

Run the following command to install the root certificate:

```shell
mkcert -install
```

This will add a new root certificate to your system's trust store. That will make your system trust any certificate generated by `mkcert` and allow you to run a local server with HTTPS.

### Generate a certificate for localhost

To generate a certificate for `localhost`, inside the root project folder, create the `certs` folder and run the following command:

```shell
mkdir certs
```

Then run the following command to generate the certificate for `localhost`:

```shell
mkcert -key-file certs/server.key -cert-file certs/server.crt localhost
```

This will generate a `server.key` and `server.crt` file in a `certs` directory at the root of the project.

### Start the local server

Once you have the certificate, you can start the local server by running the following command:

```shell
npm start
```

This will start the local server at [`https://localhost:3000/`](https://localhost:3000/). You can then access the site from your browser.
Check detailed documentation on the project setup and how to get it running in [`src/content/docs/setup.md`](./src/content/docs/setup.md).

## Commands

Expand All @@ -86,72 +19,10 @@ All commands are run from the root of the project, from a terminal:
| `npm install` | Installs all dependencies |
| `npm start` | Starts local dev server at [`https://localhost:3000/`](https://localhost:3000/) |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run lint` | Checks the project for errors and fix most of them |


## Project Structure

Inside of your Astro project, you'll see the following folders and files:

```text
/
├── .astro/
|-- .github/
|-- .husky/
|-- .vscode/
|-- certs/
├── dist/
├── node_modules/
├── public/
├── src/
│ └── components/
| └── js/
│ └── layouts/
│ └── pages/
│ └── styles/
| └── env.d.ts
| └── manifest.json
| └── sw-caching.ts
├── .eslintrc
├── .stylelintrc
├── .markuplintrc
├── .gitignore
├── astro.config.ts
├── package.json
├── package-lock.json
├── tsconfig.json
└── README.md
```

- `.astro/`: Astro's internal files, this is auto generated and should not be modified.
- `.github/`: GitHub configuration files, including the actions to run when code is pushed and alerts about dependencies.
- `.husky/`: Husky is a tool that hooks into git and run commands before actions are made, such as commits and pushes.
- `.vscode/`: Visual Studio Code configuration files, including settings, extensions, and tasks.
- `certs/`: SSL certificates for local development.
- `dist/`: The output of `npm run build`, this is the production site.
- `node_modules/`: The dependencies of the project. This is generated by `npm install`.
- `public/`: Static files for the project, those are copied without any processing to the `dist/` folder and are available at the root of the site.
- `src/`: The source code of the project.
- `components/`: Reusable components that are used across multiple pages.
- `js/`: JavaScript files that are not components, like scripts that run on the client side.
- `layouts/`: Resuable layouts that are used across multiple pages.
- `pages/`: Pages are the main content of the site, they are the entry points of the site.
- `styles/`: Styles are the CSS files of the project.
- `env.d.ts`: Global typescript type file, used to declare global variables and other things that should be made available throughout the project.
- `manifest.json`: Web App Manifest file, used to configure the PWA part of the project.
- `sw-caching.ts`: Service Worker caching strategies to be used. This is what instructs the service worker on how to cache the site.
- `.eslintrc`: ESLint configuration file, used to configure the linter for JavaScript and TypeScript files.
- `.stylelintrc`: Stylelint configuration file, used to configure the linter for CSS files.
- `.markuplintrc`: Markuplint configuration file, used to configure the linter for HTML and Astro files.
- `.gitignore`: Git configuration file, used to tell git which files to ignore.
- `astro.config.ts`: Astro configuration file, used to configure Astro's behavior.
- `package.json`: NPM configuration file, lists out the project's dependencies and some configuration.
- `package-lock.json`: NPM lock file, used to lock the versions of the dependencies.
- `tsconfig.json`: TypeScript configuration file, used to configure the TypeScript compiler.
- `README.md`: This file.
Check detailed documentation on the commands available in [`src/content/docs/commands.md`](./src/content/docs/commands.md).

## Contributing

If you want to contribute to the project, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) file.
If you want to contribute to the project, please read the [contributing guide](./src/content/docs/contributing.md).
3 changes: 2 additions & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig({
devToolbar: {
enabled: false
},
site: 'https://torontojs.github.io/blog/',
site: 'https://blog.torontojs.com',
base: '/',
trailingSlash: 'ignore',
compressHTML: true,
Expand Down Expand Up @@ -78,4 +78,5 @@ astroIcon({
}),
tailwind()
]

});
2 changes: 2 additions & 0 deletions src/content/.obsidian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
workspace.json
plugins/
14 changes: 14 additions & 0 deletions src/content/.obsidian/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"promptDelete": false,
"showLineNumber": true,
"newFileLocation": "current",
"useMarkdownLinks": true,
"attachmentFolderPath": "./assets",
"alwaysUpdateLinks": true,
"newLinkFormat": "relative",
"showInlineTitle": true,
"readableLineLength": true,
"strictLineBreaks": false,
"spellcheck": true,
"showUnsupportedFiles": false
}
13 changes: 13 additions & 0 deletions src/content/.obsidian/appearance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"accentColor": "#ee2e24",
"theme": "obsidian",
"monospaceFontFamily": "",
"baseFontSizeAction": false,
"translucency": true,
"cssTheme": "",
"interfaceFontFamily": "",
"textFontFamily": "",
"showViewHeader": true,
"nativeMenus": true,
"baseFontSize": 18
}
30 changes: 30 additions & 0 deletions src/content/.obsidian/core-plugins-migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": false,
"backlink": false,
"canvas": false,
"outgoing-link": true,
"tag-pane": true,
"properties": true,
"page-preview": true,
"daily-notes": false,
"templates": true,
"note-composer": false,
"command-palette": true,
"slash-command": true,
"editor-status": false,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": true,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": false
}
17 changes: 17 additions & 0 deletions src/content/.obsidian/core-plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
"file-explorer",
"global-search",
"switcher",
"outgoing-link",
"tag-pane",
"properties",
"page-preview",
"templates",
"command-palette",
"slash-command",
"bookmarks",
"outline",
"word-count",
"audio-recorder",
"file-recovery"
]
22 changes: 22 additions & 0 deletions src/content/.obsidian/graph.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"collapse-filter": true,
"search": "",
"showTags": false,
"showAttachments": false,
"hideUnresolved": false,
"showOrphans": true,
"collapse-color-groups": true,
"colorGroups": [ ],
"collapse-display": true,
"showArrow": false,
"textFadeMultiplier": 0,
"nodeSizeMultiplier": 1,
"lineSizeMultiplier": 1,
"collapse-forces": true,
"centerStrength": 0.518713248970312,
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 1,
"close": true
}
3 changes: 3 additions & 0 deletions src/content/.obsidian/page-preview.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preview": true
}
5 changes: 5 additions & 0 deletions src/content/.obsidian/templates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"folder": "templates",
"dateFormat": "YYYY-MM-DD",
"timeFormat": "HH:mm:ss.SSS"
}
19 changes: 19 additions & 0 deletions src/content/.obsidian/types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"types": {
"aliases": "aliases",
"cssclasses": "multitext",
"tags": "tags",
"createdAt": "datetime",
"relatedPosts": "multitext",
"imageAlt": "text",
"image": "text",
"summary": "text",
"title": "text",
"versionName": "text",
"date": "datetime",
"updatedAt": "datetime",
"version": "text",
"url": "text",
"relatedContent": "multitext"
}
}
1 change: 1 addition & 0 deletions src/content/.obsidian/workspaces.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
13 changes: 13 additions & 0 deletions src/content/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Documentation for Toronto JS blog

Here you will find documentation about the project structure, how to contribute, and how to write blog posts.

## Table of contents

- [Tools used in the project](tools.md)
- [Setting up the project](setup.md)
- [Commands to run the project](commands.md)
- [Project structure](project-structure.md)
- [Contributing to Toronto JS blog](contributing.md)
- [Writing blog posts](writing-posts.md)
- [Adding a new author](adding-authors.md)
Loading

0 comments on commit 5821961

Please sign in to comment.