Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,34 @@ DIRS_PUBLIC := $(patsubst $(CONTENT)/%, $(PUBLIC)/%, $(DIRS_CONTENT))
# Make any subdirectories needed in public
$(foreach d, $(DIRS_PUBLIC), $(shell mkdir -p $(d)))

# Metaprogramming maddness
# Metaprogramming madness

# MAKE_HTML exists so that a seperate rule for each supported extension does not have to exist.
# Instead, the template for such a rule for any valid extension is written here where it is thereby evaluated just below its definition.
# Basically, as long as a file type can actually be converted by pandoc into an HTML file, simply appending the proper extension to EXT will effectively introduce a rule supporting it.

define MAKE_HTML

$(PUBLIC)/%.html: $(join $(CONTENT)/%, $(1))
$(PANDOC) $$(PANDOC_FILE_SPECIFIC) $$^ -o $$@

endef

# For every extension, scour the content folder for files which match, then run MAKE_HTML on all of them!
${info RULES: $(foreach i, $(EXT), $(call MAKE_HTML, $(i)))}

$(foreach i, $(EXT), $(eval $(call MAKE_HTML, $(i))))



# Build website
all: $(HTMLFILES)
@echo -e "FILES: $(FILES) \nHTML: $(HTMLFILES)"
rsync -avzh $(CONTENT)/static/ $(PUBLIC)/static
$(foreach s, $(SCRIPTS), $(shell $(s) $(HTMLFILES)))

# Clean build folder
clean:
rm -rf $(PUBLIC)

# Build website, then run locally for testing.
demo: all
python -m http.server -d public/ -b 127.0.0.1 8080
2 changes: 1 addition & 1 deletion content/index.org
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#+title: Linux User's Group @ UIC
#+title: Linux User Group @ UIC
#+AUTHOR: Soham S Gumaste
#+OPTIONS: toc:nil

Expand Down
5 changes: 5 additions & 0 deletions content/opsec.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
author: Kevin Cordero
date: March 12th, 2025
title: "Threat Modeling 101: Intro to Operational Security"
---
# Metadata
This is the markdown transcript for a presentation held on Tuesday, March 12th.

Expand Down
2 changes: 1 addition & 1 deletion content/vimlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
author:
- Ethan Wong
date: October 13, 2023
title: Vim
title: VimLab Fall 2023
---

# Metadata
Expand Down
31 changes: 25 additions & 6 deletions scripts/sitemap.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/usr/bin/env bash

# Verbose
set -xeu

# Variable to collect all the markdown links into
# Format: [Article Title](Article Link)
LINKS=$""

for files in $(echo "$@" | tr ' ' '\n' | sort -V); do
F="${files#public/}";
TMP=""
printf -v TMP "[${F%.html}]($F) \n"
LINKS="${LINKS}${TMP}"
# Parameter Expansion; Remove 'public/' from filename and store into variable F
F="${files#public/}"
# "TMP" stores the current markdown link to be appended to the list
TMP=""

# Title extraction from HTML. Operates on assumption that each webpage has a title meta tag.

# find title meta tag with awk
TITLE="$(awk '/<title>/ {print $0}' $files)"
# abuses awk reformatting - just removes trailing & leading whitespace :)
TITLE="$(echo $TITLE | awk '{$1=$1};1')"
# parameter expansion again, remove title html tags
# e.g. <title>My Title</title> becomes "My Title"
TITLE=${TITLE#<title>}
TITLE=${TITLE%</title>}

# Store current markdown link with newline in TMP
printf -v TMP "[$TITLE]($F) \n"
# Append TMP to list
LINKS="${LINKS}${TMP}"
done
pandoc -s --template template.html --metadata-file metadata.yml --metadata-file sitemap.yml -o public/sitemap.html <<< "${LINKS}"

pandoc -s --template template.html --metadata-file metadata.yml --metadata-file sitemap.yml -o public/sitemap.html <<<"${LINKS}"