Dieser Artikel bezieht sich auf die traditionelle Installationsmethode, bei der das Theme lokal als Git-Submodul geklont wird. Obwohl diese Installationsmethode immer noch weit verbreitet ist, empfehlen wir, das Theme als Hugo-Modul zu installieren.
Erstellen Sie eine neue Site von Grund auf
1$ git clone https://github.com/razonyang/hugo-theme-bootstrap-skeleton myblog
2$ cd myblog
3$ git submodule add https://github.com/razonyang/hugo-theme-bootstrap themes/hugo-theme-bootstrap
4$ sed -i "s/theme:.*/theme: hugo-theme-bootstrap/g" config/_default/config.yaml
5$ rm go.mod go.sum
6$ hugo mod npm pack
7$ npm install
8$ hugo server
Wenn Sie Windows verwenden, verwenden Sie stattdessen
xcopy .\themes\hugo-theme-bootstrap\exampleSite /E.
sedersetzttheme: github.com/razonyang/hugo-theme-bootstrapdurchtheme: hugo-theme-bootstrap.
Auf einer vorhandenen Site installieren
1$ cd myblog
2$ git submodule add https://github.com/razonyang/hugo-theme-bootstrap themes/hugo-theme-bootstrap
3$ git clone https://github.com/razonyang/hugo-theme-bootstrap-skeleton /tmp/hbs-skeleton
4$ mkdir config
5$ cp -a /tmp/hbs-skeleton/config/* ./config
6$ cp -r /tmp/hbs-skeleton/content/* ./content
7$ cp -r /tmp/hbs-skeleton/archetypes/* ./archetypes
8$ cp -r /tmp/hbs-skeleton/static/* ./static
9$ cp -r /tmp/hbs-skeleton/assets/* ./assets
10$ sed -i "s/theme:.*/theme: hugo-theme-bootstrap/g" config/_default/config.yaml
11$ hugo mod npm pack
12$ npm install
13$ hugo server
Wenn Sie einen neuen Klon erstellen, müssen Sie Ihr Submodul über
git submodule update --init --recursiveaktualisieren oder mit dem Submodulgit clone --recursive <repo>klonen.
Kommentare