Files snapshot from main
Git Static Site UI is a plugin for Build Awesome that creates plain, static HTML pages for displaying a git repository. You can read code, browse commits, and clone the repository purely from plain old files on a web server. It's sort of like a read-only version of GitHub, and requires no logic on the backend whatsoever.
npm install this plugin
npm install --save git-static-site-ui
Add this plugin to your eleventy config, giving it a repo configuration object that describes the name and location of the repositories that you want to display.
import gitStaticSiteUi, {beforeHook} from 'git-static-site-ui'
export default (eleventyConfig) => {
const reposConfig = {
repos: {
"My Cool Project": {
location: "/home/me/code/cool-project",
defaultBranch: 'main',
},
},
path: "/repos",
baseUrl: "https://example.com",
}
eleventyConfig.on("eleventy.beforeConfig", beforeHook(eleventyConfig, reposConfig))
eleventyConfig.addPlugin(gitStaticSiteUi, reposConfig)
}
Then generate your website with npx @11ty/eleventy --serve. The generated HTML pages for browsing your git repositories will be at http://localhost:8080/repos.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
b0f62a Tucker McKnight
b0f62a Tucker McKnight
23d539 Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
23d539 Tucker McKnight
23d539 Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
9aa969 Tucker McKnight
bc3dd1 Tucker McKnight
b0f62a Tucker McKnight
2a0989 tucker
2a0989 tucker
2a0989 tucker
b0f62a tucker
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
278410 Tucker McKnight
b0f62a Tucker McKnight
b0f62a Tucker McKnight
bc3dd1 Tucker McKnight
# What Is This?
Git Static Site UI is a plugin for [Build Awesome](https://11ty.dev) that creates
plain, static HTML pages for displaying a git repository. You can read code,
browse commits, and clone the repository purely from plain old files on
a web server. It's sort of like a read-only version of GitHub, and requires no logic
on the backend whatsoever.
# Installation and Setup
## Prerequisites
1. git, which you probably already have
2. A Build Awesome-generated website set up. You'll need to make a couple of additions
to your config file.
## Installation & Setup
1. npm install this plugin
`npm install --save git-static-site-ui`
2. Add this plugin to your eleventy config, giving it a repo configuration
object that describes the name and location of the repositories that you
want to display.
```js
import gitStaticSiteUi, {beforeHook} from 'git-static-site-ui'
export default (eleventyConfig) => {
const reposConfig = {
repos: {
"My Cool Project": {
location: "/home/me/code/cool-project",
defaultBranch: 'main',
},
},
path: "/repos",
baseUrl: "https://example.com",
}
eleventyConfig.on("eleventy.beforeConfig", beforeHook(eleventyConfig, reposConfig))
eleventyConfig.addPlugin(gitStaticSiteUi, reposConfig)
}
```
Then generate your website with `npx @11ty/eleventy --serve`. The generated HTML pages for browsing your git repositories will be at http://localhost:8080/repos.