Browse Source

inital commit

master
Schoenberger, Philipp 6 years ago
commit
a39d976e9c
  1. 152
      Makefile
  2. 6
      README.md
  3. 29
      content/blog/01_new_page_de.md
  4. 30
      content/blog/01_new_page_en.md
  5. 2
      content/images/.gitignore
  6. BIN
      content/images/favicon.xcf
  7. 1
      content/images/gallery/.gitignore
  8. BIN
      content/images_org/familyguy.png
  9. BIN
      content/images_org/favicon.png
  10. BIN
      content/images_org/favicon.xcf
  11. 1
      content/images_org/gallery/.gitignore
  12. BIN
      content/images_org/gallery/IMG_3184.jpg
  13. BIN
      content/images_org/gallery/IMG_3364.jpg
  14. BIN
      content/images_org/gallery/IMG_3386.jpg
  15. BIN
      content/images_org/gallery/IMG_3414.jpg
  16. BIN
      content/images_org/gallery/IMG_3477.jpg
  17. BIN
      content/images_org/gallery/IMG_3483.jpg
  18. BIN
      content/images_org/gallery/IMG_3559.jpg
  19. BIN
      content/images_org/gallery/IMG_8722.jpg
  20. BIN
      content/images_org/gallery/IMG_9037.jpg
  21. BIN
      content/images_org/gallery/IMG_9097.jpg
  22. BIN
      content/images_org/gallery/IMG_9136.jpg
  23. BIN
      content/images_org/gallery/IMG_9137.jpg
  24. BIN
      content/images_org/gallery/IMG_9393.jpg
  25. BIN
      content/images_org/previous_phschoe_de.png
  26. 17
      content/pages/404.md
  27. 24
      publishconf.py
  28. 8
      requirements.txt

152
Makefile

