This commit is contained in:
bearfm 2024-01-06 01:10:35 -08:00
commit 0560eee6db
Signed by untrusted user who does not match committer: bearfm
GPG Key ID: 573A776FED58E1A4
6 changed files with 247 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
dist/*

65
Makefile Normal file
View File

@ -0,0 +1,65 @@
SRCDIR = src
DISTDIR = dist
CSSDIR = $(DISTDIR)/css
SCSSDIR = $(SRCDIR)/scss
SCSSINCDIR = $(SCSSDIR)/includes
SCSSFILES = $(wildcard $(SCSSDIR)/*.scss)
CSSFILES = $(patsubst $(SCSSDIR)/%.scss, $(CSSDIR)/%.css, $(SCSSFILES))
MDFILES = $(shell find $(SRCDIR) -type f -name '*.md')
HTMLFILES = $(patsubst $(SRCDIR)/%.md, $(DISTDIR)/%.html, $(MDFILES))
TMPL = $(SRCDIR)/tmpl.html
URI = "https://bear.oops.wtf"
.PHONY: all
all: html css $(DISTDIR)/robots.txt $(DISTDIR)/sitemap.xml
# Build
.PHONY: html
html: $(HTMLFILES)
#$(DISTDIR)/%.html: $(SRCDIR)/%.md
# pandoc --from markdown --to html --standalone $< -o $@
$(DISTDIR)/%.html: $(SRCDIR)/%.md $(TMPL)
pandoc \
--from markdown_github+smart+yaml_metadata_block+auto_identifiers \
--to html \
--template $(TMPL) \
-o $@ $<
.PHONY: css
css: $(CSSFILES)
$(CSSDIR)/%.css: $(SCSSDIR)/%.scss | $(CSSDIR)
sass --load-path=$(SCSSINCDIR) --style=compressed --scss $< $@
$(CSSDIR):
mkdir -p $@
$(DISTDIR)/robots.txt:
@echo "User-Agent: *" > $@
@echo "Allow: *" >> $@
@echo "Sitemap: $(URI)/sitemap.xml" >> $@
$(DISTDIR)/sitemap.xml: $(HTMLFILES)
@echo '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' > $@
@for f in $^; do \
echo "<url><loc>$(URI)$${f#$(DISTDIR)}</loc></url>" >> $@; \
done
@echo '</urlset>' >> $@
.PHONY: clean
clean:
rm -v $(HTMLFILES)
rm -rfv $(CSSDIR)
.PHONY: help
help:
@egrep -h '\s##\s' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[34m%-15s\033[0m %s\n", $$1, $$2}'

7
src/index.md Normal file
View File

@ -0,0 +1,7 @@
---
title: bear.oops.wtf
author: BearFM
date: January 6, 2024
---
sup

153
src/scss/style.scss Normal file
View File

@ -0,0 +1,153 @@
/*
* Copyright (c) 2024 BearFM
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
@import "https://fonts.googleapis.com/icon?family=Material+Icons";
$gruvbox-bg: #282828;
$gruvbox-fg: #ebdbb2;
$gruvbox-dark1: #3c3836;
$gruvbox-dark2: #504945;
$gruvbox-light0: #fbf1c7;
$gruvbox-light1: #ebdbb2;
$gruvbox-light2: #d5c4a1;
$gruvbox-light3: #bdae93;
$gruvbox-red: #cc241d;
$gruvbox-green: #98971a;
$gruvbox-yellow: #d79921;
$gruvbox-blue: #458588;
$gruvbox-purple: #b16286;
$gruvbox-aqua: #689d6a;
$gruvbox-orange: #d65d0e;
body {
font-family: Arial, sans-serif;
margin: 2em;
line-height: 1.6;
height: 100vh;
width: auto;
margin: 0;
padding: 0;
text-align: center;
background-color: $gruvbox-bg;
color: $gruvbox-fg;
}
header {
background-color: $gruvbox-dark1;
color: $gruvbox-fg;
a {
color: $gruvbox-fg;
text-decoration: dotted;
font-size: 1.5rem;
i {
vertical-align: middle;
display: inline-block;
}
}
}
nav {
background-color: $gruvbox-dark2;
color: $gruvbox-light1;
}
.title {
font-weight: bolder;
}
.article {
width: auto;
}
ul, li, ol {
margin: 0;
padding: 0;
list-style: none;
}
h1, h2, h3, h4, h5, h6 {
color: $gruvbox-light0;
}
a {
color: $gruvbox-blue;
&:hover {
color: $gruvbox-aqua;
}
}
button {
background-color: $gruvbox-purple;
color: $gruvbox-light0;
&:hover {
background-color: $gruvbox-blue;
}
}
p {
margin-bottom: 1em;
}
pre {
background-color: $gruvbox-dark2;
padding: 0.5em;
overflow: auto;
}
code {
font-family: 'Courier New', Courier, monospace;
background-color: $gruvbox-dark2;
color: $gruvbox-orange;
padding: 0.2em;
border-radius: 3px;
}
table {
border-collapse: collapse;
width: 100%;
margin-bottom: 1em;
border-collapse: collapse;
th, td {
border: 1px solid $gruvbox-dark1;
padding: 8px;
text-align: left;
}
}
th, td {
border: 1px solid $gruvbox-light0;
padding: 8px;
text-align: left;
}
th {
background-color: $gruvbox-light1;
}
blockquote {
border-left: 2px solid $gruvbox-dark2;
margin: 1em 0;
padding-left: 1em;
}
footer {
background-color: $gruvbox-dark1;
color: $gruvbox-light2;
}

21
src/tmpl.html Normal file
View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css">
<title>$title$</title>
</head>
<body>
<header>
<nav>
<a href="/"><i class="material-icons">home</i> Home</a>
<a href="/blog">Blog</a>
</nav>
</header>
<h1 class="title">BEAR.OOPS.WTF</h1>
<article class="article">
$body$
</article>
</body>
</html>