{{- import "../blocks/novelnav" }} {* Container for the artworks *}
{{- if !.IsUgoira }} {* The actual artwork itself, if not a ugoira *} {* NOTE: tried using a carousel, but doesn't really work that well *} {{- range index := .Images }} {* Bootstrap + Jet wizardry to dynamically scale artwork *} {{- if .Width != 0 && .Height != 0 }} {* Display artwork at full width (col-12) if it is a manga or in landscape orientation *} {* Check whether these images are part of a manga, if so, display at full width and at original resolution *} {{- if .IllustType == 1 }} {* Set image height to not exceed the viewport height for mangas *}
{{- else if .Width > .Height }}
{* Otherwise, display artwork at reduced width (col-8) if viewing on a device ≥768px in width (on small screens, the artwork is still displayed at full width) *} {{- else }}
{{- end }} {{- else }} Page {{ index + 1 }} {{- end }} {{- end }} {{- else }} {* The actual artwork itself, if a ugoira *} {{- if .Images[0].Width != 0 && .Images[0].Height != 0 }} {{- if .Images[0].Width > .Images[0].Height }}
{{- else }}
{{- end }} {{- else }}
{{- end }} {{- end }}
{* Artwork title and user information *}
{* Artist avatar, artwork name, and artist name *}
{{ .User.Name }}

{{ .Title }}

{{ .User.Name }}

{* Bookmark and like buttons *} {* NOTE: hx-push-url used to update the URL in the user's address bar correctly, otherwise pressing back will return the user one level further than intended *}
{{- if isset(.BookmarkData) && LoggedIn }} {{- else }} {{- end }} {{- if .Liked && LoggedIn}} {* NOTE: /self/unlike isn't a real URI path, just keeping it here for consistency *} {{- else }} {{- end }}
{* View Pixiv original button *} {* Artwork description *} {* Rendered conditionally to avoid a weird empty p element that messes with spacing *} {{- if .Description }}

{{- raw: parsePixivRedirect(.Description) }}

{{- end }} {* Tag information *} {* text-start ensures that the content within non-emphasized tags is left-aligned while still maintaining proper wrapping behavior *}
{{- if .AiType == 2 }} AI-generated {{- end }} {{- range .Tags }} {* NOTE: early block to catch the R-18 tag *} {{- if isEmphasize(.Name) }} {{ .Name }} {{- end }} {{- end }} {{- range .Tags }} {{- if isEmphasize(.Name) }} {* Intentionally empty to not render anything to avoid duplication *} {{- else }} {* NOTE: tried styling these tags similarly to the "View on pixiv.net" button, but even then they still draw too much attention and break visual hierarchy *}
#{{ .Name }} {{- if .TranslatedName }} {* NOTE: the .TranslatedName actually has a surprisingly high contrast ratio at 7.18 here; also nesting small tags is cursed but it works *} ({{ .TranslatedName }}) {{- end }}
{{- end }} {{- end }}
{* Other artwork information (views, bookmarks, likes, creation date) *}
{{- .Views }}
{{- .Bookmarks }}
{{- .Likes }}
{{- parseTime: .Date }}
{{- if .Images[0].Width != 0 && .Images[0].Height != 0 }}
{{ .Images[0].Width }}x{{ .Images[0].Height }}
{{- end }}
{{- if .SeriesNavData }}

{{- .SeriesNavData.Title }}

{* NOTE: formatting for the i18n crawler {{ seriesWorks := len(.NovelSeriesContentTitles) }} {{- if seriesWorks == 1 }} {{ seriesWorks }} work in this series {{- else }} {{ seriesWorks }} works in this series {{- end }} *}


{{- end }}