@ -0,0 +1,152 @@
CPUS ?= $(shell cat /proc/cpuinfo | grep processor | wc -l || echo 1)
MAKEFLAGS += --jobs=$(CPUS)
IS_UBUNTU_1404=$(shell lsb_release -r | grep 14.04 > /dev/null && echo yes || echo no)
ifeq ($IS_UBUNTU_1404,"yes")
PY=python2.7
else
PY=python3
endif
PELICAN=pelican
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
FTP_HOST=localhost
FTP_USER=anonymous
FTP_TARGET_DIR=/
SSH_HOST=phschoen.de
SSH_PORT=14118
SSH_USER=phschoen
SSH_TARGET_DIR=/var/www
S3_BUCKET=my_s3_bucket
DROPBOX_DIR=~/Dropbox/Public/
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 serve site at http://localhost:8000'
@echo ' make devserver start/restart develop_server.sh '
@echo ' make stopserver stop local server '
@echo ' ssh_upload upload the web site via SSH '
@echo ' rsync_upload upload the web site via rsync+ssh '
@echo ' dropbox_upload upload the web site via Dropbox '
@echo ' ftp_upload upload the web site via FTP '
@echo ' s3_upload upload the web site via S3 '
@echo ' github upload the web site via gh-pages '
@echo ' '
# generate thubnails
thumb-img:
IMAGE_ORG_DIR=$(INPUTDIR)/images_org
IMAGE_DIR=$(INPUTDIR)/images
IMG_SIZES=200 375 480 800 1600
IMG_FILES=$(shell find $(IMAGE_ORG_DIR)/ -type f -name '*.jpg')
IMG_FILES+=$(shell find $(IMAGE_ORG_DIR)/ -type f -name '*.png')
img: $(IMAGE_DIR)
$(IMAGE_DIR):
mkdir -p $@
define img-out-name
$(dir $(patsubst $(IMAGE_ORG_DIR)%,$(IMAGE_DIR)%, $(1)))$(2)/$(notdir $(1))
endef
img: copy-others
copy-others:
cp $(IMAGE_ORG_DIR)/* $(IMAGE_DIR)/ -r
$(foreach size, $(IMG_SIZES), \
$(foreach img, $(IMG_FILES), \
$(eval img:$(call img-out-name, $(img),$(size))) \
))
define convert-rule
$(1):$(2)
mkdir -p $(dir $(1))
convert $(2) -resize $(3) $(1)
endef
$(foreach size, $(IMG_SIZES), \
$(foreach img, $(IMG_FILES), \
$(eval $(call convert-rule, $(call img-out-name, $(img),$(size)),$(img),$(size)) ) \
) \
)
$(IMAGE_DIR)%.png: $(IMAGE_ORG_DIR)%.png
mkdir -p $(dir $@)
cp $< $@
$(IMAGE_DIR)%.jpg: $(IMAGE_ORG_DIR)%.jpg
mkdir -p $(dir $@)
cp $< $@
#$(call convert-img-rule, $(IMAGE_ORG_DIR)/gallery/IMG_3184.jpg )
img-clean:
rm $(IMAGE_DIR) -rf
html: clean $(OUTPUTDIR)/index.html
$(OUTPUTDIR)/%.html:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
clean: img-clean
[ ! -d $(OUTPUTDIR) ] || find $(OUTPUTDIR) -mindepth 1 -delete
regenerate: clean
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
serve: $(OUTPUTDIR)
cd $(OUTPUTDIR) && $(PY) -m pelican.server
devserver:
killall $(PY) pelican || true
$(BASEDIR)/develop_server.sh restart
stopserver:
kill -9 `cat pelican.pid`
kill -9 `cat srv.pid`
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
publish:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
ssh_upload: publish
scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
rsync_upload: publish
rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
dropbox_upload: publish
cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
ftp_upload: publish
lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUTDIR) $(FTP_TARGET_DIR) ; quit"
s3_upload: publish
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed
github: publish
ghp-import $(OUTPUTDIR)
git push origin gh-pages
.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload github

6
README.md

@ -0,0 +1,6 @@
phschoen.de
###########
install requirements:
pip install -r requirements.txt

29
content/blog/01_new_page_de.md

@ -0,0 +1,29 @@
title: New Webpage
date: 2019-05-22
tags: pelican, html, lightbox
category: web
lang: de
author: Philipp Schönberer
summary: I didched wordpress and moved on.
Last week I was researching for a better way to generate my webpage.
Before I was using wordpress and dozends of plugins to get a website running like I would like it
Then my server got corrupted and I had to resetup the website.
This was realy crule and I did not want to deal with the plugin crap again.
Also, wordpress was so called 'klickibunti' and I could not write content from my good old vim. :'(
This introduces a to high burden to acually write some blog, since it's not that convinient to write
or save a intermediate step and continue again later.
Also, if something is not working you have at least the git history to step back and try again.
Try this with wordpress plugins.
So overall i have still lot of things to script/implement and add but the main sceleton is now in place.
The HTML is now generated by [markdown](https://daringfireball.net/projects/markdown/) and translated
with [pelican](https://getpelican.com) into acual html and some minimal javascript.
[lightgallery
/images/previous_phschoe_de.png , Vorherige Website mit wordpress;
lightgalleryend]

30
content/blog/01_new_page_en.md

@ -0,0 +1,30 @@
title: New Webpage
date: 2019-05-22
tags: pelican, html, lightbox
category: web
lang: en
slug: web
author: Philipp Schönberer
summary: I didched wordpress and moved on.
Last week I was researching for a better way to generate my webpage.
Before I was using wordpress and dozends of plugins to get a website running like I would like it
Then my server got corrupted and I had to resetup the website.
This was realy crule and I did not want to deal with the plugin crap again.
Also, wordpress was so called 'klickibunti' and I could not write content from my good old vim. :'(
This introduces a to high burden to acually write some blog, since it's not that convinient to write
or save a intermediate step and continue again later.
Also, if something is not working you have at least the git history to step back and try again.
Try this with wordpress plugins.
So overall i have still lot of things to script/implement and add but the main sceleton is now in place.
The HTML is now generated by [markdown](https://daringfireball.net/projects/markdown/) and translated
with [pelican](https://getpelican.com) into acual html and some minimal javascript.
[lightgallery
/images/previous_phschoe_de.png ,Previous webpage with wordpress;
lightgalleryend]

2
content/images/.gitignore

@ -0,0 +1,2 @@
*.jpg
*.png

BIN
content/images/favicon.xcf

1
content/images/gallery/.gitignore

@ -0,0 +1 @@
*.thumb.*

BIN
content/images_org/familyguy.png

After

Width: 378  |  Height: 378  |  Size: 118 KiB

BIN
content/images_org/favicon.png

After

Width: 1000  |  Height: 1000  |  Size: 23 KiB

BIN
content/images_org/favicon.xcf

1
content/images_org/gallery/.gitignore

@ -0,0 +1 @@
*.thumb.*

BIN
content/images_org/gallery/IMG_3184.jpg

After

Width: 5208  |  Height: 3218  |  Size: 4.9 MiB

BIN
content/images_org/gallery/IMG_3364.jpg

After

Width: 4604  |  Height: 2845  |  Size: 2.2 MiB

BIN
content/images_org/gallery/IMG_3386.jpg

After

Width: 3844  |  Height: 2376  |  Size: 1.7 MiB

BIN
content/images_org/gallery/IMG_3414.jpg

After

Width: 4034  |  Height: 2493  |  Size: 1.5 MiB

BIN
content/images_org/gallery/IMG_3477.jpg

After

Width: 5496  |  Height: 3670  |  Size: 7.6 MiB

BIN
content/images_org/gallery/IMG_3483.jpg

After

Width: 3508  |  Height: 2307  |  Size: 1.9 MiB

BIN
content/images_org/gallery/IMG_3559.jpg

After

Width: 5496  |  Height: 3670  |  Size: 4.8 MiB

BIN
content/images_org/gallery/IMG_8722.jpg

After

Width: 5396  |  Height: 3603  |  Size: 6.6 MiB

BIN
content/images_org/gallery/IMG_9037.jpg

After

Width: 3355  |  Height: 5429  |  Size: 3.5 MiB

BIN
content/images_org/gallery/IMG_9097.jpg

After

Width: 3396  |  Height: 5495  |  Size: 2.5 MiB

BIN
content/images_org/gallery/IMG_9136.jpg

After

Width: 4903  |  Height: 3537  |  Size: 2.4 MiB

BIN
content/images_org/gallery/IMG_9137.jpg

After

Width: 4998  |  Height: 3089  |  Size: 6.4 MiB

BIN
content/images_org/gallery/IMG_9393.jpg

After

Width: 4915  |  Height: 3038  |  Size: 4.1 MiB

BIN
content/images_org/previous_phschoe_de.png

After

Width: 696  |  Height: 648  |  Size: 46 KiB

17
content/pages/404.md

@ -0,0 +1,17 @@
title: 404
date: 2019-01-03 10:20
authors: Philipp Schönberger
url: 404.html
save_as: 404.html
The page you have requested does not exist.
Just drink some coffee and take a look back in [/blog](/blog)
daf
If the problem persists, please do not hessitate to contact me:
## Contact Details ##
* Email: mail@phschoen.de
* Address: Check the WHOIS record.

24
publishconf.py

@ -0,0 +1,24 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
DELETE_OUTPUT_DIRECTORY = True
# Following items are often useful when publishing
#DISQUS_SITENAME = ""
#GOOGLE_ANALYTICS = ""

8
requirements.txt

@ -0,0 +1,8 @@
pelican
Markdown
BeautifulSoup4
typogrify
pathlib
python-resize-image
python-gettext
Loading…
Cancel
Save