templates

package
v0.167.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BodyFragment is a fragment key pointing to tbe body section of a page.
	BodyFragment templFragmentKey = "body"
	// ContentFragment is a fragment key pointing to the main content of a page.
	ContentFragment templFragmentKey = "content"
	// PaginateFragment is a fragment key pointing to the content to render when paginating.
	PaginateFragment templFragmentKey = "paginate"
)
View Source
const DefaultNotificationTimeout = 5 * time.Second

DefaultNotificationTimeout is the default duration which a notification is shown (unless overridden on a per notification basis).

View Source
const ErrorFragment templFragmentKey = "error"
View Source
const (
	ExternalHeader templFragmentKey = "ExternalHeader"
)
View Source
const SubscriptionsTable templFragmentKey = "subscriptionsTable"

Variables

View Source
var BillingFAQ = []partials.FAQEntry{
	{
		ID:       "switching",
		Question: "Can I switch plans?",
		Answer: `
				<p>Yes. You can upgrade from monthly to annual at any time. We'll prorate the difference.</p>
				`,
	},
	{
		ID:       "payment-methods",
		Question: "What payment methods do you accept?",
		Answer: `
				<p>All major credit cards, PayPal, and local payment methods depending on your region. Payments are
				handled by either Google Play (for Android app users) or Paddle (for website users).</p> `,
	},
	{
		ID:       "tax",
		Question: "Do you handle tax?",
		Answer: `
				<p>Yes. For Android app users, Google Play is our merchant of record. From website users, Paddle is our
				Merchant of Record. Both handle sales tax, VAT, and GST collection globally.</p> `,
	},
	{
		ID:       "cancel",
		Question: "Can I cancel anytime?",
		Answer: `
				<p>Absolutely. Cancel from your dashboard and you'll retain access until the end of your billing period.</p>
				<p>You can manage your subscription from Settings->Account once logged in.</p>
				`,
	},
	{
		ID:       "refunds",
		Question: "What is your refund policy?",
		Answer: `
				<p>Monthly plans: No refunds. Cancel anytime before your next billing date.</p>

				<p>Annual plans: Full refund within 14 days of purchase if you're not satisfied. After 14 days, no
				refunds are issued for the remaining period.</p>

				<p>To request a refund, contact hello@immanent.tech with your account email, or use the contact form on
				the website.</p> `,
	},
}
View Source
var (
	// ContentID points to the element containing the main content of the page.
	ContentID = models.ElementID("content")
)
View Source
var LandingPageFAQ = []partials.FAQEntry{
	{
		ID:       "whatisit",
		Question: "What is a feed reader? How is it different from X, Facebook, Instagram, etc.?",
		Answer: `
				<p>A feed reader is an app that collects content from websites, blogs, and newsletters you choose and
				displays it in one place without algorithms deciding what you see or ads interrupting your reading.</p>

				<p>Most websites publish their content as an RSS or Atom feed: a standardised file that	lists their
				latest articles. A feed reader checks these files regularly and shows you new posts as they arrive, in
				chronological order, from only the sources you've subscribed to.</p>

				<p>This is fundamentally different from social platforms like Facebook, X (Twitter), or LinkedIn, where
				a proprietary algorithm selects and ranks what you see based on engagement, advertising revenue, and
				platform goals and not your preferences. It's also different from news aggregators like Apple News or
				Google News, which curate content editorially and promote sponsored stories.</p>

				<p>With a feed reader, you own your reading list. You can follow any website that publishes a feed, from
				major newspapers to small independent blogs and everything appears together, unfiltered and in the order
				it was published.</p>
				`,
	},
	{
		ID:       "app",
		Question: "Do you have an app?",
		Answer: `
				<p>Foragd is a web app, which means there is nothing to install and no app store required. Open	your
				browser, log in on any device you already own. Because Foragd runs entirely in the browser, it works on
				every platform without a separate version for each: Chrome, Safari, Firefox, and Edge on Windows, macOS,
				Linux, iOS, and Android are all fully supported. Your reading list, bookmarks, and settings are always
				in sync across every device automatically, with no manual backup or export needed. </p>

				<p>On mobile, Foragd can be added to your home screen directly from your browser (on iOS via Safari's
				"Add to Home Screen" and on Android via Chrome's "Add to Home Screen"). This gives you a full app-like
				experience, including offline support, without going through the App Store or Google Play.</p>

				<p>This also means Foragd is always up to date. There are no app updates to approve or install;
				improvements and new features are available the moment you open the page.</p>
				`,
	},
	{
		ID:       "import",
		Question: "Can I import my subscriptions from elsewhere?",
		Answer: `
				<p>Yes. Foragd supports importing and exporting subscriptions using the OPML file format; an open
				standard that all major feed readers support. If you're switching from Feedly, Inoreader, NewsBlur, The
				Old Reader, or any other RSS reader, you can export your subscriptions as an OPML file and import them
				into Foragd in seconds, with no manual re-adding of feeds.</p>

				<p>This portability is by design. Your subscriptions are a list of websites and sources you've
				deliberately chosen to follow. Your data is always yours, not the platform's. Unlike a social media
				following list that's locked inside a single company's database, an OPML file is a plain, open format
				you can take anywhere. Foragd treats your reading list as your data, which is why Foragd also supports
				exporting as well as importing. If you're currently using a platform that doesn't offer OPML export,
				that's a sign your subscriptions are being held hostage. A feed reader that won't let you leave with
				your data isn't a tool; it's a trap.</p>

				<p>Switching to Foragd takes just a few minutes: export your OPML from your current reader, import it in
				Foragd's settings, and every feed you've ever subscribed to will be waiting for you.</p>
				`,
	},
	{
		ID:       "privacy",
		Question: "Are my subscriptions private?",
		Answer: `
				<p>Yes, completely. Foragd has no social features, no public profiles, and no follower counts. What you
				read is nobody's business but yours.</p>

				<p>Most free content platforms are built on a simple trade: you get the service, they get your attention
				and behaviour data to sell to advertisers. Every article you read, every topic you follow, every link
				you click becomes a data point used to build an advertising profile. Foragd has no advertising business
				model, so there is no incentive to collect, analyse, or sell your reading behaviour. We don't know what
				you read, and we don't want to.</p>

				<p>What we do collect is the minimum required to run the service: your email address to log in, and the
				list of feeds you subscribe to so we can fetch content for you. That's it. We don't share this with
				marketing third-parties, we don't run behavioural analytics on your reading habits, and we never inject
				ads or sponsored content into your feed.</p>

				<p>Because Foragd is subscription-funded rather than advertiser-funded, your interests and ours are
				aligned: we succeed when you find the product valuable enough to pay for, not when we maximise the time
				you spend staring at a screen. You can read the full details in our <a href="/policies/privacy"
				class="link">privacy policy</a>.</p>

				<p>Your subscriptions are also portable and exportable at any time (see the previous question on OPML
				import and export).</p> `,
	},
	{
		ID:       "opensource",
		Question: "Is Foragd open source?",
		Answer: `
				<p>Yes. Foragd's source code is publicly available <a class="link"
				href="https://github.com/immanent-tech/foragd">on GitHub</a>. But more importantly, here's why that
				matters to you as a user rather than just as a developer:</p>

				<ul class="space-y-2">
					<li>
						<p class="font-semibold">You can verify our privacy claims.</p>

						<p>	We tell you we don't track your reading habits or sell your data. But with closed-source
						software, that's a promise you have to take on faith. With open source, anyone can read the code
						and confirm that what we say matches what the software actually does. Independent researchers,
						security professionals, and privacy advocates can audit Foragd without our permission or
						involvement. Trust, but verify.</p>
					</li>
					<li>
						<p class="font-semibold">Your data can never be held hostage.</p>

						<p>If Foragd ever shut down, was acquired, or changed direction in a way you disagreed with, the
						open source code means the community could continue running it independently. Your reading list
						and the software that powers it can't be locked away. This is the open source guarantee that no
						proprietary feed reader such as Feedly, Inoreader, or anyone else can offer.</p>
					</li>
					<li>
						<p class="font-semibold">Security is stronger with more eyes on the code.</p>

						<p>Closed-source software relies on a single team to find and fix vulnerabilities. Open source
						means the entire developer community can spot and report issues, often faster than any internal
						team could alone.</p>
					</li>
					<li>
						<p class="font-semibold">You're not betting on a black box.</p>

						<p>Many RSS readers have come and gone over the years — Google Reader being the most famous
						casualty. When a proprietary service shuts down, your subscriptions, your history, and your
						reading habits can disappear overnight. Open source is a hedge against that risk. You can find
						the Foragd source code and contribute at <a class="link"
						href="https://github.com/immanent-tech/foragd">GitHub</a>.</p>
					</li>
				</ul>
				`,
	},
}
View Source
var NotificationsID = models.ElementID("notifications")

