Skip to content

Commit

Permalink
Merge pull request #9 from BoyWithSilverWings/feature/test-emojis
Browse files Browse the repository at this point in the history
try party emoji
  • Loading branch information
agneym authored Sep 21, 2019
2 parents 09b16e9 + 7f46480 commit bf46c0e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ Frontmatter level props on a document always takes precedence over Repository le
fontSize: 120%;
```

4. **I need an emoji instead of image**

You can pass in the unicode representation of the emoji from the [List](https://unicode.org/emoji/charts/full-emoji-list.html) in `imageUrl` prop.

5. **I need to format the title**

The `title` prop supports markdown, feel _free_ to _use_ it.

### I need more customisation on the output.

The generator uses a web component to create the default output and provides a repository level prop to customise this web component.
Expand Down
6 changes: 5 additions & 1 deletion __tests__/generate-html.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ describe("Generate HTML", () => {

it("process emojis", () => {
const result = generateHtml({
imageUrl: "😍"
imageUrl: "😍",
title: "Generating open graph images with Github Actions",
subtitle: "Works with Markdown files",
componentUrl: "https://unpkg.com/@agney/og-image-element@0.2.0"
});
console.log(result);
expect(result.includes(`class="emoji"`)).toBe(true);
});
});
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ inputs:
default: "#000000"
componentUrl:
description: "URL for web component"
default: "https://unpkg.com/@agney/og-image-element@0.2.2"
default: "https://unpkg.com/@agney/og-image-element@0.2.3"
fontSize:
description: "Font size for the root"
default: "100%"
Expand Down
3 changes: 2 additions & 1 deletion demo/test-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ description: Nothing to see here
ogImage:
title: Generating *open graph* images with Github Actions
subtitle: Works with Markdown files
imageUrl: 😍
imageUrl: "🥳"
background: "linear-gradient(to right, #000428, #004e92)"
filename: this-file
---

Expand Down
Binary file modified demo/this-file.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf46c0e

Please sign in to comment.