Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nicrossi committed Jul 26, 2023
0 parents commit 1ce7c9a
Show file tree
Hide file tree
Showing 78 changed files with 11,102 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
pulic/
resources/
.github/
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ko_fi: razonyang
custom:
- https://paypal.me/razonyang
48 changes: 48 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: GitHub Pages
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true

- name: Build
run: hugo --minify --gc --enableGitInfo -b https://projects.razonyang.com/hugo-theme-bootstrap-skeleton/

- name: Deploy 🚀
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules
/resources
/public
.hugo_build.lock
hugo_stats.json
24 changes: 24 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
image: registry.gitlab.com/pages/hugo/hugo_extended:latest

variables:
HUGO_ENV: production

default:
before_script:
- apk add --update --no-cache git go npm
- npm install

test:
script:
- hugo --gc --minify
rules:
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH

pages:
script:
- hugo --gc --minify
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
###############
# Build Stage #
###############
FROM hugomods/hugo:exts as builder

COPY . /src

ENV HUGO_ENV=production

# Base URL
ARG HUGO_BASEURL=
ENV HUGO_BASEURL=${HUGO_BASEURL}

# Module Proxy
ARG HUGO_MODULE_PROXY=
ENV HUGO_MODULE_PROXY=${HUGO_MODULE_PROXY}

# NPM mirrors, such as https://registry.npmmirror.com
ARG NPM_CONFIG_REGISTRY=
ENV NPM_CONFIG_REGISTRY=${NPM_CONFIG_REGISTRY}

# Install dependencies
RUN npm ci

# Build site
RUN hugo --minify --gc --enableGitInfo

# Set the fallback 404 page if defaultContentLanguageInSubdir is enabled, please replace the `en` with your default language code.
# RUN cp ./public/en/404.html ./public/404.html

###############
# Final Stage #
###############
FROM hugomods/hugo:nginx
COPY --from=builder /src/public /site
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Razon Yang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
121 changes: 121 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Hugo Theme Bootstrap Skeleton

