Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Mar 31, 2023
0 parents commit 389b779
Show file tree
Hide file tree
Showing 149 changed files with 1,806 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/cf-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Cloudflare Pages

on:
push:
branches:
- main

workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm i -g postcss-cli autoprefixer @fullhuman/postcss-purgecss rtlcss

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

- name: Cache Hugo modules
uses: actions/cache@v3
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Build
run: hugo --minify --gc --enableGitInfo

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: hb-theme
directory: ./public
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build
uses: docker/build-push-action@v4
with:
context: .
tags: example.com/user/site
73 changes: 73 additions & 0 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: GitHub Pages

on:
push:
branches:
- main

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

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

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

- name: Install Node.js dependencies
run: npm i -g postcss-cli autoprefixer @fullhuman/postcss-purgecss rtlcss

- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.hugo_build.lock
hugo_stats.json
package-json.lock
public/
node_modules/
8 changes: 8 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pull_request_rules:
- name: automatic merge for Renovate pull requests
conditions:
- author=renovate[bot]
- check-success=build
actions:
merge:
method: rebase
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
###############
# Build Stage #
###############
FROM razonyang/hugo:exts as builder
# Base URL
ARG HUGO_BASEURL=
ENV HUGO_BASEURL=${HUGO_BASEURL}
# Module Proxy
ARG HUGO_MODULE_PROXY=
ENV HUGO_MODULE_PROXY=${HUGO_MODULE_PROXY}
# Build site
COPY . /src
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 razonyang/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) 2023 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.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# HB Theme Template

The starter theme template of [HB Framework](https://hb.hugomods.com).

## Features

- **Fast** and **SEO** friendly: [PageSpeed Insight](https://pagespeed.web.dev/analysis?url=https://hb-theme.hugomods.com/en/) scored perfect :100: in all four metrics on mobile and desktop.
- **Multi-purpose**: blog, project documentations, digital garden and so on.
- **Responsive**: mobile first, built on top of Bootstrap v5.3.
- :ice_cube: **Modular** and **flexible**: extend features via various modules.
- :first_quarter_moon: **Dark mode**: light, dark or auto (follow system).
- :mag: **Search**: powerful client side *fuzzy* search that allows *filtering* and *sorting* of results, as well as searching from all multilingual sites.
- **PurgeCSS**: remove unused CSS.
- :rocket: **PWA**:
- Installable: add site to home screen.
- Offline available: offline page and offline image.
- Allow precaching resources, such as CSS, JS and fonts.
- :framed_picture: **Images Processing**: process images via URL query string and fragment, such as alignment, resizing, cropping and so on, friendly to Markdown.
- :computer: **Code block panel**: expand toggle, code copy button, line number toggle and wrap toggle.
- **Menus**: supports header menus and footer menus.
- :framed_picture: Image viewer: zoom in/out image.
- :card_index_dividers: **Archives**: group by year and month.
- :memo: **Multiple authors**: articles can be co-authored.
- :globe_with_meridians: **Multilingual**.
- :arrow_left: **RTL**: supports Right-to-Left languages.
- :arrow_up: Back/Return to top button.
- Social links: supports header and footer social links.
- Content: supports KaTex (math), Mermaid (diagrams) and Bootstrap shortcodes.
- ...

## Live Demos

| Platform | URL |
| -------- | --- |
| Cloudflare Pages | https://hb-theme.hugomods.com/ |
| GitHub Pages | https://hbstack.github.io/theme/ |
| Netlify | https://hb-theme.netlify.app/ |

## Screenshot

![Screenshot](https://raw.githubusercontent.com/hbstack/theme/main/images/screenshot.png)
31 changes: 31 additions & 0 deletions archetypes/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
description:
noindex: false
featured: false
pinned: false
series:
# -
categories:
# -
tags:
# -
images:
# -
# menu:
# main:
# weight: 100
# params:
# icon:
# vendor: bs
# name: book
# color: '#e24d0e'
---

Summary.

<!--more-->

Content.
35 changes: 35 additions & 0 deletions archetypes/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "{{ replace .Name "-" " " | title }}"
# linkTitle:
date: {{ .Date }}
draft: true
description:
noindex: false
nav_weight: 1000
# nav_icon:
# vendor: bootstrap
# name: toggles
# color: '#e24d0e'
series:
- Docs
categories:
# -
tags:
# -
images:
# -
# menu:
# main:
# weight: 100
# params:
# icon:
# vendor: bs
# name: book
# color: '#e24d0e'
---

Summary.

<!--more-->

Content.
34 changes: 34 additions & 0 deletions archetypes/tutorials.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "{{ replace .Name "-" " " | title }}"
# linkTitle:
date: {{ .Date }}
draft: true
description:
noindex: false
nav_weight: 1000
# nav_icon:
# vendor: bootstrap
# name: toggles
# color: '#e24d0e'
series:
- Tutorial
categories:
# -
tags:
# -
images:
# menu:
# main:
# weight: 100
# params:
# icon:
# vendor: bs
# name: book
# color: '#e24d0e'
---

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.ico
Binary file not shown.
Binary file added assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/pwa/offline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 389b779

Please sign in to comment.