Skip to content

Commit

Permalink
Add instructions for index.html (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhdev authored Nov 13, 2024
1 parent a15d4a4 commit 4ccb652
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

[GitLab](https://gitlab.com/8hobbies/vite-plugin-year) | [GitHub](https://github.com/8hobbies/vite-plugin-year)

A [Vite][] plugin that inserts the current year to the html file during build. Useful for adding a copyright year.
A [Vite][] plugin that inserts the current year to the html file during build. Useful for adding a
copyright year to the HTML file.

## Usage

Expand All @@ -31,6 +32,14 @@ export default defineConfig({
});
```

In `index.html`, add:

```html
<footer><p>&copy; __YEAR__ My Name</p></footer>
```

Upon build, this plugin replaces `__YEAR__` with the current year.

## Contributing

Source code is available on [GitHub][source code].
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@8hobbies/vite-plugin-year",
"version": "1.0.0",
"description": "A Vite plugin that inserts the current year to the html file during build. Useful for adding a copyright year.",
"version": "1.0.1",
"description": "A Vite plugin that inserts the current year to the HTML file during build. Useful for adding a copyright year to the HTML file.",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
Expand All @@ -26,7 +26,8 @@
"url": "git+https://github.com/8hobbies/vite-plugin-year.git"
},
"keywords": [
"vite"
"vite",
"vite-plugin"
],
"author": "8 Hobbies, LLC",
"license": "0BSD",
Expand Down

0 comments on commit 4ccb652

Please sign in to comment.