Skip to content
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

Adding PDF Shortcut #672

Merged
merged 8 commits into from
Oct 18, 2022
Merged

Adding PDF Shortcut #672

merged 8 commits into from
Oct 18, 2022

Conversation

MarionMoseby
Copy link
Contributor

@MarionMoseby MarionMoseby commented Oct 18, 2022

Issue

Adding PDF Shortcut #522

Fixes #522

Description

Adds the latest version of pdf-js (from: https://mozilla.github.io/pdf.js/) to the static/js folder, and the embed-pdf shortcode (maybe could be renamed to pdf?) to layouts/shortcodes. This shorcode was mainly taken from anvithks/hugo-embed-pdf-shortcode, as is implied to preserve copyright. Maybe an issue should be opened in his repo to let him now? (not necessary but nice)

Test Evidence

A minimal reproducible example can be reproduced like so:

  1. Create a test post in toha/content/posts/test/
  2. Fill index.md with:
---
---

{{< embed-pdf src="/posts/test/test.pdf" >}}
  1. Add a test pdf in toha/content/posts/test/test.pdf
  2. Issue: hugo serve

The result should be like so:

Screenshot 2022-10-18 at 12-04-00 Screenshot

@MarionMoseby
Copy link
Contributor Author

There are a ton of useless: Merge branch 'hugo-toha:main' into main commits, but I dont know how to remove those :/

@MarionMoseby MarionMoseby changed the title Embed pdf Adding PDF Shortcut Oct 18, 2022
@MarionMoseby
Copy link
Contributor Author

One possible improvement could be adding a "download" button to the top menu
To-Do: Write post in toha-guides with usage
Another note: I replaced the url: parameter with a src: parameter, as it seemed more consistent with the other shorcodes.

Are these 3 things ok?

Copy link
Member

@hossainemruz hossainemruz left a comment

Choose a reason for hiding this comment

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

Thanks you @MarionMoseby. Can you please add a guide for the short code?.

@hossainemruz hossainemruz added feature hacktoberfest Mark an issue so that contributor participating hacktoberfest can work on it labels Oct 18, 2022
@hossainemruz hossainemruz merged commit 0e8e182 into hugo-toha:main Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature hacktoberfest Mark an issue so that contributor participating hacktoberfest can work on it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding PDF Shortcut
2 participants