NotificationsID points to an element that can be used for displaying notifications to the user.

View Source
var ViewerFAQ = []partials.FAQEntry{
	{
		ID:       "whatisit",
		Question: "What is a feed reader? How is it different from X, Facebook, Instagram, etc.?",
		Answer: `
				<p>A feed reader is an app that collects content from websites, blogs, and newsletters you choose and
				displays it in one place without algorithms deciding what you see or ads interrupting your reading.</p>

				<p>Most websites publish their content as an RSS or Atom feed: a standardised file that	lists their
				latest articles. A feed reader checks these files regularly and shows you new posts as they arrive, in
				chronological order, from only the sources you've subscribed to.</p>

				<p>This is fundamentally different from social platforms like Facebook, X (Twitter), or LinkedIn, where
				a proprietary algorithm selects and ranks what you see based on engagement, advertising revenue, and
				platform goals and not your preferences. It's also different from news aggregators like Apple News or
				Google News, which curate content editorially and promote sponsored stories.</p>

				<p>With a feed reader, you own your reading list. You can follow any website that publishes a feed, from
				major newspapers to small independent blogs and everything appears together, unfiltered and in the order
				it was published.</p>
				`,
	},
	{
		ID:       "how-it-works",
		Question: "How does the feed viewer work?",
		Answer: `
				<p>When you enter a URL, the feed viewer will fetch the source of the page.</p>

				<p>If the source is one of the known feed formats like RSS or Atom, the viewer will format and return
				the posts contained in the feed.</p>

				<p>If the source is normal webpage, the viewer will look at links in the page and try to find one that
				points to feed content, which it will then fetch, format and display.</p>
				`,
	},
	{
		ID:       "not-working",
		Question: "Why did the feed viewer not find content for my URL?",
		Answer: `
					<p>Unfortunately, not all websites have RSS and Atom feeds. While the viewer tries its best to find
					feed content, and uses a few tricks for this, there are still websites that cannot be parsed.</p>
					`,
	},
	{
		ID:       "privacy",
		Question: "Does the feed viewer collect or store any information about me, the URL or the feed content it fetches?",
		Answer: `
					<p>No. Content is fetched and displayed dynamically, and is not stored once you navigate away from the page.</p>

					<p>We do store common analytics services to track minimal, anonymous usage of the feed viewer. No
					personal information is collected or stored. The feed viewer does not require cookies.</p>

					<p>More information can be found in our <a href="/policies/privacy" class="link">Privacy Policy</a>.</p>
					`,
	},
	{
		ID:       "open-source",
		Question: "Is this open-source?",
		Answer: `
					<p>The underlying library that does most of the heavy lifting, <a
					href="https://github.com/immanent-tech/go-syndication" class="link">go-syndication</a> is
					open-source!</p>

					<p>The site itself is part of <a href="https://foragd.app" class="link">Foragd</a>, a beautiful, web
					based, online feed reader, that uses the go-syndication library.</p>
					`,
	},
}

Functions

func About added in v0.21.0

func About() templ.Component

func AccountSettings

func AccountSettings(user *models.User) templ.Component

func ActionSuggestionSubscriptions added in v0.73.0

func ActionSuggestionSubscriptions(subscriptions models.Subscriptions) templ.Component

func AddCategory

func AddCategory(category models.Category) templ.Component

AddCategory renders a new category item to the list of categories of a subscription.

func AddFeedSubscription

func AddFeedSubscription(request *models.FeedSubscriptionRequest) templ.Component

AddFeedSubscription is a page for adding a new subscription to a feed.

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 AddSubscriptionToGroup added in v0.82.4

func AddSubscriptionToGroup(id, name string) templ.Component

AddSubscriptionToGroup renders a button indicating a subscription is part of a group subscription. Clicking the button removes it from the group.

func AdvancedSearch added in v0.81.1

func AdvancedSearch(request *models.SearchRequest, attributes templ.Attributes) templ.Component

func ArticleCard

func ArticleCard(idx int, a *models.Article) templ.Component

Card renders an article as a card, for displaying in a list.

func ArticleContent

func ArticleContent(a *models.Article) templ.Component

ArticleContent renders the complete content of an article.

func CategoryBadge added in v0.19.0

func CategoryBadge(category models.Category, options ...element.PropertiesOption) templ.Component

