Skip to content

Commit

Permalink
format acknowledgments (#143)
Browse files Browse the repository at this point in the history
* Add migration to update "Acknowledgments" field in "Menu" model to use markdown editor

* Enhance AcknowledgmentsDialog styling and image handling

- Added 'markdown-body' class to the vue-markdown component for improved styling.
- Introduced CSS rules to ensure images within the markdown are responsive, with a maximum width of 500px.
  • Loading branch information
sjoerdbeentjes authored Dec 10, 2024
1 parent 3e1f869 commit 67c7037
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
33 changes: 33 additions & 0 deletions migrations/1733825239_colophonPresentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Client } from "@datocms/cli/lib/cma-client-node";

export default async function (client: Client) {
console.log("Update existing fields/fieldsets");

const currentField = await client.fields.find("H7cTIWERTG-z24IE8ILCUw");

console.log(
'Update Multiple-paragraph text field "Acknowledgments" (`acknowledgments`) in model "Menu" (`menu`)'
);
await client.fields.update("H7cTIWERTG-z24IE8ILCUw", {
appearance: {
addons: currentField.appearance.addons,
editor: "markdown",
parameters: {
toolbar: [
"heading",
"bold",
"italic",
"strikethrough",
"code",
"unordered_list",
"ordered_list",
"quote",
"link",
"image",
"fullscreen",
],
},
type: "markdown",
},
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</v-app-bar>

<v-divider />
<vue-markdown class="px-4 py-5 flex-grow-1 overflow-y-auto justify-center" :source="acknowledgments" />
<vue-markdown class="px-4 py-5 flex-grow-1 overflow-y-auto justify-center markdown-body" :source="acknowledgments" />
<!-- <div class="px-4 py-5 flex-grow-1 overflow-y-auto justify-center" v-html="acknowledgments" /> -->
</v-card>
</v-dialog>
Expand Down Expand Up @@ -57,4 +57,10 @@
</script>

<style>
/* make image max 300 width */
.markdown-body img {
width: 100%;
max-width: 500px;
}
</style>

3 comments on commit 67c7037

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://nl2120.netlify.app as production
🚀 Deployed on https://67581aa15f02ed02230a7020--nl2120.netlify.app

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.