-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDX files for metadata for all pages without manifests #34
base: bug/DEL-108-title-and-description
Are you sure you want to change the base?
MDX files for metadata for all pages without manifests #34
Conversation
Netlify outputStatic site (preview): https://deploy-preview-34--heritage-tudelft.netlify.app |
Good morning @sammeltassen
This PR allows all the titles and descriptions on the static pages to be controlled by mdx files. If you could please review this to let me know if you are happy with the solution, that would be great thanks! There is a more detailed description and screenshots above. |
Thank you @funkydunc this is great! Two comments/suggestions:
|
Another remark: rather than pushing the default image to the repo I'd prefer to specify it in the homepage mdx and use a DLCS thumbnail url. So this would be the contents of both --- # en
title: Academic Heritage, History and Art
path: "/"
description: Explore the history of Delft University of Technology and the Special Collections of TU Delft Library
image: https://dlc.services/thumbs/7/13/00a1a6c3-25cb-4873-b570-2a77205852c9/full/683,1024/0/default.jpg
--- --- # nl
title: Academisch Erfgoed, Geschiedenis en Kunst
path: "/"
description: Verken de geschiedenis van de TU Delft en de bijzondere collecties van de TU Delft Library
image: https://dlc.services/thumbs/7/13/00a1a6c3-25cb-4873-b570-2a77205852c9/full/683,1024/0/default.jpg
--- With all these values used as defaults across the site. |
Thanks for the feedback @sammeltassen
I can do that. The function that gets the mdx for the current page can return the home values as defaults, if the values are not set in the current page mdx.
Currently here
I can change that to use a new independent entry in the translation files t('TU Delft Academic Heritage) .
OK |
I see the problem of extracting the width and height for the default image if specified as an url. Possible solutions:
|
@funkydunc You can use the homepage title for the breadcrumb or perhaps add a separate short-title property for that to the frontmatter? |
Hi @sammeltassen I've pushed an update:
Can you please clarify: On the other pages, for the part of the title breadcrumb after the main title, do you want that to be the same as the Home title or "TU Delft Academic Heritage" e.g.
|
@funkydunc Thank you for these changes. You can remove The dimensions for the default image are: imageWidth: 683
imageHeight: 1024 |
@sammeltassen what about in the |
@funkydunc Yes that can also make use of the default title |
This PR is based on the branch for #32 so should be merged first.
Provides a consistent mechanism for customising metadata on each site page.
As we know, the Exhibition, Collection, Object detail pages will get the metadata from the meta.json file, which has been populated from the Manifest. And the Publication detail page and the About page use an mdx file.
This PR makes the rest of the pages consistent with that mechanism for supplying metadata. It adds MDX files with
title
,description
,image
for:title
is requiredIf
description
orimage
is not supplied in these files, it will use the defaults. Default description is in the lang file, and the default image is the image provided in #32Here are screenshots using a custom
description
andimage
. Custom values were tested locally but not pushed, followed by the initial use case: using defaultdescription
andimage
as fallback.Note the contents of the social share preview in each case.
CUSTOM EXAMPLES:
custom mdx code (used to test but not committed)
Home custom example
Search custom example
Exhibitions custom example
USING DEFAULTS:
Home default
About default
Search default
Exhibitions default