CategoryBadge renders a badge containing a category. Options can be used to apply additional styling or attributes (i.e. HTMX options) to the badge.

func CategoryFilters added in v0.78.0

func CategoryFilters(data *models.CategoryFilters) templ.Component

func CategoryManagement

func CategoryManagement(suggested []models.Category, existing []models.Category) templ.Component

func ChangelogPage added in v0.153.0

func ChangelogPage(releases []Release) templ.Component

ChangelogPage renders a full changelog page

func ChooseSubscriptionPlan added in v0.143.0

func ChooseSubscriptionPlan(user *models.User, request *models.CheckoutRequest) templ.Component

ChooseSubscriptionPlan 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.

func Comparison added in v0.95.0

func Comparison(service string) templ.Component

func Contact added in v0.129.0

func Contact() templ.Component

func CreatePage added in v0.36.0

func CreatePage(template templ.Component, options ...PageOption) templ.Component

CreatePage creates a new page with the given body template and additional options.

func DeactivateAccountModal

func DeactivateAccountModal() templ.Component

func DeactivateResult added in v0.143.0

func DeactivateResult(user *models.User, timeLeft *time.Time) templ.Component

func DisplaySettings

func DisplaySettings(user *models.User) templ.Component

func Dock

func Dock(options ...element.PropertiesOption) templ.Component

func Document

func Document(data []byte) templ.Component

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 EditEmailSubscription added in v0.26.0

func EditEmailSubscription(request *models.EditEmailSubscriptionRequest) templ.Component

func EditFeedSubscription added in v0.82.4

func EditFeedSubscription(request *models.FeedSubscriptionRequest) templ.Component

EditFeedSubscription is a page for editing an existing feed subscription.

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 ExportSubscriptions

func ExportSubscriptions() templ.Component

ExportSubscriptions renders a form for exporting all subscriptions as an OPML file.

func ExternalError

func ExternalError(user *models.User, msg *models.UserMessage) templ.Component

func FeatureAddContent added in v0.101.0

func FeatureAddContent(flipped bool) templ.Component

func FeatureArticleFilters added in v0.101.0

func FeatureArticleFilters(flipped bool) templ.Component

func FeatureEmailNewsletters added in v0.101.0

