shipwright-io / website

Creative Commons Attribution 4.0 International
3 stars 21 forks source link

Generate adoc copies in /content/en/docs to #78 #79

Closed rolfedh closed 1 year ago

rolfedh commented 2 years ago

Changes

I converted all the .md files in ./content/en/docs/ to .adoc files.

Convert shipwright doc files to asciidoc format. We use these files (https://github.com/shipwright-io/build/tree/main/docs) to populate https://github.com/shipwright-io/website/tree/main/content/en/docs

Fixes https://github.com/shipwright-io/website/issues/75

Submitter Checklist

See the contributor guide for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

NONE
openshift-ci[bot] commented 2 years ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign otaviof after the PR has been reviewed. You can assign the PR to them by writing /assign @otaviof in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/shipwright-io/website/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
adambkaplan commented 2 years ago

It looks like the Hugo update added a new security feature - by default asciidoctor won't execute.

Submitted https://github.com/shipwright-io/website/pull/80 to fix.

3:16:10 PM: Error: Error building site: "/opt/build/repo/content/en/docs/api/buildrun.adoc:1:1": access denied: "asciidoctor" is not whitelisted in policy "security.exec.allow"; the current security configuration is:
3:16:10 PM: [security]
3:16:10 PM:   enableInlineShortcodes = false
3:16:10 PM:   [security.exec]
3:16:10 PM:     allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']
3:16:10 PM:     osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']
3:16:10 PM:   [security.funcs]
3:16:10 PM:     getenv = ['^HUGO_']
3:16:10 PM:   [security.http]
3:16:10 PM:     methods = ['(?i)GET|POST']
3:16:10 PM:     urls = ['.*']
3:16:10 PM: Total in 2141 ms
3:16:10 PM: Makefile:6: recipe for target 'build' failed
3:16:10 PM: make[1]: *** [build] Error 255
3:16:10 PM: make[1]: Leaving directory '/opt/build/repo'
3:16:10 PM: Makefile:17: recipe for target 'netlify' failed
adambkaplan commented 2 years ago

@rolfedh I rebased this on top of #80, and when I did so the converted docs don't show up :(.

rolfedh commented 2 years ago

@rolfedh I rebased this on top of #80, and when I did so the converted docs don't show up :(.

@adambkaplan One of the error messages, activating bundler-2failed led me to this blog post. Although the post is about Jekyll, not Hugo, trimming the following two lines from the bottom of the Gemfile.lock file seems to have fixed it.

BUNDLED WITH
   2.3.7
adambkaplan commented 2 years ago

More info on Hugo front matter: https://gohugo.io/content-management/front-matter/

rolfedh commented 2 years ago

/hold

rolfedh commented 2 years ago

I'll need to resolve some further issues before this PR is ready to merge:

Content outlines

Code snippets

rolfedh commented 2 years ago

I resolved the "Content Outlines" issues, above, by adding the AsciiDoc TOC directives just below the front matter of each topic:

:toc:
:toclevels: 4

AND the following parameter values to config.toml:

  [markup.tableOfContents]
    endLevel = 3
    ordered = false
    startLevel = 2

NOTE: The value of toclevels must be equal to, or less than, the value of endLevel.

I also removed the hard-coded TOC at the top of each topic.