![]() ![]() Hugo’s default behavior is to render your content with “pretty” URLs. Aliases are rendered before any content are rendered and therefore will be overwritten by any content with the same location.You need to provide absolute paths to your web root Hugo makes no assumptions about aliases.In this case, the data passed to the template is the link to the page being aliased Page the Page data for the page being aliased Important Behaviors of Aliases Layouts folder of your site (i.e., layouts/alias.html). You may customize this alias page by creating an alias.html template in the The addition of lets search engine bots know that they should not index your alias page ( ). If an end user of your website goes to, they will now be automatically redirected to the newer, correct URL. The http-equiv="refresh" line is what performs the redirect, in 0 seconds in this case. The following examples show how to create this field in TOML and YAML front matter, respectively. You can create an aliases field in the front matter of your new my-awesome-blog-post.md where you can add previous paths. The content is a revision of your previous post at content/posts/my-original-url.md. Let’s assume you create a new piece of content at content/posts/my-awesome-blog-post.md. They are relative to the Page they’re defined in, e.g.Starting with a / meaning they are relative to the BaseURL, e.g.AliasesĪliases can be used to create redirects to your page from other URLs. :title the content’s title :slug the content’s slug (or title if no slug is provided in the front matter) :slugorfilename the content’s slug (or filename if no slug is provided in the front matter) :filename the content’s filename (without extension)Īdditionally, a Go time format string prefixed with : may be used. Note that this slice access will not throw any out-of-bounds errors, so you don’t have to be exact. Uou can use a selection of the sections using slice syntax: :sections includes all but the first, :sections includes all but the last, :sections includes only the last, :sections includes section 2 and 3. :year the 4-digit year :month the 2-digit month :monthname the name of the month :day the 2-digit day :weekday the 1-digit day of the week (Sunday = 0) :weekdayname the name of the day of the week :yearday the 1- to 3-digit day of the year :section the content’s section :sections the content’s sections hierarchy. All references to time are dependent on the content’s date. The following is a list of values that can be used in a definition in your site config file. You will probably only want to use the configuration values :slug or :title. You can also configure s of taxonomies with the same syntax, by using the plural form of the taxonomy instead of the section. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |