StaticImageMedium.php 684 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @package Grav\Common\Page
  4. *
  5. * @copyright Copyright (C) 2015 - 2019 Trilby Media, LLC. All rights reserved.
  6. * @license MIT License; see LICENSE file for details.
  7. */
  8. namespace Grav\Common\Page\Medium;
  9. class StaticImageMedium extends Medium
  10. {
  11. use StaticResizeTrait;
  12. /**
  13. * Parsedown element for source display mode
  14. *
  15. * @param array $attributes
  16. * @param bool $reset
  17. * @return array
  18. */
  19. protected function sourceParsedownElement(array $attributes, $reset = true)
  20. {
  21. empty($attributes['src']) && $attributes['src'] = $this->url($reset);
  22. return ['name' => 'img', 'attributes' => $attributes];
  23. }
  24. }