BuckshotPlusPlus
  • 🤝Getting started
    • What is BuckShotPlusPlus?
    • Install
  • 📺Video tutorials
    • Getting started with bpp
    • How to use reusable components
    • How to use events
  • 👔Data types
    • Variables
    • Arrays
    • View
    • Data
    • Page
    • Event
  • 🤓The basics
    • Comments
    • Include
    • String concatenation
    • Conditions
    • Sessions
    • Static site export
  • 🔍SEO
    • Sitemap.xml
    • Meta tags
  • Advanced use
    • CSS Properties
Powered by GitBook
On this page
  • How it works
  • Declaring pages
  • Page URLs
  • Custom fonts
  • Use cases
  • Important notes

Was this helpful?

Export as PDF
  1. Data types

Page

Discover how to use page objects in BuckShotPlusPlus!

PreviousDataNextEvent

Last updated 1 year ago

Was this helpful?

In , pages represent the individual screens or web pages of your application. While they are similar to , pages are specifically designed to define the structure and content of a complete web page.

How it works

Declaring pages

To declare a page in , you use the page keyword followed by the name of the page and its properties enclosed in curly braces. The properties of a page define its title, body and other attributes.

Here's a basic example:

page index{
	title = "My Index!"
	body = My_Body_View
}

In this example, a page named index is declared with a title "My Index!" and a body content defined by the My_Body_View view.

Page URLs

The name of the page determines its URL. For instance, the index page corresponds to the root URL (/). If you name your page something other than index, the page's URL will be based on its name. For example:

page blog{
	title = "My cool blog!"
	body = My_Blog_Body_View
}

This will create a page accessible at the /blog URL.

Custom fonts

page index{
	title = "My Index!"
	body = My_Body_View
	fonts = ["https://fonts.googleapis.com/css2?family=Josefin+Sans&family=Nerko+One&family=Poppins&display=swap"]
}

Use cases

  1. Website Structure: Pages allow you to define the structure of your website, specifying which content appears on which page.

  2. Dynamic Content: By associating different views with different pages, you can create dynamic web pages that change based on user interactions or other conditions.

Important notes

  • Remember that the name of the page determines its URL, so choose names that are relevant to the content of the page.

In BuckShotPlusPlus, you can easily import custom fonts using the fonts attribute and specify an of url's like in the following example:

SEO Optimization: By giving descriptive names and titles to your pages, you can improve the search engine optimization () of your website.

Always use descriptive names for your pages to make your website more user-friendly and improve .

Ensure that the associated with a page are correctly defined and tested to avoid rendering issues.

👔
BuckshotPlusPlus
views
BuckshotPlusPlus
array
SEO
SEO
views