This commit is contained in:
2026-03-25 15:14:49 +09:00
commit 266e0b0cf9
84 changed files with 4624 additions and 0 deletions

14
themes/plain/.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
# see https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
# Maintain dependencies for npm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"

17
themes/plain/.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@@ -0,0 +1,41 @@
# see https://gist.github.com/xt0rted/46475099dc0a70ba63e16e3177407872
name: Dependabot auto-merge
on:
pull_request:
branches:
- master
permissions:
contents: read
pull-requests: read
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Create token
id: create_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.BIG_MERGER_APP_ID }}
private_key: ${{ secrets.BIG_MERGER_PRIVATE_KEY }}
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Authenticate cli
run: echo "${{ steps.create_token.outputs.token }}" | gh auth login --with-token
- name: Enable auto-merge for Dependabot PRs
if: contains(fromJSON('["version-update:semver-patch", "version-update:semver-minor"]'), steps.dependabot-metadata.outputs.update-type)
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}

48
themes/plain/.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2.6.0
with:
hugo-version: latest
- name: Build local ./exampleSite
run: hugo --minify --gc --destination ../public --source ./exampleSite --themesDir ../.. --baseURL https://janraasch.github.io/hugo-bearblog/
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build
path: ./public
deploy:
needs: build
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: build
path: ./public
- uses: peaceiris/actions-gh-pages@v3.9.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

1
themes/plain/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

View File

@@ -0,0 +1,13 @@
+++
title = "{{ replace .Name "-" " " | title }}"
date = "{{ .Date }}"
#
# description is optional
#
# description = "An optional description for SEO. If not provided, an automatically created summary will be used."
tags = [{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}"{{ printf "%s" $term }}",{{ end }}{{ end }}]
+++
This is a page about »{{ replace .Name "-" " " | title }}«.

View File

@@ -0,0 +1,22 @@
+++
title = "{{ replace .Name "-" " " | title }}"
date = "{{ .Date }}"
#
# Set menu to "main" to add this page to
# the main menu on top of the page
#
menu = "main"
#
# description is optional
#
# description = "An optional description for SEO. If not provided, an automatically created summary will be used."
#
# tags are optional
#
# tags = [{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}"{{ printf "%s" $term }}",{{ end }}{{ end }}]
+++
This is a page about »{{ replace .Name "-" " " | title }}«.

View File

@@ -0,0 +1,7 @@
{{ define "main" }}
{{- partial "nav.html" . -}}
<div class="home">
<h1>404</h1>
<p>Page not found.</p>
</div>
{{ end }}

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="{{ with .Language }}{{ .Lang }}{{ else }}en{{ end }}">
<head>
{{- partial "head.html" . -}}
{{- block "head" . }}{{ end -}}
</head>
<body>
{{- block "main" . }}{{ end -}}
</body>
</html>

View File

@@ -0,0 +1,17 @@
{{ define "main" }}
{{- partial "nav.html" . -}}
{{ $pages := union .RegularPages .Sections }}
<div class="post-list">
<h1>{{ with .Title }}{{ . }}{{ else }}{{ .Section }}{{ end }}</h1>
<ul>
{{ range $pages }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ if gt .Date.Year 2000 }}<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>{{ end }}
</li>
{{ end }}
</ul>
</div>
{{ end }}

View File

@@ -0,0 +1,16 @@
{{ define "head" }}
{{- partial "katex.html" . -}}
{{ end }}
{{ define "main" }}
{{- partial "nav.html" . -}}
<article>
<header>
<h1>{{ .Title }}</h1>
{{ if gt .Date.Year 2000 }}<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>{{ end }}
</header>
<div class="post-content">
{{ .Content }}
</div>
</article>
{{ end }}

View File

@@ -0,0 +1,11 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{- range .Data.Pages }}
{{- if gt .Date.Year 2000 }}
<url>
<loc>{{ .Permalink }}</loc>
<lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}</lastmod>
</url>
{{- end }}
{{- end }}
</urlset>

View File

@@ -0,0 +1,11 @@
{{ define "main" }}
<div class="home">
<h1>{{ .Site.Params.author }}</h1>
{{ with .Site.Params.description }}<p class="desc">{{ . }}</p>{{ end }}
<ul>
{{ range .Site.Params.homeLinks }}
<li><a href="{{ .url }}">{{ .label }}</a></li>
{{ end }}
</ul>
</div>
{{ end }}

View File

@@ -0,0 +1,34 @@
{{- $title := .Site.Title -}}
{{- $desc := .Site.Params.description -}}
{{- if and .Title (not .IsHome) -}}
{{- $title = printf "%s | %s" .Title .Site.Title -}}
{{- end -}}
{{- with .Description }}{{ $desc = . }}{{ end -}}
{{- if and (not .Description) .IsPage }}{{ with .Summary }}{{ $desc = . | plainify | truncate 160 }}{{ end }}{{ end -}}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="/css/main.css">
<title>{{ $title }}</title>
<meta name="description" content="{{ $desc }}">
<meta name="author" content="{{ .Site.Params.author }}">
<link rel="canonical" href="{{ .Permalink }}">
{{/* Open Graph */}}
<meta property="og:title" content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}">
<meta property="og:description" content="{{ $desc }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
{{ if .IsPage -}}
<meta property="og:type" content="article">
{{ with .Date }}<meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }}
{{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }}
{{- else -}}
<meta property="og:type" content="website">
{{- end }}
{{/* Twitter */}}
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}">
<meta name="twitter:description" content="{{ $desc }}">

View File

@@ -0,0 +1,12 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"
onload="renderMathInElement(document.body, {
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
throwOnError: false
});"></script>

View File

@@ -0,0 +1,8 @@
{{ $parent := .Parent }}
<nav class="site-nav">
{{ if and $parent (not $parent.IsHome) }}
<a href="{{ $parent.RelPermalink }}">&larr; {{ with $parent.Title }}{{ . }}{{ else }}{{ $parent.Section }}{{ end }}</a>
{{ else }}
<a href="/">&larr; home</a>
{{ end }}
</nav>

1
themes/plain/theme.toml Normal file
View File

@@ -0,0 +1 @@
name = "plain"