func FeatureEmailNewsletters(flipped bool) templ.Component

func FeatureFavorites added in v0.101.0

func FeatureFavorites(flipped bool) templ.Component

func FeatureFetchRemoteContent added in v0.101.0

func FeatureFetchRemoteContent(flipped bool) templ.Component

func FeatureGroupSubscriptions added in v0.101.0

func FeatureGroupSubscriptions(flipped bool) templ.Component

func FeatureImport added in v0.101.0

func FeatureImport(flipped bool) templ.Component

func FeatureLayout added in v0.101.0

func FeatureLayout(flipped bool) templ.Component

func FeatureSearchSubscription added in v0.101.0

func FeatureSearchSubscription(flipped bool) templ.Component

func FeatureSubscriptionCustomisation added in v0.101.0

func FeatureSubscriptionCustomisation(flipped bool) templ.Component

func FeatureThemes added in v0.101.0

func FeatureThemes(flipped bool) templ.Component

func Features added in v0.101.0

func Features() templ.Component

func FeaturesPageCollect added in v0.155.0

func FeaturesPageCollect() templ.Component

func FeaturesPageConsume added in v0.155.0

func FeaturesPageConsume() templ.Component

func FeaturesPageCurate added in v0.155.0

func FeaturesPageCurate() templ.Component

func FooterExternal added in v0.146.0

func FooterExternal() templ.Component

func ForgetMe added in v0.158.0

func ForgetMe() templ.Component

func FragmentKeysFromCtx added in v0.150.0

func FragmentKeysFromCtx(ctx context.Context) []templFragmentKey

func FragmentKeysToCtx added in v0.150.0

func FragmentKeysToCtx(ctx context.Context, keys ...templFragmentKey) context.Context

func FromPathFromCtx added in v0.164.1

func FromPathFromCtx(ctx context.Context) string

FromPathFromCtx retrieves the path of the referring page in the context.

func FromPathToCtx added in v0.164.1

func FromPathToCtx(ctx context.Context, path string) context.Context

FromPathToCtx stores the path of the referring page in the context.

func HeaderExternal added in v0.101.0

func HeaderExternal() templ.Component

func HeaderInternal added in v0.146.0

func HeaderInternal(props *InternalLayoutProps) templ.Component

func ImportSubscriptions

func ImportSubscriptions() templ.Component

ImportSubscriptions renders a form for the user to select or drag and drop an OPML file to import their subscriptions.

func ImportSubscriptionsResults added in v0.82.4

func ImportSubscriptionsResults(results []models.FeedSubscriptionResult) templ.Component

ImportSubscriptionsResults renders the results of importing the users subscriptions.

func InternalError added in v0.36.0

func InternalError(user *models.User, referer string, msg *models.UserMessage) templ.Component

func ItemList added in v0.155.0

func ItemList(name string, entries []ListItem) templ.Component

func Landing

func Landing() templ.Component

Landing is the landing page layout.

func LandingHeaderSlot added in v0.116.0

func LandingHeaderSlot() templ.Component

func LayoutExternal added in v0.146.0

func LayoutExternal(content ...templ.Component) templ.Component

func LayoutInternal added in v0.146.0

func LayoutInternal(props *InternalLayoutProps, content ...templ.Component) templ.Component

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 ListFavorites added in v0.39.0

func ListFavorites(response *models.ListFavoritesResponse) templ.Component

ListFavorites renders subscription and article favorites in a grid layout.

func ListPaginationControl added in v0.164.0

func ListPaginationControl(path string, filters *models.ListFilters, pagination models.Pagination) templ.Component

ListPaginationControl renders a sentinel element for controlling pagination of a list. It should be added as an OOB swap to the page whenever pagination needs to be updated (i.e., after loading the latest set of items).

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 NewFeaturePanel added in v0.101.0

func NewFeaturePanel(id string) templ.Component

func NewOpenGraphMetadata added in v0.70.0

