First setup of the blog
First article and about page Flex theme setup with some corrections and using a PR for ToC
This commit is contained in:
commit
32a4c73685
13 changed files with 256 additions and 0 deletions
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
__pycache__/
|
||||
output/
|
||||
Makefile
|
||||
publishconf.py
|
||||
tasks.py
|
||||
*.swp
|
7
.gitmodules
vendored
Normal file
7
.gitmodules
vendored
Normal file
|
@ -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/
|
28
README.md
Normal file
28
README.md
Normal file
|
@ -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`
|
||||
|
14
content/articles/First-Steps.fr.md
Normal file
14
content/articles/First-Steps.fr.md
Normal file
|
@ -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.
|
15
content/articles/First-Steps.md
Normal file
15
content/articles/First-Steps.md
Normal file
|
@ -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 !
|
||||
|
3
content/extras/custom.css
Normal file
3
content/extras/custom.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
aside nav ul li {
|
||||
text-transform: none;
|
||||
}
|
BIN
content/images/Profile.png
Normal file
BIN
content/images/Profile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
32
content/pages/about.fr.md
Normal file
32
content/pages/about.fr.md
Normal file
|
@ -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 !
|
33
content/pages/about.md
Normal file
33
content/pages/about.md
Normal file
|
@ -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 !
|
44
new_article.sh
Executable file
44
new_article.sh
Executable file
|
@ -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"
|
72
pelicanconf.py
Normal file
72
pelicanconf.py
Normal file
|
@ -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
|
1
plugins/pelican-toc
Submodule
1
plugins/pelican-toc
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit b98d89b2cfa857c59b647ef0983a470408d6d8cd
|
1
themes/Flex
Submodule
1
themes/Flex
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 077d47986154e82c97bebff5c9fb280d544887fa
|
Loading…
Add table
Reference in a new issue