diff --git a/Makefile b/Makefile index eea67f9..4120052 100644 --- a/Makefile +++ b/Makefile @@ -99,8 +99,6 @@ $(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 diff --git a/content/blog/01_new_page_de.md b/content/blog/01_new_page_de.md index 24e51f5..166bb11 100644 --- a/content/blog/01_new_page_de.md +++ b/content/blog/01_new_page_de.md @@ -3,6 +3,7 @@ date: 2019-05-22 tags: pelican, html, lightbox category: web lang: de +slug: web author: Philipp Schönberer summary: I didched wordpress and moved on. diff --git a/content/images_org/de.jpg b/content/images_org/de.jpg new file mode 100644 index 0000000..d4e29de Binary files /dev/null and b/content/images_org/de.jpg differ diff --git a/content/images_org/en.jpg b/content/images_org/en.jpg new file mode 100644 index 0000000..4c02f96 Binary files /dev/null and b/content/images_org/en.jpg differ diff --git a/content/pages/about.md b/content/pages/about_de.md similarity index 100% rename from content/pages/about.md rename to content/pages/about_de.md diff --git a/content/pages/gallery/index_de.md b/content/pages/gallery/index_de.md new file mode 100644 index 0000000..347e80d --- /dev/null +++ b/content/pages/gallery/index_de.md @@ -0,0 +1,27 @@ +title: Gallery +author: Philipp Schönberger +url: gallery/index.html +save_as: gallery/index.html +lang: en +template: page + + +Here you find latest pictures i am willing to share. Enjoy the views. + +[lightgallery + /images/gallery/IMG_3184.jpg, neighbour cat ; + /images/gallery/IMG_3364.jpg, red-tailed bumblebee at a cornflower ; + /images/gallery/IMG_3386.jpg, garden bumblebee at a cornflower ; + /images/gallery/IMG_3414.jpg, garden bumblebee at a cornflower ; + /images/gallery/IMG_3477.jpg ; + /images/gallery/IMG_3483.jpg, thistle ; + /images/gallery/IMG_3559.jpg, carolina rose ; + /images/gallery/IMG_8722.jpg, hotel in south denmark ; + /images/gallery/IMG_9037.jpg, sailingboat of the fisherman ; + /images/gallery/IMG_9097.jpg, sailingboat ; + /images/gallery/IMG_9136.jpg, sunrise in Denmark ; + /images/gallery/IMG_9137.jpg, sunrise in Denmark ; + /images/gallery/IMG_9393.jpg, harbour of grömitz at night; +lightgalleryend] + +this is some gallery: diff --git a/content/pages/gallery/index.md b/content/pages/gallery/index_en.md similarity index 58% rename from content/pages/gallery/index.md rename to content/pages/gallery/index_en.md index 0c6726b..712f83a 100644 --- a/content/pages/gallery/index.md +++ b/content/pages/gallery/index_en.md @@ -2,25 +2,26 @@ title: Gallery author: Philipp Schönberger url: gallery/index.html save_as: gallery/index.html +lang: de template: page Here you find latest pictures i am willing to share. Enjoy the views. [lightgallery - /images/gallery/IMG_3184.jpg, Neighbour cat ; + /images/gallery/IMG_3184.jpg, Nachbarskatze ; /images/gallery/IMG_3364.jpg, Steinhummel an der Kornblume ; /images/gallery/IMG_3386.jpg, Gartenhummel an der Kornblume ; /images/gallery/IMG_3414.jpg, Gartenhummel an der Kornblume ; /images/gallery/IMG_3477.jpg ; /images/gallery/IMG_3483.jpg, Distel ; - /images/gallery/IMG_3559.jpg, Windrose in Blüte ; + /images/gallery/IMG_3559.jpg, Wiesenrose in Blüte ; /images/gallery/IMG_8722.jpg, Dänische Südseehaus ; - /images/gallery/IMG_9037.jpg, Fisherman Sailingboat ; - /images/gallery/IMG_9097.jpg, Sailingboat ; - /images/gallery/IMG_9136.jpg, Sunrise in Denmark ; - /images/gallery/IMG_9137.jpg, Sunrise in Denmark ; - /images/gallery/IMG_9393.jpg, Harbour Grömitz at night; + /images/gallery/IMG_9037.jpg, Segelboot vom Fischer ; + /images/gallery/IMG_9097.jpg, Segelboot ; + /images/gallery/IMG_9136.jpg, Sonnenaufgang in Dänemark ; + /images/gallery/IMG_9137.jpg, Sonnenaufgang in Dänemark ; + /images/gallery/IMG_9393.jpg, Grömitzer Hafen bei Nacht ; lightgalleryend] this is some gallery: diff --git a/content/pages/impressum.md b/content/pages/impressum_de.md similarity index 99% rename from content/pages/impressum.md rename to content/pages/impressum_de.md index 03f845d..86ceb05 100644 --- a/content/pages/impressum.md +++ b/content/pages/impressum_de.md @@ -1,6 +1,7 @@ title: Impressum authors: Philipp Schönberger url: impressum.html +lang: de save_as: impressum.html Haftungsausschluss (Disclaimer) diff --git a/content/pages/index.md b/content/pages/index_de.md similarity index 94% rename from content/pages/index.md rename to content/pages/index_de.md index 0fe4a73..6ff5338 100644 --- a/content/pages/index.md +++ b/content/pages/index_de.md @@ -1,7 +1,6 @@ title: home author: Philipp Schönberger -url: index.html -save_as: index.html +lang: de template: page Welcome to my webpage. diff --git a/content/pages/index_en.md b/content/pages/index_en.md new file mode 100644 index 0000000..2d6a020 --- /dev/null +++ b/content/pages/index_en.md @@ -0,0 +1,20 @@ +title: home +author: Philipp Schönberger +lang: en +template: page + +Welcome to my webpage. + +It contains things I work or worked on and lot of other things I had fun with. + +I’m Philipp Schönberger born in in Zeitz(Germany) within the 1988. +In Constance I made my bachelor degree within ‘computer engineering‘. +Afterwards I absolved my master degree within the ‘robotics and intelligent embedded systems‘ in Lübeck. +Currently I am employed as software engineer/architect for a satellite aided router in Germany near the Lake Constance. + +Enjoy your stay. + +## Contact ## + +* Email: mail@phschoen.de +* Address: Check the WHOIS record. diff --git a/content/pages/projects/01_3d_printer.md b/content/pages/projects/01_3d_printer.md index 938482c..ade799f 100644 --- a/content/pages/projects/01_3d_printer.md +++ b/content/pages/projects/01_3d_printer.md @@ -1,7 +1,6 @@ title: Projects date: 2019-05-20 author: Philipp Schönberger -slug: 3d_printer_en template: page category: projects url: projects/01_3d_printer.html diff --git a/content/pages/projects/projects.md b/content/pages/projects/projects.md index d9e295b..a3e7ffe 100644 --- a/content/pages/projects/projects.md +++ b/content/pages/projects/projects.md @@ -1,11 +1,12 @@ title: Projects date: 2019-05-20 author: Philipp Schönberger -slug: projects +template: projects category: projects url: projects/index.html save_as: projects/index.html + Here you can view the latest projects i've started. This page contains tutorials, rough drafts I work on. The articles in here aren't necessarily finished and some of them aren't open to discussion, because they are work in progress (or chaos). Some of them might be turned into self-contained blog posts, some of them will never get out of this dungeon. diff --git a/pelicanconf.py b/pelicanconf.py index eac4b16..2e779f7 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -8,7 +8,7 @@ from operator import itemgetter, methodcaller AUTHOR = 'Philipp Schönberger' EMAIL = 'mail AT phschoen.de' SITENAME = 'https://phschoen.de' -OUTPUT_PATH = 'output/DEV/' +OUTPUT_PATH = 'output/' # Base URL this page is hosted at: SITENAME = 'phschoen.de' @@ -27,11 +27,21 @@ DATE_FORMATS = { LOCALE = ('usa', 'de', # On Windows 'en_US', 'de_DE' # On Unix/Linux ) +ARTICLE_URL = 'blog/{slug}' +ARTICLE_SAVE_AS = 'blog/{slug}/index.html' +ARTICLE_LANG_URL = '{lang}/blog/{slug}' +ARTICLE_LANG_SAVE_AS = '{lang}/blog/{slug}.html' + +PAGE_URL = '{slug}' +PAGE_SAVE_AS = '{slug}/index.html' +PAGE_LANG_URL = '{lang}/{slug}' +PAGE_LANG_SAVE_AS = '{lang}/{slug}/index.html' + +LOCALE = 'en_US' # We are using the custom minimal theme: THEME = 'themes/minimal' -# THEME = 'themes/pelican-chunk' -#THEME = 'themes/pelican-themes/bootstrap4-standard' +THEME_STATIC_DIR = 'theme' DELETE_OUTPUT_DIRECTORY = True # MARKUP = ('md',) @@ -118,29 +128,35 @@ DEFAULT_CATEGORY = 'uncategorized' PLUGIN_PATHS = ['plugins', ] PLUGINS = ['lightgallery', 'i18n_subsites'] -# PLUGIN_PATHS = ['./pelican-plugins/', ] - -# PLUGINS = ['i18n_subsites', ] -# JINJA_ENVIRONMENT = { -# 'extensions': ['jinja2.ext.i18n'], -# } GITHUB_SOURCE_PATH = "wooot" -I18N_SUBSITES = {'en': {'SITENAME': 'phschoen.com', - }, +I18N_SUBSITES = { 'de': {'SITENAME': 'phschoen.de', + 'THEME_STATIC_DIR': 'theme', + 'OUTPUT_PATH': './output/de', + }, + 'en': {'SITENAME': 'phschoen.com', + 'SITEURL': SITEURL, + 'THEME_STATIC_DIR': 'theme', + 'OUTPUT_PATH': './output/', }, } -languages_lookup = {'en': 'English', - 'de': 'Deutsch', +languages_lookup = {'en': {'name': 'English', + 'icon': SITEURL+'/images/en.jpg' + }, + 'de': {'name': 'Deutsch', + 'icon': SITEURL+'/images/de.jpg' + }, } +def lookup_lang_ico(lang_code): + return languages_lookup[lang_code]['icon'] def lookup_lang_name(lang_code): - return languages_lookup[lang_code] + return languages_lookup[lang_code]['name'] def getGitHubPage(source_file): @@ -149,11 +165,11 @@ def getGitHubPage(source_file): def getBasename(path): - return "name " + return ntpath.basename(path) def month_name(month_number): - return "month_name" + return calendar.month_name[month_number] def sortTupleByIndex(items, index=0, reverse=True): @@ -172,4 +188,5 @@ JINJA_FILTERS = {'month_name': month_name, 'basename': getBasename, 'asGitHubPage': getGitHubPage, 'lookup_lang_name': lookup_lang_name, + 'lookup_lang_ico': lookup_lang_ico, } diff --git a/plugins/i18n_subsites/i18n_subsites.py b/plugins/i18n_subsites/i18n_subsites.py index dc27799..eb19799 100644 --- a/plugins/i18n_subsites/i18n_subsites.py +++ b/plugins/i18n_subsites/i18n_subsites.py @@ -35,7 +35,7 @@ except ImportError: _MAIN_SETTINGS = None # settings dict of the main Pelican instance _MAIN_LANG = None # lang of the main Pelican instance _MAIN_SITEURL = None # siteurl of the main Pelican instance -_MAIN_STATIC_FILES = None # list of Static instances the main Pelican instance +_MAIN_STATIC_FILES = [] # list of Static instances the main Pelican instance _SUBSITE_QUEUE = {} # map: lang -> settings overrides _SITE_DB = OrderedDict() # OrderedDict: lang -> siteurl _SITES_RELPATH_DB = {} # map: (lang, base_lang) -> relpath @@ -372,6 +372,10 @@ def interlink_static_files(generator): generator.add_source_path(staticfile, static=True) except TypeError: generator.add_source_path(staticfile) + else: + generator.add_source_path(staticfile, static=True) + staticfile.override_url = posixpath.join(relpath, staticfile.url) + print (staticfile.get_relative_source_path()) def save_main_static_files(static_generator): @@ -379,7 +383,7 @@ def save_main_static_files(static_generator): global _MAIN_STATIC_FILES # test just for current lang as settings change in autoreload mode if static_generator.settings['DEFAULT_LANG'] == _MAIN_LANG: - _MAIN_STATIC_FILES = static_generator.staticfiles + _MAIN_STATIC_FILES.extend(static_generator.staticfiles) def update_generators(): diff --git a/plugins/lightgallery/lightgallery.py b/plugins/lightgallery/lightgallery.py index f9cb035..0b859f1 100644 --- a/plugins/lightgallery/lightgallery.py +++ b/plugins/lightgallery/lightgallery.py @@ -8,8 +8,7 @@ from pathlib import Path logger = logging.getLogger(__name__) -IMAGE_PATH = './content/' -IMAGE_SIZES = [200, 375, 480, 800, 1600] +_MAIN_SETTINGS = None # settings dict of the main Pelican instance def process_content(article): @@ -39,6 +38,7 @@ def process_content(article): img_url = cont[0].strip() if img_url == "": continue + img_url = img_url img_text = "" if (len(cont) > 1): @@ -51,22 +51,21 @@ def process_content(article): imgs_text += "class=\"col-xs-6 col-sm-4 col-md-3\" " imgs_text += "data-responsive=\"" - for i in IMAGE_SIZES[1:-1]: - new_url = "" + str(Path(img_url).parent) + "/" + str(i) + "/" + str(Path(img_url).name) - logger.info("t\'" + new_url + "\n") - # create_scaled_image(IMAGE_PATH + img_url, IMAGE_PATH + new_url, i) - imgs_text += "" + new_url + ", " + for i in [375, 480, 800, 1600]: + imgs_text += "" + _MAIN_SETTINGS['SITEURL'] + str(Path(img_url).parent) + imgs_text += "/" + str(i) + "/" + str(Path(img_url).name) + imgs_text += " " + str(i) + ", " imgs_text += "\" " imgs_text += "data-src=\"" - imgs_text += img_url + imgs_text += _MAIN_SETTINGS['SITEURL'] + img_url imgs_text += "\" " imgs_text += "data-sub-html=\"" imgs_text += img_text imgs_text += "
" - imgs_text += create_exif_print(IMAGE_PATH + img_url) + imgs_text += create_exif_print("./content/" + img_url) imgs_text += "
" imgs_text += "\"> " @@ -200,8 +199,8 @@ def create_exif_print(img_path): ret += "/" + str(exif[33434][1]) ret += "sec " - if 34850 in exif: - ret += "