Assuming your code is running for a node page, the methods I see used most often in core/contrib modules are either using menu_get_object() or arg():
if ($node = menu_get_object()) {
// Get the nid
$nid = $node->nid;
$ git log origin/master
// Update 2021
composer create-project drupal/recommended-project myproject -n
or
composer create-project drupal/recommended-project:^8.9 myproject -n
cd myproject
lando init --source cwd --recipe drupal8 --webroot web --name myproject
lando start
Please note I created that sheet as a personal side note/draft and not everything is fully tested. There could be errors or better things to do. So if you spot something wrong or something that can be improved, feel free to comment below and I will do the changes.
Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}