feat: add Forestry.io integration

This commit is contained in:
George Cushen 2019-10-09 18:47:32 +01:00
parent 1a195d83b7
commit 4c014375e1
8 changed files with 204 additions and 24 deletions

View file

@ -0,0 +1,50 @@
---
label: Blog post
hide_body: false
fields:
- type: text
name: title
label: title
- type: text
name: subtitle
label: subtitle
- type: datetime
name: date
label: date
- type: list
name: authors
label: authors
- type: list
name: tags
label: tags
- type: text
name: summary
label: summary
- type: field_group
name: image
label: image
fields:
- type: number
name: placement
label: placement
- type: text
name: caption
label: caption
- type: text
name: focal_point
label: focal_point
description: Image Focal Point (Smart, Center, TopLeft, Top, TopRight, Left, Right,
BottomLeft, Bottom, BottomRight)
- name: projects
type: list
config:
use_select: false
min:
max:
label: projects
description: Associate this content with a project by entering a project folder
name
- name: featured
type: boolean
label: featured
description: You can filter by featured content on your homepage

View file

@ -0,0 +1,71 @@
---
label: Event
hide_body: true
fields:
- type: text
name: title
label: title
- name: subtitle
type: text
config:
required: false
label: subtitle
- type: text
name: event
label: event
description: Name of the event (e.g. Academic Conference)
- type: text
name: event_url
label: Event Link
- type: text
name: location
label: location
- type: datetime
name: publishDate
label: publishDate
description: When to publish this page (choose today)
- type: datetime
name: date
label: date
description: Start time
- type: datetime
name: date_end
label: date_end
description: End time
- type: boolean
name: all_day
label: all_day
- type: list
name: authors
label: Presenters
- type: textarea
name: abstract
label: abstract
- type: text
name: url_slides
label: url_slides
- type: text
name: url_video
label: url_video
- type: text
name: url_code
label: url_code
- type: field_group
name: image
label: image
fields:
- type: number
name: placement
label: placement
- type: text
name: caption
label: caption
- type: text
name: focal_point
label: focal_point
description: Image Focal Point (Smart, Center, TopLeft, Top, TopRight, Left, Right,
BottomLeft, Bottom, BottomRight)
- name: featured
type: boolean
label: featured
description: You can filter by featured content on your homepage

56
.forestry/settings.yml Normal file
View file

@ -0,0 +1,56 @@
---
new_page_extension: md
auto_deploy: false
admin_path:
webhook_url:
sections:
- type: directory
path: content/home
label: Home
create: all
match: "**/*"
- type: directory
path: content/post
label: Blog posts
create: all
match: "**/*"
templates:
- blog-post
- type: directory
path: content/project
label: Projects
create: all
match: "**/*"
- type: directory
path: content/talk
label: Events
create: all
match: "**/*"
templates:
- event
- type: directory
path: content/publication
label: Publications
create: all
match: "**/*"
- type: directory
path: content
label: Pages
create: all
match: "*"
upload_dir: static/img
public_path: "/img"
front_matter_path: ''
use_front_matter_path: false
file_template: ":filename:"
build:
preview_env:
- HUGO_ENV=staging
- HUGO_VERSION=0.58.2
preview_output_directory: public
preview_docker_image: forestryio/hugo:latest
mount_path: "/srv"
working_dir: "/srv"
instant_preview_command: hugo server -D -E -F --port 8080 --bind 0.0.0.0 --renderToDisk
-d public
version: 0.58.2

1
config.toml Symbolic link
View file

@ -0,0 +1 @@
./config/_default/config.toml

View file

@ -31,6 +31,9 @@ subtitle = ""
# Background image. # Background image.
# image = "image.jpg" # Name of image in `static/img/`. # image = "image.jpg" # Name of image in `static/img/`.
# image_darken = 0.6 # Darken the image? Range 0-1 where 0 is transparent and 1 is opaque. # image_darken = 0.6 # Darken the image? Range 0-1 where 0 is transparent and 1 is opaque.
# image_size = "cover" # Options are `cover` (default), `contain`, or `actual` size.
# image_position = "center" # Options include `left`, `center` (default), or `right`.
# image_parallax = true # Use a fun parallax-like fixed background effect? true/false
# Text color (true=light or false=dark). # Text color (true=light or false=dark).
text_color_light = true text_color_light = true

View file

@ -26,6 +26,9 @@ hero_media = "hero-academic.png"
# Background image. # Background image.
# image = "" # Name of image in `static/img/`. # image = "" # Name of image in `static/img/`.
# image_darken = 0.6 # Darken the image? Range 0-1 where 0 is transparent and 1 is opaque. # image_darken = 0.6 # Darken the image? Range 0-1 where 0 is transparent and 1 is opaque.
# image_size = "cover" # Options are `cover` (default), `contain`, or `actual` size.
# image_position = "center" # Options include `left`, `center` (default), or `right`.
# image_parallax = true # Use a fun parallax-like fixed background effect? true/false
# Text color (true=light or false=dark). # Text color (true=light or false=dark).
text_color_light = true text_color_light = true

@ -1 +1 @@
Subproject commit 3911b8ff5327a8f703bd88d2c53db1c116b75614 Subproject commit d8e90e9d649c6ce86eb0b71ad20b6c4953298177

View file

@ -12,15 +12,26 @@ if [ ! -d .git ]; then
exit 1; exit 1;
fi fi
function view_update () {
echo -e "Checking for updates...\n"
cd themes/academic
git fetch
git log --pretty=oneline --abbrev-commit --decorate HEAD..origin/master
cd ../../
}
# Function to update Academic # Function to update Academic
function install_update () { function do_update () {
# Apply any updates # Apply any updates
git submodule update --remote --merge git submodule update --remote --merge
# - Update Netlify.toml with required Hugo version # - Update Netlify.toml with required Hugo version
if [ -f ./netlify.toml ]; then if [ -f ./netlify.toml ]; then
version=$(sed -n 's/^min_version = //p' themes/academic/theme.toml) # Postfix '.0' to Hugo min_version as sadly it doesn't map to a precise semantic version.
sed -i '' -e "s/HUGO_VERSION = .*/HUGO_VERSION = $version/g" ./netlify.toml version=$(sed -n 's/^min_version = //p' themes/academic/theme.toml | tr -d '"')
version="${version}.0"
echo "Set Netlify Hugo version to v${version}"
sed -i '' -e "s/HUGO_VERSION = .*/HUGO_VERSION = \"$version\"/g" ./netlify.toml
fi fi
echo echo
@ -34,22 +45,7 @@ version=$(sed -n 's/^version = "//p' themes/academic/data/academic.toml)
echo -e "Source Themes Academic v$version\n" echo -e "Source Themes Academic v$version\n"
# Display available updates # Display available updates
echo -e "Checking for updates...\n" view_update
cd themes/academic
git fetch
git log --pretty=oneline --abbrev-commit --decorate HEAD..origin/master
cd ../../
title="Do you wish to install the above updates?" # Apply any updates
prompt="Choose an option and press Enter:" do_update
options=("Yes" "No")
echo "$title"
PS3="$prompt "
select opt in "${options[@]}"; do
case $opt in
Yes ) install_update; break;;
No ) break;;
* ) break;;
esac
done