Skip to content

Commit 2bb11f6

Browse files
committed
content: configure "manual" Hugo page summaries
This change adds Hugo's "manual" summary markers to all non-draft content pages. As https://gohugo.io/content-management/summaries/ explains: You can define a summary manually, in front matter, or automatically. A manual summary takes precedence over a front matter summary, and a front matter summary takes precedence over an automatic summary. Before this change, all pages on the site (save one) used "automatic" summary derivation, which Hugo performs for us ... automatically. The somewhat older Hugo version we use in this commit (which is upgraded in the next commit) generates a plain text summary, which is then used by our site build in a few places: _public/algolia.json (which is fed into the site's search indexer); a page's "description" meta element; and some "share this page on ..." social media links, where it makes sense to pre-fill the social media message with a summary of the page for the user. After the next commit's upgrade to the most recent version of Hugo, automatic summaries are no longer generated as plain text but as HTML, as mentioned in the release notes for Hugo v0.134.0[0]. In the next commit, that Hugo change means we have to use a function to strip out the HTML wherever the summary is used. This mostly works, but leaves us with a problem: the places where our build needs to truncate a summary (e.g. because it would be too long to place in a social media post, or in the page's "description" meta tag") are now dominated by more "used to be HTML" tags and content. These are *already* somewhat annoying in the cuelang.org search results page; if we were to submit the Hugo upgrade (CL 1215755) as is, then after the site's re-index the result summaries would look even worse. This change attempts to fix the problem by adding Hugo's manual summary markers to each page. These markers delineate a page's summary inline, and Hugo uses all the page content up to the marker as the summary. The position of these markers has been manually selected to sit before the first script/upload/code block of the page, which will hopefully remove many of the offending elements from the search results page. It's not possible to test this beforehand as we currently only re-index after CL submission. Updates to these marker positions, if this change turns out to be sub-optimal for any page, should be done lightly, and as a regular part of the page's content maintenance. Be aware that they should probably be done with an eye on the site's SEO aims, as the summaries are part of the site metadata that's scraped by search engines. Alternatively, see the site's sole example of using a specifically written summary that's not visible on the page, in /content/docs/concept/faq/new-modules-vs-old-modules/en.md. This is what Hugo calls a "front matter" summary, and might be useful to tune specific pages' appearance in search results, perhaps where the "manual" method cannot delineate the summary we'd like to present to search users. NB manual markers take precedence even over front matter summaries. [0]: https://github.com/gohugoio/hugo/releases/tag/v0.134.0 Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com> Change-Id: Iccb8d7cde131ceb0d60ba602113e8bfbe2b2d65b Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1215778 Reviewed-by: Paul Jolly <paul@myitcv.io> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
1 parent ab06600 commit 2bb11f6

372 files changed

Lines changed: 748 additions & 0 deletions

File tree

  • content
    • community/talks
    • docs
      • concept
        • alias-and-reference-scopes
        • code-generation-and-extraction-use-case
        • configuration-use-case
        • cue-language-version
        • data-validation-use-case
        • faq
          • removing-list-arithmetic-operators-v0.11
          • upgrading-from-evalv2-to-evalv3
        • how-cue-enables-configuration
        • how-cue-enables-data-validation
        • how-cue-works-with-go
        • how-cue-works-with-json-schema
        • how-cue-works-with-json
        • how-cue-works-with-openapi
        • how-cue-works-with-protocol-buffers
        • how-cue-works-with-yaml
        • modules-packages-instances
        • modules
        • old-modules-packages-instances
        • querying-use-case
        • schema-definition-use-case
        • the-logic-of-cue
        • using-the-cue-export-command
        • working-with-incomplete-cue
      • howto
        • about-commented-cue-guides
        • build-cue-api-java-jar
        • build-libcue-shared-library
        • combine-multiple-json-files-by-using-file-metadata
        • combine-multiple-json-files-into-a-list
        • combine-multiple-yaml-files-by-using-file-metadata
        • combine-multiple-yaml-files-into-a-list
        • conditionally-include-cue-files-using-build-attributes
        • conditionally-include-list-elements
        • constrain-string-as-valid-integer
        • constrain-the-length-of-a-string
        • constrain-the-sum-of-a-list-of-numbers
        • disallow-a-specific-field-name
        • embed-files-in-cue-evaluation
        • encode-json-yaml-with-cue
        • ensure-list-values-present-in-another-list
        • export-fields-whose-names-are-not-valid-identifiers
        • fetch-json-data-http
        • generate-cue-from-go-dependency
        • generate-cue-from-local-go
        • generate-go-types-from-cue-definitions
        • handle-errors-go-api
        • influence-workflow-command-task-order
        • inject-system-information-into-evaluation-using-tag-variable
        • inject-value-into-evaluation-using-tag-attribute
        • list-no-duplicates
        • log-statistics-from-the-cue-evaluator
        • mark-a-field-as-optional
        • mark-a-field-as-required
        • mirror-modules-between-registries
        • negate-a-disjunction
        • place-data-files-different-locations-file-embedding
        • place-data-go-api
        • produce-string-set-from-list
        • refer-to-fields-whose-names-are-not-valid-identifiers
        • search-this-site
        • specify-a-default-value-for-a-field
        • transform-json-with-cue
        • transform-yaml-with-cue
        • use-encoding-base64-decode
        • use-encoding-base64-encode
        • use-encoding-csv-decode-to-access-csv-data-stored-as-a-string
        • use-encoding-csv-decode-to-access-data-stored-in-a-csv-file
        • use-encoding-csv-encode-to-emit-csv-data
        • use-encoding-json-compact-to-produce-single-line-json-from-a-file
        • use-encoding-json-compact-to-produce-single-line-json-from-a-string
        • use-encoding-json-compact-to-produce-single-line-json-from-cue-data
        • use-encoding-json-indent-to-produce-human-readable-json-from-a-file
        • use-encoding-json-indent-to-produce-human-readable-json-from-a-string
        • use-encoding-json-validate-as-a-field-validator
        • use-encoding-yaml-validate-encoding-yaml-validatepartial-as-field-validators
        • use-list-avg-list-max-list-min-list-sum-to-summarise-lists-of-numbers
        • use-list-concat-to-concatenate-lists
        • use-list-contains-as-a-field-validator
        • use-list-contains-to-report-if-a-value-is-in-a-list
        • use-list-flattenn-to-flatten-lists
        • use-list-issorted-as-a-field-validator
        • use-list-issorted-to-report-if-lists-are-sorted
        • use-list-issortedstrings-as-a-field-validator
        • use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted
        • use-list-maxitems-list-minitems-to-constrain-list-length
        • use-list-sort-to-sort-lists
        • use-list-sortstrings-to-sort-lists-of-strings
        • use-list-uniqueitems-as-a-field-validator
        • use-net-ip-to-validate-ip-addresses
        • use-net-ipcidr-to-validate-ip-cidr-ranges
        • use-net-ipv4-to-validate-ipv4-addresses
        • use-net-parseip-net-ipstring-to-convert-ip-address-representations
        • use-path-base-path-dir-path-ext-to-examine-path-filename-components
        • use-path-join-to-construct-well-formed-paths
        • use-regexp-replaceall-regexp-replaceallliteral-to-modify-strings
        • use-strconv-atoi-to-convert-strings-to-ints
        • use-strings-contains-strings-hasprefix-strings-hassuffix-as-field-validators
        • use-strings-replace
        • use-text-template-execute-to-generate-text-from-data
        • use-the-built-in-function-and
        • use-the-built-in-function-close
        • use-the-built-in-function-len
        • use-the-built-in-function-matchif
        • use-the-built-in-function-matchn
        • use-the-built-in-function-or
        • use-the-built-in-functions-div-mod-quo-rem
        • use-your-first-cue-workflow-command
        • validate-go-cuego
        • validate-integer-value-parity
        • validate-json-using-cue
        • validate-json-using-go-api
        • validate-yaml-using-cue
        • walk-schemas-using-go-api
        • write-a-type-switch
      • introduction
      • reference
      • tour
      • tutorial
        • cfgmgmtcamp-2025
        • controlling-kubernetes
        • convert-values-java-cue
        • converting-json-schema-to-cue
        • get-started-cue-java
        • handle-errors-java-api
        • loading-cue-go-api
        • new-to-cue
        • publishing-modules-to-the-central-registry
        • using-modules-with-go-api
        • validate-data-schema-java
        • validating-simple-yaml-files
        • working-with-a-custom-module-registry
        • working-with-the-central-registry
    • privacy-policy
  • hugo/content/en

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content/community/talks/en.md

Lines changed: 2 additions & 0 deletions

content/docs/_en.md

Lines changed: 2 additions & 0 deletions

content/docs/concept/_en.md

Lines changed: 2 additions & 0 deletions

content/docs/concept/alias-and-reference-scopes/en.md

Lines changed: 2 additions & 0 deletions

content/docs/concept/code-generation-and-extraction-use-case/en.md

Lines changed: 2 additions & 0 deletions

content/docs/concept/configuration-use-case/en.md

Lines changed: 2 additions & 0 deletions

content/docs/concept/cue-language-version/en.md

Lines changed: 2 additions & 0 deletions

content/docs/concept/data-validation-use-case/en.md

Lines changed: 2 additions & 0 deletions

content/docs/concept/faq/removing-list-arithmetic-operators-v0.11/en.md

Lines changed: 2 additions & 0 deletions

content/docs/concept/faq/symbolic-link-support/en.md

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)