Skip to content

Commit ccdfff1

Browse files
committed
update env vars example, add vercel-template.md
1 parent f871599 commit ccdfff1

8 files changed

Lines changed: 175 additions & 35 deletions

File tree

.env.development.example

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88
# Example values: http://localhost:3000
99
SITE_URL=http://localhost:3000
1010

11+
# --------------- Optional ---------------
12+
1113
# Url of the 'script.js' file hosted on Plausible analytics server.
12-
# Safe to omit in development.
1314
# Can be either hosted by Plausible or your own self-hosted server instance.
14-
# Example values: https://plausible.io/js/script.js | https://plausible.arm1.nemanjamitic.com/js/script.js
15+
# Example values: https://plausible.io/js/script.js | https://plausible.arm1.nemanjamitic.com/js/script.js | empty
1516
PLAUSIBLE_SCRIPT_URL=
1617

17-
# --------------- Optional ---------------
18-
1918
# Domain that identifies your website instance in Plausible analytics dashboard.
20-
# Safe to omit in development.
2119
# Example values: localhost:3000 | empty
2220
# Default value: SITE_URL without https://
2321
PLAUSIBLE_DOMAIN=

.env.production.example

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55

66
# Your website url.
77
# Includes protocol https:// or http://, no trailing slash '/'.
8-
# Only in Vercel build environment can be omitted and inferred from VERCEL_PROJECT_PRODUCTION_URL.
8+
# Only in Vercel BUILD environment can be omitted and inferred from VERCEL_PROJECT_PRODUCTION_URL.
99
# Example values: https://nemanjamitic.com | https://nemanjam.github.io | https://nemanjam.vercel.app
1010
SITE_URL=https://nemanjam.github.io
1111

12+
# --------------- Optional ---------------
13+
1214
# Url of the 'script.js' file hosted on Plausible analytics server.
1315
# Can be either hosted by Plausible or your own self-hosted server instance.
14-
# Example values: https://plausible.io/js/script.js | https://plausible.arm1.nemanjamitic.com/js/script.js
16+
# Example values: https://plausible.io/js/script.js | https://plausible.arm1.nemanjamitic.com/js/script.js | empty
1517
PLAUSIBLE_SCRIPT_URL=
1618

17-
# --------------- Optional ---------------
18-
1919
# Domain that identifies your website instance in Plausible analytics dashboard.
20-
# Example values: nemanjamitic.com | nemanjam.github.io | nemanjam.vercel.app
20+
# Example values: nemanjamitic.com | nemanjam.github.io | nemanjam.vercel.app | empty
2121
# Default value: SITE_URL without https://
2222
PLAUSIBLE_DOMAIN=nemanjamitic.com
2323

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ https://github.com/user-attachments/assets/5bf85aee-a3bd-4ca0-9b6d-d5b4f555934b
5353
- Code syntax highlighting, Twitter/YouTube/OG-links embeds
5454
- Giscus comments, Share post
5555
- Draft posts, RSS and JSON feeds
56-
- GitHub Pages, Nginx, x86 and arm Docker deployments
56+
- Vercel, GitHub Pages, Nginx, x86 and arm Docker deployments
5757
- GitHub Actions workflows and local scripts
5858

5959
## Motivation
@@ -79,23 +79,22 @@ A list of required and optional environment variables:
7979

8080
# Your website url.
8181
# Includes protocol https:// or http://, no trailing slash '/'.
82+
# Only in Vercel BUILD environment can be omitted and inferred from VERCEL_PROJECT_PRODUCTION_URL.
8283
# Example values dev: http://localhost:3000
8384
# Example values prod: https://nemanjamitic.com | https://nemanjam.github.io | https://nemanjam.vercel.app
8485
SITE_URL=https://nemanjam.github.io
8586

87+
# --------------- Optional ---------------
88+
8689
# Url of the 'script.js' file hosted on Plausible analytics server.
87-
# Safe to omit in development.
8890
# Can be either hosted by Plausible or your own self-hosted server instance.
8991
# Example values dev: empty
90-
# Example values prod: https://plausible.io/js/script.js | https://plausible.arm1.nemanjamitic.com/js/script.js
92+
# Example values prod: https://plausible.io/js/script.js | https://plausible.arm1.nemanjamitic.com/js/script.js | empty
9193
PLAUSIBLE_SCRIPT_URL=https://plausible.arm1.nemanjamitic.com/js/script.js
9294

93-
# --------------- Optional ---------------
94-
9595
# Domain that identifies your website instance in Plausible analytics dashboard.
96-
# Safe to omit in development.
9796
# Example values dev: localhost:3000 | empty
98-
# Example values prod: nemanjamitic.com | nemanjam.github.io | nemanjam.vercel.app
97+
# Example values prod: nemanjamitic.com | nemanjam.github.io | nemanjam.vercel.app | empty
9998
# Default value: SITE_URL without https://
10099
PLAUSIBLE_DOMAIN=nemanjamitic.com
101100

@@ -222,10 +221,14 @@ You have three options to deploy to Vercel: 1. Deploy button, 2. Local and 3. Gi
222221

223222
#### Deploy button
224223

225-
Just click the button below and follow the wizard to create a new project, build it, and deploy it. By default, the `SITE_URL` environment variable is inferred from the predefined `VERCEL_PROJECT_PRODUCTION_URL`. You can also explicitly set a custom `SITE_URL`, as well as `PLAUSIBLE_DOMAIN` and `PLAUSIBLE_SCRIPT_URL`, to enable Plausible Analytics. After updating environment variables, you will need to rebuild and redeploy the app for the changes to take effect.
226-
227224
[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io&envDescription=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%23environment-variables&envLink=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%2Fblob%2Fmain%2F.env.production.example&project-name=Developer%20blog&repository-name=nemanjam.github.io&demo-title=Developer%20blog&demo-description=Developer%20blog%20template%20built%20with%20Astro%20and%20Tailwind.&demo-url=https%3A%2F%2Fnemanjam.vercel.app&demo-image=https%3A%2F%2Fraw.githubusercontent.com%2Fnemanjam%2Fnemanjam.github.io%2Frefs%2Fheads%2Fmain%2Fdocs%2Fscreenshots%2Fdeveloper-blog-screenshot-1200x630.png&skippable-integrations=1)
228225

226+
Just click the button above and follow the wizard to create a new project, build it, and deploy it.
227+
228+
By default, the `SITE_URL` environment variable is inferred from the predefined `VERCEL_PROJECT_PRODUCTION_URL`. You can also explicitly set a custom `SITE_URL`, as well as `PLAUSIBLE_DOMAIN` and `PLAUSIBLE_SCRIPT_URL`, to enable Plausible Analytics.
229+
230+
After updating environment variables, you will need to rebuild and redeploy the app for the changes to take effect.
231+
229232
#### Local
230233

231234
Create a new Vercel project, and deploy it using Vercel CLI.

docs/working-notes/vercel-button.md

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
3+
# For Readme
4+
5+
```bash
6+
https://vercel.com/new/clone
7+
?repository-url=https://github.com/nemanjam/nemanjam.github.io
8+
&envDescription=https://github.com/nemanjam/nemanjam.github.io#environment-variables
9+
&envLink=https://github.com/nemanjam/nemanjam.github.io/blob/main/.env.production.example
10+
&project-name=Developer blog
11+
&repository-name=nemanjam.github.io
12+
&demo-title=Developer blog
13+
&demo-description=Developer blog template built with Astro and Tailwind.
14+
&demo-url=https://nemanjam.vercel.app
15+
&demo-image=https://raw.githubusercontent.com/nemanjam/nemanjam.github.io/refs/heads/main/docs/screenshots/developer-blog-screenshot-1200x630.png
16+
&skippable-integrations=1
17+
18+
```
19+
20+
```md
21+
https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io&envDescription=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%23environment-variables&envLink=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%2Fblob%2Fmain%2F.env.production.example&project-name=Developer%20blog&repository-name=nemanjam.github.io&demo-title=Developer%20blog&demo-description=Developer%20blog%20template%20built%20with%20Astro%20and%20Tailwind.&demo-url=https%3A%2F%2Fnemanjam.vercel.app&demo-image=https%3A%2F%2Fraw.githubusercontent.com%2Fnemanjam%2Fnemanjam.github.io%2Frefs%2Fheads%2Fmain%2Fdocs%2Fscreenshots%2Fdeveloper-blog-screenshot-1200x630.png&skippable-integrations=1
22+
23+
24+
```
25+
26+
27+
## For templates
28+
29+
```bash
30+
https://vercel.com/new/clone
31+
?repository-url=https://github.com/nemanjam/nemanjam.github.io
32+
&envDescription=https://github.com/nemanjam/nemanjam.github.io#environment-variables
33+
&envLink=https://github.com/nemanjam/nemanjam.github.io/blob/main/.env.production.example
34+
&project-name=Developer blog
35+
&repository-name=nemanjam.github.io
36+
&demo-title=Developer blog
37+
&demo-description=Developer blog template built with Astro and Tailwind.
38+
&demo-url=https://nemanjam.vercel.app
39+
&demo-image=https://raw.githubusercontent.com/nemanjam/nemanjam.github.io/refs/heads/main/docs/screenshots/developer-blog-screenshot-1200x630.png
40+
&skippable-integrations=1
41+
&from=templates
42+
&teamSlug=amy-vtest314
43+
```
44+
45+
46+
```md
47+
https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io&envDescription=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%23environment-variables&envLink=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%2Fblob%2Fmain%2F.env.production.example&project-name=Developer%20blog&repository-name=nemanjam.github.io&demo-title=Developer%20blog&demo-description=Developer%20blog%20template%20built%20with%20Astro%20and%20Tailwind.&demo-url=https%3A%2F%2Fnemanjam.vercel.app&demo-image=https%3A%2F%2Fraw.githubusercontent.com%2Fnemanjam%2Fnemanjam.github.io%2Frefs%2Fheads%2Fmain%2Fdocs%2Fscreenshots%2Fdeveloper-blog-screenshot-1200x630.png&skippable-integrations=1&from=templates&teamSlug=amy-vtest314
48+
49+
```
File renamed without changes.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
2+
# Full stack FastAPI template Next.js
3+
4+
Developer blog built with Astro, with a comprehensive feature set and well-structured code.
5+
6+
Run your coding blog in minutes. Benefit from robust, understandable, well-separated code. Optionally customize design by modifying files in the components folder. Multiple deployment options, Vercel, Nginx, Github Pages and Docker.
7+
8+
# Screenshot
9+
10+
![Frontend screenshot](https://raw.githubusercontent.com/nemanjam/nemanjam.github.io/refs/heads/main/docs/screenshots/developer-blog-screenshot-1200x630.png)
11+
12+
# Demo
13+
14+
**Vercel: [https://nemanjam.vercel.app](https://nemanjam.vercel.app)**
15+
16+
**Nginx: [https://nemanjamitic.com](https://nemanjamitic.com)**
17+
18+
# Features
19+
20+
- Latest Astro, static, high performance website
21+
- Post and Project content collections
22+
- Tailwind responsive design
23+
- Color themes with light/dark modes
24+
- Tags and Categories, pagination
25+
- Optimized images, view transitions
26+
- Extracted constants, types, utils, configs, queries, assets
27+
- Full TypeScript, Zod schemas, validated config
28+
- ESLint, Prettier, path aliases, sorted imports
29+
- React for interactive components
30+
- Design system pages, latest commit info in footer
31+
- Remote markdown content option
32+
- Hierarchical layouts
33+
- SEO friendly - sitemap, metadata
34+
- Open Graph image, Satori generated
35+
- Code syntax highlighting, Twitter/YouTube/OG-links embeds
36+
- Giscus comments, Share post
37+
- Draft posts, RSS and JSON feeds
38+
- Vercel, GitHub Pages, Nginx, x86 and arm Docker deployments
39+
- GitHub Actions workflows and local scripts
40+
41+
# Running locally
42+
43+
Install and run project locally for development.
44+
45+
## Environment variables
46+
47+
This project uses static generation - **all environment variables are build-time only**. The values are inlined at build time and are immutable at runtime. Any variables defined at runtime will be ignored.
48+
49+
A list of required and optional environment variables: [.env.development.example](https://github.com/nemanjam/nemanjam.github.io/blob/main/.env.development.example).
50+
51+
## Installation and running
52+
53+
```bash
54+
# install packages
55+
pnpm install
56+
57+
# copy and set environment variables
58+
cp .env.development.example .env.development
59+
60+
# run development server and visit http://localhost:3000
61+
pnpm dev
62+
63+
# delete node_modules and pnpm-lock.yaml
64+
pnpm clean
65+
```
66+
67+
# Deploying to Vercel
68+
69+
### Vercel button
70+
71+
[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io&envDescription=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%23environment-variables&envLink=https%3A%2F%2Fgithub.com%2Fnemanjam%2Fnemanjam.github.io%2Fblob%2Fmain%2F.env.production.example&project-name=Developer%20blog&repository-name=nemanjam.github.io&demo-title=Developer%20blog&demo-description=Developer%20blog%20template%20built%20with%20Astro%20and%20Tailwind.&demo-url=https%3A%2F%2Fnemanjam.vercel.app&demo-image=https%3A%2F%2Fraw.githubusercontent.com%2Fnemanjam%2Fnemanjam.github.io%2Frefs%2Fheads%2Fmain%2Fdocs%2Fscreenshots%2Fdeveloper-blog-screenshot-1200x630.png&skippable-integrations=1&from=templates&teamSlug=amy-vtest314)
72+
73+
Just click the button above and follow the wizard to create a new project, build it, and deploy it.
74+
75+
By default, the `SITE_URL` environment variable is inferred from the predefined `VERCEL_PROJECT_PRODUCTION_URL`. You can also explicitly set a custom `SITE_URL`, as well as `PLAUSIBLE_DOMAIN` and `PLAUSIBLE_SCRIPT_URL`, to enable Plausible Analytics.
76+
77+
After updating environment variables, you will need to rebuild and redeploy the app for the changes to take effect.
78+
79+
#### Github Actions
80+
81+
In Vercel dashboard create a new project and set the environment variables. In Vercel account settings create a access token and set it as `VERCEL_TOKEN` Github repository secret. In Vercel project settings copy your user id and project id and set them as `VERCEL_ORG_ID` and `VERCEL_PROJECT_ID` Github repository secrets.
82+
83+
```bash
84+
# Github repository -> Settings -> Secrets and variables -> Repository secrets
85+
86+
VERCEL_TOKEN
87+
VERCEL_ORG_ID
88+
VERCEL_PROJECT_ID
89+
```
90+
91+
Then just trigger the following workflow:
92+
93+
```bash
94+
# .github/workflows
95+
96+
# uses Vercel CLI to pull, pre-build and deploy
97+
# you must have an existing project and environment variables already defined on Vercel
98+
vercel__deploy-manual.yml
99+
```
100+
101+
**Detailed tutorial:** https://nemanjamitic.com/blog/2026-02-26-vercel-static-github-actions
102+
103+
# Credits
104+
105+
It reuses good solutions from other projects, see the [Credits list](https://github.com/nemanjam/nemanjam.github.io#credits).
106+
File renamed without changes.

0 commit comments

Comments
 (0)