The starter template for [Hugo Bootstrap Theme](https://github.com/razonyang/hugo-theme-bootstrap) that install the theme as a Hugo module.

## Demo

| Platform | URL |
|---|---|
| Netlify | https://hbs-skeleton.netlify.app/ |
| GitHub Pages | https://projects.razonyang.com/hugo-theme-bootstrap-skeleton/ |
| Cloudflare Pages | https://hbs-skeleton.pages.dev/ |
| Docker image | See also [Dockerfile](Dockerfile) |

## Usage

Please make sure you have install the [build tools](https://hbs.razonyang.com/v1/en/docs/getting-started/prerequisites/#build-tools) prior to using this template.

**1. Clone this repository**

It's recommending cloning the repo by clicking the `Use this template` button, if you're hosting your code on GitHub.

You can also clone it manually.

```shell
$ git clone https://github.com/razonyang/hugo-theme-bootstrap-skeleton.git blog
$ cd blog
$ rm -rf .git
$ git init -b main
```

> The `rm -rf .git` is a dangerous action, please make sure that you enter the right folder.
**2. Modify the `go.mod`**

Replace the following line to yours, such as `module github.com/user/repo`.

```text
module github.com/razonyang/hugo-theme-bootstrap-skeleton
```

**3. Commit and push changes to your repository**

```shell
$ git add -A
$ git commit -m 'First commit'
$ git remote set-url origin github.com/user/repo
$ git push origin main
```

## Go Proxy(Optional)

If you're located at China mainland without VPN, the Hugo module download may fail.

There are two proxies for this: [GOPROXY.CN](https://goproxy.cn) and [GOPROXY.IO](https://goproxy.io).

```bash
$ export HUGO_MODULE_PROXY=https://goproxy.cn
```

> Please note that, Hugo doesn't respect the `GOPROXY` env var, please use `HUGO_MODULE_PROXY` instead.
You can also set the `module.proxy` instead of using env var.

```yaml
module:
proxy: https://goproxy.cn
```
## Server
**1. Install dependencies**
```shell
$ npm i
```

Generally, this step only needs to be performed once for each local project.

**2. Start server**

```shell
$ hugo server
```

## Upgrade theme

```shell
$ hugo mod get github.com/razonyang/hugo-theme-bootstrap@master
$ hugo mod npm pack
$ npm update
$ git add go.mod go.sum package.json package-lock.json
$ git commit -m 'Update the theme'
```

You can also replace the `master` with stable [releases](https://github.com/razonyang/hugo-theme-bootstrap/releases).

## Deployment

> The `baseURL` is very important, the CSS, JS and Sitemap require it to be set.
**Please make sure you've change the `baseURL` on `config/production/config.yaml` before deploying your site.**

**Please also remove the `-b {url}` from the following files if you're using this template.**

- `.github/workflows/gh-pages.yml`

This template supports GitHub Pages, Docker image, Netlify out-of-box. See also [Deployment](https://hbs.razonyang.com/v1/en/docs/deployment/) for getting more detail.

The following parameters also need to be tweaked.

- Replace the `utterances.*` or `giscus.*` with your own to get notified when someone comments.
- Modify the `repo` to your own, or delete it if it's unused.
- `contact.endpoint`.

There are some hooks under the `layouts/partials/hooks` folder for showing how to use them, please feel free to delete them.

## Documentations

- [English](https://hbs.razonyang.com/v1/en/)
- [简体中文](https://hbs.razonyang.com/v1/zh-hans/)
- [繁體中文](https://hbs.razonyang.com/v1/zh-hant/)
22 changes: 22 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# type: docs
title: {{ replace .Name "-" " " | title }}
date: {{ .Date }}
featured: false
draft: true
comment: true
toc: true
reward: true
pinned: false
carousel: false
series:
categories: []
tags: []
images: []
---

Summary.

<!--more-->

Content.
1 change: 1 addition & 0 deletions assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jsconfig.json
Binary file added assets/favicon.webp
Binary file not shown.
10 changes: 10 additions & 0 deletions assets/icons/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { faBlog, faBook, faFile, faNewspaper } from '@fortawesome/free-solid-svg-icons';
// import { faAddressBook } from '@fortawesome/free-regular-svg-icons';
// import { faAmazon, faGoogle } from '@fortawesome/free-brands-svg-icons';

const icons = [
faBook, faBlog, faFile, faNewspaper,
// faAddressBook,
// faAmazon, faGoogle,
];
export default icons;
Empty file added assets/main/js/custom.ts
Empty file.
Empty file added assets/main/scss/_custom.scss
Empty file.
4 changes: 4 additions & 0 deletions assets/main/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// OVERRIDE THE BOOTSTRAP AND THEME SCSS VARIABLES.
// See also https://hbs.razonyang.com/v1/en/docs/advanced/scss-variables/.

// $logo-animation: false;
17 changes: 17 additions & 0 deletions config/_default/author.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Razon Yang
# avatar: images/profile.png # Avatar image. Default to "images/profile.webp".
bio: 'Gopher, PHPer, Full Stack Engineer.'
company: Company # HTML markup are supported, such as: <a href="https://example.com" target="_blank" rel="noopener noreferrer">Company</a>.
location: Earth # HTML markup are supported, such as: <a href='https://www.openstreetmap.org/search?query=Earth'>Earth</a>.
# about: https://razonyang.com # The external about page. The internal about page will be used if not set.
params: {
# layout: compact
}
# See https://hbs.razonyang.com/v1/en/docs/widgets/social-links/.
social:
email: razonyang@gmail.com
github: razonyang/hugo-theme-bootstrap
twitter: razonyang
patreon: razonyang
paypal: razonyang
rss: "" # Remove RSS
37 changes: 37 additions & 0 deletions config/_default/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
baseURL: /
title: Hugo Bootstrap Skeleton
theme: github.com/razonyang/hugo-theme-bootstrap
copyright: 'Copyright © 2016-{year} Razon Yang. All Rights Reserved.'
defaultContentLanguage: en
# hasCJKLanguage: true # Uncomment it if your content contains Chinese/Japanese/Korean Languages.
# defaultContentLanguageInSubdir: true
# disableLanguages:
# - fr
# - zh-cn
# - zh-tw
paginate: 10
# paginatePath: page
enableRobotsTXT: true
enableEmoji: true
pygmentsUseClasses: true
# googleAnalytics: UA-123-45
# disqusShortname: yourdiscussshortname

blackfriday:
hrefTargetBlank: true

taxonomies:
category: categories
series: series
tag: tags
authors: authors

build:
writeStats: true

permalinks:
news: /news/:year/:month/:title/
blog: /blog/:year/:month/:title/

# module:
# proxy: https://goproxy.cn
2 changes: 2 additions & 0 deletions config/_default/config.zh-hans.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title: HBS 脚手架
hasCJKLanguage: true
12 changes: 12 additions & 0 deletions config/_default/languages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
en:
languageName: English
weight: 1

zh-hans:
languageName: 简体中文
weight: 4
params:
description: 一个快速、响应式和功能丰富的 Hugo 博客主题
keywords: 'Hugo, Bootstrap, 博客主题'
archive:
dateFormat: 01-02
6 changes: 6 additions & 0 deletions config/_default/menu.en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
main:
- name: Documentations
identifier: documentations
url: https://hbs.razonyang.com/v1/en/docs/
params:
icon: '<i class="fas fa-fw fa-book"></i>'
6 changes: 6 additions & 0 deletions config/_default/menu.zh-hans.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
main:
- name: 文档
identifier: documentations
url: https://hbs.razonyang.com/v1/zh-hans/docs/
params:
icon: '<i class="fas fa-fw fa-book"></i>'
Loading

0 comments on commit 1ce7c9a

Please sign in to comment.