func NewOpenGraphMetadata(options ...opengraph.Option) *opengraph.OpenGraph

NewMetadata creates a new opengraph Metadata object with properties set to values given by the options. Where a property is not set by an option, a default value will be used.

func NewUserHome

func NewUserHome() templ.Component

NewUserHome is a home page displayed for new users, with some instructions and actions to help them set up the app.

func NotFound

func NotFound() templ.Component

func Notification

func Notification(msg *models.UserMessage, options ...notificationOption) templ.Component

Notification renders a notification (or alert) in the UI. The notification will be coloured appropriately for the status/severity of the UserMessage.

func PaddleHead added in v0.143.0

func PaddleHead() templ.Component

func PathFromCtx added in v0.80.3

func PathFromCtx(ctx context.Context) string

PathFromCtx retrieves the URL path from the context.

func PathToCtx added in v0.80.3

func PathToCtx(ctx context.Context, path string) context.Context

PathToCtx stores the URL path in the context.

func PostsIndex added in v0.36.0

func PostsIndex(posts []*models.MarkdownFile) templ.Component

func PurchaseSubscriptionSuccess added in v0.143.0

func PurchaseSubscriptionSuccess(transactionID string) templ.Component

func RemoveSubscriptionModal

func RemoveSubscriptionModal(request *models.RemoveSubscriptionRequest, options ...element.PropertiesOption) templ.Component

RemoveObjectModal renders a modal that will action an unsubscribe request when the user has confirmed.

func ReportIssue added in v0.131.3

func ReportIssue(details *models.ReportIssueRequest) templ.Component

ReportIssue renders a form for reporting issues with the app.

func Search() templ.Component

func SearchResults

func SearchResults(results *models.SearchResults) templ.Component

SearchResults 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(suggestions *models.SearchResults) templ.Component

SearchSuggestions will render suggestions for a given search.

func ShareArticleModal added in v0.34.1

func ShareArticleModal(request *models.ShareArticleRequest) templ.Component

func ShowFeedSuggestions added in v0.110.0

func ShowFeedSuggestions(request *models.FeedSuggestionsResults) templ.Component

func ShowNoSuggestions added in v0.110.0

func ShowNoSuggestions(text string) templ.Component

func ShowSubscriptionEmail added in v0.26.0

func ShowSubscriptionEmail(email string) templ.Component
func SideBar(options ...element.PropertiesOption) templ.Component

func SimilarArticles

func SimilarArticles(articles models.Articles) templ.Component

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(idx int, path string, subscription *models.Subscription) templ.Component

SubscriptionCard renders a subscription in a card format, suitable for showing together with other subscriptions in a list/grid. The idx argument is used to indicate the position of this subscription card relative to others in a grid/list (and is used for CSS-based animations).

func SubscriptionSettings added in v0.150.0

func SubscriptionSettings(data *SubscriptionSettingsData) templ.Component

func Unsubscribe added in v0.87.0

func Unsubscribe(token string) templ.Component

func UnsubscribeResult added in v0.87.0

func UnsubscribeResult(msg *models.UserMessage) templ.Component

func UpdateTitle added in v0.36.0

func UpdateTitle(title string) templ.Component

func UpdatesToast

func UpdatesToast(options ...element.PropertiesOption) templ.Component

UpdatesToast renders a toast notification to inform the user that updated content is available.

func UserAccountIssue

func UserAccountIssue() templ.Component

func UserAvatar

func UserAvatar(user *models.User, attributes templ.Attributes) templ.Component

func UserHome added in v0.37.0

func UserHome(data *HomeData) templ.Component

UserHome is the default user home page.

func UserSettings added in v0.39.0

func UserSettings() templ.Component

func Viewer added in v0.21.0

func Viewer(feed *models.Feed, errMsg *models.UserMessage) templ.Component

func ViewerError added in v0.36.0

