Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure every site configures markup #1274

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion common-content/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,17 @@
[module]
[module.hugoVersion]
extended = true
min = "0.116.0"
min = "0.116.0"

[markup]
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
24 changes: 14 additions & 10 deletions common-docs/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,24 @@ maxAge="6h"
getenv = ["^HUGO_CURRICULUM_GITHUB_BEARER_TOKEN$"]


theme = "common-theme"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't think we need to declare common theme any more if we're importing the module btw


#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'


[markup]
# I've configured markdown so you don't have to
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
# Enable HTML codeblocks, e.g. for <details> blocks
unsafe = true

theme = "common-theme"

#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
14 changes: 14 additions & 0 deletions common-theme/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,17 @@ getenv = ["^HUGO_CURRICULUM_GITHUB_BEARER_TOKEN$"]
[module.hugoVersion]
extended = true
min = "0.133.0"


[markup]
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
15 changes: 14 additions & 1 deletion org-cyf-guides/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,17 @@ baseURL = "https://guides.codeyourfuture.io/"
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'
nextPrevSortOrder = 'asc'

[markup]
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
14 changes: 14 additions & 0 deletions org-cyf-how-this-works/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,17 @@ baseURL = "https://curriculum.codeyourfuture.io/"
[module]
[[module.imports]]
path = "github.com/CodeYourFuture/curriculum/org-cyf-theme"


[markup]
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
20 changes: 12 additions & 8 deletions org-cyf-itd/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ description="Meet the world of tech in 30 days"
weight = 3
url = "https://codeyourfuture.io/donate/"

#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'


[markup]
# I've configured markdown so you don't have to
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
# Enable HTML codeblocks, e.g. for <details> blocks
unsafe = true

#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
20 changes: 12 additions & 8 deletions org-cyf-launch/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ baseURL = "https://launch.codeyourfuture.io/"
target = "content/pd/blocks"


#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'


[markup]
# I've configured markdown so you don't have to
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
# Enable HTML codeblocks, e.g. for <details> blocks
unsafe = true

#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
20 changes: 12 additions & 8 deletions org-cyf-piscine/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ title = "CYF Piscine"
[params]
googleFonts="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;500;700&family=Inter:wght@400;600&display=swap"

#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'


[markup]
# I've configured markdown so you don't have to
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
# Enable HTML codeblocks, e.g. for <details> blocks
unsafe = true

#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
19 changes: 12 additions & 7 deletions org-cyf-sdc/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@ baseURL = "https://sdc.codeyourfuture.io/"
[params]
googleFonts="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;500;700&family=Inter:wght@400;600&display=swap"

#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this one not be inherited from theme?

Actually maybe this should be tidied up a bit more. What can we inherit from org-cyf-theme module?

https://gohugo.io/getting-started/configuration/#configure-page

[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'


[markup]
# I've configured markdown so you don't have to
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
# Enable HTML codeblocks, e.g. for <details> blocks
unsafe = true
#this makes the section nav go the right way
# because of this 'unexpected behaviour' https://gohugo.io/methods/page/nextinsection/
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
14 changes: 14 additions & 0 deletions org-cyf-theme/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,17 @@ maxAge = 0
# Allow accessing a GitHub bearer token to avoid rate limits when doing HTTP fetches to the GitHub API.
# This can be generated at https://github.com/settings/tokens?type=beta and needs read-only access to all public CYF GitHub repos.
getenv = ["^HUGO_CURRICULUM_GITHUB_BEARER_TOKEN$"]


[markup]
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
14 changes: 14 additions & 0 deletions org-cyf-tracks/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,17 @@ baseURL = "https://tracks.codeyourfuture.io/"

[taxonomies]
track_kind = "track_kinds"


[markup]
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
14 changes: 14 additions & 0 deletions org-cyf/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,17 @@ target = "content/guides"
[page]
nextPrevInSectionSortOrder = 'asc'
nextPrevSortOrder = 'asc'


[markup]
[markup.tableOfContents]
endLevel = 2
ordered = true
startLevel = 2
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
34 changes: 34 additions & 0 deletions tooling/go/cmd/site-consistency/hugo_toml_structs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package main

type hugoToml struct {
Markup *hugoTomlMarkup `toml:"markup"`
}

type hugoTomlMarkup struct {
TableOfContents *hugoTomlTableOfContents `toml:"tableOfContents"`
Goldmark *hugoTomlGoldmark `toml:"goldmark"`
}

type hugoTomlTableOfContents struct {
Endlevel *int `toml:"endLevel"`
Ordered *bool `toml:"ordered"`
StartLevel *int `toml:"startLevel"`
}

type hugoTomlGoldmark struct {
Renderer *hugoTomlGoldmarkRenderer `toml:"renderer"`
Parser *hugoTomlGoldmarkParser `toml:"parser"`
}

type hugoTomlGoldmarkRenderer struct {
Unsafe *bool `toml:"unsafe"`
}

type hugoTomlGoldmarkParser struct {
Attribute *hugoTomlGoldmarkParserAttribute `toml:"attribute"`
}

type hugoTomlGoldmarkParserAttribute struct {
Block *bool `toml:"block"`
Title *bool `toml:"title"`
}
Loading
Loading