Skip to content

Commit

Permalink
Add link to project on bottom
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Dolitsky <[email protected]>
  • Loading branch information
jdolitsky committed Nov 14, 2023
1 parent 1d16753 commit 820f878
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# specs-latest
# specs-latest

Source code to generate https://oci-playground.github.io/specs-latest/
8 changes: 5 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
<title>OCI specs latest</title>
</head>
<body style="background:#e8e9ff;padding: 20px;font-family: monospace">
<div style="width:100%px; max-width:700px;text-align:left;padding: 20px;border:1px solid #c7c2c2; background:white">
<div style="width:100%%px; max-width:700px;text-align:left;padding: 20px;border:1px solid #c7c2c2; background:white">
<h1>OCI specs latest</h1>
<p><b>last generated</b>: Tue Nov 14 16:37:05 2023</p>
<hr/><h2><a target="_blank" href="https://github.com/opencontainers/distribution-spec">distribution</a></h2>
<ul><li><div><h3><a target="_blank" href="https://github.com/opencontainers/distribution-spec/tree/91ba954eac70e40d63b2678421e7197cd33e0f2e">91ba954eac70e40d63b2678421e7197cd33e0f2e</a></h3>
<p><b>date:</b> Mon Nov 13 14:27:35 2023
Expand Down Expand Up @@ -197,6 +196,9 @@ <h1>OCI specs latest</h1>
<span>[<a target="_blank" href="specs/runtime/v1.0.0/oci-runtime-spec.html">oci-runtime-spec.html</a>]</span>
<span>[<a target="_blank" href="specs/runtime/v1.0.0/oci-runtime-spec.pdf">oci-runtime-spec.pdf</a>]</span>
</div></li>
</ul></div>
</ul><br/>
<i><p>generated on Tue Nov 14 16:42:08 2023</p></i>
<i><p>generated by <a target="_blank" href="https://github.com/oci-playground/specs-latest">github.com/oci-playground/specs-latest</a></p></i>
</div>
</body>
</html>
15 changes: 9 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,28 @@ func processConfig(config *specsConfig) {
gitWorkspace := filepath.Join(currentDir, "docs", "git-workspace")
log.Printf("ensuring git workspace directory %s", gitWorkspace)
os.MkdirAll(gitWorkspace, 0755)
now := time.Now().Format("Mon Jan 02 15:04:05 2006")
s := fmt.Sprintf(`<html>

s := `<html>
<head>
<title>OCI specs latest</title>
</head>
<body style="background:#e8e9ff;padding: 20px;font-family: monospace">
<div style="width:100%%px; max-width:700px;text-align:left;padding: 20px;border:1px solid #c7c2c2; background:white">
<h1>OCI specs latest</h1>
<p><b>last generated</b>: %s</p>
`, now)
`
for _, spec := range config.Specs {
os.Chdir(gitWorkspace)
s += processSpec(&spec)
}
os.Chdir(currentDir)
s += `</div>
now := time.Now().Format("Mon Jan 02 15:04:05 2006")
s += fmt.Sprintf(`<br/>
<i><p>generated on %s</p></i>
<i><p>generated by <a target="_blank" href="https://github.com/oci-playground/specs-latest">github.com/oci-playground/specs-latest</a></p></i>
</div>
</body>
</html>
`
`, now)
indexFile := filepath.Join(currentDir, "docs", "index.html")
if err := os.WriteFile(indexFile, []byte(s), 0644); err != nil {
log.Fatalf("WriteFile: %v", err)
Expand Down

0 comments on commit 820f878

Please sign in to comment.