func ViewerError(msg *models.UserMessage) templ.Component

func ViewerResults added in v0.21.0

func ViewerResults(feed *models.Feed) templ.Component

func VsFeedly added in v0.95.0

func VsFeedly() templ.Component

func VsFeedlyMeta added in v0.117.0

func VsFeedlyMeta() templ.Component

func VsInoreader added in v0.95.0

func VsInoreader() templ.Component

func VsInoreaderMeta added in v0.117.0

func VsInoreaderMeta() templ.Component

func WithNotificationTimeout added in v0.155.0

func WithNotificationTimeout(duration time.Duration) notificationOption

Types

type Article added in v0.27.0

type Article struct {
	*models.Article
}

type ChangeEntry added in v0.153.0

type ChangeEntry struct {
	Type        ChangeType `toml:"type"`
	Description string     `toml:"description"`
}

ChangeEntry is a single change within a release

type ChangeType added in v0.153.0

type ChangeType string

ChangeType represents the type of change in a release

const (
	ChangeTypeNew      ChangeType = "new"
	ChangeTypeImproved ChangeType = "improved"
	ChangeTypeFixed    ChangeType = "fixed"
	ChangeTypeRemoved  ChangeType = "removed"
	ChangeTypeSecurity ChangeType = "security"
)

type HomeData added in v0.142.0

type HomeData struct {
	LatestArticles models.Articles
	RareCategories models.CategoryCounts
	Subscriptions  models.Subscriptions
	TopCategories  models.CategoryCounts
}

type InternalLayoutProps added in v0.146.0

type InternalLayoutProps struct {
	User *models.User
}

type ListItem added in v0.155.0

type ListItem struct {
	Name        string
	Description string
}

type Page

type Page struct {
	// Component is the main body content of the page.
	Component templ.Component
	// Title is a string for the (browser) titlebar.
	Title string
	// Description adds a meta tag with the given text.
	Description string
	// OGMetadata contains the Opengraph metadata for the page.
	OpenGraph *opengraph.OpenGraph
	// CanonicalLink is the link that will be used with <link rel="canonical> on the page.
	CanonicalLink string
}

Page contains data for rendering a full HTML page.

type PageOption added in v0.21.0

type PageOption func(*Page)

PageOption is a functional option applied to a page.

func WithCanonicalLink(link string) PageOption

WithCanonicalLink sets the <link rel="canonical> link for the page.

func WithOpenGraphMetadata added in v0.70.0

func WithOpenGraphMetadata(metadata *opengraph.OpenGraph) PageOption

WithOpenGraphMetadata option sets the given metadata as appropriate Open Graph tags in the page header.

func WithPageDescription added in v0.21.0

func WithPageDescription(desc string) PageOption

WithPageDescription option sets a description meta tag in the page header.

func WithPageTitle added in v0.21.0

func WithPageTitle(title string) PageOption

WithPageTitle option sets the page title (displayed in the browser titlebar).

type Release added in v0.153.0

type Release struct {
	Version  string        `toml:"version"`
	Date     string        `toml:"date"`
	Type     VersionType   `toml:"type"`
	IsLatest bool          `toml:"is_latest"`
	Changes  []ChangeEntry `toml:"changes"`
}

Release represents a single versioned release

type Subscription added in v0.27.0

type Subscription struct {
	*models.Subscription
}

type SubscriptionSettingsData added in v0.150.0

type SubscriptionSettingsData struct {
	User          *models.User
	Subscriptions models.Subscriptions
}

type VersionType added in v0.153.0

type VersionType string

VersionType represents semver release tier

const (
	VersionMajor VersionType = "major"
	VersionMinor VersionType = "minor"
	VersionPatch VersionType = "patch"
)

Directories

Path Synopsis
helpers
mailto
Package mailto provides a method for easily constructing a mailto: string for use in links.
Package mailto provides a method for easily constructing a mailto: string for use in links.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL