Documentation
¶
Index ¶
- Constants
- Variables
- func AccountSettings(user *models.User) templ.Component
- func AddCategory(path, inputName string, category models.Category) templ.Component
- func AddFeedSubscription(request *models.AddFeedSubscriptionRequest) templ.Component
- func AddFeedsetsSuccessNotification(feedsets []string) templ.Component
- func AddGroupSubscription(request *models.GroupSubscriptionRequest) templ.Component
- func AddSearchSubscription(request *models.SearchSubscriptionRequest) templ.Component
- func AddSearchSubscriptionFilter(filter *models.AddSubscriptionSearchFilterRequest) templ.Component
- func ArticleCard(article *models.Article) templ.Component
- func ArticleContent(article *models.Article) templ.Component
- func Body(content templ.Component) templ.Component
- func CategoryManagement(path, inputName string, suggested []models.Category, ...) templ.Component
- func Content(data *models.ViewComponent) templ.Component
- func DeactivateAccountModal() templ.Component
- func DisplaySettings(user *models.User) templ.Component
- func Dock(pageURL string, attributes templ.Attributes) templ.Component
- func Document(data []byte) templ.Component
- func EditGroupSubscription(request *models.GroupSubscriptionRequest) templ.Component
- func EditSearchSubscription(request *models.SearchSubscriptionRequest) templ.Component
- func EditSubscription(request *models.EditSubscriptionRequest) templ.Component
- func EditSubscriptionSuccessNotification(subscription *models.Subscription) templ.Component
- func EmptyContent() templ.Component
- func ErrorPage(msg *models.UserMessage) templ.Component
- func ExportSubscriptions() templ.Component
- func ExternalError(msg *models.UserMessage) templ.Component
- func FavoritesGrid(subscriptions models.Subscriptions, articles models.Articles) templ.Component
- func FilterControls(path string, categories models.CategoryCounts, filters *models.ListFilters) templ.Component
- func GeneratePageTitle(title string) string
- func GetNotificationIDFromCtx(ctx context.Context) string
- func Head() templ.Component
- func HelpPopover(id, anchor string) templ.Component
- func ImportResults(results []*models.AddFeedSubscriptionResult) templ.Component
- func ImportSubscriptions() templ.Component
- func IssueReportedConfirmation(msg *models.UserMessage) templ.Component
- func Landing() templ.Component
- func ListArticles(response *models.ListArticlesResponse) templ.Component
- func ListSubscriptions(response *models.ListSubscriptionsResponse) templ.Component
- func Logo(classes ...string) templ.Component
- func LogoSmall(classes ...string) templ.Component
- func Modal(id string) templ.Component
- func NewButton(options ...Option[element]) templ.Component
- func NewDiv(options ...Option[element]) templ.Component
- func NewLink(options ...Option[element]) templ.Component
- func NewMailtoLink(to string, options ...MailtoOption) templ.Component
- func NewProxiedImage(img *types.ImageInfo, props string, options ...Option[element]) templ.Component
- func NewUserHome() templ.Component
- func NoSearchResults() templ.Component
- func NotFound() templ.Component
- func Notification(msg *models.UserMessage, timeout time.Duration) templ.Component
- func Page(body templ.Component) templ.Component
- func PageTitle() templ.Component
- func PageTitleFromCtx(ctx context.Context) string
- func PageTitleToCtx(ctx context.Context, title string) context.Context
- func PaginateArticles(response *models.ListArticlesResponse) templ.Component
- func PaginateSubscriptions(response *models.ListSubscriptionsResponse) templ.Component
- func PaginationControl(ctx context.Context, route, target string, pagination models.Pagination) templ.Component
- func RemoveSubscriptionModal(request *models.RemoveSubscriptionRequest) templ.Component
- func ReportObjectIssues(objectType, id string, details *models.ReportObjectIssueRequest) templ.Component
- func ReportPageIssue(details *models.ReportIssueRequest) templ.Component
- func SearchFilters(attributes templ.Attributes) templ.Component
- func SearchResults(articles models.Articles, pagination models.Pagination) templ.Component
- func SearchResultsGrid(request *models.SearchRequest, articles models.Articles, ...) templ.Component
- func SearchSubscriptionFilterSuggestions(subscriptions models.Subscriptions) templ.Component
- func SearchSuggestions(request *models.SearchRequest, subscriptions models.Subscriptions, ...) templ.Component
- func ServerErrorNotification(msg *models.UserMessage) templ.Component
- func SettingsPage() templ.Component
- func ShareObjectModal(id, title, link string) templ.Component
- func ShowTailwindBreakpoints() templ.Component
- func SideBar(attributes templ.Attributes) templ.Component
- func SimilarArticles(articles models.Articles) templ.Component
- func SubscriptionCard(s *models.Subscription) templ.Component
- func ToggleFavorite(id string, objectType string, isFavorite bool) templ.Component
- func UpdateCSRFToken() templ.Component
- func UpdateViewArticleFavorite(id models.ItemID, isFavorite bool) templ.Component
- func UpdateViewArticleMark(id string, isUnread bool) templ.Component
- func UpdatesToast() templ.Component
- func UserAccountIssue() templ.Component
- func UserAvatar(user *models.User, attributes templ.Attributes) templ.Component
- func UserChooseSubscriptionPlan(user *models.User, planID string) templ.Component
- type Button
- type Div
- type FragmentKey
- type HTMLElement
- func (e *HTMLElement) AddClasses(classes ...string)
- func (e *HTMLElement) GetClasses() []string
- func (e *HTMLElement) GetID() string
- func (e *HTMLElement) GetTarget() string
- func (e *HTMLElement) HasAttribute(key string) bool
- func (e *HTMLElement) MergeAttributes(attributes templ.Attributes)
- func (e *HTMLElement) SetAttribute(key string, value any)
- func (e *HTMLElement) SetID(id string)
- type Home
- type ID
- type Link
- type MailtoLink
- type MailtoOption
- type Option
- func WithAttribute(key string, value any) Option[element]
- func WithAttributes(attributes templ.Attributes) Option[element]
- func WithClasses(classes ...string) Option[element]
- func WithHXInclude(value string) Option[element]
- func WithHXMethod(method, path string) Option[element]
- func WithHXParams(params string) Option[element]
- func WithHXPushURL(value bool) Option[element]
- func WithHXReplaceURL(value bool) Option[element]
- func WithHXSwap(value string) Option[element]
- func WithHXTarget(value string) Option[element]
- func WithHXTrigger(trigger string) Option[element]
- func WithHXVals(vals map[string]any) Option[element]
- func WithHXValsJS(val string) Option[element]
- func WithID(id string) Option[element]
- type ProxiedImage
- type SideBarComponent
- type Template
Constants ¶
const ( FragmentContent FragmentKey = "content" ImgProxyKey contextKey = "imgproxy_key" ImgProxySalt contextKey = "imgproxy_salt" )
const DefaultNotificationTimeout = 5 * time.Second
Variables ¶
var ( // ContentID points to the element containing the main content of the page. ContentID = ID("content") // ErrorID points to an element that can be used to display error messages to the user. ErrorID = ID("error") // ModalContainerID points to an element that holds a modal. ModalContainerID = ID("modals") // ModalID points to an element that can be used to render a modal. ModalID = ID("modal") // NotificationsID points to an element that can be used for displaying notifications to the user. NotificationsID = ID("notifications") )
var DefaultPageTitle = config.AppName + ": " + config.AppDescription
DefaultPageTitle is the default <title> tag value if none is set.
Functions ¶
func AddCategory ¶
AddCategory renders a new category item to the list of categories of a subscription.
func AddFeedSubscription ¶
func AddFeedSubscription(request *models.AddFeedSubscriptionRequest) templ.Component
AddFeedSubscription is a page for adding a new subscription to a feed.
func AddFeedsetsSuccessNotification ¶
AddFeedsetsSuccessNotification renders a notification when a new user is successfully subscribed to one or more curated feedsets.
func AddGroupSubscription ¶
func AddGroupSubscription(request *models.GroupSubscriptionRequest) templ.Component
AddGroupSubscription is a page for adding a new group subscription.
func AddSearchSubscription ¶
func AddSearchSubscription(request *models.SearchSubscriptionRequest) templ.Component
AddSearchSubscription is a page for adding a new search subscription.
func AddSearchSubscriptionFilter ¶
func AddSearchSubscriptionFilter(filter *models.AddSubscriptionSearchFilterRequest) templ.Component
func ArticleCard ¶
Card renders an article as a card, for displaying in a list.
func ArticleContent ¶
ArticleContent renders the complete content of an article.
func Body ¶
Body renders the `<body>` element. Body content can be passed directly or the children templ syntax can be used.
func CategoryManagement ¶
func Content ¶
func Content(data *models.ViewComponent) templ.Component
Content renders the given template wrapped with appropriate header/footer navigation. Used for most user content pages.
func DeactivateAccountModal ¶
func Document ¶
Document renders the given raw HTML data as full-page prose content. Used primarily for hosted markdown documents (i.e., privacy policy, terms of service, etc.)
func EditGroupSubscription ¶
func EditGroupSubscription(request *models.GroupSubscriptionRequest) templ.Component
EditGroupSubscription is a page for editing a group subscription.
func EditSearchSubscription ¶
func EditSearchSubscription(request *models.SearchSubscriptionRequest) templ.Component
EditSearchSubscription is a page for editing a search subscription.
func EditSubscription ¶
func EditSubscription(request *models.EditSubscriptionRequest) templ.Component
func EditSubscriptionSuccessNotification ¶
func EditSubscriptionSuccessNotification(subscription *models.Subscription) templ.Component
func EmptyContent ¶
EmptyContent renders a layout appropriate for use when there is nothing to show.
func ExportSubscriptions ¶
ExportSubscriptions renders a form for exporting all subscriptions as an OPML file.
func ExternalError ¶
func ExternalError(msg *models.UserMessage) templ.Component
ExternalErrorPage renders a page containing a link to contact support and/or go back to the landing page.
func FavoritesGrid ¶
FavoritesGrid renders subscription and article favorites in a grid layout.
func FilterControls ¶
func FilterControls(path string, categories models.CategoryCounts, filters *models.ListFilters) templ.Component
func GeneratePageTitle ¶
GeneratePageTitle generates an appropriate page title string by combining the input with the app name.
func HelpPopover ¶
HelpPopover can be used to render a help icon, that when clicked, will open a popover displaying informational or help text.
func ImportResults ¶
func ImportResults(results []*models.AddFeedSubscriptionResult) templ.Component
ImportResults is a partial template that displays the results of an import.
func ImportSubscriptions ¶
ImportPage is a page for importing subscriptions from an external source (e.g., an OPML file).
func IssueReportedConfirmation ¶
func IssueReportedConfirmation(msg *models.UserMessage) templ.Component
IssueReportedConfirmation will show feedback to a user that the issue they reported has been recorded.
func ListArticles ¶
func ListArticles(response *models.ListArticlesResponse) templ.Component
ListArticles renders the list of articles in a grid layout with filtering controls and an actions menu.
func ListSubscriptions ¶
func ListSubscriptions(response *models.ListSubscriptionsResponse) templ.Component
ListSubscriptions renders the list of subscriptions in a grid layout with filtering controls and an actions menu.
func NewMailtoLink ¶
func NewMailtoLink(to string, options ...MailtoOption) templ.Component
NewMailtoLink creates a new html link with a `mailto:` href attribute.
func NewProxiedImage ¶
func NewUserHome ¶
func NoSearchResults ¶
NoSearchResults renders an informational message for when no search results were returned.
func Notification ¶
Notification renders a notification with the given user message.
func PageTitleFromCtx ¶
PageTitleFromCtx retrieves the page title string from the context.
func PageTitleToCtx ¶
PageTitleToCtx stores the page title string in the context.
func PaginateArticles ¶
func PaginateArticles(response *models.ListArticlesResponse) templ.Component
PaginateArticles renders the given list of articles as cards with an optional element to trigger pagination to load more.
func PaginateSubscriptions ¶
func PaginateSubscriptions(response *models.ListSubscriptionsResponse) templ.Component
PaginateSubscriptions renders the given list of subscriptions as cards with an optional element to trigger pagination to load more.
func PaginationControl ¶
func PaginationControl(ctx context.Context, route, target string, pagination models.Pagination) templ.Component
PaginationControl generates an element that will cause a pagination request when scrolled into view.
func RemoveSubscriptionModal ¶
func RemoveSubscriptionModal(request *models.RemoveSubscriptionRequest) templ.Component
RemoveObjectModal renders a modal that will action an unsubscribe request when the user has confirmed.
func ReportObjectIssues ¶
func ReportObjectIssues(objectType, id string, details *models.ReportObjectIssueRequest) templ.Component
func ReportPageIssue ¶
func ReportPageIssue(details *models.ReportIssueRequest) templ.Component
ReportPageIssue renders a form for reporting issues with the app.
func SearchFilters ¶
func SearchFilters(attributes templ.Attributes) templ.Component
func SearchResults ¶
SearchResults renders the list of articles as cards with an optional element to trigger pagination for loading more.
func SearchResultsGrid ¶
func SearchResultsGrid(request *models.SearchRequest, articles models.Articles, pagination models.Pagination) templ.Component
SearchResultsGrid renders the given articles returned from the given search in a grid layout with an actions menu.
func SearchSubscriptionFilterSuggestions ¶
func SearchSubscriptionFilterSuggestions(subscriptions models.Subscriptions) templ.Component
func SearchSuggestions ¶
func SearchSuggestions(request *models.SearchRequest, subscriptions models.Subscriptions, articles models.Articles) templ.Component
SearchSuggestions will render suggestions for a given search.
func ServerErrorNotification ¶
func ServerErrorNotification(msg *models.UserMessage) templ.Component
ServerErrorNotification creates an error notification that includes a button for reporting the error to support.
func SettingsPage ¶
func ShareObjectModal ¶
RemoveObjectModal renders a modal that will action an unsubscribe request when the user has confirmed.
func ShowTailwindBreakpoints ¶
func SimilarArticles ¶
SimilarArticles renders a page of articles that are the result of a search for similar articles to a given input set.
func SubscriptionCard ¶
func SubscriptionCard(s *models.Subscription) templ.Component
SubscriptionCard renders a subscription in a card format, suitable for showing together with other subscriptions in a list/grid.
func ToggleFavorite ¶
ToggleFavorite renders an updated favorite link based on the object's favorite status.
func UpdateCSRFToken ¶
UpdateCSRFToken renders an input with the csrf token taken from the context.
func UpdateViewArticleFavorite ¶
UpdateViewArticleFavorite updates the favorite action when viewing an article.
func UpdateViewArticleMark ¶
UpdateViewArticleMark updates the mark action when viewing an article.
func UpdatesToast ¶
UpdatesToast renders a toast notification to inform the user that updated content is available.
func UserAccountIssue ¶
UserAccountIssuePage renders a full page with a message to the user indicating that their account has an issue that needs support to resolve. Usually, this will be displayed when a subscription plan payment has failed and requires manual intervention.
func UserAvatar ¶
func UserChooseSubscriptionPlan ¶
UserChooseSubscriptionPlanPage renders a full page for the user to choose their subscription plan, with any previously selected option highlighted. This is displayed after a user account has been created (in Auth0) and redirects the user to Stripe for payment.
Types ¶
type Button ¶
type Button struct {
HTMLElement
}
type Div ¶
type Div struct {
HTMLElement
}
type FragmentKey ¶
type FragmentKey string
type HTMLElement ¶
func NewHTMLElement ¶
func NewHTMLElement() HTMLElement
func (*HTMLElement) AddClasses ¶
func (e *HTMLElement) AddClasses(classes ...string)
func (*HTMLElement) GetClasses ¶
func (e *HTMLElement) GetClasses() []string
func (*HTMLElement) GetID ¶
func (e *HTMLElement) GetID() string
func (*HTMLElement) GetTarget ¶
func (e *HTMLElement) GetTarget() string
func (*HTMLElement) HasAttribute ¶
func (e *HTMLElement) HasAttribute(key string) bool
func (*HTMLElement) MergeAttributes ¶
func (e *HTMLElement) MergeAttributes(attributes templ.Attributes)
func (*HTMLElement) SetAttribute ¶
func (e *HTMLElement) SetAttribute(key string, value any)
func (*HTMLElement) SetID ¶
func (e *HTMLElement) SetID(id string)
type Home ¶
type Link ¶
type Link struct {
HTMLElement
}
type MailtoLink ¶
type MailtoLink struct {
// contains filtered or unexported fields
}
MailtoLink represents a link that will open the user's mail client, with optionall pre-filled details).
type MailtoOption ¶
type MailtoOption func(*MailtoLink)
MailtoOption is a functional option to apply to a mailto: link object.
func WithLinkOptions ¶
func WithLinkOptions(options ...Option[element]) MailtoOption
WithLinkOptions option passes the given options to the underlying link object. It can be used for further customisation of the link.
func WithMailtoBody ¶
func WithMailtoBody(body string) MailtoOption
WithMailtoBody option adds body text to the mailto: link.
func WithMailtoSubject ¶
func WithMailtoSubject(subject string) MailtoOption
WithMailtoSubject option adds a subject to the mailto: link.
type Option ¶
type Option[T any] func(T)
Option is a generic type for functional options.
func WithAttribute ¶
func WithAttributes ¶
func WithAttributes(attributes templ.Attributes) Option[element]
func WithClasses ¶
func WithHXInclude ¶
func WithHXMethod ¶
func WithHXParams ¶
func WithHXPushURL ¶
func WithHXReplaceURL ¶
func WithHXSwap ¶
func WithHXTarget ¶
func WithHXTrigger ¶
func WithHXVals ¶
func WithHXValsJS ¶
type ProxiedImage ¶
type ProxiedImage struct {
HTMLElement
}
type SideBarComponent ¶
type SideBarComponent struct {
// contains filtered or unexported fields
}
Source Files
¶
- article_templ.go
- buttons_templ.go
- categories_templ.go
- containers_templ.go
- controls_templ.go
- debug_templ.go
- dock_templ.go
- elements_templ.go
- favorites_templ.go
- header_templ.go
- home_templ.go
- issues_templ.go
- landing_templ.go
- logo_templ.go
- notifications_templ.go
- object_templ.go
- page_templ.go
- pagination_templ.go
- partials_templ.go
- pricing_templ.go
- search_templ.go
- settings_templ.go
- sidebar_templ.go
- subscription_templ.go
- templates.go
- user_templ.go