Skip to content

Commit cfbe496

Browse files
committed
blogs
1 parent 95a7c70 commit cfbe496

File tree

6 files changed

+71
-7
lines changed

6 files changed

+71
-7
lines changed

public/404.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Redirecting...</title>
6+
<script type="text/javascript">
7+
// Single Page Apps for GitHub Pages
8+
// MIT License
9+
// https://github.com/rafgraph/spa-github-pages
10+
// This script takes the current URL and converts the path and query
11+
// string into just a query string, and then redirects the browser
12+
// to the new URL with the query string and hash fragment, but no
13+
// path, to load the single page app's index.html root.
14+
(function(){
15+
var redirect = sessionStorage.getItem('redirect');
16+
if (redirect) {
17+
sessionStorage.removeItem('redirect');
18+
window.location.replace(redirect);
19+
} else {
20+
var path = window.location.pathname;
21+
var query = window.location.search;
22+
var fragment = window.location.hash;
23+
var newUrl = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/?' +
24+
(path.startsWith('/') ? path.substring(1) : path) + query + fragment;
25+
sessionStorage.setItem('redirect', newUrl);
26+
window.location.replace(newUrl);
27+
}
28+
})();
29+
</script>
30+
</head>
31+
<body>
32+
</body>
33+
</html>

public/posts/do-i-need-to-create-a-lib-for-that.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,24 @@ type Tournament struct {
5252

5353
With the foundational structs in place, Gemini and I embarked on implementing the core logic.
5454
This was where the real challenge and fun began. Handling the "bye" mechanism – __ensuring that teams or competitors who automatically advance in the first round are correctly placed__ – proved to be particularly tricky.
55-
It's not as straightforward as it might seem, but with Gemini's assistance, we iterated through various approaches, and it did its best to help navigate those complexities. It was a true collaborative effort, pushing both my understanding and Gemini's capabilities to deliver a robust solution.
55+
It's not as straightforward as it might seem, but with Gemini's assistance, we iterated through various approaches, and it did its best to help navigate those complexities. It was a true collaborative effort, pushing both my understanding and Gemini's capabilities to deliver a robust solution.
56+
57+
## Publishing Your Go Module
58+
59+
Once you've developed your Go package, the next step is to make it available for others to use. This involves a few crucial steps to ensure your module is correctly versioned and discoverable.
60+
61+
1. **Define Your Module Path in `go.mod`:**
62+
Your `go.mod` file must declare the correct module path, which typically corresponds to the repository where your code is hosted. For `go-tournament-brackets`, this should be `module github.com/fezcode/go-tournament-brackets`. This path is how other Go projects will import and reference your module.
63+
64+
2. **Create and Push a Version Tag (Release):**
65+
Go modules rely on Git tags for versioning. To publish a specific version of your module, you need to:
66+
* **Tag your commit:** Use `git tag vX.Y.Z` (e.g., `git tag v0.1.0`) to mark a specific commit as a release. Semantic Versioning (SemVer) is highly recommended for your tags (e.g., `v0.1.0`, `v1.0.0`).
67+
* **Push the tag:** After creating the tag locally, push it to your remote repository: `git push origin vX.Y.Z`. This makes the version visible to module proxies.
68+
69+
3. **Module Discovery by Go Proxies (e.g., `proxy.golang.org`):**
70+
Go module proxies (like `proxy.golang.org`) automatically discover new module versions when they are tagged and pushed to a public repository. While you don't strictly *need* to run a command to "publish" in the traditional sense, you can explicitly request a proxy to fetch a new version.
71+
* **Requesting a specific version:** You can use `go get github.com/fezcode/go-tournament-brackets@v0.1.0` (or `go list -m github.com/fezcode/go-tournament-brackets@v0.1.0`) from *any* Go project. I used `$env:GOPROXY="proxy.golang.org"; go list -m github.com/fezcode/go-tournament-brackets`. When this command is executed, if the proxy doesn't have that version, it will fetch it from your repository.
72+
* **Important Note:** The `GOPROXY=proxy.golang.org go list -m example.com/mymodule@v0.1.0` command is primarily used to *verify* that a module can be fetched from the proxy, or to *force* a proxy to fetch a new version if it hasn't discovered it yet. It's not a "publishing" command in itself, but rather a way to interact with the proxy.
73+
74+
4. **Visibility on `pkg.go.dev`:**
75+
After your module is tagged and discoverable by Go module proxies, `pkg.go.dev` (the official Go package discovery site) will eventually index it. This process is not instantaneous and can take some time (from minutes to a few hours). You won't see your listing immediately, so patience is indeed key!

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { HashRouter as Router } from 'react-router-dom';
2+
import { BrowserRouter as Router } from 'react-router-dom';
33
import Layout from './components/Layout';
44
import AnimatedRoutes from './components/AnimatedRoutes';
55

src/index.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ code {
1414
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
1515
monospace;
1616
}
17+
18+
/* Styling for inline code blocks */
19+
.prose code:not(pre > code) {
20+
background-color: #242424; /* gray-600 */ /* Changed background color */
21+
color: #f87171; /* primary-400 - Reverted color */
22+
padding: 0.2em 0.4em;
23+
border-radius: 0.25rem;
24+
font-family: 'JetBrains Mono', monospace;
25+
font-weight: 300; /* Lighter font weight */
26+
}

src/pages/NotFoundPage.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import React from 'react';
22
import { Link } from 'react-router-dom';
3+
import { ArrowLeftIcon } from '@phosphor-icons/react';
34

45
const NotFoundPage = () => {
56
return (
6-
<div className="text-center">
7+
<div className="text-center mt-20 mb-20">
78
<h1 className="text-9xl font-bold text-gray-400">404</h1>
8-
<p className="text-2xl md:text-3xl font-light mb-8">
9+
<p className="text-2xl md:text-3xl font-light mb-8 text-white"> {/* Added text-white class */}
910
Sorry, the page you are looking for does not exist.
1011
</p>
11-
<Link to="/" className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
12-
Go to Homepage
12+
<Link to="/" className="text-primary-400 hover:underline flex items-center justify-center gap-2 text-lg"> {/* Changed styling and text */}
13+
<ArrowLeftIcon size={24} /> Back to Home
1314
</Link>
1415
</div>
1516
);

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = {
7878
},
7979

8080
li: {
81-
lineHeight: '1.5',
81+
lineHeight: '1.6',
8282
},
8383
},
8484
},

0 commit comments

Comments
 (0)