This commit is contained in:
2025-05-13 22:04:36 +02:00
parent 15a6807518
commit aa3f4536ad
10 changed files with 6 additions and 232 deletions

View File

@ -1,8 +1,8 @@
services:
hugo:
image: ghcr.io/gohugoio/hugo:latest # Official Hugo image
image: ghcr.io/gohugoio/hugo:latest
container_name: hugo-blog
platform: linux/amd64 # Use emulation for M4 chip
platform: linux/amd64
volumes:
- ./site:/src
ports:

View File

@ -1,15 +0,0 @@
---
title: "Example Page"
weight: 1
---
# Example Documentation
This is an example page using the Book theme.
## Features
- Clean documentation layout
- Sidebar navigation
- Search functionality
- Mobile friendly designdddd

View File

@ -1,8 +0,0 @@
---
title: "Documentation"
weight: 1
---
# Documentation
Welcome to the documentation section. This demonstrates the Book theme's documentation capabilities.

View File

@ -1,15 +0,0 @@
---
title: "Example Page"
weight: 1
---
# Example Documentation
This is an example page using the Book theme.
## Features
- Clean documentation layout
- Sidebar navigation
- Search functionality
- Mobile friendly design

View File

@ -1 +0,0 @@
ddd

View File

@ -1,9 +0,0 @@
---
title: "My First Post"
date: 2025-05-13
draft: false
---
# Hello World!
This is my first blog post using the Book theme.

View File

@ -3,10 +3,7 @@ languageCode: "en-us"
title: "My Documentation Site"
theme: "book"
# Book theme specific parameters
params:
# (Optional) Set to 'true' to mark as draft
# bookDraft: true
# (Optional) Set this to the section name if section is not root
# bookSection: docs

View File

@ -1,166 +0,0 @@
#!/bin/bash
# Remove any previous setup to start fresh
rm -rf site
mkdir -p site
# Create hugo.yaml config file
cat > site/hugo.yaml << EOF
baseURL: "http://localhost:1313/"
languageCode: "en-us"
title: "Jens Bech's Blog"
theme: "PaperMod"
# Menu items
menu:
main:
- identifier: archive
name: Archive
url: /archive/
weight: 10
- identifier: categories
name: Categories
url: /categories/
weight: 20
- identifier: tags
name: Tags
url: /tags/
weight: 30
- identifier: search
name: Search
url: /search/
weight: 40
# PaperMod theme specific parameters
params:
# Theme appearance
defaultTheme: auto
disableThemeToggle: false
# Homepage settings
profileMode:
enabled: true
title: "Jens Bech"
subtitle: "Welcome to my minimalist blog"
imageUrl: "/images/profile.jpg"
buttons:
- name: Archive
url: "/archive/"
- name: Categories
url: "/categories/"
- name: Tags
url: "/tags/"
# Display settings
ShowReadingTime: true
ShowShareButtons: false
ShowPostNavLinks: true
ShowBreadCrumbs: true
ShowCodeCopyButtons: true
hideFooter: false
# Search settings
fuseOpts:
isCaseSensitive: false
shouldSort: true
location: 0
distance: 1000
threshold: 0.4
minMatchCharLength: 0
keys: ["title", "permalink", "summary", "content"]
EOF
# Create theme directory
mkdir -p site/themes
# Clone the PaperMod theme
git clone https://github.com/adityatelange/hugo-PaperMod site/themes/PaperMod
# Create search page
mkdir -p site/content
cat > site/content/search.md << EOF
---
title: "Search"
layout: "search"
summary: "search"
---
EOF
# Create archive page
cat > site/content/archive.md << EOF
---
title: "Archive"
layout: "archives"
url: "/archive/"
summary: "archives"
---
EOF
# Create example blog posts
mkdir -p site/content/posts
# Get current date - works on both systems
CURRENT_DATE=$(date +"%Y-%m-%d")
# Calculate tomorrow's date in a cross-platform way
# First try macOS syntax
if date -v+1d &>/dev/null; then
# macOS date command
TOMORROW=$(date -v+1d +"%Y-%m-%d")
elif date -d "+1 day" &>/dev/null; then
# Linux date command
TOMORROW=$(date -d "+1 day" +"%Y-%m-%d")
else
# Fallback - just use current date for both
TOMORROW=$CURRENT_DATE
fi
cat > site/content/posts/first-post.md << EOF
---
title: "My First Post"
date: ${CURRENT_DATE}
draft: false
tags: ["blog", "tech"]
categories: ["personal"]
author: "Jens Bech"
---
# Hello World!
This is my first blog post using the PaperMod theme. It's a clean, elegant theme with great features:
## Features
- Light/Dark mode toggle
- Clean design with good typography
- Mobile-friendly interface
- Fast loading times
- Search capability
- Archive view for browsing all posts
EOF
cat > site/content/posts/second-post.md << EOF
---
title: "Getting Started with Hugo"
date: ${TOMORROW}
draft: false
tags: ["hugo", "guide"]
categories: ["tutorials"]
author: "Jens Bech"
---
# Getting Started with Hugo
Hugo is an amazing static site generator that makes blogging a breeze!
## Why Hugo?
- Blazing fast performance
- Flexible content management
- Simple deployment
- Great theme ecosystem
EOF
# Create directory for images
mkdir -p site/static/images
echo "Hugo site with PaperMod theme properly set up! Now run the Docker container."

View File

@ -1,17 +1,14 @@
#!/bin/bash
# Remove any previous setup to start fresh
rm -rf site
mkdir -p site
# Create hugo.yaml config file matching the demo image
cat > site/hugo.yaml << EOF
baseURL: "http://localhost:1313/"
languageCode: "en-us"
title: "PaperMod"
theme: "PaperMod"
# Menu items
menu:
main:
- identifier: archives
@ -23,13 +20,10 @@ menu:
url: /tags/
weight: 20
# PaperMod theme specific parameters
params:
# Theme appearance
defaultTheme: auto
disableThemeToggle: false
# Homepage settings - NOT using profileMode (showing list of posts)
homeInfoParams:
Title: "Hi there \U0001F44B"
Content: "Welcome to my blog"
@ -46,7 +40,6 @@ params:
- name: cv
url: "https://example.com/"
# Display settings
ShowReadingTime: true
ShowShareButtons: false
ShowPostNavLinks: true
@ -54,7 +47,6 @@ params:
ShowCodeCopyButtons: true
hideFooter: false
# Search settings
fuseOpts:
isCaseSensitive: false
shouldSort: true
@ -65,12 +57,9 @@ params:
keys: ["title", "permalink", "summary", "content"]
EOF
# Create theme directory
mkdir -p site/themes
# Clone the PaperMod theme
git clone https://github.com/adityatelange/hugo-PaperMod site/themes/PaperMod
# Create archive page
mkdir -p site/content
cat > site/content/archives.md << EOF
---
@ -81,10 +70,8 @@ summary: "archives"
---
EOF
# Create example blog posts exactly like in the demo
mkdir -p site/content/posts
# Get current date in YYYY-MM-DD format
CURRENT_DATE=$(date +"%Y-%m-%d")
cat > site/content/posts/papermod-installation.md << EOF

4
yeet.sh Normal file
View File

@ -0,0 +1,4 @@
chmod +x setup.sh
./setup-papermod-standard.sh
docker compose down
docker compose up -d