Archive old talks
This commit is contained in:
parent
12863a4f92
commit
9692827603
73 changed files with 0 additions and 618 deletions
4
archive/building-static-websites-sculpin/README.rst
Normal file
4
archive/building-static-websites-sculpin/README.rst
Normal file
|
@ -0,0 +1,4 @@
|
|||
Building static websites with Sculpin
|
||||
#####################################
|
||||
|
||||
https://www.oliverdavies.uk/talks/building-static-websites-sculpin
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
name: My talk
|
||||
menu_links:
|
||||
- { title: Home, href: / }
|
||||
- { title: About, href: /about }
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
layout: default
|
||||
title: Hello!
|
||||
---
|
||||
|
||||
Hello, World!
|
8
archive/building-static-websites-sculpin/demo.txt
Normal file
8
archive/building-static-websites-sculpin/demo.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
- Adding a new page (`/talks`)
|
||||
- Adding a new menu link
|
||||
- Adding a new content type (talks)
|
||||
- Add a new talk
|
||||
- Show how to use page-level variables, adding events to a talk
|
||||
- Adding the talks page to the menu
|
||||
- Active menu link styling?
|
||||
- Generating a production version of the site
|
BIN
archive/building-static-websites-sculpin/images/packagist.png
Normal file
BIN
archive/building-static-websites-sculpin/images/packagist.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 126 KiB |
129
archive/building-static-websites-sculpin/main.style
Normal file
129
archive/building-static-websites-sculpin/main.style
Normal file
|
@ -0,0 +1,129 @@
|
|||
pageSetup:
|
||||
firstTemplate: coverPage
|
||||
height: 18cm
|
||||
margin-bottom: 0cm
|
||||
margin-gutter: 0cm
|
||||
margin-left: 0cm
|
||||
margin-right: 0cm
|
||||
margin-top: 0cm
|
||||
size: null
|
||||
spacing-footer: 2mm
|
||||
spacing-header: 2mm
|
||||
width: 32cm
|
||||
|
||||
pageTemplates:
|
||||
coverPage:
|
||||
# background: images/title.png
|
||||
frames: []
|
||||
[12%, 10%, 76%, 75%]
|
||||
showFooter: false
|
||||
showHeader: false
|
||||
|
||||
titlePage:
|
||||
alignment: TA_CENTER
|
||||
frames: []
|
||||
[8%, 8%, 85%, 65%]
|
||||
showFooter: true
|
||||
showHeader: false
|
||||
|
||||
standardPage:
|
||||
frames: []
|
||||
[3%, 3%, 92%, 92%]
|
||||
showFooter: true
|
||||
showHeader: false
|
||||
|
||||
imagePage:
|
||||
alignment: TA_CENTER
|
||||
frames: []
|
||||
[12%, 10%, 76%, 80%]
|
||||
showFooter: true
|
||||
showHeader: false
|
||||
|
||||
outputPage:
|
||||
frames: []
|
||||
[8%, 10%, 82%, 65%]
|
||||
showFooter: false
|
||||
showHeader: false
|
||||
|
||||
linkColor: #24608a
|
||||
|
||||
fontsAlias:
|
||||
stdMono: Inconsolata-Regular
|
||||
stdMonoBold: Inconsolata-Regular
|
||||
stdMonoBoldItalic: Inconsolata-Regular
|
||||
stdMonoItalic: Inconsolata-Regular
|
||||
|
||||
styles:
|
||||
normal:
|
||||
fontSize: 24
|
||||
leading: 32
|
||||
textColor: #383745
|
||||
|
||||
bodytext:
|
||||
alignment: TA_LEFT
|
||||
|
||||
heading:
|
||||
fontSize: 20
|
||||
spaceAfter: 16
|
||||
textColor: #24608a
|
||||
|
||||
title:
|
||||
fontSize: 300%
|
||||
parent: heading
|
||||
|
||||
bullet-list:
|
||||
commands: []
|
||||
[LEFTPADDING, [0, 0], [1, -1], 10]
|
||||
[RIGHTPADDING, [0, 0], [1, -1], 0]
|
||||
[VALIGN, [0, 0], [-1, -1], TOP]
|
||||
colWidths: ["20", null]
|
||||
textColor: #aaaaaa
|
||||
|
||||
bullet-list-item:
|
||||
spaceBefore: 14
|
||||
spaceAfter: 0
|
||||
|
||||
titleslideinfo:
|
||||
alignment: TA_CENTER
|
||||
fontSize: 140%
|
||||
parent: normal
|
||||
|
||||
footer:
|
||||
alignment: TA_RIGHT
|
||||
fontName: stdMono
|
||||
fontSize: 20
|
||||
textColor: #24608a
|
||||
rightIndent: 16
|
||||
spaceBefore: 0
|
||||
|
||||
literal:
|
||||
backColor: white
|
||||
fontName: stdMono
|
||||
|
||||
code:
|
||||
backColor: white
|
||||
borderWidth: 0
|
||||
fontSize: 20
|
||||
leading: 24
|
||||
parent: literal
|
||||
spaceBefore: 4
|
||||
|
||||
blockquote:
|
||||
parent: normal
|
||||
fontName: stdItalic
|
||||
leading: 36
|
||||
|
||||
attribution:
|
||||
parent: normal
|
||||
textColor: #66666
|
||||
|
||||
centred:
|
||||
alignment: TA_CENTER
|
||||
parent: normal
|
||||
|
||||
centredtitle:
|
||||
alignment: TA_CENTER
|
||||
fontName: stdBold
|
||||
fontSize: 48
|
||||
leading: 64
|
||||
parent: heading
|
308
archive/building-static-websites-sculpin/slides.rst
Normal file
308
archive/building-static-websites-sculpin/slides.rst
Normal file
|
@ -0,0 +1,308 @@
|
|||
.. footer:: @opdavies
|
||||
|
||||
Building static websites with Sculpin
|
||||
#####################################
|
||||
|
||||
|
|
||||
|
||||
.. class:: titleslideinfo
|
||||
|
||||
Oliver Davies (@opdavies)
|
||||
|
||||
.. page:: imagePage
|
||||
|
||||
.. image:: druplicon.png
|
||||
:width: 10cm
|
||||
|
||||
.. page::
|
||||
|
||||
.. image:: sculpin.png
|
||||
:width: 10cm
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
What is Sculpin?
|
||||
================
|
||||
|
||||
* Static site generator
|
||||
* CLI tool
|
||||
* Built on Symfony's HttpKernel
|
||||
* HTML + Markdown + Twig = Static site
|
||||
|
||||
What do I use it for?
|
||||
=====================
|
||||
|
||||
* My personal website
|
||||
* Some client websites
|
||||
* HTML prototypes and testing
|
||||
* Learning YAML and Twig (and some Symfony)
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
``composer require sculpin/sculpin``
|
||||
|
||||
|
|
||||
|
||||
``composer create-project sculpin/blog-skeleton my-blog``
|
||||
|
||||
|
|
||||
|
||||
``composer create-project opdavies/sculpin-skeleton my-site``
|
||||
|
||||
Using Sculpin
|
||||
=============
|
||||
|
||||
* Configuration lives in ``app/config``
|
||||
* Source files live in ``source``.
|
||||
|
||||
Generate a site
|
||||
===============
|
||||
|
||||
* ``vendor/bin/sculpin generate``
|
||||
* ``--server``
|
||||
* ``--watch``
|
||||
* ``--env``
|
||||
|
||||
source/index.md
|
||||
===============
|
||||
|
||||
.. code-block:: markdown
|
||||
:include: code/index.md.txt
|
||||
|
||||
output_dev/index.html
|
||||
=====================
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello, World!</p>
|
||||
</body>
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
- Stored in ``app/config``
|
||||
- ``sculpin_site.yml``
|
||||
- ``sculpin_site_{env}.yml``
|
||||
- Key-value pairs
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/configuration.txt
|
||||
|
||||
Using on pages
|
||||
==============
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>{{ site.name }}</title>
|
||||
</head>
|
||||
|
||||
YAML front matter
|
||||
=================
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
layout: post
|
||||
title: New blog post
|
||||
draft: yes
|
||||
---
|
||||
|
||||
# My new blog post
|
||||
|
||||
More front matter
|
||||
=================
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
layout: post
|
||||
title: New blog post
|
||||
draft: yes
|
||||
tags:
|
||||
- drupal
|
||||
- php
|
||||
- sculpin
|
||||
---
|
||||
|
||||
# My new blog post
|
||||
|
||||
|
||||
|
||||
Even more front matter
|
||||
======================
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
layout: post
|
||||
title: New blog post
|
||||
draft: yes
|
||||
tags:
|
||||
- drupal
|
||||
- php
|
||||
- sculpin
|
||||
tweets: yes
|
||||
foo: bar
|
||||
---
|
||||
|
||||
# My new blog post
|
||||
|
||||
Using on pages
|
||||
==============
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
---
|
||||
...
|
||||
testimonials:
|
||||
- { name: ..., role: ..., text: ..., url: ... }
|
||||
- { name: ..., role: ..., text: ..., url: ... }
|
||||
- { name: ..., role: ..., text: ..., url: ... }
|
||||
---
|
||||
|
||||
{% for testimonial in page.testimonials %}
|
||||
<h2>{{ testimonial.name }} - {{ testimonial.role }}</h2>
|
||||
<p>{{ testimonial.text }}</p>
|
||||
{% endfor %}
|
||||
|
||||
Layouts
|
||||
=======
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
{# source/_layouts/app.html.twig #}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ site.locale|default('en') }}">
|
||||
<head>
|
||||
<title>{{ site.name|default('Sculpin Skeleton') }}</title>
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Layouts
|
||||
=======
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
{# source/_layouts/default.html.twig #}
|
||||
|
||||
{% extends 'app' %}
|
||||
|
||||
{% block body %}
|
||||
{% block content %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
Includes
|
||||
========
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
{% include 'about-author' with {
|
||||
avatar: site.avatar,
|
||||
work: site.work,
|
||||
} only %}
|
||||
|
||||
{% for link in links %}
|
||||
{% include 'menu-link' with { link } only %}
|
||||
{% endfor %}
|
||||
|
||||
Content types
|
||||
=============
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# app/config/sculpin_kernel.yml
|
||||
|
||||
sculpin_content_types:
|
||||
projects:
|
||||
permalink: projects/:slug_title/
|
||||
|
||||
Accessing custom content types
|
||||
==============================
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
title: My Projects
|
||||
layout: default
|
||||
use:
|
||||
- projects
|
||||
---
|
||||
|
||||
{% for project in data.projects %}
|
||||
<h2>{{ project.title }}</h2>
|
||||
{% endfor %}
|
||||
|
||||
.. page:: titlePage
|
||||
|
||||
.. class:: centredtitle
|
||||
|
||||
Demo
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
Extending Sculpin
|
||||
=================
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# app/config/sculpin_kernel.yml
|
||||
|
||||
...
|
||||
|
||||
services:
|
||||
App\TwigExtension\TalkExtension:
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
.. page:: imagePage
|
||||
|
||||
.. image:: images/packagist.png
|
||||
:width: 22cm
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
|
||||
.. code-block:: php
|
||||
:startinline: true
|
||||
|
||||
// app/SculpinKernel.php
|
||||
|
||||
use Opdavies\Sculpin\Bundle\TwigMarkdownBundle\SculpinTwigMarkdownBundle;
|
||||
use Sculpin\Bundle\SculpinBundle\HttpKernel\AbstractKernel;
|
||||
|
||||
final class SculpinKernel extends AbstractKernel
|
||||
{
|
||||
protected function getAdditionalSculpinBundles(): array
|
||||
{
|
||||
return [
|
||||
SculpinTwigMarkdownBundle::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Thanks!
|
||||
=======
|
||||
|
||||
References:
|
||||
|
||||
* https://sculpin.io
|
||||
* https://github.com/opdavies/sculpin-talk-demo
|
||||
* https://github.com/opdavies/oliverdavies.uk
|
||||
* https://github.com/opdavies/docker-image-sculpin-serve
|
||||
|
||||
|
|
||||
|
||||
Me:
|
||||
|
||||
* https://www.oliverdavies.uk
|
Loading…
Add table
Add a link
Reference in a new issue