-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 16b274a
Showing
11 changed files
with
422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output/ | ||
__pycache__/ | ||
cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
PY?= | ||
PELICAN?=pelican | ||
PELICANOPTS= | ||
|
||
BASEDIR=$(CURDIR) | ||
INPUTDIR=$(BASEDIR)/content | ||
OUTPUTDIR=$(BASEDIR)/output | ||
CONFFILE=$(BASEDIR)/pelicanconf.py | ||
PUBLISHCONF=$(BASEDIR)/publishconf.py | ||
|
||
GITHUB_PAGES_BRANCH=main | ||
GITHUB_PAGES_COMMIT_MESSAGE=Generate Pelican site | ||
|
||
|
||
DEBUG ?= 0 | ||
ifeq ($(DEBUG), 1) | ||
PELICANOPTS += -D | ||
endif | ||
|
||
RELATIVE ?= 0 | ||
ifeq ($(RELATIVE), 1) | ||
PELICANOPTS += --relative-urls | ||
endif | ||
|
||
SERVER ?= "0.0.0.0" | ||
|
||
PORT ?= 0 | ||
ifneq ($(PORT), 0) | ||
PELICANOPTS += -p $(PORT) | ||
endif | ||
|
||
|
||
help: | ||
@echo 'Makefile for a pelican Web site ' | ||
@echo ' ' | ||
@echo 'Usage: ' | ||
@echo ' make html (re)generate the web site ' | ||
@echo ' make clean remove the generated files ' | ||
@echo ' make regenerate regenerate files upon modification ' | ||
@echo ' make publish generate using production settings ' | ||
@echo ' make serve [PORT=8000] serve site at http://localhost:8000' | ||
@echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 ' | ||
@echo ' make devserver [PORT=8000] serve and regenerate together ' | ||
@echo ' make devserver-global regenerate and serve on 0.0.0.0 ' | ||
@echo ' make github upload the web site via gh-pages ' | ||
@echo ' ' | ||
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html ' | ||
@echo 'Set the RELATIVE variable to 1 to enable relative urls ' | ||
@echo ' ' | ||
|
||
html: | ||
"$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) | ||
|
||
clean: | ||
[ ! -d "$(OUTPUTDIR)" ] || rm -rf "$(OUTPUTDIR)" | ||
|
||
regenerate: | ||
"$(PELICAN)" -r "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) | ||
|
||
serve: | ||
"$(PELICAN)" -l "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) | ||
|
||
serve-global: | ||
"$(PELICAN)" -l "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -b $(SERVER) | ||
|
||
devserver: | ||
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) | ||
|
||
devserver-global: | ||
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -b 0.0.0.0 | ||
|
||
publish: | ||
"$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(PUBLISHCONF)" $(PELICANOPTS) | ||
|
||
github: publish | ||
ghp-import -m "$(GITHUB_PAGES_COMMIT_MESSAGE)" -b $(GITHUB_PAGES_BRANCH) "$(OUTPUTDIR)" --no-jekyll | ||
git push origin $(GITHUB_PAGES_BRANCH) | ||
|
||
|
||
.PHONY: html help clean regenerate serve serve-global devserver devserver-global publish github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Source files for Robert Lanzafame's Personal Website | ||
|
||
Started October, 2024. Content will come later. | ||
|
||
Borrowing liberally from Jason Moore's websites like this one: [github.com/mechmotum/mechmotum.github.io](https://github.com/mechmotum/mechmotum.github.io). | ||
|
||
Setup notes: | ||
- started with Jason's `env.yml` file | ||
- used Pelican's quickstart method | ||
- copied Jason's config file | ||
- forked [Jason's template repo](https://github.com/mechmotum/pelican-alchemy) ([my repo](https://github.com/rlanzafame/pelican-alchemy)) | ||
- created an assets repo to keep images out of this one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
THEME_PATH: C:\Users\rlanzafame\code\pelican\pelican-alchemy\alchemy | ||
PLUGIN_PATHS: C:\Users\rlanzafame\code\pelican\pelican-plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
First Post | ||
========== | ||
|
||
:date: 2024-10-13 08:00 | ||
:tags: none | ||
:category: none | ||
:slug: first-post | ||
:authors: Robert Lanzafame | ||
:summary: First post. | ||
|
||
This is the first post... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
===== | ||
About | ||
===== | ||
|
||
:url: | ||
:save_as: index.html | ||
:sortorder: 0 | ||
:date: 2024-10-13 | ||
:front: true | ||
|
||
I am currently a Senior Lecturer at Delft University of Technology in the | ||
Netherlands. This website will collect...stuff. | ||
|
||
Thanks to Jason Moore for the `template`_, and so many other great ideas | ||
related to education, open source tools and much more. | ||
|
||
This website is built in `this repository`_ and uses material liberally from Jason's repo `here`_. | ||
|
||
.. _template: https://mechmotum.github.io/ | ||
.. _this repository: https://github.com/rlanzafame/rlanzafame.github.io | ||
.. _here: https://github.com/mechmotum/mechmotum.github.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
======= | ||
Contact | ||
======= | ||
|
||
:sortorder: 6 | ||
|
||
===== | ||
|
||
Contact Robert at [email protected] or [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: pelican | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- beautifulsoup4 | ||
- invoke | ||
- livereload | ||
- pelican | ||
- pyyaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Borrowing heavily from Jason Moore's site: | ||
# https://github.com/mechmotum/mechmotum.github.io/ | ||
|
||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- # | ||
from __future__ import unicode_literals | ||
|
||
import os | ||
import yaml | ||
|
||
AUTHOR = 'Robert Lanzafame' | ||
SITENAME = 'Robert Lanzafame' | ||
SITEURL = "" | ||
SOURCEURL = 'https://github.com/rlanzafame/rlanzafame.github.io' | ||
|
||
PATH = "content" | ||
TIMEZONE = 'Europe/Rome' | ||
DEFAULT_LANG = 'en' | ||
|
||
## Jason Moore's settings | ||
|
||
# This sets the default pages to be top level items and articles to be under | ||
# /blog/. | ||
INDEX_SAVE_AS = 'blog/index.html' | ||
|
||
# All blog posts will have slugs that match the file name. | ||
PATH_METADATA = '(?P<path_no_ext>.*)\..*' # regex to grab file name without ext | ||
ARTICLE_URL = 'blog/{path_no_ext}.html' | ||
ARTICLE_SAVE_AS = 'blog/{path_no_ext}.html' | ||
|
||
PAGE_URL = '{slug}.html' | ||
PAGE_SAVE_AS = '{slug}.html' | ||
PAGE_ORDER_BY = 'sortorder' | ||
|
||
MENUITEMS = [('Blog', '/blog/')] | ||
|
||
## Pelican initialization settings | ||
# Feed generation is usually not desired when developing | ||
FEED_ALL_ATOM = None | ||
CATEGORY_FEED_ATOM = None | ||
TRANSLATION_FEED_ATOM = None | ||
AUTHOR_FEED_ATOM = None | ||
AUTHOR_FEED_RSS = None | ||
|
||
# Blogroll | ||
LINKS = () | ||
|
||
# Social widget | ||
SOCIAL = () | ||
|
||
DEFAULT_PAGINATION = False | ||
|
||
## More of Jason Moore's settings | ||
try: | ||
with open('config.yml', 'r') as config_file: | ||
config_data = yaml.load(config_file, Loader=yaml.FullLoader) | ||
except IOError: | ||
THEME = '' | ||
PLUGIN_PATHS = [''] | ||
else: | ||
THEME = config_data['THEME_PATH'] | ||
PLUGIN_PATHS = config_data['PLUGIN_PATHS'] | ||
if isinstance(PLUGIN_PATHS, type('')): | ||
PLUGIN_PATHS = [PLUGIN_PATHS] | ||
print(THEME, PLUGIN_PATHS) | ||
## THEME | ||
|
||
# Alchemy theme settings | ||
OS_SEP = os.sep | ||
# DISQUS_SITENAME = "blank" | ||
SITESUBTITLE = 'Personal Website' | ||
SITEIMAGE = 'https://rlanzafame.github.io/assets/images/sailboat-sloop.svg' | ||
# INSTITUTEIMAGE should bee 100px in height | ||
INSTITUTIONIMAGE = 'https://rlanzafame.github.io/assets/logos/tud-233x100.png' | ||
DESCRIPTION = '' | ||
# pelican-alchemy removed the original theme.css, so bring it back. | ||
THEME_CSS_OVERRIDES = ['theme/css/origtheme.css'] | ||
REPO_URL = 'https://github.com/rlanzafame/rlanzafame.github.io' | ||
# TODO : Fix the template so that if this isn't declared it still builds. | ||
EXCLUDED_CATEGORIES = [] | ||
|
||
#GOOGLE_ANALYTICS = '' | ||
#DISQUS_SITENAME = '' | ||
|
||
## PLUGINS | ||
|
||
PLUGINS = ['render_math', 'extract_toc'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Borrowing heavily from Jason Moore's site: | ||
# https://github.com/mechmotum/mechmotum.github.io/ | ||
|
||
# This file is only used if you use `make publish` or | ||
# explicitly specify it as your config file. | ||
|
||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- # | ||
from __future__ import unicode_literals # from Jason Moore's site | ||
|
||
import os | ||
import sys | ||
|
||
sys.path.append(os.curdir) | ||
from pelicanconf import * | ||
|
||
# If your site is available via HTTPS, make sure SITEURL begins with https:// | ||
SITEURL = "https://rlanzafame.github.io" | ||
RELATIVE_URLS = False | ||
|
||
FEED_ALL_ATOM = "feeds/all.atom.xml" | ||
CATEGORY_FEED_ATOM = "feeds/{slug}.atom.xml" | ||
|
||
DELETE_OUTPUT_DIRECTORY = True | ||
|
||
# Following items are often useful when publishing | ||
|
||
# DISQUS_SITENAME = "" | ||
# GOOGLE_ANALYTICS = "" |
Oops, something went wrong.