chore: updates to the content API (for use in CIBUS)
This commit is contained in:
parent
1b3a2dec72
commit
917695a1da
3 changed files with 11 additions and 1 deletions
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
||||||
.PHONY: help build publish
|
.PHONY: help build publish
|
||||||
VERSION = 1.5.0
|
VERSION = 1.6.0
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
from wagtail.api import APIField
|
||||||
from wagtail.blocks import (
|
from wagtail.blocks import (
|
||||||
CharBlock,
|
CharBlock,
|
||||||
ChoiceBlock,
|
ChoiceBlock,
|
||||||
|
@ -14,6 +15,13 @@ class ImageBlock(StructBlock):
|
||||||
caption = CharBlock(required=False)
|
caption = CharBlock(required=False)
|
||||||
attribution = CharBlock(required=False)
|
attribution = CharBlock(required=False)
|
||||||
|
|
||||||
|
api_fields = [
|
||||||
|
APIField('image'),
|
||||||
|
# Adds a URL to a rendered thumbnail of the image to the API
|
||||||
|
APIField('caption'),
|
||||||
|
APIField('attribution'),
|
||||||
|
]
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
icon = "image"
|
icon = "image"
|
||||||
template = "base/blocks/image_block.html"
|
template = "base/blocks/image_block.html"
|
||||||
|
|
|
@ -6,6 +6,7 @@ from modelcluster.fields import ParentalKey, ParentalManyToManyField
|
||||||
from modelcluster.contrib.taggit import ClusterTaggableManager
|
from modelcluster.contrib.taggit import ClusterTaggableManager
|
||||||
from taggit.models import TaggedItemBase
|
from taggit.models import TaggedItemBase
|
||||||
from wagtail.api import APIField
|
from wagtail.api import APIField
|
||||||
|
from wagtail.images.api.fields import ImageRenditionField
|
||||||
|
|
||||||
from wagtail.models import Page, Orderable
|
from wagtail.models import Page, Orderable
|
||||||
from wagtail.fields import RichTextField, StreamField
|
from wagtail.fields import RichTextField, StreamField
|
||||||
|
@ -78,6 +79,7 @@ class BlogPage(SeoMixin, Page):
|
||||||
# Export fields over the API
|
# Export fields over the API
|
||||||
api_fields = [
|
api_fields = [
|
||||||
APIField('gallery_images'),
|
APIField('gallery_images'),
|
||||||
|
# Adds a URL to a rendered thumbnail of the image to the API
|
||||||
APIField('body'),
|
APIField('body'),
|
||||||
APIField('intro'),
|
APIField('intro'),
|
||||||
APIField('tags'),
|
APIField('tags'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue