Files
hugo/setup-papermod-standard.sh

133 lines
3.6 KiB
Bash
Executable File

#!/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
name: Archives
url: /archives/
weight: 10
- identifier: tags
name: Tags
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"
socialIcons:
- name: twitter
url: "https://twitter.com/"
- name: stackoverflow
url: "https://stackoverflow.com/"
- name: github
url: "https://github.com/"
- name: linkedin
url: "https://linkedin.com/"
- name: cv
url: "https://example.com/"
# 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 archive page
mkdir -p site/content
cat > site/content/archives.md << EOF
---
title: "Archives"
layout: "archives"
url: "/archives/"
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
---
title: "Papermod - Installation"
date: 2020-09-15
summary: "Follow this guide to setup hugo and create a new site. Make sure you install latest version of hugo(>=0.57.1). After you have created a new site, at Step 3 follow the steps..."
tags: ["PaperMod"]
author: "Aditya Telange"
---
# Papermod - Installation
Follow this guide to setup hugo and create a new site. Make sure you install latest version of hugo(>=0.57.1). After you have created a new site, at Step 3 follow the steps...
EOF
cat > site/content/posts/papermod-features.md << EOF
---
title: "Papermod - Features"
date: 2020-09-16
summary: "Assets (js/css) The following is enabled by default minification - makes the assets size smallest as possible. bundling - bundles all the styles in one single asset fingerprint/integrity check. Default Theme light/dark..."
tags: ["PaperMod"]
author: "Aditya Telange"
---
# Papermod - Features
Assets (js/css) The following is enabled by default minification - makes the assets size smallest as possible. bundling - bundles all the styles in one single asset fingerprint/integrity check. Default Theme light/dark...
EOF
cat > site/content/posts/markdown-syntax.md << EOF
---
title: "Markdown Syntax Guide"
date: 2019-03-11
summary: "This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme..."
tags: ["markdown", "syntax"]
author: "Hugo Authors"
---
# Markdown Syntax Guide
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme...
EOF
echo "Hugo site with PaperMod theme properly set up to match the demo! Now run the Docker container."