Skip to content

Commit c5c77d2

Browse files
authored
docs: Initial import from localai-website (#1312)
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 763f94c commit c5c77d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+6111
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "docs/themes/hugo-theme-relearn"]
2+
path = docs/themes/hugo-theme-relearn
3+
url = https://github.com/McShelby/hugo-theme-relearn.git

docs/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM klakegg/hugo:ext-alpine
2+
3+
RUN apk add git && \
4+
git config --global --add safe.directory /src

docs/README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# LocalAI website
2+
3+
LocalAI documentation website
4+
5+
## Requirement
6+
In this project, the Docsy theme component is pulled in as a Hugo module, together with other module dependencies:
7+
8+
```bash
9+
$ hugo mod graph
10+
hugo: collected modules in 566 ms
11+
hugo: collected modules in 578 ms
12+
github.com/google/docsy-example github.com/google/[email protected]
13+
github.com/google/docsy-example github.com/google/docsy/[email protected]
14+
github.com/google/docsy/[email protected] github.com/twbs/[email protected]+incompatible
15+
github.com/google/docsy/[email protected] github.com/FortAwesome/[email protected]
16+
```
17+
18+
If you want to do SCSS edits and want to publish these, you need to install `PostCSS`
19+
20+
```bash
21+
npm install
22+
```
23+
24+
## Running the website locally
25+
26+
Building and running the site locally requires a recent `extended` version of [Hugo](https://gohugo.io).
27+
You can find out more about how to install Hugo for your environment in our
28+
[Getting started](https://www.docsy.dev/docs/getting-started/#prerequisites-and-installation) guide.
29+
30+
Once you've made your working copy of the site repo, from the repo root folder, run:
31+
32+
```
33+
hugo server
34+
```
35+
36+
## Running a container locally
37+
38+
You can run docsy-example inside a [Docker](https://docs.docker.com/)
39+
container, the container runs with a volume bound to the `docsy-example`
40+
folder. This approach doesn't require you to install any dependencies other
41+
than [Docker Desktop](https://www.docker.com/products/docker-desktop) on
42+
Windows and Mac, and [Docker Compose](https://docs.docker.com/compose/install/)
43+
on Linux.
44+
45+
1. Build the docker image
46+
47+
```bash
48+
docker-compose build
49+
```
50+
51+
1. Run the built image
52+
53+
```bash
54+
docker-compose up
55+
```
56+
57+
> NOTE: You can run both commands at once with `docker-compose up --build`.
58+
59+
1. Verify that the service is working.
60+
61+
Open your web browser and type `http://localhost:1313` in your navigation bar,
62+
This opens a local instance of the docsy-example homepage. You can now make
63+
changes to the docsy example and those changes will immediately show up in your
64+
browser after you save.
65+
66+
### Cleanup
67+
68+
To stop Docker Compose, on your terminal window, press **Ctrl + C**.
69+
70+
To remove the produced images run:
71+
72+
```console
73+
docker-compose rm
74+
```
75+
For more information see the [Docker Compose
76+
documentation](https://docs.docker.com/compose/gettingstarted/).
77+
78+
## Troubleshooting
79+
80+
As you run the website locally, you may run into the following error:
81+
82+
```
83+
➜ hugo server
84+
85+
INFO 2021/01/21 21:07:55 Using config file:
86+
Building sites … INFO 2021/01/21 21:07:55 syncing static files to /
87+
Built in 288 ms
88+
Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): resource "scss/scss/main.scss_9fadf33d895a46083cdd64396b57ef68" not found in file cache
89+
```
90+
91+
This error occurs if you have not installed the extended version of Hugo.
92+
See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-hugo) of the user guide for instructions on how to install Hugo.
93+
94+
Or you may encounter the following error:
95+
96+
```
97+
➜ hugo server
98+
99+
Error: failed to download modules: binary with name "go" not found
100+
```
101+
102+
This error occurs if you have not installed the `go` programming language on your system.
103+
See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-go-language) of the user guide for instructions on how to install `go`.

docs/config.toml

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# this is a required setting for this theme to appear on https://themes.gohugo.io/
2+
# change this to a value appropriate for you; if your site is served from a subdirectory
3+
# set it like "https://example.com/mysite/"
4+
baseURL = "https://localai.io/"
5+
6+
# canonicalization will only be used for the sitemap.xml and index.xml files;
7+
# if set to false, a site served from a subdirectory will generate wrong links
8+
# inside of the above mentioned files; if you serve the page from the servers root
9+
# you are free to set the value to false as recommended by the official Hugo documentation
10+
canonifyURLs = true # true -> all relative URLs would instead be canonicalized using baseURL
11+
# required value to serve this page from a webserver AND the file system;
12+
# if you don't want to serve your page from the file system, you can also set this value
13+
# to false
14+
relativeURLs = true # true -> rewrite all relative URLs to be relative to the current content
15+
# if you set uglyURLs to false, this theme will append 'index.html' to any branch bundle link
16+
# so your page can be also served from the file system; if you don't want that,
17+
# set disableExplicitIndexURLs=true in the [params] section
18+
uglyURLs = false # true -> basic/index.html -> basic.html
19+
20+
# the directory where Hugo reads the themes from; this is specific to your
21+
# installation and most certainly needs be deleted or changed
22+
#themesdir = "../.."
23+
# yeah, well, obviously a mandatory setting for your site, if you want to
24+
# use this theme ;-)
25+
theme = "hugo-theme-relearn"
26+
27+
# the main language of this site; also an automatic pirrrate translation is
28+
# available in this showcase
29+
languageCode = "en"
30+
31+
# make sure your defaultContentLanguage is the first one in the [languages]
32+
# array below, as the theme needs to make assumptions on it
33+
defaultContentLanguage = "en"
34+
35+
# the site's title of this showcase; you should change this ;-)
36+
title = "LocalAI Documentation"
37+
38+
# We disable this for testing the exampleSite; you must do so too
39+
# if you want to use the themes parameter disableGeneratorVersion=true;
40+
# otherwise Hugo will create a generator tag on your home page
41+
disableHugoGeneratorInject = true
42+
43+
[outputs]
44+
# add JSON to the home to support Lunr search; This is a mandatory setting
45+
# for the search functionality
46+
# add PRINT to home, section and page to activate the feature to print whole
47+
# chapters
48+
home = ["HTML", "RSS", "PRINT", "SEARCH", "SEARCHPAGE"]
49+
section = ["HTML", "RSS", "PRINT"]
50+
page = ["HTML", "RSS", "PRINT"]
51+
52+
[markup]
53+
[markup.highlight]
54+
# if `guessSyntax = true`, there will be no unstyled code even if no language
55+
# was given BUT Mermaid and Math codefences will not work anymore! So this is a
56+
# mandatory setting for your site if you want to use Mermaid or Math codefences
57+
guessSyntax = true
58+
59+
# here in this showcase we use our own modified chroma syntax highlightning style
60+
# which is imported in theme-relearn-light.css / theme-relearn-dark.css;
61+
# if you want to use a predefined style instead:
62+
# - remove the following `noClasses`
63+
# - set the following `style` to a predefined style name
64+
# - remove the `@import` of the self-defined chroma stylesheet from your CSS files
65+
# (here eg.: theme-relearn-light.css / theme-relearn-dark.css)
66+
noClasses = false
67+
style = "tango"
68+
69+
[markup.goldmark.renderer]
70+
# activated for this showcase to use HTML and JavaScript; decide on your own needs;
71+
# if in doubt, remove this line
72+
unsafe = true
73+
74+
# allows `hugo server` to display this showcase in IE11; this is used for testing, as we
75+
# are still supporting IE11 - although with degraded experience; if you don't care about
76+
# `hugo server` or browsers of ancient times, fell free to remove this whole block
77+
[server]
78+
[[server.headers]]
79+
for = "**.html"
80+
[server.headers.values]
81+
X-UA-Compatible = "IE=edge"
82+
83+
# showcase of the menu shortcuts; you can use relative URLs linking
84+
# to your content or use fully-quallified URLs to link outside of
85+
# your project
86+
[languages]
87+
[languages.en]
88+
title = "LocalAI documentation"
89+
weight = 1
90+
languageName = "English"
91+
[languages.en.params]
92+
landingPageName = "<i class='fas fa-home'></i> Home"
93+
[[languages.en.menu.shortcuts]]
94+
name = "<i class='fas fa-home'></i> Home"
95+
url = "/"
96+
weight = 1
97+
[[languages.en.menu.shortcuts]]
98+
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
99+
identifier = "ds"
100+
url = "https://github.com/go-skynet/LocalAI"
101+
weight = 10
102+
103+
[[languages.en.menu.shortcuts]]
104+
name = "<i class='fas fa-fw fa-camera'></i> Examples"
105+
url = "https://github.com/go-skynet/LocalAI/tree/master/examples/"
106+
weight = 11
107+
108+
[[languages.en.menu.shortcuts]]
109+
name = "<i class='fas fa-fw fa-images'></i> Model Gallery"
110+
url = "https://github.com/go-skynet/model-gallery"
111+
weight = 12
112+
113+
[[languages.en.menu.shortcuts]]
114+
name = "<i class='fas fa-fw fa-download'></i> Container images"
115+
url = "https://quay.io/repository/go-skynet/local-ai"
116+
weight = 20
117+
#[[languages.en.menu.shortcuts]]
118+
# name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
119+
# url = "more/credits/"
120+
# weight = 30
121+
122+
[[languages.en.menu.shortcuts]]
123+
name = "<i class='fas fa-fw fa-tags'></i> Releases"
124+
url = "https://github.com/go-skynet/LocalAI/releases"
125+
weight = 40
126+
127+
128+
# mounts are only needed in this showcase to access the publicly available screenshots;
129+
# remove this section if you don't need further mounts
130+
[module]
131+
[[module.mounts]]
132+
source = 'archetypes'
133+
target = 'archetypes'
134+
[[module.mounts]]
135+
source = 'assets'
136+
target = 'assets'
137+
[[module.mounts]]
138+
source = 'content'
139+
target = 'content'
140+
[[module.mounts]]
141+
source = 'data'
142+
target = 'data'
143+
[[module.mounts]]
144+
source = 'i18n'
145+
target = 'i18n'
146+
[[module.mounts]]
147+
source = '../images'
148+
target = 'static/images'
149+
[[module.mounts]]
150+
source = 'layouts'
151+
target = 'layouts'
152+
[[module.mounts]]
153+
source = 'static'
154+
target = 'static'
155+
156+
157+
# settings specific to this theme's features; choose to your likings and
158+
# consult this documentation for explaination
159+
[params]
160+
editURL = "https://github.com/mudler/LocalAI/edit/master/docs/content/"
161+
description = "Documentation for LocalAI"
162+
author = "Ettore Di Giacinto"
163+
showVisitedLinks = true
164+
collapsibleMenu = true
165+
disableBreadcrumb = false
166+
disableInlineCopyToClipBoard = true
167+
disableNextPrev = false
168+
disableLandingPageButton = true
169+
breadcrumbSeparator = ">"
170+
titleSeparator = "::"
171+
themeVariant = [ "auto", "relearn-bright", "relearn-light", "relearn-dark", "learn", "neon", "blue", "green", "red" ]
172+
themeVariantAuto = [ "relearn-light", "relearn-dark" ]
173+
disableSeoHiddenPages = true
174+
# this is to index search for your native language in other languages, too (eg.
175+
# pir in this showcase)
176+
additionalContentLanguage = [ "en" ]
177+
# this is for the stylesheet generator to allow for interactivity in Mermaid
178+
# graphs; you usually will not need it and you should remove this for
179+
# security reasons
180+
mermaidInitialize = "{ \"securityLevel\": \"loose\" }"
181+
mermaidZoom = true

0 commit comments

Comments
 (0)