commit 32a4c73685904c0f421f3fcec3238232a119c9ec Author: trotFunky Date: Sun May 31 23:01:02 2020 +0100 First setup of the blog First article and about page Flex theme setup with some corrections and using a PR for ToC diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..974c440 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +__pycache__/ +output/ +Makefile +publishconf.py +tasks.py +*.swp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..834ebbe --- /dev/null +++ b/.gitmodules @@ -0,0 +1,7 @@ +[submodule "themes/Flex"] + path = themes/Flex + url = https://github.com/lpenaud/Flex/ + branch = toc-style +[submodule "plugins/pelican-toc"] + path = plugins/pelican-toc + url = https://github.com/ingwinlu/pelican-toc/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..f5196b6 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# TFK-Blog + +This is the sources for my blog. +They are generated using Pelican and based on the Flex theme. + +## Prerequisites + +Python dependencies : + - pelican[Markdown] + - typogrify + - beautifulsoup4 (Maybe ? Was already pulled for me) + +You can install everything by running the following command : +`sudo pip3 install pelican[Markdown] typogrify beautifulsoup4` + +## Build + +To generate the site, you have to setup the pelican project : +`pelican-quickstart` + +Then, check that the `pelicanconf.py` file has not been changed. If it has, replace it. + +You can now generate the site by running `make html` and test it on your local machine, port 8000, by running `make serve`. + +## Write + +You can use the script `new_article.sh` to create a new article, fill its metadata and start editing it righ away. Otherwise, they are under `content/articles` + diff --git a/content/articles/First-Steps.fr.md b/content/articles/First-Steps.fr.md new file mode 100644 index 0000000..b2ac9eb --- /dev/null +++ b/content/articles/First-Steps.fr.md @@ -0,0 +1,14 @@ +Title: Premiers pas +Date: 2020-05-31 20:40 +Category: Blog +Tags: +Slug: first-steps +Summary: C'est le début d'une nouvelle aventure ! + +Cela fait longtemps que ça me trottait en tête mais le moment est venu : il est temps de +se mettre à écrire ! J'ai plusieurs fois eu des problèmes que j'ai du rechercher plusieurs +fois car j'avais oublié la solution, ou même seulement envie de garder les sources qui +m'ont aidé à mettre en place quelque chose. + +C'est donc le début de cette aventure d'écriture, qui ne peut pas faire de mal et va +potentiellement m'aider (ou d'autres!) dans le futur. diff --git a/content/articles/First-Steps.md b/content/articles/First-Steps.md new file mode 100644 index 0000000..408a30a --- /dev/null +++ b/content/articles/First-Steps.md @@ -0,0 +1,15 @@ +Title: First steps +Date: 2020-05-31 20:45 +Category: Blog +Tags: +lang: en +Slug: first-steps +Summary: This is the start of a new adventure ! + +Starting writing has been on my list for a long time : the time is now ! Multiple times +I had to search for a solution to the same problem twice or even wanted to keep a record +of the references that helped me setup something. + +Thus, this is the start of this writing adventure ! It can't hurt and it might just help +me (or others!) in the future ! + diff --git a/content/extras/custom.css b/content/extras/custom.css new file mode 100644 index 0000000..94cb732 --- /dev/null +++ b/content/extras/custom.css @@ -0,0 +1,3 @@ +aside nav ul li { + text-transform: none; +} diff --git a/content/images/Profile.png b/content/images/Profile.png new file mode 100644 index 0000000..f07f9e8 Binary files /dev/null and b/content/images/Profile.png differ diff --git a/content/pages/about.fr.md b/content/pages/about.fr.md new file mode 100644 index 0000000..2637fd4 --- /dev/null +++ b/content/pages/about.fr.md @@ -0,0 +1,32 @@ +Title: About +Date: 2020-05-31 19:20 +Slug: about +toc_run: false + +# Bienvenue ! + +## Ce site + +L'idée derrière ce site est d'avoir un lieu où je peux partager mes expériences, problèmes +solutions, écrits, réflexions et tout autre chose écrite qui peut intéresser ou être utile +à d'autres que moi. (Ceci comprend mon moi du futur !) + +Il se présente donc sous la forme d'un blog (dont vous prouvez trouver les sources +[ici](https://git.tfk-astrodome.net/Teo-CD/TFK-Blog)) pas forcément structuré ou plannifié, +mais (idéalement) au moins organisé par catégorie/thème ! + +## Ce bonhomme + +Moi c'est trotFunky (Abrégé `trot`. Ou alors Téo, mais trotFunky c'est bien). +Jeune français de 98 (plus pratique que garder un âge à jour), +(bientôt) ingénieur diplômé de l'[Institut Polytechnique de Paris](https://www.ip-paris.fr/) +qui s'amuse à bidouiller, programmer et faire du jeu de rôle. +Développeur bas-niveau du club de robotique INTech pendant trois ans. Visiblement, blogger. + +## Astrodome ? + +Quel nom étrange ! Le dictionnaire anglais Merriam-Webster définit un "Astrodome" comme +la canopée vitrée pointée vers le haut dans un avion et qui sert à observer les étoiles et pour +naviguer. J'ai choisit ce mot pour mon URL car je visualise mes différents services +comme différentes étoiles dans ma galaxie/constellation. L'Astrodome permet donc +d'observer cette constellation ! diff --git a/content/pages/about.md b/content/pages/about.md new file mode 100644 index 0000000..1b1909b --- /dev/null +++ b/content/pages/about.md @@ -0,0 +1,33 @@ +Title: About +Date: 2020-05-31 19:41 +Slug: about +lang: en +toc_run: false + +# Welcome ! + +## This website + +The idea behing this website is to be a place where I can share my experiments, issues, +how I resolved them, essays, thoughts and anything else that could be useful for anyone +other than me. (Which could be myself from the future!). + +Thus I chose to make it a blog (the sources of which can be found +[here](https://git.tfk-astrodome.net/Teo-CD/TFK-Blog)) which might not be well structued +or planned but -- idealy -- at least organized by category/theme ! + +## This guy + +I'm trotFunky (Shortened `trot`. Or Téo, but trotFunky is alright). I'm a French guy, +born in 1998 (That's easier to keep updated than an age), (soon to be) gratuated from +l'[Institut Polytechnique de Paris](https://www.ip-paris.fr) who likes to tinker, code +and play tabletop RPGs. Low-level programmer at the robotics club INTech for three years. +Apparently, a blogger. + +## Astrodome ? + +What a strange name ! Merriam-Webster defines an "astrodome" as follows : +> A transparent dome in the upper surface of an airplane from within which the navigator makes celestial observations + +I chose this noun for my URL as I picture my different services as multiple stars in +galaxy/constellation that is mine. The Astrodome allows observing this constellation ! diff --git a/new_article.sh b/new_article.sh new file mode 100755 index 0000000..dff4c77 --- /dev/null +++ b/new_article.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Add the metadata if the answer is not empty +# Usage: +# append_to_metadata file_name metadata_name +append_to_metadata() { + if [ $# -eq 2 ]; then + echo -n "$2 : " + read answer + if [ -n "$answer" ]; then + echo "$2: ""$answer" >> "content/articles/$1" + else + echo "Empty answer, nothing was appended" + fi + fi +} + +echo -n "Filename : " +read filename + +append_to_metadata "$filename" "Title" + +append_to_metadata "$filename" "Date" + +append_to_metadata "$filename" "Category" + +append_to_metadata "$filename" "Tags" + +append_to_metadata "$filename" "Lang" + +append_to_metadata "$filename" "Slug" + +append_to_metadata "$filename" "Summary" + +echo -e "\n" >> content/articles/"$filename" + +# Try to get the default editor from alternatives +EDITOR=${EDITOR:-$(update-alternatives --list editor | head -n1)} +# If not present set it to vi +EDITOR=${EDITOR:-vi} + +# Open the newly created file, openfully in the chosen editor + +$EDITOR content/articles/"$filename" diff --git a/pelicanconf.py b/pelicanconf.py new file mode 100644 index 0000000..05df97b --- /dev/null +++ b/pelicanconf.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # +from __future__ import unicode_literals +from datetime import datetime + +AUTHOR = 'trotFunky' +SITENAME = "L'Astrodome" +SITETITLE = "L'Astrodome" +SITESUBTITLE = "Un point d'observation de mon univers" +SITELOGO = "/images/Profile.png" +SITEURL = 'https://tfk-astrodome.net' + +CC_LICENSE = { + 'name': 'Creative Commons Attribution-ShareAlike', + 'version': '4.0', + 'slug': 'by-sa' +} +COPYRIGHT_YEAR = datetime.now().year + +PATH = 'content' +PLUGIN_PATHS = ["plugins"] +STATIC_PATHS = ['extras/custom.css'] + +# tell pelican where it should copy that file to in your output folder +EXTRA_PATH_METADATA = { +'extras/custom.css': {'path': 'static/custom.css'} +} + +CUSTOM_CSS = 'static/custom.css' + +PLUGINS = ["pelican-toc"] + +TIMEZONE = 'Europe/Paris' + +DEFAULT_LANG = 'fr' + +# Feed generation is usually not desired when developing +FEED_ALL_ATOM = 'feeds/all.atom.xml' +CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' +TRANSLATION_FEED_ATOM = None +AUTHOR_FEED_ATOM = None +AUTHOR_FEED_RSS = None + +# Blogroll +LINKS = (("Categories", SITEURL+'/categories.html'),) + +# Social widget +SOCIAL = (('rss', SITEURL+'/feeds/all.atom.xml'),) + +DEFAULT_PAGINATION = False + +# Uncomment following line if you want document-relative URLs when developing +#RELATIVE_URLS = True + +MAIN_MENU = False + +LOCALE = ('fr_FR', 'en_US') + +TYPOGRIFY = True +THEME = "themes/Flex" + +# Flex theme + +TOC_FLOAT = 'right' +TOC = { + 'TOC_HEADERS' : '^h[1-6]', + 'TOC_RUN' : 'true', + 'TOC_INCLUDE_TITLE' : 'false', +} + +THEME_COLOR_AUTO_DETECT_BROWSER_PREFERENCE = True +THEME_COLOR_ENABLE_USER_OVERRIDE = True diff --git a/plugins/pelican-toc b/plugins/pelican-toc new file mode 160000 index 0000000..b98d89b --- /dev/null +++ b/plugins/pelican-toc @@ -0,0 +1 @@ +Subproject commit b98d89b2cfa857c59b647ef0983a470408d6d8cd diff --git a/themes/Flex b/themes/Flex new file mode 160000 index 0000000..077d479 --- /dev/null +++ b/themes/Flex @@ -0,0 +1 @@ +Subproject commit 077d47986154e82c97bebff5c9fb280d544887fa