Skip to content

Commit

Permalink
切换到hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
lyremelody committed Apr 30, 2024
1 parent 0bffa06 commit ce46569
Show file tree
Hide file tree
Showing 722 changed files with 13,694 additions and 1,536 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.125.4
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
TZ: America/Los_Angeles
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public

# Deployment job
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@v4
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/hugo-book"]
path = themes/hugo-book
url = https://github.com/alex-shpak/hugo-book
4 changes: 0 additions & 4 deletions ability-and-improvement/README.md

This file was deleted.

5 changes: 5 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++
10 changes: 10 additions & 0 deletions archetypes/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "{{ .Name | humanize | title }}"
weight: 1
# bookFlatSection: false
# bookToc: true
# bookHidden: false
# bookCollapseSection: false
# bookComments: false
# bookSearchExclude: false
---
6 changes: 6 additions & 0 deletions archetypes/posts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ .Name | humanize | title }}"
date: {{ .Date }}
# bookComments: false
# bookSearchExclude: false
---
3 changes: 3 additions & 0 deletions assets/_custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* You can add custom styles here. */

// @import "plugins/numbered";
66 changes: 66 additions & 0 deletions assets/_defaults.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Used in layout
$padding-1: 1px !default;
$padding-4: 0.25rem !default;
$padding-8: 0.5rem !default;
$padding-16: 1rem !default;

$font-size-base: 16px !default;
$font-size-12: 0.75rem !default;
$font-size-14: 0.875rem !default;
$font-size-16: 1rem !default;

$border-radius: $padding-4 !default;

$body-font-weight: normal !default;

$body-min-width: 20rem !default;
$container-max-width: 80rem !default;

$header-height: 3.5rem !default;
$menu-width: 16rem !default;
$toc-width: 16rem !default;

$mobile-breakpoint: $menu-width + $body-min-width * 1.2 + $toc-width !default;

$hint-colors: (
info: #6bf,
warning: #fd6,
danger: #f66,
) !default;

// Themes
@mixin theme-light {
--gray-100: #f8f9fa;
--gray-200: #e9ecef;
--gray-500: #adb5bd;

--color-link: #0055bb;
--color-visited-link: #8440f1;

--body-background: white;
--body-font-color: black;

--icon-filter: none;

--hint-color-info: #6bf;
--hint-color-warning: #fd6;
--hint-color-danger: #f66;
}

@mixin theme-dark {
--gray-100: rgba(255, 255, 255, 0.1);
--gray-200: rgba(255, 255, 255, 0.2);
--gray-500: rgba(255, 255, 255, 0.5);

--color-link: #84b2ff;
--color-visited-link: #b88dff;

--body-background: #343a40;
--body-font-color: #e9ecef;

--icon-filter: brightness(0) invert(1);

--hint-color-info: #6bf;
--hint-color-warning: #fd6;
--hint-color-danger: #f66;
}
39 changes: 39 additions & 0 deletions assets/_fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* roboto-regular - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local(''),
url('fonts/roboto-v27-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/roboto-v27-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* roboto-700 - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-display: swap;
src: local(''),
url('fonts/roboto-v27-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/roboto-v27-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* roboto-mono-regular - latin */
@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local(''),
url('fonts/roboto-mono-v13-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/roboto-mono-v13-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

body {
font-family: 'Roboto', sans-serif;
}

code {
font-family: 'Roboto Mono', monospace;
}
Loading

0 comments on commit ce46569

Please sign in to comment.