FUNCTIONStruncateSyntaxtruncate SIZE INPUTtruncate SIZE ELLIPSIS INPUTSince Go templates are HTML-aware, truncate will intelligently handle normal strings vs HTML strings:{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → <em>Keep my …</em>` See AlsoerrorffloatdateFormatstringprintfAbout HugoOverviewHugo and GDPRHugo 0.32 HOWTOWhat is HugoHugo FeaturesThe Benefits of StaticLicenseGetting StartedGet Started OverviewQuick StartInstall HugoBasic UsageDirectory StructureConfigurationThemesThemes OverviewInstall and Use ThemesTheme ComponentsCreate a ThemeContent ManagementContent Management OverviewOrganizationPage BundlesSupported Content FormatsFront MatterPage ResourcesImage ProcessingShortcodesRelated ContentSectionsTypesArchetypesTaxonomiesSummariesLinks and Cross ReferencesURL ManagementMenusStatic FilesTable of ContentsCommentsMultilingual and i18nSyntax HighlightingTemplatesTemplates OverviewIntroductionTemplate Lookup OrderCustom Output FormatsBase Templates and BlocksList Page TemplatesHomepage TemplateSection TemplatesTaxonomy TemplatesSingle Page TemplatesContent View TemplatesData TemplatesPartial TemplatesShortcode TemplatesLocal File Templates404 PageMenu TemplatesPaginationRSS TemplatesSitemap TemplateRobots.txtInternal TemplatesAlternative TemplatingTemplate DebuggingFunctionsFunctions Quick ReferenceBuilt-inCastCollectionsCompareCryptoDataEncodingFmtHugoImagesInflectLangMathOSPartialsPathReflectResourcesSafeSiteStringsTemplatesTimeTransformURLsObjectsObjects OverviewSite ObjectsPage ObjectsShortcode ObjectsTime ObjectsTaxonomy ObjectsFile ObjectsMenu Entry ObjectsHugo ObjectsGit ObjectsSitemap ObjectsHugo PipesHugo Pipes OverviewHugo Pipes IntroductionSASS / SCSSPostCSSAsset minificationAsset bundlingFingerprinting and SRIResource from TemplateResource from StringCLITroubleshootingTroubleshootFAQBuild PerformanceToolsDeveloper Tools OverviewMigrationsStarter KitsFrontendsEditor Plug-insSearchOther ProjectsHosting & DeploymentHosting & Deployment OverviewHost-Agnostic Deploys with NanoboxHost on NetlifyHost on FirebaseHost on GitHubHost on GitLabHosting on KeyCDNHost on BitbucketDeployment with WerckerDeployment with RsyncContributeContribute to HugoDevelopmentDocumentationThemesMaintenance