Skip to content

Commit 87464d9

Browse files
Update README.md
1 parent 4dc529e commit 87464d9

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -222,25 +222,42 @@ For more information on customizing themes, visit the [GitHub Pages Documentatio
222222

223223
[github-docs]: https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/adding-a-theme-to-your-github-pages-site-using-jekyll
224224

225-
## The Trick
226-
GitHub Pages generates a static site but
227-
don't you know that you can deploy games using this?
228-
The trick is actually the code: if that is purely
229-
JavaScript, then it will work. To prove this, I deployed
225+
## What Static Site Really Means
226+
227+
GitHub Pages is known for hosting static sites, but what does "static" really mean?
228+
Does this imply that such sites cannot incorporate dynamic elements through JavaScript?
229+
230+
The term "static site" refers to the way content is served to the user. In a static
231+
site, all content is pre-generated into HTML files and delivered directly to the
232+
browser. This means there's no server-side processing or database interactions
233+
happening in real-time when a user visits the site.
234+
235+
However, this doesn't mean static sites are devoid of interactivity or dynamism.
236+
Through client-side JavaScript, static sites can include dynamic behaviors such as
237+
content updates, animations, and interactions. JavaScript can also fetch data from
238+
external APIs, bringing in dynamic content or functionality, albeit without direct
239+
server-side processing or database access on the hosting server.
240+
241+
The key limitation of static sites, particularly in the context of GitHub Pages, is
242+
the absence of backend functionality. This means while you can fetch and display
243+
data from external sources, you cannot directly save data back to a server or
244+
database through GitHub Pages. Any form of data storage or complex server-side
245+
logic would require external services or APIs.
246+
247+
In essence, static sites served through GitHub Pages offer a blend of performance
248+
and security for delivering content, with the flexibility to incorporate dynamic
249+
elements via client-side JavaScript, making them suitable for a wide range of
250+
applications from personal blogs to documentation and portfolio websites.
251+
In short, it has its own advantages compared to a full-pledged website.
252+
253+
GitHub Pages can even host games if the code is purely written in
254+
JavaScript. To prove this, I deployed
230255
demo games from Vanilla Web Projects using GitHub Pages:
231256

232257
<https://jdevfullstack-projects.github.io/hangman-game/>
233258

234259
<https://jdevfullstack-projects.github.io/breakout-game/>
235260

236-
As you can see here, because of the pure JavaScript,
237-
it enables the site not to be static. Remember,
238-
GitHub is referring to its being static
239-
for the server-side,
240-
so you can't directly run, say, a PHP script. And
241-
since JavaScript is browser-side scripting, it
242-
will work as expected.
243-
244261
## Blogging Vs Vlogging
245262
To my surprise, blogging is not dead.
246263
I simply had that conclusion realizing

0 commit comments

Comments
 (0)